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

Malea, Daniel daniel.malea at intel.com
Mon Apr 15 09:19:04 PDT 2013


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.malea at intel.com<mailto:daniel.malea at intel.com>>>
Cc: "llvm-commits at cs.uiuc.edu<mailto:llvm-commits at cs.uiuc.edu><mailto: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><mailto:llvm-commits 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.malea at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 01_track_line_numbers.patch
Type: application/octet-stream
Size: 6012 bytes
Desc: 01_track_line_numbers.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/a99ae45d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 02_refactor_assembly_writer.patch
Type: application/octet-stream
Size: 17454 bytes
Desc: 02_refactor_assembly_writer.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/a99ae45d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 03_debug_ir_pass.patch
Type: application/octet-stream
Size: 11836 bytes
Desc: 03_debug_ir_pass.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/a99ae45d/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 04_opt_tests.patch
Type: application/octet-stream
Size: 54760 bytes
Desc: 04_opt_tests.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130415/a99ae45d/attachment-0003.obj>


More information about the llvm-commits mailing list