diff options
author | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2000-07-24 14:25:22 +0000 |
---|---|---|
committer | Elena Zannoni <ezannoni@kwikemart.cygnus.com> | 2000-07-24 14:25:22 +0000 |
commit | 0aba1244556ea8cb395fa0590d772e74fb9512b5 (patch) | |
tree | 99a2a891c9b3974525269115b2443244e5ef0abd | |
parent | e7997b74f5b7645ca895ff4007cdec3ee9484842 (diff) | |
download | gdb-0aba1244556ea8cb395fa0590d772e74fb9512b5.zip gdb-0aba1244556ea8cb395fa0590d772e74fb9512b5.tar.gz gdb-0aba1244556ea8cb395fa0590d772e74fb9512b5.tar.bz2 |
* gdbarch.sh: Add NUM_PSEUDO_REGS to the gdbarch structure.
* gdbarch.c: Regenerate.
* gdbarch.h: Regenerate.
* inferior.h (NUM_PSEUDO_REGS): Delete macro.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/gdbarch.c | 29 | ||||
-rw-r--r-- | gdb/gdbarch.h | 13 | ||||
-rwxr-xr-x | gdb/gdbarch.sh | 5 | ||||
-rw-r--r-- | gdb/inferior.h | 9 |
5 files changed, 54 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e3030f9..d03e54a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2000-07-24 Elena Zannoni <ezannoni@kwikemart.cygnus.com> + + * gdbarch.sh: Add NUM_PSEUDO_REGS to the gdbarch structure. + * gdbarch.c: Regenerate. + * gdbarch.h: Regenerate. + * inferior.h (NUM_PSEUDO_REGS): Delete macro. + Sun Jul 23 21:40:55 2000 Anthony Green <green@redhat.com> * language.c: Include jv-lang.h. diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 2d4510e..e0953ff 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -145,6 +145,7 @@ struct gdbarch gdbarch_read_sp_ftype *read_sp; gdbarch_write_sp_ftype *write_sp; int num_regs; + int num_pseudo_regs; int sp_regnum; int fp_regnum; int pc_regnum; @@ -292,6 +293,7 @@ struct gdbarch startup_gdbarch = 0, 0, 0, + 0, generic_get_saved_register, 0, 0, @@ -479,6 +481,7 @@ verify_gdbarch (struct gdbarch *gdbarch) if ((GDB_MULTI_ARCH >= 2) && (gdbarch->num_regs == -1)) internal_error ("gdbarch: verify_gdbarch: num_regs invalid"); + /* Skip verify of num_pseudo_regs, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->sp_regnum == -1)) internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid"); @@ -775,6 +778,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: NUM_REGS # %s\n", XSTRING (NUM_REGS)); #endif +#ifdef NUM_PSEUDO_REGS + fprintf_unfiltered (file, + "gdbarch_dump: NUM_PSEUDO_REGS # %s\n", + XSTRING (NUM_PSEUDO_REGS)); +#endif #ifdef SP_REGNUM fprintf_unfiltered (file, "gdbarch_dump: SP_REGNUM # %s\n", @@ -1348,6 +1356,11 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: NUM_REGS = %ld\n", (long) NUM_REGS); #endif +#ifdef NUM_PSEUDO_REGS + fprintf_unfiltered (file, + "gdbarch_dump: NUM_PSEUDO_REGS = %ld\n", + (long) NUM_PSEUDO_REGS); +#endif #ifdef SP_REGNUM fprintf_unfiltered (file, "gdbarch_dump: SP_REGNUM = %ld\n", @@ -2169,6 +2182,22 @@ set_gdbarch_num_regs (struct gdbarch *gdbarch, } int +gdbarch_num_pseudo_regs (struct gdbarch *gdbarch) +{ + /* Skip verify of num_pseudo_regs, invalid_p == 0 */ + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_num_pseudo_regs called\n"); + return gdbarch->num_pseudo_regs; +} + +void +set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, + int num_pseudo_regs) +{ + gdbarch->num_pseudo_regs = num_pseudo_regs; +} + +int gdbarch_sp_regnum (struct gdbarch *gdbarch) { if (gdbarch->sp_regnum == -1) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 49932c0..5561417 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -239,6 +239,19 @@ extern void set_gdbarch_num_regs (struct gdbarch *gdbarch, int num_regs); #endif #endif +/* Default (value) for non- multi-arch platforms. */ +#if (GDB_MULTI_ARCH == 0) && !defined (NUM_PSEUDO_REGS) +#define NUM_PSEUDO_REGS (0) +#endif + +extern int gdbarch_num_pseudo_regs (struct gdbarch *gdbarch); +extern void set_gdbarch_num_pseudo_regs (struct gdbarch *gdbarch, int num_pseudo_regs); +#if GDB_MULTI_ARCH +#if (GDB_MULTI_ARCH > 1) || !defined (NUM_PSEUDO_REGS) +#define NUM_PSEUDO_REGS (gdbarch_num_pseudo_regs (current_gdbarch)) +#endif +#endif + extern int gdbarch_sp_regnum (struct gdbarch *gdbarch); extern void set_gdbarch_sp_regnum (struct gdbarch *gdbarch, int sp_regnum); #if GDB_MULTI_ARCH diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 7e24c55..b7c592c 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -294,6 +294,11 @@ f:1:TARGET_READ_SP:CORE_ADDR:read_sp:void:::0:0 f:1:TARGET_WRITE_SP:void:write_sp:CORE_ADDR val:val::0:0 # v:2:NUM_REGS:int:num_regs::::0:-1 +# This macro gives the number of pseudo-registers that live in the +# register namespace but do not get fetched or stored on the target. +# These pseudo-registers may be aliases for other registers, +# combinations of other registers, or they may be computed by GDB. +v:2:NUM_PSEUDO_REGS:int:num_pseudo_regs::::0:0::0::: v:2:SP_REGNUM:int:sp_regnum::::0:-1 v:2:FP_REGNUM:int:fp_regnum::::0:-1 v:2:PC_REGNUM:int:pc_regnum::::0:-1 diff --git a/gdb/inferior.h b/gdb/inferior.h index 95a8c61..eb947d1 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -59,15 +59,6 @@ extern void write_inferior_status_register (struct inferior_status #define ARCH_NUM_REGS NUM_REGS #endif -/* This macro gives the number of pseudo-registers that live in the - register namespace but do not get fetched or stored on the target. - These pseudo-registers may be aliases for other registers, - combinations of other registers, or they may be computed by GDB. - FIXME: move into gdbarch.[ch] */ -#ifndef NUM_PSEUDO_REGS -#define NUM_PSEUDO_REGS 0 -#endif - /* This function is called when the value of a pseudo-register needs to be updated. Typically it will be defined on a per-architecture basis. FIXME: move into gdbarch.[ch]. */ |