On 06/21/2010 11:14, Reid Kleckner wrote:> Yes, I have some version of 7.1 installed on my workstation and it works for me.I repeted what you did step by step and it still doesn't work for me, see log below. Two differences: I am on FreeBSD and it's 32 bit. It's svn revision 105825. Plus I have few unrelated patched applied to it which shouldn't matter. Yuri $ lli --version Low Level Virtual Machine (http://llvm.org/): llvm version 2.8svn DEBUG build with assertions. Built Jun 21 2010 (09:46:06). Host: i386-unknown-freebsd8.1 Host CPU: corei7 Registered Targets: x86 - 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 $ clang -fexceptions t.c -c -emit-llvm -o t.bc $ gdb --args lli -jit-emit-debug t.bc GNU gdb (GDB) 7.1 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i386-unknown-freebsd8.1". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>... Reading symbols from /usr/local/llvm/svn-r105825.dbg/bin/lli...done. (gdb) run Starting program: /usr/local/llvm/svn-r105825.dbg/bin/lli -jit-emit-debug t.bc Hello, World! Program received signal SIGABRT, Aborted. 0x354fa0f7 in ?? () (gdb) bt #0 0x354fa0f7 in ?? () #1 0x354f8c2a in ?? () #2 0x35531134 in ?? () #3 0x349d9b05 in ?? () #4 0x08052cd9 in main (argc=3, argv=0xbfbfe238, envp=0xbfbfe248) at /tmp/llvm-svn/llvm/tools/lli/lli.cpp:234
Reid Kleckner
2010-Jun-21 21:14 UTC
[LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?
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. Reid On Mon, Jun 21, 2010 at 12:49 PM, Yuri <yuri at rawbw.com> wrote:> On 06/21/2010 11:14, Reid Kleckner wrote: >> >> Yes, I have some version of 7.1 installed on my workstation and it works >> for me. > > > I repeted what you did step by step and it still doesn't work for me, see > log below. > Two differences: I am on FreeBSD and it's 32 bit. It's svn revision 105825. > Plus I have few unrelated patched applied to it which shouldn't matter. > > Yuri > > $ lli --version > Low Level Virtual Machine (http://llvm.org/): > llvm version 2.8svn > DEBUG build with assertions. > Built Jun 21 2010 (09:46:06). > Host: i386-unknown-freebsd8.1 > Host CPU: corei7 > > Registered Targets: > x86 - 32-bit X86: Pentium-Pro and above > x86-64 - 64-bit X86: EM64T and AMD64 > $ clang -fexceptions t.c -c -emit-llvm -o t.bc > $ gdb --args lli -jit-emit-debug t.bc > GNU gdb (GDB) 7.1 > Copyright (C) 2010 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later > <http://gnu.org/licenses/gpl.html> > This is free software: you are free to change and redistribute it. > There is NO WARRANTY, to the extent permitted by law. Type "show copying" > and "show warranty" for details. > This GDB was configured as "i386-unknown-freebsd8.1". > For bug reporting instructions, please see: > <http://www.gnu.org/software/gdb/bugs/>... > Reading symbols from /usr/local/llvm/svn-r105825.dbg/bin/lli...done. > (gdb) run > Starting program: /usr/local/llvm/svn-r105825.dbg/bin/lli -jit-emit-debug > t.bc > Hello, World! > > Program received signal SIGABRT, Aborted. > 0x354fa0f7 in ?? () > (gdb) bt > #0 0x354fa0f7 in ?? () > #1 0x354f8c2a in ?? () > #2 0x35531134 in ?? () > #3 0x349d9b05 in ?? () > #4 0x08052cd9 in main (argc=3, argv=0xbfbfe238, envp=0xbfbfe248) at > /tmp/llvm-svn/llvm/tools/lli/lli.cpp:234 > > >
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
Seemingly Similar 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 ?