diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-05-03 00:26:34 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-05-03 00:26:34 +0000 |
commit | 82de1e5bfbe5e536e9b240fd4a9eefbe52bdeedb (patch) | |
tree | b5dd8db7bed5f662474756221b93a1e550db5d4a /gdb/stack.c | |
parent | 75d2dc161aa9bc05546269de4589313478d4412b (diff) | |
download | gdb-82de1e5bfbe5e536e9b240fd4a9eefbe52bdeedb.zip gdb-82de1e5bfbe5e536e9b240fd4a9eefbe52bdeedb.tar.gz gdb-82de1e5bfbe5e536e9b240fd4a9eefbe52bdeedb.tar.bz2 |
2003-05-02 Andrew Cagney <cagney@redhat.com>
* std-regs.c (value_of_builtin_frame_pc_reg): Delete #ifdef
PC_REGNUM, re-indent.
* stack.c (frame_info): Use "pc" for the name of get_frame_pc when
PC_REGNUM isn't set.
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 2cb9a95..cfb3605 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -614,10 +614,25 @@ frame_info (char *addr_exp, int from_tty) int i, count, numregs; char *funname = 0; enum language funlang = language_unknown; + const char *pc_regname; if (!target_has_stack) error ("No stack."); + /* Name of the value returned by get_frame_pc(). Per comments, "pc" + is not a good name. */ + if (PC_REGNUM >= 0) + /* OK, this is weird. The PC_REGNUM hardware register's value can + easily not match that of the internal value returned by + get_frame_pc(). */ + pc_regname = REGISTER_NAME (PC_REGNUM); + else + /* But then, this is weird to. Even without PC_REGNUM, an + architectures will often have a hardware register called "pc", + and that register's value, again, can easily not match + get_frame_pc(). */ + pc_regname = "pc"; + fi = parse_frame_specification (addr_exp); if (fi == NULL) error ("Invalid frame specified."); @@ -680,7 +695,7 @@ frame_info (char *addr_exp, int from_tty) print_address_numeric (get_frame_base (fi), 1, gdb_stdout); printf_filtered (":\n"); } - printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM)); + printf_filtered (" %s = ", pc_regname); print_address_numeric (get_frame_pc (fi), 1, gdb_stdout); wrap_here (" "); @@ -695,7 +710,7 @@ frame_info (char *addr_exp, int from_tty) printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line); puts_filtered ("; "); wrap_here (" "); - printf_filtered ("saved %s ", REGISTER_NAME (PC_REGNUM)); + printf_filtered ("saved %s ", pc_regname); print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout); printf_filtered ("\n"); |