This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/9] gdb: Avoid unneeded calls to parse_frame_specification.
- From: Pedro Alves <palves at redhat dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>, gdb-patches at sourceware dot org
- Date: Wed, 30 Sep 2015 14:48:44 +0100
- Subject: Re: [PATCH 6/9] gdb: Avoid unneeded calls to parse_frame_specification.
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1441996064 dot git dot andrew dot burgess at embecosm dot com> <d31811bc92659ab4253cecf1fa7e6d5e4e44d7e4 dot 1441996064 dot git dot andrew dot burgess at embecosm dot com>
On 09/11/2015 07:49 PM, Andrew Burgess wrote:
> Within the stack command there are a couple of places where fixed
> strings are passed into functions that are really intended for
> processing user input. These fixed strings are then processed and the
> result returned.
>
> Given that the input strings in these cases are fixed, and are always
> "0", then the result will always be the same, the current frame. By
> switching to using get_current_frame instead the code can be simplified,
> and the intention of the code is clearer.
>
> gdb/ChangeLog:
>
> * stack.c (parse_frame_specification): Delete.
> (parse_frame_specification_1): Rename to
> parse_frame_specification.
> (frame_info): Use parse_frame_specification.
> (select_frame_command): Likewise.
> (return_command): Use select_frame and print_stack_frame rather
> than frame_command and select_frame_command.
> (func_command): Use get_current_frame rather than
> parse_frame_specification.
OK. Nice clean up.
Thanks,
Pedro Alves