diff options
author | Yao Qi <yao.qi@linaro.org> | 2015-09-15 10:25:51 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2015-09-15 10:25:51 +0100 |
commit | ade90bdeb78ccaeb294e34af04751f2f649a324f (patch) | |
tree | 6e287b95a6130b9c3cf4fa4438edc01b6d169e74 /gdb/gdbserver/linux-aarch64-low.c | |
parent | afa18d267a8cdc61b2c96b98af8c217f92516dc6 (diff) | |
download | gdb-ade90bdeb78ccaeb294e34af04751f2f649a324f.zip gdb-ade90bdeb78ccaeb294e34af04751f2f649a324f.tar.gz gdb-ade90bdeb78ccaeb294e34af04751f2f649a324f.tar.bz2 |
aarch64 multi-arch support (part 2): siginfo fixup
This patch is to fixup the siginfo_t when aarch64 gdb or gdbserver
read from or write to the arm inferior. It is to convert the
"struct siginfo_t" between aarch64 and arm, which is quite mechanical.
gdb/gdbserver:
2015-09-15 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
function.
(struct linux_target_ops the_low_target): Install
aarch64_linux_siginfo_fixup.
gdb:
2015-09-15 Yao Qi <yao.qi@linaro.org>
* aarch64-linux-nat.c (aarch64_linux_siginfo_fixup): New function.
(_initialize_aarch64_linux_nat): Call linux_nat_set_siginfo_fixup.
* nat/aarch64-linux.c (aarch64_compat_siginfo_from_siginfo):
New function.
(aarch64_siginfo_from_compat_siginfo): New function.
* nat/aarch64-linux.h: Include signal.h.
(compat_int_t, compat_uptr_t, compat_time_t): Typedef.
(compat_timer_t, compat_clock_t): Likewise.
(struct compat_timeval): New.
(union compat_sigval): New.
(struct compat_siginfo): New.
(cpt_si_pid, cpt_si_uid, cpt_si_timerid): New macros.
(cpt_si_overrun, cpt_si_status, cpt_si_utime): Likewise.
(cpt_si_stime, cpt_si_ptr, cpt_si_addr): Likewise.
(cpt_si_band, cpt_si_fd): Likewise.
Diffstat (limited to 'gdb/gdbserver/linux-aarch64-low.c')
-rw-r--r-- | gdb/gdbserver/linux-aarch64-low.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index aebf1e3..73b248c 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -430,6 +430,27 @@ ps_get_thread_area (const struct ps_prochandle *ph, return PS_OK; } +/* Implementation of linux_target_ops method "siginfo_fixup". */ + +static int +aarch64_linux_siginfo_fixup (siginfo_t *native, void *inf, int direction) +{ + /* Is the inferior 32-bit? If so, then fixup the siginfo object. */ + if (!is_64bit_tdesc ()) + { + if (direction == 0) + aarch64_compat_siginfo_from_siginfo ((struct compat_siginfo *) inf, + native); + else + aarch64_siginfo_from_compat_siginfo (native, + (struct compat_siginfo *) inf); + + return 1; + } + + return 0; +} + /* Implementation of linux_target_ops method "linux_new_process". */ static struct arch_process_info * @@ -581,7 +602,7 @@ struct linux_target_ops the_low_target = aarch64_stopped_data_address, NULL, /* collect_ptrace_register */ NULL, /* supply_ptrace_register */ - NULL, /* siginfo_fixup */ + aarch64_linux_siginfo_fixup, aarch64_linux_new_process, aarch64_linux_new_thread, aarch64_linux_new_fork, |