[Lldb-commits] [PATCH] Fix segfault notification in lldb-mi

Greg Clayton clayborg at gmail.com
Mon Feb 9 11:11:27 PST 2015


Make a test case that access violates and remove code from the MI driver in main.c


================
Comment at: test/tools/lldb-mi/main.c:15-32
@@ -14,14 +14,20 @@
 int doloop;
+int dosegfault;
 int g_MyVar = 3;
 static int s_MyVar = 4;
 int main (int argc, char const *argv[])
 {
     int a, b;
     printf("argc=%d\n", argc);   //BP_printf_call
     //BP_argctest
     a = a_MyFunction();          //BP_a_MyFunction_call
     b = b_MyFunction();          //BP_b_MyFunction_call
     //BP_localstest -- it must be at line #24 (or fix it in main*.micmds)
     if (doloop) // BP_doloop
         infloop();
+    if (dosegfault)
+    {
+        int *p = NULL;
+        *p = 1;
+    }
     if (argc > 1 && *argv[1] == 'l') {
----------------
This should go into a test case binary, probably doesn't belong in the actual MI driver.

http://reviews.llvm.org/D7500

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list