Module Name:    src
Committed By:   rin
Date:           Mon Dec 14 02:05:08 UTC 2020

Modified Files:
        src/external/gpl3/gdb/dist/gdb: nbsd-nat.c

Log Message:
Add some precautions for platforms without PT_STEP support.

"nat/gdb_ptrace.h" defines PT_STEP as 9, if it is not defined. nat-ptrace.c
depends on this; inf_ptrace_target::resume() uses PT_STEP unconditionally
when its ``step'' argument is non-zero. Therefore,

- Add comment that nbsd-nat.c should include <sys/ptrace.h> directly,
  instead of "nat/gdb_ptrace.h".

- Add gdb_assert(step == 0) in nbsd_nat_target::resume() ifndef PT_STEP,
  before calling inf_ptrace_target::resume().


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/nbsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.21 src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.22
--- src/external/gpl3/gdb/dist/gdb/nbsd-nat.c:1.21	Mon Dec 14 02:01:03 2020
+++ src/external/gpl3/gdb/dist/gdb/nbsd-nat.c	Mon Dec 14 02:05:07 2020
@@ -27,6 +27,9 @@
 #include "gdbarch.h"
 
 #include <sys/types.h>
+/* Use <sys/ptrace.h> directly, instead of "nat/gdb_ptrace.h".  Otherwise,
+   PT_STEP will be defined unintentionally, which breaks platforms without
+   PT_STEP support.  */
 #include <sys/ptrace.h>
 #include <sys/sysctl.h>
 #include <sys/wait.h>
@@ -539,6 +542,7 @@ nbsd_nat_target::resume (ptid_t ptid, in
 	nbsd_resume (this, ptid_t (inf->pid, 0, 0), step, signal);
     }
 #else
+    gdb_assert(step == 0);
     if (ptid.pid () == -1)
       ptid = inferior_ptid;
     inf_ptrace_target::resume (ptid, step, signal); 

Reply via email to