[PATCH] Debugging LLVM IR with LLDB (and gdb)

Andrew Trick atrick at apple.com
Tue May 7 13:29:14 PDT 2013


On Apr 24, 2013, at 1:04 PM, "Malea, Daniel" <daniel.malea at intel.com> wrote:
> On 2013-04-17 11:31 AM, "Malea, Daniel" <daniel.malea at intel.com> wrote:
> 
>> Has anyone tried this pass or had a chance to look at the patches?
>> 
>> http://llvm-reviews.chandlerc.com/D659

Duping my comment to the commits list since it isn't CC'd from phabricator, and I'd like general feedback on the next step: integrating it with a normal clang build...

I think this is a great idea, and the implementation looks very nice.

Can you forward declare SlotTracker and have createSlotTracker accept a Module, instead of moving the class to the header? I think it's an implementation detail.

I really would like to take the next step to make this useful. We need a clang/llvm option that can be used without "-g" to generate the -debug.ll files in the output directory.

Meanwhile, I think you should commit what you have.

-Andy

>> On 2013-04-15 12:19 PM, "Malea, Daniel" <daniel.malea at intel.com> wrote:
>> 
>>> Ah, sorry, I figured phabricator link was sufficient. Here are the 4
>>> patches that represent the latest phabricator review:
>>> 
>>> 
>>> 
>>> Part #1: FormattedStream -- Add line tracking
>>> - previously formatted_raw_ostream tracked columns, now it tracks lines
>>> too
>>> - used by DebugIR pass to know the line number to connect to each IR
>>> instruction
>>> 
>>> Part #2: Pull up AssemblyWriter interface into header to allow
>>> subclassing
>>> - made all functions virtual so that subclasses can specialize them
>>> - add printInstructionLine so that subclasses can choose whether or not
>>> to
>>> print the newline character (without having to implement
>>> printBasicBlock()
>>> - no intended change in functionality/behaviour!
>>> 
>>> Part #3: DebugIR -- emit IR file and replace source lines with IR lines
>>> in MD
>>> - requires existing debug information to be present
>>> - fixes up file name and line number information
>>> - emits a "<orig_filename>-debug.ll" succinct IR file (without !dbg
>>> metadata
>>> or debug intrinsics) that can be read by a debugger
>>> 
>>> Part #4: DebugIR tests -- lit tests for the line number transform
>>> - simple one-function case
>>> - function-calling case
>>> - external function calling case
>>> - exception throwing case
>>> - vector case
>>> - O3 (vector) case
>>> 
>>> 
>>> 
>>> 
>>> From: Chandler Carruth
>>> <chandlerc at google.com<mailto:chandlerc at google.com>>
>>> Date: Monday, 15 April, 2013 4:29 AM
>>> To: Stefanus Du Toit
>>> <stefanus.du.toit at intel.com<mailto:stefanus.du.toit at intel.com>>
>>> Cc: Nadav Rotem <nrotem at apple.com<mailto:nrotem at apple.com>>, Daniel Malea
>>> <daniel.malea at intel.com<mailto:daniel.malea at intel.com>>,
>>> "llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>"
>>> <llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>>
>>> Subject: Re: [PATCH] Debugging LLVM IR with LLDB (and gdb)
>>> 
>>> On Mon, Apr 15, 2013 at 1:21 AM, Du Toit, Stefanus
>>> <stefanus.du.toit at intel.com<mailto:stefanus.du.toit at intel.com>> wrote:
>>> The link to the patch is at the bottom of the email.
>>> 
>>> As usual, please attach the patch to the email. The best way when using
>>> Phabricator (as we documented) is to add the commits list to the review
>>> there so that everyone on the mailing list can follow the code review and
>>> participate even if not using the specific tool.
>>> 
>>> 
>>> --
>>> Stefanus Du Toit 
>>> <stefanus.du.toit at intel.com<mailto:stefanus.du.toit at intel.com>>
>>> Intel Waterloo
>>> Phone: 519-591-1738<tel:519-591-1738>
>>> 
>>> 
>>> From: Nadav Rotem
>>> <nrotem at apple.com<mailto:nrotem at apple.com><mailto:nrotem at apple.com<mailto
>>> :
>>> nrotem at apple.com>>>
>>> Date: Sunday, 14 April, 2013 4:00 AM
>>> To: Daniel Malea 
>>> <daniel.malea at intel.com<mailto:daniel.malea at intel.com><mailto:daniel.male
>>> a
>>> @intel.com<mailto:daniel.malea at intel.com>>>
>>> Cc: 
>>> "llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu><mailto:llvm-co
>>> m
>>> mits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>>"
>>> <llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu><mailto:llvm-co
>>> m
>>> mits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>>>
>>> Subject: Re: [PATCH] Debugging LLVM IR with LLDB (and gdb)
>>> 
>>> Hi Daniel,
>>> 
>>> You forgot to attache the patch.
>>> 
>>> Thanks,
>>> Nadav
>>> 
>>> On Apr 11, 2013, at 1:53 PM, "Malea, Daniel"
>>> <daniel.malea at intel.com<mailto:daniel.malea at intel.com><mailto:daniel.male
>>> a
>>> @intel.com<mailto:daniel.malea at intel.com>>> wrote:
>>> 
>>> [Š]
>>> I'd be appreciative of testing and/or review comments! The patch is
>>> available on phabricator http://llvm-reviews.chandlerc.com/D659and the
>>> details from the review request follow.
>>> 
>>> 
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu>
>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>> 
>> 
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commit
> s

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130507/480f3fc1/attachment.html>


More information about the llvm-commits mailing list