aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-01-21 17:37:51 +0000
committerDaniel Jacobowitz <drow@false.org>2007-01-21 17:37:51 +0000
commit7b9ee6a80648a8e8bb30090d76035605299f805d (patch)
treeddd27905b7aabe89e0f0ce23b2727cf70766639a /gdb
parent113096576766ad92cfa059437ea6d370ceecd0cf (diff)
downloadgdb-7b9ee6a80648a8e8bb30090d76035605299f805d.zip
gdb-7b9ee6a80648a8e8bb30090d76035605299f805d.tar.gz
gdb-7b9ee6a80648a8e8bb30090d76035605299f805d.tar.bz2
* gdbarch.sh (register_type): Update comment.
* gdbarch.h: Regenerated. * arch-utils.c (generic_register_size): Call register_type. * ia64-tdep.c (ia64_extract_return_value): Likewise. * m32c-tdep.c (check_for_saved): Likewise. * mips-tdep.c (mips_print_register, print_gp_register_row) (mips_print_registers_info): Likewise. * sh-tdep.c (sh_pseudo_register_read, sh_pseudo_register_write): Likewise. * sh64-tdep.c (sh64_pseudo_register_read, sh64_pseudo_register_write) (sh64_do_register, sh64_print_register) (sh64_media_print_registers_info): Likewise. * tui/tui-regs.c (tui_register_format): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/arch-utils.c2
-rw-r--r--gdb/gdbarch.h4
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/ia64-tdep.c3
-rw-r--r--gdb/m32c-tdep.c2
-rw-r--r--gdb/mips-tdep.c10
-rw-r--r--gdb/sh-tdep.c4
-rw-r--r--gdb/sh64-tdep.c19
-rw-r--r--gdb/tui/tui-regs.c2
10 files changed, 42 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9752b2b..5589609 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,21 @@
2007-01-21 Daniel Jacobowitz <dan@codesourcery.com>
+ * gdbarch.sh (register_type): Update comment.
+ * gdbarch.h: Regenerated.
+ * arch-utils.c (generic_register_size): Call register_type.
+ * ia64-tdep.c (ia64_extract_return_value): Likewise.
+ * m32c-tdep.c (check_for_saved): Likewise.
+ * mips-tdep.c (mips_print_register, print_gp_register_row)
+ (mips_print_registers_info): Likewise.
+ * sh-tdep.c (sh_pseudo_register_read, sh_pseudo_register_write):
+ Likewise.
+ * sh64-tdep.c (sh64_pseudo_register_read, sh64_pseudo_register_write)
+ (sh64_do_register, sh64_print_register)
+ (sh64_media_print_registers_info): Likewise.
+ * tui/tui-regs.c (tui_register_format): Likewise.
+
+2007-01-21 Daniel Jacobowitz <dan@codesourcery.com>
+
* objfiles.h (ALL_PRIMARY_SYMTABS): Define.
* ada-lang.c (symtab_for_sym, ada_lookup_symbol_list)
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 3864250..df3f9f6 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -250,7 +250,7 @@ int
generic_register_size (int regnum)
{
gdb_assert (regnum >= 0 && regnum < NUM_REGS + NUM_PSEUDO_REGS);
- return TYPE_LENGTH (gdbarch_register_type (current_gdbarch, regnum));
+ return TYPE_LENGTH (register_type (current_gdbarch, regnum));
}
/* Assume all registers are adjacent. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 56bf313..4fac0ee 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -469,7 +469,9 @@ extern void set_gdbarch_register_name (struct gdbarch *gdbarch, gdbarch_register
#define REGISTER_NAME(regnr) (gdbarch_register_name (current_gdbarch, regnr))
#endif
-/* REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE. */
+/* Return the type of a register specified by the architecture. Only
+ the register cache should call this function directly; others should
+ use "register_type". */
extern int gdbarch_register_type_p (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index ee616e3..db88df0 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -455,7 +455,9 @@ f:=:int:sdb_reg_to_regnum:int sdb_regnr:sdb_regnr::no_op_reg_to_regnum::0
f:=:int:dwarf2_reg_to_regnum:int dwarf2_regnr:dwarf2_regnr::no_op_reg_to_regnum::0
f:=:const char *:register_name:int regnr:regnr
-# REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
+# Return the type of a register specified by the architecture. Only
+# the register cache should call this function directly; others should
+# use "register_type".
M::struct type *:register_type:int reg_nr:reg_nr
# If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
# register offsets computed using just REGISTER_TYPE, this can be
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 43da69d..dfcc024 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -3034,7 +3034,8 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache,
ULONGEST val;
int offset = 0;
int regnum = IA64_GR8_REGNUM;
- int reglen = TYPE_LENGTH (ia64_register_type (NULL, IA64_GR8_REGNUM));
+ int reglen = TYPE_LENGTH (register_type (get_regcache_arch (regcache),
+ IA64_GR8_REGNUM));
int n = TYPE_LENGTH (type) / reglen;
int m = TYPE_LENGTH (type) % reglen;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 3aeeedf..5c8f4fb 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -1481,7 +1481,7 @@ check_for_saved (void *prologue_untyped, pv_t addr, CORE_ADDR size, pv_t value)
if (value.reg == tdep->pc->num)
saved_size = tdep->ret_addr_bytes;
- else if (gdbarch_register_type (arch, value.reg)
+ else if (register_type (arch, value.reg)
== tdep->data_addr_reg_type)
saved_size = tdep->push_addr_bytes;
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 9c7eeff..99dd2f5 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -4031,7 +4031,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
gdb_byte raw_buffer[MAX_REGISTER_SIZE];
int offset;
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
{
mips_print_fp_register (file, frame, regnum);
return;
@@ -4063,7 +4063,7 @@ mips_print_register (struct ui_file *file, struct frame_info *frame,
offset = 0;
print_scalar_formatted (raw_buffer + offset,
- gdbarch_register_type (gdbarch, regnum), 'x', 0,
+ register_type (gdbarch, regnum), 'x', 0,
file);
}
@@ -4100,7 +4100,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
break; /* end the row: reached FP register */
if (col == 0)
@@ -4126,7 +4126,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
{
if (*REGISTER_NAME (regnum) == '\0')
continue; /* unused register */
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
break; /* end row: reached FP register */
/* OK: get the data in raw format. */
@@ -4178,7 +4178,7 @@ mips_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
regnum = NUM_REGS;
while (regnum < NUM_REGS + NUM_PSEUDO_REGS)
{
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) ==
+ if (TYPE_CODE (register_type (gdbarch, regnum)) ==
TYPE_CODE_FLT)
{
if (all) /* true for "INFO ALL-REGISTERS" command */
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index fa7fccf..752f642 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2004,7 +2004,7 @@ sh_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
base_regnum) * portion));
/* We must pay attention to the endiannes. */
sh_register_convert_to_virtual (reg_nr,
- gdbarch_register_type (gdbarch, reg_nr),
+ register_type (gdbarch, reg_nr),
temp_buffer, buffer);
}
else if (reg_nr >= FV0_REGNUM && reg_nr <= FV_LAST_REGNUM)
@@ -2044,7 +2044,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
base_regnum = dr_reg_base_num (reg_nr);
/* We must pay attention to the endiannes. */
- sh_register_convert_to_raw (gdbarch_register_type (gdbarch, reg_nr),
+ sh_register_convert_to_raw (register_type (gdbarch, reg_nr),
reg_nr, buffer, temp_buffer);
/* Write the real regs for which this one is an alias. */
diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c
index 844fb9a..dbab7c0 100644
--- a/gdb/sh64-tdep.c
+++ b/gdb/sh64-tdep.c
@@ -1597,8 +1597,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* We must pay attention to the endianness. */
sh64_register_convert_to_virtual (reg_nr,
- gdbarch_register_type (gdbarch,
- reg_nr),
+ register_type (gdbarch, reg_nr),
temp_buffer, buffer);
}
@@ -1669,8 +1668,7 @@ sh64_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
/* We must pay attention to the endianness. */
sh64_register_convert_to_virtual (reg_nr,
- gdbarch_register_type (gdbarch,
- reg_nr),
+ register_type (gdbarch, reg_nr),
temp_buffer, buffer);
}
@@ -1755,7 +1753,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
base_regnum = sh64_dr_reg_base_num (reg_nr);
/* We must pay attention to the endianness. */
- sh64_register_convert_to_raw (gdbarch_register_type (gdbarch, reg_nr),
+ sh64_register_convert_to_raw (register_type (gdbarch, reg_nr),
reg_nr,
buffer, temp_buffer);
@@ -1829,8 +1827,7 @@ sh64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
for (portion = 0; portion < 2; portion++)
{
/* We must pay attention to the endianness. */
- sh64_register_convert_to_raw (gdbarch_register_type (gdbarch,
- reg_nr),
+ sh64_register_convert_to_raw (register_type (gdbarch, reg_nr),
reg_nr,
buffer, temp_buffer);
@@ -2084,10 +2081,10 @@ sh64_do_register (struct gdbarch *gdbarch, struct ui_file *file,
if (!frame_register_read (frame, regnum, raw_buffer))
fprintf_filtered (file, "*value not available*\n");
- val_print (gdbarch_register_type (gdbarch, regnum), raw_buffer, 0, 0,
+ val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
file, 'x', 1, 0, Val_pretty_default);
fprintf_filtered (file, "\t");
- val_print (gdbarch_register_type (gdbarch, regnum), raw_buffer, 0, 0,
+ val_print (register_type (gdbarch, regnum), raw_buffer, 0, 0,
file, 0, 1, 0, Val_pretty_default);
fprintf_filtered (file, "\n");
}
@@ -2102,7 +2099,7 @@ sh64_print_register (struct gdbarch *gdbarch, struct ui_file *file,
else if (regnum >= 0 && regnum < NUM_REGS)
{
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
+ if (TYPE_CODE (register_type (gdbarch, regnum)) == TYPE_CODE_FLT)
sh64_do_fp_register (gdbarch, file, frame, regnum); /* FP regs */
else
sh64_do_register (gdbarch, file, frame, regnum);
@@ -2139,7 +2136,7 @@ sh64_media_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
continue;
}
- if (TYPE_CODE (gdbarch_register_type (gdbarch, regnum))
+ if (TYPE_CODE (register_type (gdbarch, regnum))
== TYPE_CODE_FLT)
{
if (fpregs)
diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c
index 4f3f424..4be83dc 100644
--- a/gdb/tui/tui-regs.c
+++ b/gdb/tui/tui-regs.c
@@ -654,7 +654,7 @@ tui_register_format (struct gdbarch *gdbarch, struct frame_info *frame,
struct cleanup *cleanups;
char *p, *s;
int pos;
- struct type *type = gdbarch_register_type (gdbarch, regnum);
+ struct type *type = register_type (gdbarch, regnum);
name = gdbarch_register_name (gdbarch, regnum);
if (name == 0)