]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/nat/linux-ptrace.c
Fix non executable stack handling when calling functions in the inferior.
[thirdparty/binutils-gdb.git] / gdb / nat / linux-ptrace.c
index 0ce258f3692e657aa95954e43987ba0e355cad1d..1c6781957465369864cd1e40781945790b2085ad 100644 (file)
@@ -621,3 +621,16 @@ linux_is_extended_waitstatus (int wstat)
 {
   return (linux_ptrace_get_extended_event (wstat) != 0);
 }
+
+/* Return true if the event in LP may be caused by breakpoint.  */
+
+int
+linux_wstatus_maybe_breakpoint (int wstat)
+{
+  return (WIFSTOPPED (wstat)
+         && (WSTOPSIG (wstat) == SIGTRAP
+             /* SIGILL and SIGSEGV are also treated as traps in case a
+                breakpoint is inserted at the current PC.  */
+             || WSTOPSIG (wstat) == SIGILL
+             || WSTOPSIG (wstat) == SIGSEGV));
+}