فهرست منبع

Allow all processes to trace when built with DEBUG.

This lazily fixes the prctl(2) race with auto gdb.
Bryan Drewery 11 سال پیش
والد
کامیت
d99c7e29fa
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      src/shell.cc

+ 4 - 0
src/shell.cc

@@ -269,6 +269,10 @@ static void got_sigtrap(int z)
 void check_trace(int start)
 {
 #ifdef DEBUG
+#ifdef PR_SET_PTRACER
+  if (start == 1)
+    prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
+#endif
   return;
 #endif