diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-12 16:51:13 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2007-06-12 16:51:13 +0000 |
commit | c1afe53dd0ad0474a838e84cd0d98f8830c3d9ef (patch) | |
tree | 3085f21c5fd97e175e756c369e246516cd81d7c8 | |
parent | 474c1661763ea406e7b76ba49718330a6b8ade94 (diff) | |
download | gdb-c1afe53dd0ad0474a838e84cd0d98f8830c3d9ef.zip gdb-c1afe53dd0ad0474a838e84cd0d98f8830c3d9ef.tar.gz gdb-c1afe53dd0ad0474a838e84cd0d98f8830c3d9ef.tar.bz2 |
2007-06-12 Markus Deuling <deuling@de.ibm.com>
* gdbarch.sh (REGISTER_TO_VALUE): Replace by gdbarch_register_to_value.
* findvar.c (value_from_register): Likewise.
* gdbarch.sh (VALUE_TO_REGISTER): Replace by gdbarch_value_to_register.
* valops.c (value_assign): Likewise.
* gdbarch.sh (CONVERT_REGISTER_P): Replace by
gdbarch_convert_register_p.
* findvar.c (value_from_register): Likewise.
* valops.c (value_assign): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/findvar.c | 7 | ||||
-rw-r--r-- | gdb/gdbarch.c | 18 | ||||
-rw-r--r-- | gdb/gdbarch.h | 18 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 6 | ||||
-rw-r--r-- | gdb/valops.c | 8 |
6 files changed, 24 insertions, 45 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 15ca1d2..20960f3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2007-06-12 Markus Deuling <deuling@de.ibm.com> + * gdbarch.sh (REGISTER_TO_VALUE): Replace by gdbarch_register_to_value. + * findvar.c (value_from_register): Likewise. + * gdbarch.sh (VALUE_TO_REGISTER): Replace by gdbarch_value_to_register. + * valops.c (value_assign): Likewise. + * gdbarch.sh (CONVERT_REGISTER_P): Replace by + gdbarch_convert_register_p. + * findvar.c (value_from_register): Likewise. + * valops.c (value_assign): Likewise. + * gdbarch.c, gdbarch.h: Regenerate. + +2007-06-12 Markus Deuling <deuling@de.ibm.com> + * gdbarch.sh (REGISTER_SIM_REGNO): Replace by gdbarch_register_sim_regno. * sim-regno.h (sim_regno): Likewise (comment). diff --git a/gdb/findvar.c b/gdb/findvar.c index 971bb44..839e988 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -624,20 +624,21 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) struct type *type1 = check_typedef (type); struct value *v; - if (CONVERT_REGISTER_P (regnum, type1)) + if (gdbarch_convert_register_p (current_gdbarch, regnum, type1)) { /* The ISA/ABI need to something weird when obtaining the specified value from this register. It might need to re-order non-adjacent, starting with REGNUM (see MIPS and i386). It might need to convert the [float] register into the corresponding [integer] type (see Alpha). The assumption - is that REGISTER_TO_VALUE populates the entire value + is that gdbarch_register_to_value populates the entire value including the location. */ v = allocate_value (type); VALUE_LVAL (v) = lval_register; VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; - REGISTER_TO_VALUE (frame, regnum, type1, value_contents_raw (v)); + gdbarch_register_to_value (current_gdbarch, + frame, regnum, type1, value_contents_raw (v)); } else { diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 20a7bb3..fa61d9a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -751,12 +751,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: convert_from_func_ptr_addr = <0x%lx>\n", (long) current_gdbarch->convert_from_func_ptr_addr); -#ifdef CONVERT_REGISTER_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "CONVERT_REGISTER_P(regnum, type)", - XSTRING (CONVERT_REGISTER_P (regnum, type))); -#endif fprintf_unfiltered (file, "gdbarch_dump: convert_register_p = <0x%lx>\n", (long) current_gdbarch->convert_register_p); @@ -1104,12 +1098,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: register_sim_regno = <0x%lx>\n", (long) current_gdbarch->register_sim_regno); -#ifdef REGISTER_TO_VALUE - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "REGISTER_TO_VALUE(frame, regnum, type, buf)", - XSTRING (REGISTER_TO_VALUE (frame, regnum, type, buf))); -#endif fprintf_unfiltered (file, "gdbarch_dump: register_to_value = <0x%lx>\n", (long) current_gdbarch->register_to_value); @@ -1247,12 +1235,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: value_from_register = <0x%lx>\n", (long) current_gdbarch->value_from_register); -#ifdef VALUE_TO_REGISTER - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "VALUE_TO_REGISTER(frame, regnum, type, buf)", - XSTRING (VALUE_TO_REGISTER (frame, regnum, type, buf))); -#endif fprintf_unfiltered (file, "gdbarch_dump: value_to_register = <0x%lx>\n", (long) current_gdbarch->value_to_register); diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 3a5d3ce..c20696e 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -453,32 +453,14 @@ extern void set_gdbarch_believe_pcc_promotion (struct gdbarch *gdbarch, int beli typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type); extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type); extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p); -#if !defined (GDB_TM_FILE) && defined (CONVERT_REGISTER_P) -#error "Non multi-arch definition of CONVERT_REGISTER_P" -#endif -#if !defined (CONVERT_REGISTER_P) -#define CONVERT_REGISTER_P(regnum, type) (gdbarch_convert_register_p (current_gdbarch, regnum, type)) -#endif typedef void (gdbarch_register_to_value_ftype) (struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf); extern void gdbarch_register_to_value (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf); extern void set_gdbarch_register_to_value (struct gdbarch *gdbarch, gdbarch_register_to_value_ftype *register_to_value); -#if !defined (GDB_TM_FILE) && defined (REGISTER_TO_VALUE) -#error "Non multi-arch definition of REGISTER_TO_VALUE" -#endif -#if !defined (REGISTER_TO_VALUE) -#define REGISTER_TO_VALUE(frame, regnum, type, buf) (gdbarch_register_to_value (current_gdbarch, frame, regnum, type, buf)) -#endif typedef void (gdbarch_value_to_register_ftype) (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf); extern void gdbarch_value_to_register (struct gdbarch *gdbarch, struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf); extern void set_gdbarch_value_to_register (struct gdbarch *gdbarch, gdbarch_value_to_register_ftype *value_to_register); -#if !defined (GDB_TM_FILE) && defined (VALUE_TO_REGISTER) -#error "Non multi-arch definition of VALUE_TO_REGISTER" -#endif -#if !defined (VALUE_TO_REGISTER) -#define VALUE_TO_REGISTER(frame, regnum, type, buf) (gdbarch_value_to_register (current_gdbarch, frame, regnum, type, buf)) -#endif /* Construct a value representing the contents of register REGNUM in frame FRAME, interpreted as type TYPE. The routine needs to diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 37e9f49..7440cd3 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -487,9 +487,9 @@ F::int:get_longjmp_target:CORE_ADDR *pc:pc # v:=:int:believe_pcc_promotion::::::: # -f:=:int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0 -f:=:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0 -f:=:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf:frame, regnum, type, buf:0 +f::int:convert_register_p:int regnum, struct type *type:regnum, type:0:generic_convert_register_p::0 +f::void:register_to_value:struct frame_info *frame, int regnum, struct type *type, gdb_byte *buf:frame, regnum, type, buf:0 +f::void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const gdb_byte *buf:frame, regnum, type, buf:0 # Construct a value representing the contents of register REGNUM in # frame FRAME, interpreted as type TYPE. The routine needs to # allocate and return a struct value with all value attributes diff --git a/gdb/valops.c b/gdb/valops.c index 8cbda26..1163756 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -636,12 +636,14 @@ value_assign (struct value *toval, struct value *fromval) if (!frame) error (_("Value being assigned to is no longer active.")); - if (CONVERT_REGISTER_P (VALUE_REGNUM (toval), type)) + if (gdbarch_convert_register_p + (current_gdbarch, VALUE_REGNUM (toval), type)) { /* If TOVAL is a special machine register requiring conversion of program values to a special raw format. */ - VALUE_TO_REGISTER (frame, VALUE_REGNUM (toval), - type, value_contents (fromval)); + gdbarch_value_to_register (current_gdbarch, + frame, VALUE_REGNUM (toval), + type, value_contents (fromval)); } else { |