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.
This commit is contained in:
parent
75d2dc161a
commit
82de1e5bfb
3 changed files with 33 additions and 14 deletions
|
@ -1,5 +1,10 @@
|
||||||
2003-05-02 Andrew Cagney <cagney@redhat.com>
|
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.
|
||||||
|
|
||||||
* gdbarch.sh (REGISTER_SIZE, REGISTER_BYTES): Make optional.
|
* gdbarch.sh (REGISTER_SIZE, REGISTER_BYTES): Make optional.
|
||||||
* gdbarch.h, gdbarch.c: Re-generate.
|
* gdbarch.h, gdbarch.c: Re-generate.
|
||||||
* d10v-tdep.c (d10v_gdbarch_init): Do not set register_size,
|
* d10v-tdep.c (d10v_gdbarch_init): Do not set register_size,
|
||||||
|
|
19
gdb/stack.c
19
gdb/stack.c
|
@ -614,10 +614,25 @@ frame_info (char *addr_exp, int from_tty)
|
||||||
int i, count, numregs;
|
int i, count, numregs;
|
||||||
char *funname = 0;
|
char *funname = 0;
|
||||||
enum language funlang = language_unknown;
|
enum language funlang = language_unknown;
|
||||||
|
const char *pc_regname;
|
||||||
|
|
||||||
if (!target_has_stack)
|
if (!target_has_stack)
|
||||||
error ("No 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);
|
fi = parse_frame_specification (addr_exp);
|
||||||
if (fi == NULL)
|
if (fi == NULL)
|
||||||
error ("Invalid frame specified.");
|
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);
|
print_address_numeric (get_frame_base (fi), 1, gdb_stdout);
|
||||||
printf_filtered (":\n");
|
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);
|
print_address_numeric (get_frame_pc (fi), 1, gdb_stdout);
|
||||||
|
|
||||||
wrap_here (" ");
|
wrap_here (" ");
|
||||||
|
@ -695,7 +710,7 @@ frame_info (char *addr_exp, int from_tty)
|
||||||
printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line);
|
printf_filtered (" (%s:%d)", sal.symtab->filename, sal.line);
|
||||||
puts_filtered ("; ");
|
puts_filtered ("; ");
|
||||||
wrap_here (" ");
|
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);
|
print_address_numeric (frame_pc_unwind (fi), 1, gdb_stdout);
|
||||||
printf_filtered ("\n");
|
printf_filtered ("\n");
|
||||||
|
|
||||||
|
|
|
@ -98,20 +98,19 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame)
|
||||||
static struct value *
|
static struct value *
|
||||||
value_of_builtin_frame_pc_reg (struct frame_info *frame)
|
value_of_builtin_frame_pc_reg (struct frame_info *frame)
|
||||||
{
|
{
|
||||||
#ifdef PC_REGNUM
|
|
||||||
if (PC_REGNUM >= 0)
|
if (PC_REGNUM >= 0)
|
||||||
return value_of_register (PC_REGNUM, frame);
|
return value_of_register (PC_REGNUM, frame);
|
||||||
#endif
|
else
|
||||||
{
|
{
|
||||||
struct value *val = allocate_value (builtin_type_void_data_ptr);
|
struct value *val = allocate_value (builtin_type_void_data_ptr);
|
||||||
char *buf = VALUE_CONTENTS_RAW (val);
|
char *buf = VALUE_CONTENTS_RAW (val);
|
||||||
if (frame == NULL)
|
if (frame == NULL)
|
||||||
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
|
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
|
||||||
else
|
else
|
||||||
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
|
ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
|
||||||
get_frame_pc (frame));
|
get_frame_pc (frame));
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct value *
|
static struct value *
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue