aboutsummaryrefslogtreecommitdiff
path: root/gdb/riscv-tdep.h
diff options
context:
space:
mode:
authorLancelot SIX <lsix@lancelotsix.com>2021-07-16 22:10:08 +0000
committerLancelot SIX <lsix@lancelotsix.com>2021-07-16 22:10:08 +0000
commite843807b2df9f99b8172bfaf4daa3a42461cdbfa (patch)
treefdce54aa31c1f7bb740dc766c5d7bc13d0428299 /gdb/riscv-tdep.h
parent47357fdc1db04240be98c683de776b3a351e945b (diff)
downloadgdb-e843807b2df9f99b8172bfaf4daa3a42461cdbfa.zip
gdb-e843807b2df9f99b8172bfaf4daa3a42461cdbfa.tar.gz
gdb-e843807b2df9f99b8172bfaf4daa3a42461cdbfa.tar.bz2
gdb: Support stepping out from signal handler on riscv*-linux
Currently, gdb cannot step outside of a signal handler on RISC-V platforms. This causes multiple failures in gdb.base/sigstep.exp: FAIL: gdb.base/sigstep.exp: continue to handler, nothing in handler, step from handler: leave handler (timeout) FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, step from handler: leave handler (timeout) FAIL: gdb.base/sigstep.exp: continue to handler, nothing in handler, next from handler: leave handler (timeout) FAIL: gdb.base/sigstep.exp: continue to handler, si+advance in handler, next from handler: leave handler (timeout) FAIL: gdb.base/sigstep.exp: stepi from handleri: leave signal trampoline FAIL: gdb.base/sigstep.exp: nexti from handleri: leave signal trampoline === gdb Summary === # of expected passes 587 # of unexpected failures 6 This patch adds support for stepping outside of a signal handler on riscv*-*-linux*. Implementation is heavily inspired from mips_linux_syscall_next_pc and surroundings as advised by Pedro Alves. After this patch, all tests in gdb.base/sigstep.exp pass. Build and tested on riscv64-linux-gnu.
Diffstat (limited to 'gdb/riscv-tdep.h')
-rw-r--r--gdb/riscv-tdep.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/riscv-tdep.h b/gdb/riscv-tdep.h
index 62bf479..03870cf 100644
--- a/gdb/riscv-tdep.h
+++ b/gdb/riscv-tdep.h
@@ -34,6 +34,7 @@ enum
RISCV_FP_REGNUM = 8, /* Frame Pointer. */
RISCV_A0_REGNUM = 10, /* First argument. */
RISCV_A1_REGNUM = 11, /* Second argument. */
+ RISCV_A7_REGNUM = 17, /* Seventh argument. */
RISCV_PC_REGNUM = 32, /* Program Counter. */
RISCV_NUM_INTEGER_REGS = 32,
@@ -102,6 +103,9 @@ struct gdbarch_tdep
int duplicate_frm_regnum = -1;
int duplicate_fcsr_regnum = -1;
+ /* Return the expected next PC assuming FRAME is stopped at a syscall
+ instruction. */
+ CORE_ADDR (*syscall_next_pc) (struct frame_info *frame);
};