This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 6/9] gdb: Avoid unneeded calls to parse_frame_specification.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]