[LLVMdev] Getting the Debugging JIT-ed Code with GDB example to work

Kaylor, Andrew andrew.kaylor at intel.com
Tue Mar 25 16:19:24 PDT 2014


Actually, put aside what I said in my previous reply for a second.

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.

You'll need to use a build of lli with symbols to make this work.

-Andy

From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Zach Devito
Sent: Tuesday, March 25, 2014 1:35 PM
To: LLVM Developers Mailing List
Subject: [LLVMdev] Getting the Debugging JIT-ed Code with GDB example to work

I'm trying to run the example described at:

http://llvm.org/docs/DebuggingJITedCode.html

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?

Thanks,

Zach


zdevito at derp:~/terra/tests$ ~/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/clang -cc1 -O0 -g -emit-llvm showdebug.c
zdevito at derp:~/terra/tests$ gdb --args ~/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli -use-mcjit showdebug.ll 5
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
Copyright (C) 2012 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/zdevito/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli...(no debugging symbols found)...done.
(gdb) b showdebug.c:6
No symbol table is loaded.  Use the "file" command.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (showdebug.c:6) pending.
(gdb) r
Starting program: /home/zdevito/clang+llvm-3.4-x86_64-unknown-ubuntu12.04/bin/lli -use-mcjit showdebug.ll 5
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Inferior 1 (process 8538) exited with code 0170]
(gdb)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140325/5cd3a0ad/attachment.html>


More information about the llvm-dev mailing list