diff options
author | Carl Love <cel@us.ibm.com> | 2021-11-15 20:31:06 +0000 |
---|---|---|
committer | Carl Love <cel@us.ibm.com> | 2021-11-18 10:17:31 -0600 |
commit | 90ad9178f19221a836cae3b4b2298ee0a968017a (patch) | |
tree | 4610ce75897ca7be088511b63fb22ee303f09792 /gdb/ppc-linux-tdep.c | |
parent | 2888fe8d193bd1e82e1e155b9795308184fe923b (diff) | |
download | gdb-90ad9178f19221a836cae3b4b2298ee0a968017a.zip gdb-90ad9178f19221a836cae3b4b2298ee0a968017a.tar.gz gdb-90ad9178f19221a836cae3b4b2298ee0a968017a.tar.bz2 |
gdb: PowerPC fix gdb.base/break-interp.exp
This patch fixes eight test failures on PowerPC for the test
gdb.base/break-interp.exp. The patch adds a funtion and registers it to
setup the displaced stepping for ppc-linux platform. The patch moves the
struct ppc_inferior_data to the ppc-tdep.h include file to make it visible
to the ppc-linux-tdep.c and rs6000-tdep.c files. Additionally the function
get_ppc_per_inferior is made external in ppc-tdep.h to make it visible in
both files.
Tested on Power 10 ppc64le-linux with no regressions.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r-- | gdb/ppc-linux-tdep.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 6df2411..9e89542 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -2014,6 +2014,23 @@ ppc64_linux_gcc_target_options (struct gdbarch *gdbarch) return ""; } +static displaced_step_prepare_status +ppc_linux_displaced_step_prepare (gdbarch *arch, thread_info *thread, + CORE_ADDR &displaced_pc) +{ + ppc_inferior_data *per_inferior = get_ppc_per_inferior (thread->inf); + if (!per_inferior->disp_step_buf.has_value ()) + { + /* Figure out where the displaced step buffer is. */ + CORE_ADDR disp_step_buf_addr + = linux_displaced_step_location (thread->inf->gdbarch); + + per_inferior->disp_step_buf.emplace (disp_step_buf_addr); + } + + return per_inferior->disp_step_buf->prepare (thread, displaced_pc); +} + static void ppc_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) @@ -2190,6 +2207,11 @@ ppc_linux_init_abi (struct gdbarch_info info, ppc_init_linux_record_tdep (&ppc_linux_record_tdep, 4); ppc_init_linux_record_tdep (&ppc64_linux_record_tdep, 8); + + /* Setup displaced stepping. */ + set_gdbarch_displaced_step_prepare (gdbarch, + ppc_linux_displaced_step_prepare); + } void _initialize_ppc_linux_tdep (); |