diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-12-21 00:48:51 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2018-12-21 17:06:27 +0000 |
commit | a96bd1ccc0dca2d260e0e30de462f37066973ceb (patch) | |
tree | f55dff0aa35c3c6f1e9e05999c34be012c3e85c5 /gdb/riscv-tdep.c | |
parent | 3dcfdc58656caa4a38e1fde73a07a19114347226 (diff) | |
download | gdb-a96bd1ccc0dca2d260e0e30de462f37066973ceb.zip gdb-a96bd1ccc0dca2d260e0e30de462f37066973ceb.tar.gz gdb-a96bd1ccc0dca2d260e0e30de462f37066973ceb.tar.bz2 |
gdb/riscv: Format CORE_ADDR as a string for printing
Avoid compiler errors caused by trying to print CORE_ADDR using '%ld'
format, instead convert to a string and print that instead.
gdb/ChangeLog:
* riscv-tdep.c (riscv_scan_prologue): Use plongest to format
a signed offset as a string.
Diffstat (limited to 'gdb/riscv-tdep.c')
-rw-r--r-- | gdb/riscv-tdep.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 88b79af..6a55ab8 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1542,10 +1542,16 @@ riscv_scan_prologue (struct gdbarch *gdbarch, if (stack.find_reg (gdbarch, i, &offset)) { if (riscv_debug_unwinder) - fprintf_unfiltered (gdb_stdlog, - "Register $%s at stack offset %ld\n", - gdbarch_register_name (gdbarch, i), - offset); + { + /* Display OFFSET as a signed value, the offsets are from + the frame base address to the registers location on + the stack, with a descending stack this means the + offsets are always negative. */ + fprintf_unfiltered (gdb_stdlog, + "Register $%s at stack offset %s\n", + gdbarch_register_name (gdbarch, i), + plongest ((LONGEST) offset)); + } trad_frame_set_addr (cache->regs, i, offset); } } |