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

Ilia K ki.stfu at gmail.com
Tue Feb 10 00:28:01 PST 2015

In http://reviews.llvm.org/D7500#120727, @clayborg wrote:

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

This case checks lldb-mi functionality. Why would you want to remove it from here?

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
     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
+    if (dosegfault)
+    {
+        int *p = NULL;
+        *p = 1;
+    }
     if (argc > 1 && *argv[1] == 'l') {
clayborg wrote:
> This should go into a test case binary, probably doesn't belong in the actual MI driver.
Why? In this case I'm checking that lldb-mi prints the *stopped, so this test relates to MI driver.



More information about the lldb-commits mailing list