diff options
author | Tom Tromey <tromey@redhat.com> | 2011-07-22 15:31:52 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2011-07-22 15:31:52 +0000 |
commit | 3543a589b22f9e26af4f71ce737dd9aae3410fda (patch) | |
tree | 527a7e87e1d9ae26fba99eb127227758a70c4fe4 /gdb/gdbarch.c | |
parent | 26ac12805d14072ea51a3e880e7ef1718f9b8d7b (diff) | |
download | gdb-3543a589b22f9e26af4f71ce737dd9aae3410fda.zip gdb-3543a589b22f9e26af4f71ce737dd9aae3410fda.tar.gz gdb-3543a589b22f9e26af4f71ce737dd9aae3410fda.tar.bz2 |
gdb
* amd64-tdep.c (amd64_pseudo_register_read_value): Rename
from amd64_pseudo_register_read. Change arguments. Call
mark_value_bytes_unavailable when needed.
(amd64_init_abi): Use set_gdbarch_pseudo_register_read_value, not
set_gdbarch_pseudo_register_read.
* sentinel-frame.c (sentinel_frame_prev_register): Use
regcache_cooked_read_value.
* regcache.h (regcache_cooked_read_value): Declare.
* regcache.c (regcache_cooked_read_value): New function.
(regcache_cooked_read): Call
gdbarch_pseudo_register_read_value if available.
* i386-tdep.h (i386_pseudo_register_read_value): Declare.
(i386_pseudo_register_read): Remove.
* i386-tdep.c (i386_pseudo_register_read_into_value): Rename from
i386_pseudo_register_read. Change arguments. Call
mark_value_bytes_unavailable when needed.
(i386_pseudo_register_read_value): New function.
(i386_gdbarch_init): Call set_gdbarch_pseudo_register_read_value,
not set_gdbarch_pseudo_register_read.
* gdbarch.sh (pseudo_register_read_value): New method.
* gdbarch.c, gdbarch.h: Rebuild.
* findvar.c (value_from_register): Call get_frame_register_value.
gdb/testsuite
* gdb.dwarf2/typeddwarf.c: XFAIL 'z' on x86-64.
* gdb.dwarf2/typeddwarf.exp (xfail-gdb-test): Add arch_pattern
argument.
* gdb.dwarf2/typeddwarf-amd64.S: New file.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r-- | gdb/gdbarch.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 1e65c17..600cce6 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -161,6 +161,7 @@ struct gdbarch gdbarch_write_pc_ftype *write_pc; gdbarch_virtual_frame_pointer_ftype *virtual_frame_pointer; gdbarch_pseudo_register_read_ftype *pseudo_register_read; + gdbarch_pseudo_register_read_value_ftype *pseudo_register_read_value; gdbarch_pseudo_register_write_ftype *pseudo_register_write; int num_regs; int num_pseudo_regs; @@ -313,6 +314,7 @@ struct gdbarch startup_gdbarch = 0, /* write_pc */ legacy_virtual_frame_pointer, /* virtual_frame_pointer */ 0, /* pseudo_register_read */ + 0, /* pseudo_register_read_value */ 0, /* pseudo_register_write */ 0, /* num_regs */ 0, /* num_pseudo_regs */ @@ -594,6 +596,7 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of write_pc, has predicate. */ /* Skip verify of virtual_frame_pointer, invalid_p == 0 */ /* Skip verify of pseudo_register_read, has predicate. */ + /* Skip verify of pseudo_register_read_value, has predicate. */ /* Skip verify of pseudo_register_write, has predicate. */ if (gdbarch->num_regs == -1) fprintf_unfiltered (log, "\n\tnum_regs"); @@ -1085,6 +1088,12 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file) "gdbarch_dump: pseudo_register_read = <%s>\n", host_address_to_string (gdbarch->pseudo_register_read)); fprintf_unfiltered (file, + "gdbarch_dump: gdbarch_pseudo_register_read_value_p() = %d\n", + gdbarch_pseudo_register_read_value_p (gdbarch)); + fprintf_unfiltered (file, + "gdbarch_dump: pseudo_register_read_value = <%s>\n", + host_address_to_string (gdbarch->pseudo_register_read_value)); + fprintf_unfiltered (file, "gdbarch_dump: gdbarch_pseudo_register_write_p() = %d\n", gdbarch_pseudo_register_write_p (gdbarch)); fprintf_unfiltered (file, @@ -1700,6 +1709,30 @@ set_gdbarch_pseudo_register_read (struct gdbarch *gdbarch, } int +gdbarch_pseudo_register_read_value_p (struct gdbarch *gdbarch) +{ + gdb_assert (gdbarch != NULL); + return gdbarch->pseudo_register_read_value != NULL; +} + +struct value * +gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, struct regcache *regcache, int cookednum) +{ + gdb_assert (gdbarch != NULL); + gdb_assert (gdbarch->pseudo_register_read_value != NULL); + if (gdbarch_debug >= 2) + fprintf_unfiltered (gdb_stdlog, "gdbarch_pseudo_register_read_value called\n"); + return gdbarch->pseudo_register_read_value (gdbarch, regcache, cookednum); +} + +void +set_gdbarch_pseudo_register_read_value (struct gdbarch *gdbarch, + gdbarch_pseudo_register_read_value_ftype pseudo_register_read_value) +{ + gdbarch->pseudo_register_read_value = pseudo_register_read_value; +} + +int gdbarch_pseudo_register_write_p (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); |