Код: Выделить всё
#include
#include
int addNumbs(int a, int b)
{
return a+b;
}
int main()
{
int a =5;
int b= 24;
int total = addNumbs(a,b);
printf("%d\n", total);
return 0;
}
emem>> strong> debugersample.py:образного/>>>>>>
Код: Выделить всё
import lldb
debugger = lldb.debugger
debugger.HandleCommand("b main")
debugger.HandleCommand("r")
for i in range(0,3): #execute next 3 times
debugger.HandleCommand("n")
debugger.HandleCommand("bt")
< /code>
Запуск lldb: < /p>
clang -g main -o main
lldb ./main
(lldb) command script import debugsample.py
Breakpoint 1: where = main`main + 15 at main.c:11:9, address = 0x0000000100003f0f
Process 5344 launched: '/Users/xxxx/CLionProjects/C_Practice/main' (x86_64)
error: invalid thread
error: invalid thread
error: invalid thread
error: invalid thread
Process 5344 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x0000000100003f0f main`main at main.c:11:9
8
9 int main()
10 {
-> 11 int a =5;
12 int b= 24;
13
14 int* ptr = (int*)malloc(sizeof(int));
Target 0: (main) stopped.
Подробнее здесь: https://stackoverflow.com/questions/794 ... lid-thread