chieftec$ gcc -g hello2.c -o hello2 -O0 chieftec$ ./hello2 Hello world! a=120 b=10 c=110 chieftec$ lldb ./hello2 (lldb) target create "./hello2" Current executable set to './hello2' (x86_64). (lldb) b main Breakpoint 1: where = hello2`main + 15 at hello2.c:10, address = 0x00000000004008bf (lldb) r Process 19672 launched: './hello2' (x86_64) Process 19672 stopped * thread #1, stop reason = breakpoint 1.1 frame #0: 0x00000000004008bf hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:10 7 long b; 8 long long c; 9 -> 10 printf("Hello world!\n"); 11 12 a = 120; 13 (lldb) p a (int) $0 = 0 (lldb) frame variable (int) argc = 1 (char **) argv = 0x00007f7fff552cb8 (int) a = 0 (long) b = 140187721351136 (long long) c = 140187721351136 (lldb) n Hello world! Process 19672 stopped * thread #1, stop reason = step over frame #0: 0x00000000004008c9 hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:12 9 10 printf("Hello world!\n"); 11 -> 12 a = 120; 13 14 b = 10; 15 c = a - b; (lldb) Process 19672 stopped * thread #1, stop reason = step over frame #0: 0x00000000004008d0 hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:14 11 12 a = 120; 13 -> 14 b = 10; 15 c = a - b; 16 17 printf("a=%d b=%ld c=%lld\n", a, b, c); (lldb) Process 19672 stopped * thread #1, stop reason = step over frame #0: 0x00000000004008d8 hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:15 12 a = 120; 13 14 b = 10; -> 15 c = a - b; 16 17 printf("a=%d b=%ld c=%lld\n", a, b, c); 18 (lldb) Process 19672 stopped * thread #1, stop reason = step over frame #0: 0x00000000004008e5 hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:17 14 b = 10; 15 c = a - b; 16 -> 17 printf("a=%d b=%ld c=%lld\n", a, b, c); 18 19 return 2; 20 } (lldb) frame variable (int) argc = 1 (char **) argv = 0x00007f7fff552cb8 (int) a = 120 (long) b = 10 (long long) c = 110 (lldb) p a (int) $1 = 120 (lldb) n a=120 b=10 c=110 Process 19672 stopped * thread #1, stop reason = step over frame #0: 0x0000000000400901 hello2`main(argc=1, argv=0x00007f7fff552cb8) at hello2.c:19 16 17 printf("a=%d b=%ld c=%lld\n", a, b, c); 18 -> 19 return 2; 20 } (lldb) c Process 19672 resuming Process 19672 exited with status = 2 (0x00000002) (lldb) version lldb version 5.0.0 (http://llvm.org/svn/llvm-project/lldb/trunk revision 296360) (lldb) platform status Platform: host Triple: x86_64-unknown-netbsd7.99 OS Version: 7.99.63 (0799006300) Kernel: NetBSD 7.99.63 (GENERIC) #8: Tue Feb 28 11:56:53 CET 2017 root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC Hostname: 127.0.0.1 WorkingDir: /public/lldb_devel Kernel: NetBSD Release: 7.99.63 Version: NetBSD 7.99.63 (GENERIC) #8: Tue Feb 28 11:56:53 CET 2017 root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC (lldb)