<div dir="ltr">That bug was fixed this January in <span style="font-family:arial,sans-serif;font-size:13px">r199350, so you may need to update LLVM.</span></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Mar 25, 2014 at 9:44 PM, Zach Devito <span dir="ltr"><<a href="mailto:zdevito@stanford.edu" target="_blank">zdevito@stanford.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I tested it with the symbols enabled for lli and it still doesn't work. Below is the assembly for GDBJITRegistrar::registerObject containing the inlined body of NotifyDebugger. It looks like the call to __jit_debug_register_code was inlined away despite being marked with LLVM_ATTRIBUTE_NOINLINE. LLVM was compiled with the following GCC:<div>
<br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">zdevito@derp:~/terra/tests$ gcc --version<br>
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3<br>Copyright (C) 2011 Free Software Foundation, Inc.<br>This is free software; see the source for copying conditions. There is NO<br>warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</blockquote>
<div><br></div><div>Maybe the LLVM_ATTRIBUTE_NOINLINE macro is defined wrong, or the compiler is ignoring it?</div><div><br></div><div>Zach</div><div><br></div><div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Dump of assembler code for function (anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&):<br> 0x0000000000b1eba0 <+0>:<span style="white-space:pre-wrap"> </span>push rbp<br> 0x0000000000b1eba1 <+1>:<span style="white-space:pre-wrap"> </span>push r15<br>
0x0000000000b1eba3 <+3>:<span style="white-space:pre-wrap"> </span>push r14<br> 0x0000000000b1eba5 <+5>:<span style="white-space:pre-wrap"> </span>push r13<br> 0x0000000000b1eba7 <+7>:<span style="white-space:pre-wrap"> </span>push r12<br>
0x0000000000b1eba9 <+9>:<span style="white-space:pre-wrap"> </span>push rbx<br> 0x0000000000b1ebaa <+10>:<span style="white-space:pre-wrap"> </span>sub rsp,0x28<br> 0x0000000000b1ebae <+14>:<span style="white-space:pre-wrap"> </span>mov r14,rdi<br>
0x0000000000b1ebb1 <+17>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rsi+0x8]<br> 0x0000000000b1ebb5 <+21>:<span style="white-space:pre-wrap"> </span>mov r13,QWORD PTR [rax+0x8]<br>
0x0000000000b1ebb9 <+25>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rsp+0x8],r13<br> 0x0000000000b1ebbe <+30>:<span style="white-space:pre-wrap"> </span>test r13,r13<br> 0x0000000000b1ebc1 <+33>:<span style="white-space:pre-wrap"> </span>je 0xb1edcf <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+559><br>
0x0000000000b1ebc7 <+39>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rax+0x10]<br> 0x0000000000b1ebcb <+43>:<span style="white-space:pre-wrap"> </span>sub rax,r13<br> 0x0000000000b1ebce <+46>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rsp],rax<br>
0x0000000000b1ebd2 <+50>:<span style="white-space:pre-wrap"> </span>mov r15,QWORD PTR [r14+0x8]<br> 0x0000000000b1ebd6 <+54>:<span style="white-space:pre-wrap"> </span>mov ebp,DWORD PTR [r14+0x18]<br>
0x0000000000b1ebda <+58>:<span style="white-space:pre-wrap"> </span>add r14,0x8<br> 0x0000000000b1ebde <+62>:<span style="white-space:pre-wrap"> </span>test rbp,rbp<br> 0x0000000000b1ebe1 <+65>:<span style="white-space:pre-wrap"> </span>je 0xb1ec3f <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+159><br>
0x0000000000b1ebe3 <+67>:<span style="white-space:pre-wrap"> </span>mov rax,r13<br> 0x0000000000b1ebe6 <+70>:<span style="white-space:pre-wrap"> </span>or rax,0x4<br> 0x0000000000b1ebea <+74>:<span style="white-space:pre-wrap"> </span>cmp rax,0xfffffffffffffffc<br>
0x0000000000b1ebee <+78>:<span style="white-space:pre-wrap"> </span>je 0xb1ee1e <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+638><br> 0x0000000000b1ebf4 <+84>:<span style="white-space:pre-wrap"> </span>mov ecx,r13d<br>
0x0000000000b1ebf7 <+87>:<span style="white-space:pre-wrap"> </span>shr ecx,0x9<br> 0x0000000000b1ebfa <+90>:<span style="white-space:pre-wrap"> </span>mov eax,r13d<br> 0x0000000000b1ebfd <+93>:<span style="white-space:pre-wrap"> </span>shr eax,0x4<br>
0x0000000000b1ec00 <+96>:<span style="white-space:pre-wrap"> </span>xor eax,ecx<br> 0x0000000000b1ec02 <+98>:<span style="white-space:pre-wrap"> </span>lea ecx,[rbp-0x1]<br> 0x0000000000b1ec05 <+101>:<span style="white-space:pre-wrap"> </span>and eax,ecx<br>
0x0000000000b1ec07 <+103>:<span style="white-space:pre-wrap"> </span>lea rdx,[rax+rax*2]<br> 0x0000000000b1ec0b <+107>:<span style="white-space:pre-wrap"> </span>mov rsi,QWORD PTR [r15+rdx*8]<br>
0x0000000000b1ec0f <+111>:<span style="white-space:pre-wrap"> </span>cmp r13,rsi<br> 0x0000000000b1ec12 <+114>:<span style="white-space:pre-wrap"> </span>je 0xb1ec4a <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+170><br>
0x0000000000b1ec14 <+116>:<span style="white-space:pre-wrap"> </span>mov edx,0x1<br> 0x0000000000b1ec19 <+121>:<span style="white-space:pre-wrap"> </span>nop DWORD PTR [rax+0x0]<br> 0x0000000000b1ec20 <+128>:<span style="white-space:pre-wrap"> </span>cmp rsi,0xfffffffffffffffc<br>
0x0000000000b1ec24 <+132>:<span style="white-space:pre-wrap"> </span>je 0xb1ec3f <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+159><br> 0x0000000000b1ec26 <+134>:<span style="white-space:pre-wrap"> </span>add eax,edx<br>
0x0000000000b1ec28 <+136>:<span style="white-space:pre-wrap"> </span>and eax,ecx<br> 0x0000000000b1ec2a <+138>:<span style="white-space:pre-wrap"> </span>lea rdi,[rax+rax*2]<br> 0x0000000000b1ec2e <+142>:<span style="white-space:pre-wrap"> </span>mov rsi,QWORD PTR [r15+rdi*8]<br>
0x0000000000b1ec32 <+146>:<span style="white-space:pre-wrap"> </span>inc edx<br> 0x0000000000b1ec34 <+148>:<span style="white-space:pre-wrap"> </span>cmp r13,rsi<br> 0x0000000000b1ec37 <+151>:<span style="white-space:pre-wrap"> </span>jne 0xb1ec20 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+128><br>
0x0000000000b1ec39 <+153>:<span style="white-space:pre-wrap"> </span>lea rax,[r15+rdi*8]<br> 0x0000000000b1ec3d <+157>:<span style="white-space:pre-wrap"> </span>jmp 0xb1ec4e <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+174><br>
0x0000000000b1ec3f <+159>:<span style="white-space:pre-wrap"> </span>lea rax,[rbp+rbp*2+0x0]<br> 0x0000000000b1ec44 <+164>:<span style="white-space:pre-wrap"> </span>lea rax,[r15+rax*8]<br> 0x0000000000b1ec48 <+168>:<span style="white-space:pre-wrap"> </span>jmp 0xb1ec4e <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+174><br>
0x0000000000b1ec4a <+170>:<span style="white-space:pre-wrap"> </span>lea rax,[r15+rdx*8]<br> 0x0000000000b1ec4e <+174>:<span style="white-space:pre-wrap"> </span>lea rcx,[rbp+rbp*2+0x0]<br> 0x0000000000b1ec53 <+179>:<span style="white-space:pre-wrap"> </span>lea rcx,[r15+rcx*8]<br>
0x0000000000b1ec57 <+183>:<span style="white-space:pre-wrap"> </span>cmp rax,rcx<br> 0x0000000000b1ec5a <+186>:<span style="white-space:pre-wrap"> </span>jne 0xb1edee <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+590><br>
0x0000000000b1ec60 <+192>:<span style="white-space:pre-wrap"> </span>mov edi,0x20<br> 0x0000000000b1ec65 <+197>:<span style="white-space:pre-wrap"> </span>call 0x4e8120 <_Znwm@plt><br> 0x0000000000b1ec6a <+202>:<span style="white-space:pre-wrap"> </span>mov r12,rax<br>
0x0000000000b1ec6d <+205>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x18],0x0<br> 0x0000000000b1ec76 <+214>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x10],0x0<br>
0x0000000000b1ec7f <+223>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x8],0x0<br> 0x0000000000b1ec88 <+232>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12],0x0<br>
0x0000000000b1ec90 <+240>:<span style="white-space:pre-wrap"> </span>test r12,r12<br> 0x0000000000b1ec93 <+243>:<span style="white-space:pre-wrap"> </span>je 0xb1ee0d <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+621><br>
0x0000000000b1ec99 <+249>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x10],r13<br> 0x0000000000b1ec9e <+254>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rsp]<br>
0x0000000000b1eca2 <+258>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x18],rax<br> 0x0000000000b1eca7 <+263>:<span style="white-space:pre-wrap"> </span>xor eax,eax<br> 0x0000000000b1eca9 <+265>:<span style="white-space:pre-wrap"> </span>test ebp,ebp<br>
0x0000000000b1ecab <+267>:<span style="white-space:pre-wrap"> </span>je 0xb1ed2b <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+395><br> 0x0000000000b1ecad <+269>:<span style="white-space:pre-wrap"> </span>mov rax,r13<br>
0x0000000000b1ecb0 <+272>:<span style="white-space:pre-wrap"> </span>or rax,0x4<br> 0x0000000000b1ecb4 <+276>:<span style="white-space:pre-wrap"> </span>cmp rax,0xfffffffffffffffc<br> 0x0000000000b1ecb8 <+280>:<span style="white-space:pre-wrap"> </span>je 0xb1ee1e <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+638><br>
0x0000000000b1ecbe <+286>:<span style="white-space:pre-wrap"> </span>mov eax,r13d<br> 0x0000000000b1ecc1 <+289>:<span style="white-space:pre-wrap"> </span>shr eax,0x9<br> 0x0000000000b1ecc4 <+292>:<span style="white-space:pre-wrap"> </span>mov ecx,r13d<br>
0x0000000000b1ecc7 <+295>:<span style="white-space:pre-wrap"> </span>shr ecx,0x4<br> 0x0000000000b1ecca <+298>:<span style="white-space:pre-wrap"> </span>xor ecx,eax<br> 0x0000000000b1eccc <+300>:<span style="white-space:pre-wrap"> </span>dec ebp<br>
0x0000000000b1ecce <+302>:<span style="white-space:pre-wrap"> </span>and ecx,ebp<br> 0x0000000000b1ecd0 <+304>:<span style="white-space:pre-wrap"> </span>lea rdx,[rcx+rcx*2]<br> 0x0000000000b1ecd4 <+308>:<span style="white-space:pre-wrap"> </span>lea rax,[r15+rdx*8]<br>
0x0000000000b1ecd8 <+312>:<span style="white-space:pre-wrap"> </span>mov rdi,QWORD PTR [r15+rdx*8]<br> 0x0000000000b1ecdc <+316>:<span style="white-space:pre-wrap"> </span>cmp r13,rdi<br> 0x0000000000b1ecdf <+319>:<span style="white-space:pre-wrap"> </span>je 0xb1ed65 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+453><br>
0x0000000000b1ece5 <+325>:<span style="white-space:pre-wrap"> </span>xor edx,edx<br> 0x0000000000b1ece7 <+327>:<span style="white-space:pre-wrap"> </span>mov esi,0x1<br> 0x0000000000b1ecec <+332>:<span style="white-space:pre-wrap"> </span>nop DWORD PTR [rax+0x0]<br>
0x0000000000b1ecf0 <+336>:<span style="white-space:pre-wrap"> </span>cmp rdi,0xfffffffffffffffc<br> 0x0000000000b1ecf4 <+340>:<span style="white-space:pre-wrap"> </span>je 0xb1ed24 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+388><br>
0x0000000000b1ecf6 <+342>:<span style="white-space:pre-wrap"> </span>add ecx,esi<br> 0x0000000000b1ecf8 <+344>:<span style="white-space:pre-wrap"> </span>and ecx,ebp<br> 0x0000000000b1ecfa <+346>:<span style="white-space:pre-wrap"> </span>test rdx,rdx<br>
0x0000000000b1ecfd <+349>:<span style="white-space:pre-wrap"> </span>sete r8b<br> 0x0000000000b1ed01 <+353>:<span style="white-space:pre-wrap"> </span>cmp rdi,0xfffffffffffffff8<br> 0x0000000000b1ed05 <+357>:<span style="white-space:pre-wrap"> </span>sete bl<br>
0x0000000000b1ed08 <+360>:<span style="white-space:pre-wrap"> </span>test r8b,bl<br> 0x0000000000b1ed0b <+363>:<span style="white-space:pre-wrap"> </span>cmovne rdx,rax<br> 0x0000000000b1ed0f <+367>:<span style="white-space:pre-wrap"> </span>lea rdi,[rcx+rcx*2]<br>
0x0000000000b1ed13 <+371>:<span style="white-space:pre-wrap"> </span>lea rax,[r15+rdi*8]<br> 0x0000000000b1ed17 <+375>:<span style="white-space:pre-wrap"> </span>mov rdi,QWORD PTR [r15+rdi*8]<br>
0x0000000000b1ed1b <+379>:<span style="white-space:pre-wrap"> </span>inc esi<br> 0x0000000000b1ed1d <+381>:<span style="white-space:pre-wrap"> </span>cmp r13,rdi<br> 0x0000000000b1ed20 <+384>:<span style="white-space:pre-wrap"> </span>jne 0xb1ecf0 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+336><br>
0x0000000000b1ed22 <+386>:<span style="white-space:pre-wrap"> </span>jmp 0xb1ed65 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+453><br> 0x0000000000b1ed24 <+388>:<span style="white-space:pre-wrap"> </span>test rdx,rdx<br>
0x0000000000b1ed27 <+391>:<span style="white-space:pre-wrap"> </span>cmovne rax,rdx<br> 0x0000000000b1ed2b <+395>:<span style="white-space:pre-wrap"> </span>xorps xmm0,xmm0<br> 0x0000000000b1ed2e <+398>:<span style="white-space:pre-wrap"> </span>movaps XMMWORD PTR [rsp+0x10],xmm0<br>
0x0000000000b1ed33 <+403>:<span style="white-space:pre-wrap"> </span>lea rsi,[rsp+0x8]<br> 0x0000000000b1ed38 <+408>:<span style="white-space:pre-wrap"> </span>mov rdi,r14<br> 0x0000000000b1ed3b <+411>:<span style="white-space:pre-wrap"> </span>mov rdx,rax<br>
0x0000000000b1ed3e <+414>:<span style="white-space:pre-wrap"> </span>call 0xb1f150 <llvm::DenseMapBase<llvm::DenseMap<char const*, std::pair<unsigned long, jit_code_entry*>, llvm::DenseMapInfo<char const*> >, char const*, std::pair<unsigned long, jit_code_entry*>, llvm::DenseMapInfo<char const*> >::InsertIntoBucketImpl(char const* const&, std::pair<char const*, std::pair<unsigned long, jit_code_entry*> >*)><br>
0x0000000000b1ed43 <+419>:<span style="white-space:pre-wrap"> </span>mov rcx,QWORD PTR [rsp+0x8]<br> 0x0000000000b1ed48 <+424>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax],rcx<br>
0x0000000000b1ed4b <+427>:<span style="white-space:pre-wrap"> </span>mov rcx,rax<br> 0x0000000000b1ed4e <+430>:<span style="white-space:pre-wrap"> </span>add rcx,0x8<br> 0x0000000000b1ed52 <+434>:<span style="white-space:pre-wrap"> </span>je 0xb1ed65 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+453><br>
0x0000000000b1ed54 <+436>:<span style="white-space:pre-wrap"> </span>mov rdx,QWORD PTR [rsp+0x10]<br> 0x0000000000b1ed59 <+441>:<span style="white-space:pre-wrap"> </span>mov rsi,QWORD PTR [rsp+0x18]<br>
0x0000000000b1ed5e <+446>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rcx+0x8],rsi<br> 0x0000000000b1ed62 <+450>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rcx],rdx<br>
0x0000000000b1ed65 <+453>:<span style="white-space:pre-wrap"> </span>mov rcx,QWORD PTR [rsp]<br> 0x0000000000b1ed69 <+457>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax+0x8],rcx<br>
0x0000000000b1ed6d <+461>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax+0x10],r12<br>=> 0x0000000000b1ed71 <+465>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x707310] # 0x1226088 <_ZN12_GLOBAL__N_112JITDebugLockE><br>
0x0000000000b1ed78 <+472>:<span style="white-space:pre-wrap"> </span>call 0xca3810 <llvm::sys::MutexImpl::acquire()><br> 0x0000000000b1ed7d <+477>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rip+0x6fdeb4] # 0x121cc38<br>
0x0000000000b1ed84 <+484>:<span style="white-space:pre-wrap"> </span>mov DWORD PTR [rax+0x4],0x1<br> 0x0000000000b1ed8b <+491>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12+0x8],0x0<br>
0x0000000000b1ed94 <+500>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rax+0x10]<br> 0x0000000000b1ed98 <+504>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [r12],rax<br>
0x0000000000b1ed9c <+508>:<span style="white-space:pre-wrap"> </span>test rax,rax<br> 0x0000000000b1ed9f <+511>:<span style="white-space:pre-wrap"> </span>je 0xb1eda5 <(anonymous namespace)::GDBJITRegistrar::registerObject(llvm::ObjectBuffer const&)+517><br>
0x0000000000b1eda1 <+513>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax+0x8],r12<br> 0x0000000000b1eda5 <+517>:<span style="white-space:pre-wrap"> </span>mov rax,QWORD PTR [rip+0x6fde8c] # 0x121cc38<br>
0x0000000000b1edac <+524>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax+0x10],r12<br> 0x0000000000b1edb0 <+528>:<span style="white-space:pre-wrap"> </span>mov QWORD PTR [rax+0x8],r12<br>
0x0000000000b1edb4 <+532>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x7072cd] # 0x1226088 <_ZN12_GLOBAL__N_112JITDebugLockE><br> 0x0000000000b1edbb <+539>:<span style="white-space:pre-wrap"> </span>call 0xca3850 <llvm::sys::MutexImpl::release()><br>
0x0000000000b1edc0 <+544>:<span style="white-space:pre-wrap"> </span>add rsp,0x28<br> 0x0000000000b1edc4 <+548>:<span style="white-space:pre-wrap"> </span>pop rbx<br> 0x0000000000b1edc5 <+549>:<span style="white-space:pre-wrap"> </span>pop r12<br>
0x0000000000b1edc7 <+551>:<span style="white-space:pre-wrap"> </span>pop r13<br> 0x0000000000b1edc9 <+553>:<span style="white-space:pre-wrap"> </span>pop r14<br> 0x0000000000b1edcb <+555>:<span style="white-space:pre-wrap"> </span>pop r15<br>
0x0000000000b1edcd <+557>:<span style="white-space:pre-wrap"> </span>pop rbp<br> 0x0000000000b1edce <+558>:<span style="white-space:pre-wrap"> </span>ret <br> 0x0000000000b1edcf <+559>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x35f9a9] # 0xe7e77f<br>
0x0000000000b1edd6 <+566>:<span style="white-space:pre-wrap"> </span>lea rsi,[rip+0x35f6fc] # 0xe7e4d9<br> 0x0000000000b1eddd <+573>:<span style="white-space:pre-wrap"> </span>lea rcx,[rip+0x35f9da] # 0xe7e7be<br>
0x0000000000b1ede4 <+580>:<span style="white-space:pre-wrap"> </span>mov edx,0x84<br> 0x0000000000b1ede9 <+585>:<span style="white-space:pre-wrap"> </span>call 0x4e7ef0 <__assert_fail@plt><br>
0x0000000000b1edee <+590>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x35fa29] # 0xe7e81e<br> 0x0000000000b1edf5 <+597>:<span style="white-space:pre-wrap"> </span>lea rsi,[rip+0x35f6dd] # 0xe7e4d9<br>
0x0000000000b1edfc <+604>:<span style="white-space:pre-wrap"> </span>lea rcx,[rip+0x35f9bb] # 0xe7e7be<br> 0x0000000000b1ee03 <+611>:<span style="white-space:pre-wrap"> </span>mov edx,0x86<br>
0x0000000000b1ee08 <+616>:<span style="white-space:pre-wrap"> </span>call 0x4e7ef0 <__assert_fail@plt><br> 0x0000000000b1ee0d <+621>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x35fa73] # 0xe7e887<br>
0x0000000000b1ee14 <+628>:<span style="white-space:pre-wrap"> </span>mov esi,0x1<br> 0x0000000000b1ee19 <+633>:<span style="white-space:pre-wrap"> </span>call 0xc9dbe0 <llvm::report_fatal_error(char const*, bool)><br>
0x0000000000b1ee1e <+638>:<span style="white-space:pre-wrap"> </span>lea rdi,[rip+0x1a8998] # 0xcc77bd<br> 0x0000000000b1ee25 <+645>:<span style="white-space:pre-wrap"> </span>lea rsi,[rip+0x1a8045] # 0xcc6e71<br>
0x0000000000b1ee2c <+652>:<span style="white-space:pre-wrap"> </span>lea rcx,[rip+0x35f722] # 0xe7e555<br> 0x0000000000b1ee33 <+659>:<span style="white-space:pre-wrap"> </span>mov edx,0x1e0<br>
0x0000000000b1ee38 <+664>:<span style="white-space:pre-wrap"> </span>call 0x4e7ef0 <__assert_fail@plt></blockquote></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Tue, Mar 25, 2014 at 4:19 PM, Kaylor, Andrew <span dir="ltr"><<a href="mailto:andrew.kaylor@intel.com" target="_blank">andrew.kaylor@intel.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Actually, put aside what I said in my previous reply for a second.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I just noticed in your output below that GDB didn’t have symbols for lli. That’s probably the heart of your problem. GDB relies on hooking a known function
to get the JITed code registration to work. Since it didn’t find symbols for lli, it won’t find the hook function.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">You’ll need to use a build of lli with symbols to make this work.<u></u><u></u></span></p><div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">-Andy<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>]
<b>On Behalf Of </b>Zach Devito<br>
<b>Sent:</b> Tuesday, March 25, 2014 1:35 PM<br>
<b>To:</b> LLVM Developers Mailing List<br>
<b>Subject:</b> [LLVMdev] Getting the Debugging JIT-ed Code with GDB example to work<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div><div>
<p class="MsoNormal">I'm trying to run the example described at:<u></u><u></u></p><div><div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://llvm.org/docs/DebuggingJITedCode.html" target="_blank">http://llvm.org/docs/DebuggingJITedCode.html</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I followed the sample command line session (below, with versions numbers for everything), but gdb doesn't stop at the breakpoints as described. Any idea what is wrong?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Zach<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">zdevito@derp:~/terra/tests$ ~/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/clang -cc1 -O0 -g -emit-llvm showdebug.c <br>
zdevito@derp:~/terra/tests$ gdb --args ~/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli -use-mcjit showdebug.ll 5<br>
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04<br>
Copyright (C) 2012 Free Software Foundation, Inc.<br>
License GPLv3+: GNU GPL version 3 or later <<a href="http://gnu.org/licenses/gpl.html" target="_blank">http://gnu.org/licenses/gpl.html</a>><br>
This is free software: you are free to change and redistribute it.<br>
There is NO WARRANTY, to the extent permitted by law. Type "show copying"<br>
and "show warranty" for details.<br>
This GDB was configured as "x86_64-linux-gnu".<br>
For bug reporting instructions, please see:<br>
<<a href="http://bugs.launchpad.net/gdb-linaro/" target="_blank">http://bugs.launchpad.net/gdb-linaro/</a>>...<br>
Reading symbols from /home/zdevito/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli...(no debugging symbols found)...done.<br>
(gdb) b showdebug.c:6<br>
No symbol table is loaded. Use the "file" command.<br>
Make breakpoint pending on future shared library load? (y or [n]) y<br>
Breakpoint 1 (showdebug.c:6) pending.<br>
(gdb) r<br>
Starting program: /home/zdevito/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli -use-mcjit showdebug.ll 5<br>
[Thread debugging using libthread_db enabled]<br>
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".<br>
[Inferior 1 (process 8538) exited with code 0170]<br>
(gdb) <u></u><u></u></p>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</div>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>