On 06/21/2010 14:14, Reid Kleckner wrote:> Since FreeBSD is an ELF target, this should work fine. I've also > tested that this works in 32-bit by building gdb and llvm in 32-bit > mode and testing this stuff while running on a 64-bit OS. > > I would try setting a breakpoint in gdb on > 'llvm::JITDebugRegisterer::RegisterFunction' to see that it is being > called, and that getELFWriterInfo returns something. If that function > actually installs the code entry, then it's a gdb problem. >I am on FreeBSD and gdb-7.1 seems to be broken. It fails to set breakpoints in shared libs. using symbol-file causes this message: (gdb) symbol-file /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so Load new symbol table from "/usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so"? (y or n) y Reading symbols from /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so...done. Unable to read JIT descriptor from remote memory! Googling this message leads back to your name :-) Do you know why might it fail to load JIT descriptor? I filed gdb PR: http://sourceware.org/bugzilla/show_bug.cgi?id=11737 Yuri
Reid Kleckner
2010-Jun-22 01:01 UTC
[LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
On Mon, Jun 21, 2010 at 5:14 PM, Yuri <yuri at rawbw.com> wrote:> I am on FreeBSD and gdb-7.1 seems to be broken. It fails to set breakpoints > in shared libs. using symbol-file causes this message: > > (gdb) symbol-file /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so > Load new symbol table from > "/usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so"? (y or n) y > Reading symbols from > /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so...done. > Unable to read JIT descriptor from remote memory! > > > Googling this message leads back to your name :-) Do you know why might it > fail to load JIT descriptor? > > I filed gdb PR: http://sourceware.org/bugzilla/show_bug.cgi?id=11737One thing you could do as a temporary work around is to link with LLVM statically. There's already an open bug where if the JIT is in a shared library, then you cannot run the program twice under gdb without restarting gdb, which is really annoying. This affects me, and I do intend to fix it eventually. I'm not sure if it's the same as your problem though. Reid
On 06/21/2010 18:01, Reid Kleckner wrote:> This affects me, and I do intend to fix it eventually. I'm not sure > if it's the same as your problem though. >Looks like this is the same problem. Yuri
On 06/21/2010 18:01, Reid Kleckner wrote:> One thing you could do as a temporary work around is to link with LLVM > statically. There's already an open bug where if the JIT is in a > shared library, then you cannot run the program twice under gdb > without restarting gdb, which is really annoying. > > This affects me, and I do intend to fix it eventually. I'm not sure > if it's the same as your problem though. > > Reid >Did you have a chance to fix this issue with gdb failing to debug libLLVM-2.8svn.so as a shared lib? I keep hitting this issue. Older gdb for some reason doesn't see llvm::* types which makes debugging difficult. And I can't really link with LLVM statically. Yuri
On 06/21/2010 17:14, Yuri wrote:> I am on FreeBSD and gdb-7.1 seems to be broken. It fails to set > breakpoints in shared libs. using symbol-file causes this message: > > (gdb) symbol-file /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so > Load new symbol table from > "/usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so"? (y or n) y > Reading symbols from /usr/local/llvm/svn-r105825.dbg/lib/libLLVM-2.8svn.so...done. > Unable to read JIT descriptor from remote memory! >I don't know what is going on with gdb and llvm, but I tried the upcoming gdb-7.3 and the message "Unable to read JIT descriptor from remote memory!" is back when llvm::JITEmitDebugInfo is set and libLLVM-3.0.so is loaded dynamically. gdb-7.1 was broken, gdb-7.2 works, now gdb-7.3 code is broken again. Yuri
Maybe Matching Threads
- [LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
- [LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
- [LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
- [LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
- [LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?