gdb: Avoid unneeded calls to parse_frame_specification.
authorAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 7 Sep 2015 08:04:07 +0000 (09:04 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 12 Oct 2015 21:30:10 +0000 (23:30 +0200)
commitedbbff4a22154a4b155ac987436c6498947cf8b4
tree7e16490898b869b21da1a1cb80025a362675593e
parent9d622bda566a4980b045631f500c29717ede8186
gdb: Avoid unneeded calls to parse_frame_specification.

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.
gdb/ChangeLog
gdb/stack.c