[lldb-dev] lldb problems on linux

Kaylor, Andrew andrew.kaylor at intel.com
Wed Aug 7 14:24:52 PDT 2013


I agree that logging is the best place to start.  Without a better idea of what's failing, it's hard to say where to start.

You could try something like setting a breakpoint in the CommandObjectBreakpointSet::DoExecute() function, and stepping through from there.  I think that's likely to get you to the beginning of the DWARF processing if setting a breakpoint is the first thing you do after creating the target (or specifying it on the command line).  It's a long and winding road from there to the meaty bits, but without some hints from the log output it's hard to say where a wrong turn might have been taken.

SymbolFileDWARF::ParseCompileUnit() is another potentially interesting starting place, but I think there's a good chance you won't get there if you aren't seeing any source information.

-Andy

From: Malea, Daniel
Sent: Wednesday, August 07, 2013 1:14 PM
To: Kal Conley
Cc: Kaylor, Andrew; lldb-dev at cs.uiuc.edu
Subject: Re: [lldb-dev] lldb problems on linux

Enabling logging is probably a good first place to start. If you're not seeing source information, then maybe lldb is unable to parse some stuff that clang is generating... to see what the DWARF parser is doing, you can:

(lldb) log enable dwarf all

There's many logging categories that can be enabled; some are quite verbose..to see all of them, do:

(lldb) log list

Also, with the '-f' option, you can dump the output to a file for easier perusal.


Cheers,
Dan

From: Kal Conley <kcconley at gmail.com<mailto:kcconley at gmail.com>>
Date: Wednesday, 7 August, 2013 2:44 PM
To: Daniel Malea <daniel.malea at intel.com<mailto:daniel.malea at intel.com>>
Cc: Andrew Kaylor <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>>, "lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>" <lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>>
Subject: Re: [lldb-dev] lldb problems on linux

I am still seeing issues with source-level debugging. "target modules dump sections" has symbol entries. Also source level debugging is working in gdb, so I know that symbols are available.
The strange thing is, I tried the same thing with a simple "Hello world" program and source level debugging worked. Both programs are being compiled with clang-3.4.

Can someone give me a tip where I can should put breakpoints in LLDB to debug this?

Thanks,
-Kal

Am 8/7/13 12:04 AM, schrieb Kal Conley:
Hi Dan,
Sorry I wasn't clear. My fix fixes the test suite issue. The only remaining issue is the source debugging issue. I haven't got to look into that yet. I am on Debian Wheezy.
-Kal

Am 8/6/13 11:44 PM, schrieb Malea, Daniel:
Thank you Kal for the fix! Much appreciated :)

I committed it in r187818.

So, just to clarify, you're still unable to run the test suite after the fix? Which distro are you on?


Thanks,
Dan

From: Kal Conley <kcconley at gmail.com<mailto:kcconley at gmail.com>>
Date: Tuesday, 6 August, 2013 5:27 PM
To: Andrew Kaylor <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>>, "lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>" <lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>>
Subject: Re: [lldb-dev] lldb problems on linux

Hi Andy,
So I figured out the python issue. Host::GetLLDBPath() is broken. It was failing for me because I am building in Release mode. It only works in Debug mode by luck :) The problem is lines 1035+ in source/Host/common/Host.cpp. llvm::Twine should only be used for temporary objects! See http://llvm.org/docs/ProgrammersManual.html#dss-twine

I have attached a patch this fixes the issue. I haven't found time to investigate my other issue yet.

Thanks!
-Kal

Am 8/6/13 4:29 PM, schrieb Kaylor, Andrew:
Hmm...  I've never seen the -P option print the wrong path.  Looking at the code (in Host::GetLLDBPath) it doesn't even look possible for it to print what you're seeing.

On the other hand, the second directory you mention should be the correct one.  If you set PYTHONPATH to that does "python -c 'import lldb'" work?

-Andy

From: Kal Conley [mailto:kcconley at gmail.com]
Sent: Tuesday, August 06, 2013 2:00 AM
To: Kaylor, Andrew
Cc: lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>
Subject: Re: [lldb-dev] lldb problems on linux

Hi Andy,
I tried
export PYTHONPATH=`$llvm/build/Debug+Asserts/bin/lldb -P`
but it didn't work for me. If I run `build/bin/lldb -P` it outputs "build/lib7/site-packages" which doesn't exist.
There is a directory build/lib/python-2.7/site-packages but if I set the PYTHONPATH to this directory I get the same errors.
I can import lldb; in python successfully though.
Any other ideas?
-Kal

2013/8/5 Kaylor, Andrew <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>>
Hi Kal,

For the second problem, you need to set the PYTHONPATH environment variable.  Try this:

export PYTHONPATH=`$llvm/build/Debug+Asserts/bin/lldb -P`

Regarding the source information, I would start by using the following command within lldb (after you have created the target you want to debug):

target modules dump sections

If you don't see debug sections in that list, then that's the problem.  If you do, try enabling DWARF logging ('log enable dwarf all') and see if anything obvious turns up in the output when you try to set a breakpoint.

-Andy

From: lldb-dev-bounces at cs.uiuc.edu<mailto:lldb-dev-bounces at cs.uiuc.edu> [mailto:lldb-dev-bounces at cs.uiuc.edu<mailto:lldb-dev-bounces at cs.uiuc.edu>] On Behalf Of Kal Conley
Sent: Sunday, August 04, 2013 11:27 AM
To: lldb-dev at cs.uiuc.edu<mailto:lldb-dev at cs.uiuc.edu>

Subject: [lldb-dev] lldb problems on linux

Hi,
I recently build lldb from trunk (revision 187708) and source-level debugging isn't working for me. It seems its not loading any source information. What is the best way to troubleshoot this?
Also make check-lldb doesn't work on Linux when building with CMake. I just get error:

This script requires lldb.py to be in either /home/user/tools/llvm_3.4~svn187708/tools/lldb/build/Debug/LLDB.framework/Resources/Python, /home/user/tools/llvm_3.4~svn187708/tools/lldb/build/Release/LLDB.framework/Resources/Python, or /home/user/tools/llvm_3.4~svn187708/tools/lldb/build/BuildAndIntegration/LLDB.framework/Resources/Python
I get the same error with lldb-3.3.

Thanks!




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130807/e741f313/attachment.html>


More information about the lldb-dev mailing list