mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-10 09:59:06 +08:00
gdb/rs6000: Read backchain as unsigned.
Previously, backchain was read as a signed quantity, resulting in addresses like 0xfffffffffffeded0 instead of 0xfffeded0 returned by unwinder on 32-bit powerpc. While normally such addresses are masked off, this causes problems for tracepoints, since 0xfffffffffffeded0 is considered unavailable. Fixes a test failure in gdb.trace/entry-values.exp. gdb/ChangeLog: * corefile.c (safe_read_memory_unsigned_integer): New function. * gdbcore.h (safe_read_memory_unsigned_integer): New prototype. * rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2016-03-09 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
|
* corefile.c (safe_read_memory_unsigned_integer): New function.
|
||||||
|
* gdbcore.h (safe_read_memory_unsigned_integer): New prototype.
|
||||||
|
* rs6000-tdep.c (rs6000_frame_cache): Read backchain as unsigned.
|
||||||
|
|
||||||
2016-03-09 Marcin Kościelnicki <koriakin@0x04.net>
|
2016-03-09 Marcin Kościelnicki <koriakin@0x04.net>
|
||||||
|
|
||||||
* rs6000-tdep.c: Add "ax.h" and "ax-gdb.h" includes.
|
* rs6000-tdep.c: Add "ax.h" and "ax-gdb.h" includes.
|
||||||
|
@ -306,6 +306,24 @@ safe_read_memory_integer (CORE_ADDR memaddr, int len,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Read memory at MEMADDR of length LEN and put the contents in
|
||||||
|
RETURN_VALUE. Return 0 if MEMADDR couldn't be read and non-zero
|
||||||
|
if successful. */
|
||||||
|
|
||||||
|
int
|
||||||
|
safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len,
|
||||||
|
enum bfd_endian byte_order,
|
||||||
|
ULONGEST *return_value)
|
||||||
|
{
|
||||||
|
gdb_byte buf[sizeof (ULONGEST)];
|
||||||
|
|
||||||
|
if (target_read_memory (memaddr, buf, len))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
*return_value = extract_unsigned_integer (buf, len, byte_order);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
LONGEST
|
LONGEST
|
||||||
read_memory_integer (CORE_ADDR memaddr, int len,
|
read_memory_integer (CORE_ADDR memaddr, int len,
|
||||||
enum bfd_endian byte_order)
|
enum bfd_endian byte_order)
|
||||||
|
@ -76,6 +76,9 @@ extern int safe_read_memory_integer (CORE_ADDR memaddr, int len,
|
|||||||
extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
|
extern ULONGEST read_memory_unsigned_integer (CORE_ADDR memaddr,
|
||||||
int len,
|
int len,
|
||||||
enum bfd_endian byte_order);
|
enum bfd_endian byte_order);
|
||||||
|
extern int safe_read_memory_unsigned_integer (CORE_ADDR memaddr, int len,
|
||||||
|
enum bfd_endian byte_order,
|
||||||
|
ULONGEST *return_value);
|
||||||
|
|
||||||
/* Read an integer from debugged code memory, given address,
|
/* Read an integer from debugged code memory, given address,
|
||||||
number of bytes, and byte order for code. */
|
number of bytes, and byte order for code. */
|
||||||
|
@ -3336,9 +3336,9 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
|
|||||||
if (!fdata.frameless)
|
if (!fdata.frameless)
|
||||||
{
|
{
|
||||||
/* Frameless really means stackless. */
|
/* Frameless really means stackless. */
|
||||||
LONGEST backchain;
|
ULONGEST backchain;
|
||||||
|
|
||||||
if (safe_read_memory_integer (cache->base, wordsize,
|
if (safe_read_memory_unsigned_integer (cache->base, wordsize,
|
||||||
byte_order, &backchain))
|
byte_order, &backchain))
|
||||||
cache->base = (CORE_ADDR) backchain;
|
cache->base = (CORE_ADDR) backchain;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user