This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 01/10] Rationalize "backtrace" command line parsing
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 26 Apr 2017 13:33:07 +0300
- Subject: Re: [RFA 01/10] Rationalize "backtrace" command line parsing
- Authentication-results: sourceware.org; auth=none
- References: <20170425194113.17862-1-tom@tromey.com> <20170425194113.17862-2-tom@tromey.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>
> Date: Tue, 25 Apr 2017 13:41:04 -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.
Do we really want to make backward-incompatible changes in such a
veteran command?
> +@code{backtrace} can accept some arguments:
This sentence will look erroneous in print, because it starts with a
lower-case letter. Maybe use "The @code{backtrace} command can ..."
instead.
Also, you've removed the @table and the corresponding @item, so now
the description text describes something that was not yet called out:
@node Backtrace
@section Backtraces
@cindex traceback
@cindex call stack traces
A backtrace is a summary of how your program got where it is. It shows one
line per frame, for many frames, starting with the currently executing
frame (frame zero), followed by its caller (frame one), and on up the
stack.
@anchor{backtrace-command}
@kindex backtrace
@kindex bt @r{(@code{backtrace})}
Print a backtrace of the entire stack, use the @code{backtrace}
command, or its alias @code{bt}. This command will print one line ...
Since @kindex leaves no traces in the manual, I think this will look
weird, don't you agree?
Thanks.