I have a global function in the long run:
int test()
{
int a = 12;
int c = 10;
printf("a=%d",a);
a += c ;
printf("a=%d", a);
return a;
}
I debug the program and interrupt it, then issue the following command:
(lldb) call test()
a=12a=22(int) $0 = 22
(lldb)
I want it to break the method test()into each line after I clicked call test(), and not immediately return the result. Does anyone know how to do this?
------------------------------------ Answer Below --------- --- ------------------------
@ Jason Molenda's answer is the correct answer, use expr -i0 -- test()instead call test():
(lldb) b test
Breakpoint 1: 4 locations.
(lldb) expr -i0
error: Execution was interrupted, reason: breakpoint 1.1.
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
(lldb)
Now it breaks into test(), but causes an error !!! How to avoid a mistake?
source
share