From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA v3 01/13] Rationalize "backtrace" command line parsing
Date: Sat, 24 Mar 2018 06:31:00 -0000 [thread overview]
Message-ID: <83tvt6gf1j.fsf@gnu.org> (raw)
In-Reply-To: <20180323205512.14434-2-tom@tromey.com> (message from Tom Tromey on Fri, 23 Mar 2018 14:55:00 -0600)
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Fri, 23 Mar 2018 14:55:00 -0600
>
> The backtrace command has peculiar command-line parsing. In
> particular, it splits the command line, then loops over the arguments.
> If it sees a word it recognizes, like "full", it effectively drops
> this word from the argument vector. Then, it pastes together the
> remaining arguments, passing them on to backtrace_command_1, which in
> turn passes the resulting string to parse_and_eval_long.
>
> The documentation doesn't mention the parse_and_eval_long at all, so
> it is a bit of a hidden feature that you can "bt 3*2". The strange
> algorithm above also means you can "bt 3 * no-filters 2" and get 6
> frames...
>
> This patch changes backtrace's command line parsing to be a bit more
> rational. Now, special words like "full" are only recognized at the
> start of the command.
>
> This also updates the documentation to describe the various bt options
> individually.
>
> gdb/ChangeLog
> 2018-03-23 Tom Tromey <tom@tromey.com>
>
> * stack.c (backtrace_command): Rewrite command line parsing.
>
> gdb/doc/ChangeLog
> 2018-03-23 Tom Tromey <tom@tromey.com>
>
> * gdb.texinfo (Backtrace): Describe options individually.
> ---
> gdb/ChangeLog | 4 ++++
> gdb/doc/ChangeLog | 4 ++++
> gdb/doc/gdb.texinfo | 54 ++++++++++++++++++++--------------------------
> gdb/stack.c | 62 +++++++++++++++++------------------------------------
> 4 files changed, 51 insertions(+), 73 deletions(-)
>
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 74e0fdb4a4..b48dd4ed4b 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -7307,39 +7307,31 @@ frame (frame zero), followed by its caller (frame one), and on up the
> stack.
>
> @anchor{backtrace-command}
> -@table @code
> @kindex backtrace
> @kindex bt @r{(@code{backtrace})}
> -@item backtrace
> -@itemx bt
> -Print a backtrace of the entire stack: one line per frame for all
> -frames in the stack.
> -
> -You can stop the backtrace at any time by typing the system interrupt
> -character, normally @kbd{Ctrl-c}.
> -
> -@item backtrace @var{n}
> -@itemx bt @var{n}
> -Similar, but print only the innermost @var{n} frames.
> -
> -@item backtrace -@var{n}
> -@itemx bt -@var{n}
> -Similar, but print only the outermost @var{n} frames.
> -
> -@item backtrace full
> -@itemx bt full
> -@itemx bt full @var{n}
> -@itemx bt full -@var{n}
> -Print the values of the local variables also. As described above,
> -@var{n} specifies the number of frames to print.
> -
> -@item backtrace no-filters
> -@itemx bt no-filters
> -@itemx bt no-filters @var{n}
> -@itemx bt no-filters -@var{n}
> -@itemx bt no-filters full
> -@itemx bt no-filters full @var{n}
> -@itemx bt no-filters full -@var{n}
Is it wise to delete the @table? We always describe commands in that
format, AFAIR.
> +Print a backtrace of the entire stack, use the @code{backtrace}
> +command, or its alias @code{bt}. This command will print one line per
I gues you meant "To print a backtrace of the entire stack ...",
because otherwise the first sentence reads weirdly.
Otherwise, the documentation part is OK. Thanks.
next prev parent reply other threads:[~2018-03-24 6:31 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 20:55 [RFA v3 00/13] various frame filter fixes and cleanups Tom Tromey
2018-03-23 20:55 ` [RFA v3 06/13] Allow C-c to work in backtrace in more cases Tom Tromey
2018-03-23 20:55 ` [RFA v3 13/13] Remove verbose code from backtrace command Tom Tromey
2018-03-23 20:55 ` [RFA v3 09/13] Return EXT_LANG_BT_ERROR in one more spot in py-framefilter.c Tom Tromey
2018-03-23 20:55 ` [RFA v3 11/13] Improve "backtrace" help text Tom Tromey
2018-03-23 20:55 ` [RFA v3 08/13] Move some code later in backtrace_command_1 Tom Tromey
2018-03-23 20:55 ` [RFA v3 12/13] Simplify exception handling in py-framefilter.c Tom Tromey
2018-03-23 20:55 ` [RFA v3 10/13] Call wrap_hint in one more spot " Tom Tromey
2018-03-23 20:55 ` [RFA v3 03/13] Allow hiding of some filtered frames Tom Tromey
2018-03-24 6:32 ` Eli Zaretskii
2018-03-23 20:55 ` [RFA v3 04/13] Remove EXT_LANG_BT_COMPLETED Tom Tromey
2018-03-23 20:55 ` [RFA v3 01/13] Rationalize "backtrace" command line parsing Tom Tromey
2018-03-24 6:31 ` Eli Zaretskii [this message]
2018-03-25 16:50 ` Tom Tromey
2018-03-25 17:11 ` Eli Zaretskii
2018-03-26 20:45 ` Tom Tromey
2018-03-27 2:35 ` Eli Zaretskii
2018-03-23 20:55 ` [RFA v3 05/13] Avoid manual resource management in py-framefilter.c Tom Tromey
2018-03-23 20:55 ` [RFA v3 02/13] Change backtrace_command_1 calling to use flags Tom Tromey
2018-03-23 20:55 ` [RFA v3 07/13] Throw a "quit" on a KeyboardException in py-framefilter.c Tom Tromey
2018-03-24 11:41 ` Pedro Alves
2018-03-25 16:37 ` Tom Tromey
2018-03-25 17:13 ` Pedro Alves
2018-03-26 21:14 ` Tom Tromey
2018-03-24 11:42 ` [RFA v3 00/13] various frame filter fixes and cleanups Pedro Alves
2018-03-27 4:01 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83tvt6gf1j.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox