diff options
author | Pedro Alves <palves@redhat.com> | 2011-03-18 18:42:41 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-03-18 18:42:41 +0000 |
commit | 8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c (patch) | |
tree | f08c75005e0a84b4ea64218341df6caf2bca0799 /gdb/spu-tdep.c | |
parent | 0fdb4f184b39af02d76e21cd25af561b464f15a6 (diff) | |
download | gdb-8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c.zip gdb-8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c.tar.gz gdb-8dccd430c9de0e6cf747ae4bb1bf9d944fe3397c.tar.bz2 |
gdb/
* dwarf2loc.c (read_pieced_value): Handle get_frame_register_bytes
returning that the register piece is unavailable/optimized out.
(write_pieced_value): Handle get_frame_register_bytes returning
that the register piece is unavailable/optimized out when doing a
read-modify write of a bitfield.
* findvar.c (value_from_register): Handle get_frame_register_bytes
returning that the register piece is unavailable/optimized out.
* frame.c (get_frame_register_bytes): New parameters `optimizedp'
and `unavailablep'. Throw error on bad debug info. Use
frame_register instead of frame_register_read, to fill in the new
arguments.
* frame.h (get_frame_register_bytes): New parameters `optimizedp'
and `unavailablep'.
* valops.c: (value_assign): Adjust, and handle
get_frame_register_bytes failing.
* spu-tdep.c: Include exceptions.h.
(spu_software_single_step): Adjust, and handle
get_frame_register_bytes failing.
(spu_get_longjmp_target): Ditto.
* gdbarch.sh (register_to_value): Change to return int. New
parameters `optimizedp' and `unavailablep'.
* gdbarch.h, gdbarch.c: Regenerate.
* i386-tdep.c (i386_register_to_value): Adjust to new
gdbarch_register_to_value interface.
* i387-tdep.c (i387_register_to_value): Ditto.
* i387-tdep.h (i387_register_to_value): Ditto.
* alpha-tdep.c (alpha_register_to_value): Ditto.
* ia64-tdep.c (ia64_register_to_value): Ditto.
* m68k-tdep.c (m68k_register_to_value): Ditto.
* mips-tdep.c (mips_register_to_value): Ditto.
* rs6000-tdep.c (rs6000_register_to_value): Ditto.
Diffstat (limited to 'gdb/spu-tdep.c')
-rw-r--r-- | gdb/spu-tdep.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index 7f0cd7d..da7024a 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -45,7 +45,7 @@ #include "observer.h" #include "infcall.h" #include "dwarf2.h" - +#include "exceptions.h" #include "spu-tdep.h" @@ -1594,8 +1594,21 @@ spu_software_single_step (struct frame_info *frame) target += SPUADDR_ADDR (pc); else if (reg != -1) { - get_frame_register_bytes (frame, reg, 0, 4, buf); - target += extract_unsigned_integer (buf, 4, byte_order) & -4; + int optim, unavail; + + if (get_frame_register_bytes (frame, reg, 0, 4, buf, + &optim, &unavail)) + target += extract_unsigned_integer (buf, 4, byte_order) & -4; + else + { + if (optim) + error (_("Could not determine address of " + "single-step breakpoint.")); + if (unavail) + throw_error (NOT_AVAILABLE_ERROR, + _("Could not determine address of " + "single-step breakpoint.")); + } } target = target & lslr; @@ -1618,9 +1631,13 @@ spu_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc) enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; CORE_ADDR jb_addr; + int optim, unavail; /* Jump buffer is pointed to by the argument register $r3. */ - get_frame_register_bytes (frame, SPU_ARG1_REGNUM, 0, 4, buf); + if (!get_frame_register_bytes (frame, SPU_ARG1_REGNUM, 0, 4, buf, + &optim, &unavail)) + return 0; + jb_addr = extract_unsigned_integer (buf, 4, byte_order); if (target_read_memory (SPUADDR (tdep->id, jb_addr), buf, 4)) return 0; |