[LLVMdev] Why -jit-emit-debug doesn't work with gdb-7.1 ?

Reid Kleckner reid.kleckner at gmail.com
Mon Jun 21 14:14:29 PDT 2010


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
>
>
>




More information about the llvm-dev mailing list