<prompt>%
</prompt> <userinput>lldb -- temp
</userinput>(lldb) target create "temp"
Current executable set to 'temp' (x86_64).
(lldb)
<userinput>breakpoint set -n main
</userinput> <lineannotation>Skip the set-up code
</lineannotation>Breakpoint 1: where = temp`main + 15 at temp.c:8:2, address = 0x00000000002012ef
<lineannotation>lldb puts breakpoint at main()
</lineannotation>(lldb)
<userinput>process launch
</userinput> <lineannotation>Run as far as main()
</lineannotation>Process 9992 launching
Process 9992 launched: '/home/pauamma/tmp/temp' (x86_64)
<lineannotation>Program starts running
</lineannotation>Process 9992 stopped
* thread #1, name = 'temp', stop reason = breakpoint 1.1
<lineannotation>lldb stops at main()
</lineannotation> frame #0: 0x00000000002012ef temp`main at temp.c:8:2
5
main() {
6
int i;
7
-
> 8
printf("This is my program\n");
<lineannotation>Indicates the line where it stopped
</lineannotation> 9
bazz(i);
10
return 0;
11
}
(lldb)
<userinput>thread step-over
</userinput> <lineannotation>Go to next line
</lineannotation>This is my program
<lineannotation>Program prints out
</lineannotation>Process 9992 stopped
* thread #1, name = 'temp', stop reason = step over
frame #0: 0x0000000000201300 temp`main at temp.c:9:7
6
int i;
7
8
printf("This is my program\n");
-
> 9
bazz(i);
10
return 0;
11
}
12
(lldb)
<userinput>thread step-in
</userinput> <lineannotation>step into bazz()
</lineannotation>Process 9992 stopped
* thread #1, name = 'temp', stop reason = step in
frame #0: 0x000000000020132b temp`bazz(anint=-5360) at temp.c:14:29
<lineannotation>lldb displays stack frame
</lineannotation> 11
}
12
13
int bazz(int anint) {
-
> 14
printf("You gave me %d\n", anint);
15
return anint;
16
}
(lldb)