[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 24/44] linux-user: provide frame information in x86-6
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 24/44] linux-user: provide frame information in x86-64 safe_syscall |
Date: |
Wed, 8 Jun 2016 16:30:05 +0300 |
From: Peter Maydell <address@hidden>
Use cfi directives in the x86-64 safe_syscall to allow gdb to get
backtraces right from within it. (In particular this will be
quite a common situation if the user interrupts QEMU while it's
in a blocked safe-syscall: at the point of the syscall insn RBP
is in use for something else, and so gdb can't find the frame then
without assistance.)
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/host/x86_64/safe-syscall.inc.S | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/linux-user/host/x86_64/safe-syscall.inc.S
b/linux-user/host/x86_64/safe-syscall.inc.S
index dde434c..e09368d 100644
--- a/linux-user/host/x86_64/safe-syscall.inc.S
+++ b/linux-user/host/x86_64/safe-syscall.inc.S
@@ -24,6 +24,7 @@
* -1-and-errno-set convention is done by the calling wrapper.
*/
safe_syscall_base:
+ .cfi_startproc
/* This saves a frame pointer and aligns the stack for the syscall.
* (It's unclear if the syscall ABI has the same stack alignment
* requirements as the userspace function call ABI, but better safe
than
@@ -31,6 +32,8 @@ safe_syscall_base:
* does not list any ABI differences regarding stack alignment.)
*/
push %rbp
+ .cfi_adjust_cfa_offset 8
+ .cfi_rel_offset rbp, 0
/* The syscall calling convention isn't the same as the
* C one:
@@ -70,12 +73,19 @@ safe_syscall_start:
safe_syscall_end:
/* code path for having successfully executed the syscall */
pop %rbp
+ .cfi_remember_state
+ .cfi_def_cfa_offset 8
+ .cfi_restore rbp
ret
return_ERESTARTSYS:
/* code path when we didn't execute the syscall */
+ .cfi_restore_state
mov $-TARGET_ERESTARTSYS, %rax
pop %rbp
+ .cfi_def_cfa_offset 8
+ .cfi_restore rbp
ret
+ .cfi_endproc
.size safe_syscall_base, .-safe_syscall_base
--
2.1.4
- [Qemu-devel] [PULL 10/44] linux-user: Define macro for size of host kernel sigset_t, (continued)
- [Qemu-devel] [PULL 10/44] linux-user: Define macro for size of host kernel sigset_t, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 08/44] linux-user: Fix stray tab-indent, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 09/44] linux-user: Factor out uses of do_sigprocmask() from sigreturn code, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 11/44] linux-user: Use safe_syscall for sigsuspend syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 13/44] linux-user: Remove redundant default action check in queue_signal(), riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 18/44] linux-user: pause() should not pause if signal pending, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 14/44] linux-user: Remove redundant gdb_queuesig(), riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 12/44] linux-user: Fix race between multiple signals, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 16/44] linux-user: Queue synchronous signals separately, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 17/44] linux-user: Block signals during sigaction() handling, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 24/44] linux-user: provide frame information in x86-64 safe_syscall,
riku . voipio <=
- [Qemu-devel] [PULL 15/44] linux-user: Remove real-time signal queuing, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 23/44] linux-user: Avoid possible misalignment in target_to_host_siginfo(), riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 19/44] linux-user: Restart exit() if signal pending, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 20/44] linux-user: Use safe_syscall for kill, tkill and tgkill syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 25/44] linux-user: Fix handling of arm_fadvise64_64 syscall, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 21/44] linux-user: Restart fork() if signals pending, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 28/44] linux-user: Use safe_syscall wrapper for readv and writev syscalls, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 22/44] linux-user: Use both si_code and si_signo when converting siginfo_t, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 26/44] linux-user: Fix NR_fadvise64 and NR_fadvise64_64 for 32-bit guests, riku . voipio, 2016/06/08
- [Qemu-devel] [PULL 33/44] linux-user: Use safe_syscall wrapper for flock, riku . voipio, 2016/06/08