<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">lldb looks like it's adding some offset for the breakpoint command? The disassemble command looks like it works fine, but the breakpoint command is using an address fairly far into
printf in this case. Before I head off to investigate, does anyone have any idea what might be going on here or suggestions on where to start?<br>
<br>
Thanks.<br>
-Mike<br>
<br>
(lldb) disassemble -n printf<br>
libc.so.6`__printf at printf.c:30:<br>
0x7f961e2a2840: subq $216, %rsp<br>
<br>
libc.so.6`__printf + 7 at printf.c:30:<br>
0x7f961e2a2847: testb %al, %al<br>
0x7f961e2a2849: movq %rsi, 40(%rsp)<br>
0x7f961e2a284e: movq %rdx, 48(%rsp)<br>
0x7f961e2a2853: movq %rcx, 56(%rsp)<br>
0x7f961e2a2858: movq %r8, 64(%rsp)<br>
0x7f961e2a285d: movq %r9, 72(%rsp)<br>
0x7f961e2a2862: je 0x7f961e2a289b ; __printf + 91 at printf.c:34<br>
0x7f961e2a2864: movaps %xmm0, 80(%rsp) <=============== breakpoint gets set here<br>
0x7f961e2a2869: movaps %xmm1, 96(%rsp)<br>
0x7f961e2a286e: movaps %xmm2, 112(%rsp)<br>
0x7f961e2a2873: movaps %xmm3, 128(%rsp)<br>
0x7f961e2a287b: movaps %xmm4, 144(%rsp)<br>
0x7f961e2a2883: movaps %xmm5, 160(%rsp)<br>
0x7f961e2a288b: movaps %xmm6, 176(%rsp)<br>
0x7f961e2a2893: movaps %xmm7, 192(%rsp)<br>
0x7f961e2a289b: leaq 224(%rsp), %rax<br>
0x7f961e2a28a3: movq %rdi, %rsi<br>
0x7f961e2a28a6: leaq 8(%rsp), %rdx<br>
0x7f961e2a28ab: movl $8, 8(%rsp)<br>
0x7f961e2a28b3: movl $48, 12(%rsp)<br>
0x7f961e2a28bb: movq %rax, 16(%rsp)<br>
0x7f961e2a28c0: leaq 32(%rsp), %rax<br>
0x7f961e2a28c5: movq %rax, 24(%rsp)<br>
0x7f961e2a28ca: movq 3556935(%rip), %rax<br>
0x7f961e2a28d1: movq (%rax), %rdi<br>
0x7f961e2a28d4: callq 0x7f961e2979c0 ; _IO_vfprintf_internal at vfprintf.c:211<br>
0x7f961e2a28d9: addq $216, %rsp<br>
0x7f961e2a28e0: ret <br>
<br>
(lldb) b printf<br>
Breakpoint 2: where = libc.so.6`__printf + 36 at printf.c:30, address = 0x00007f961e2a2864<br>
(lldb) breakpoint set -n printf<br>
Breakpoint 3: where = libc.so.6`__printf + 36 at printf.c:30, address = 0x00007f961e2a2864<br>
<br>
(lldb) target modules lookup -s printf -v<br>
1 symbols match 'printf' in /home/mikesart/data/src/blah2/build/blah:<br>
Address: 0x0000000000000000 (0x0000000000000000)<br>
Summary: 0x0000000000000000<br>
0x0000000000000000<br>
2 symbols match 'printf' in /lib/x86_64-linux-gnu/libc.so.6:<br>
Address: libc.so.6[0x0000000000053840] (libc.so.6..text + 215200)<br>
Summary: libc.so.6`__printf at printf.c:30<br>
Module: file = "/lib/x86_64-linux-gnu/libc.so.6", arch = "x86_64"<br>
CompileUnit: id = {0x0009273a}, file = "/build/buildd/eglibc-2.15/stdio-common/printf.c", language = "ISO C:1989"<br>
Function: id = {0x0009367e}, name = "__printf", range = [0x00007f961e2a2840-0x00007f961e2a28e1)<br>
FuncType: id = {0x0009367e}, decl = printf.c:29, clang_type = "int (const char *)"<br>
Blocks: id = {0x0009367e}, range = [0x7f961e2a2840-0x7f961e2a28e1)<br>
LineEntry: [0x00007f961e2a2840-0x00007f961e2a2864): /build/buildd/eglibc-2.15/stdio-common/printf.c:30<br>
Variable: id = {0x000936a3}, name = "format", type= "const char *", location = rdi, decl = printf.c:29<br>
Variable: id = {0x000936b3}, name = "arg", type= "va_list", location = DW_OP_fbreg(-216), decl = printf.c:31<br>
Variable: id = {0x000936c2}, name = "done", type= "int", location = rax, decl = printf.c:32<br>
Address: libc.so.6[0x0000000000053840] (libc-2.15.so..text + 215200)<br>
Summary: libc.so.6`__printf at printf.c:30<br>
Module: file = "/lib/x86_64-linux-gnu/libc.so.6", arch = "x86_64"<br>
CompileUnit: id = {0x0009273a}, file = "/build/buildd/eglibc-2.15/stdio-common/printf.c", language = "ISO C:1989"<br>
Function: id = {0x0009367e}, name = "__printf", range = [0x00007f961e2a2840-0x00007f961e2a28e1)<br>
FuncType: id = {0x0009367e}, decl = printf.c:29, clang_type = "int (const char *)"<br>
Blocks: id = {0x0009367e}, range = [0x7f961e2a2840-0x7f961e2a28e1)<br>
LineEntry: [0x00007f961e2a2840-0x00007f961e2a2864): /build/buildd/eglibc-2.15/stdio-common/printf.c:30<br>
Symbol: id = {0x00001ebc}, range = [0x0000000000053840-0x00000000000538e1), name="_IO_printf"<br>
Variable: id = {0x000936a3}, name = "format", type= "const char *", location = rdi, decl = printf.c:29<br>
Variable: id = {0x000936b3}, name = "arg", type= "va_list", location = DW_OP_fbreg(-216), decl = printf.c:31<br>
Variable: id = {0x000936c2}, name = "done", type= "int", location = rax, decl = printf.c:32<br>
<br>
gdb works as expected:<br>
<br>
(gdb) disassemble printf<br>
Dump of assembler code for function __printf:<br>
0x00007ffff7054840 <+0>: sub rsp,0xd8<br>
0x00007ffff7054847: test al,al<br>
0x00007ffff7054849: mov QWORD PTR [rsp+0x28],rsi<br>
0x00007ffff705484e: mov QWORD PTR [rsp+0x30],rdx<br>
0x00007ffff7054853: mov QWORD PTR [rsp+0x38],rcx<br>
0x00007ffff7054858: mov QWORD PTR [rsp+0x40],r8<br>
0x00007ffff705485d: mov QWORD PTR [rsp+0x48],r9<br>
0x00007ffff7054862: je 0x7ffff705489b<br>
0x00007ffff7054864: movaps XMMWORD PTR [rsp+0x50],xmm0<br>
0x00007ffff7054869: movaps XMMWORD PTR [rsp+0x60],xmm1<br>
0x00007ffff705486e: movaps XMMWORD PTR [rsp+0x70],xmm2<br>
0x00007ffff7054873: movaps XMMWORD PTR [rsp+0x80],xmm3<br>
0x00007ffff705487b: movaps XMMWORD PTR [rsp+0x90],xmm4<br>
0x00007ffff7054883: movaps XMMWORD PTR [rsp+0xa0],xmm5<br>
0x00007ffff705488b: movaps XMMWORD PTR [rsp+0xb0],xmm6<br>
0x00007ffff7054893: movaps XMMWORD PTR [rsp+0xc0],xmm7<br>
0x00007ffff705489b: lea rax,[rsp+0xe0]<br>
0x00007ffff70548a3: mov rsi,rdi<br>
0x00007ffff70548a6: lea rdx,[rsp+0x8]<br>
0x00007ffff70548ab: mov DWORD PTR [rsp+0x8],0x8<br>
0x00007ffff70548b3: mov DWORD PTR [rsp+0xc],0x30<br>
0x00007ffff70548bb: mov QWORD PTR [rsp+0x10],rax<br>
0x00007ffff70548c0: lea rax,[rsp+0x20]<br>
0x00007ffff70548c5: mov QWORD PTR [rsp+0x18],rax<br>
0x00007ffff70548ca: mov rax,QWORD PTR [rip+0x364647] # 0x7ffff73b8f18<br>
0x00007ffff70548d1: mov rdi,QWORD PTR [rax]<br>
0x00007ffff70548d4: call 0x7ffff70499c0 <_IO_vfprintf_internal at vfprintf.c:211><br>
0x00007ffff70548d9: add rsp,0xd8<br>
0x00007ffff70548e0: ret<br>
End of assembler dump.<br>
(gdb) b printf<br>
Breakpoint 2 at 0x7ffff7054840: file printf.c, line 30.<br>
<br>
</div>
</body>
</html>