[PATCH 1/2] teach tracehook_report_syscall_exit() to handle stepping

Oleg Nesterov oleg at redhat.com
Sun Nov 8 20:54:39 UTC 2009


Preparation, no changes in compiled code.

Currently tracehook_report_syscall_exit() ignores "int step" argument.
Each architecture has to implement the stepping itself in the low-level
code, and the behaviour is not consistent across different machines.

Change tracehook_report_syscall_exit() to handle "step == T" case but
hide the code under #ifdef, then we can change each arch separately.

---

 include/linux/tracehook.h |    8 ++++++++
 1 file changed, 8 insertions(+)

--- TH/include/linux/tracehook.h~1_SYSCALL_EXIT	2009-10-30 00:44:25.000000000 +0100
+++ TH/include/linux/tracehook.h	2009-11-08 20:05:20.000000000 +0100
@@ -134,6 +134,14 @@ static inline __must_check int tracehook
  */
 static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
 {
+#ifdef arch_has_fill_sigtrap_info
+	if (step) {
+		siginfo_t info;
+		arch_fill_sigtrap_info(current, regs, &info);
+		force_sig_info(SIGTRAP, &info, current);
+		return;
+	}
+#endif
 	ptrace_report_syscall(regs);
 }
 




More information about the utrace-devel mailing list