[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules

Talin viridia at gmail.com
Sun Feb 13 19:55:50 PST 2011


One more screen shot: The version I just checked now allows you to see all
of the children of a given compile unit:

[image: llbrowse3.png]

I've already found at least one bug in my compiler's frontend using this
tool :)

Oh, and before I forget, I need three small changes to DebugInfo.h:

   - DebugInfoFinder's 'module' parameter should be const.
   - isArtificial should return a bool, not an unsigned.
   - DIDerivedType should have an method that allows access to the 'name'
   attribute of the DIE.

On Sun, Feb 13, 2011 at 2:59 PM, Talin <viridia at gmail.com> wrote:

> LLBrowse has now been checked in to the llvm.org subversion repository:
>
> http://llvm.org/svn/llvm-project/llbrowse/trunk/
>
> There are instructions for building and running in the doc/ directory.
>
> <http://llvm.org/svn/llvm-project/llbrowse/trunk/>First task if someone
> wants to take it on - update all of the source files to have the UIUC
> license info at the top, and add a LICENSE.txt file :)
>
> Other TODO items, many of which are fairly trivial:
>
>    - Update the status bar when a module is loaded (currently says "no
>    module loaded")
>    - Add support for command-line parameters - you should be able to
>    specify a module file on the command line and have it load it on startup.
>    - Change the subversion property for the HTML files in the doc
>    directory to have the proper mime type.
>    - Add new icons for different DIE types (currently all DWARF nodes use
>    the same icon.) Note that you need to re-run CMake after adding a new icon
>    so it can create the dependency rules for converting the icon data to a C
>    header file. Icons are always 20x20 and can easily be created in GIMP.
>    - Add a "search" function that allows searching for a symbol by name.
>    (This one's not trivial due to the lazy construction of tree nodes.
>    Basically what it needs to do is walk the tree (avoiding cycles), and call
>    treeCtrl->SelectItem and treeCtrl->EnsureVisible on the node whose caption
>    contains the search string. I have some notes on how to do this.)
>    - Make sure the app isn't leaking memory when loading a new module over
>    an old one.
>
> In the mean time, I'll be working on getting DWARF derived type DIEs to
> display as much information as possible... :)
>
> On Fri, Feb 11, 2011 at 11:22 PM, Talin <viridia at gmail.com> wrote:
>
>> I've written a little GUI application that displays an LLVM module as an
>> expandable tree, which can be useful for examining the module's contents.
>> Some features:
>>
>>    - Based on wxWidgets, so it's completely cross-platform.
>>    - CMake build script can locate both LLVM and wxWidgets installations
>>    automatically.
>>    - Loads either .ll or .bc files.
>>    - Supports browsing of LLVM types, variables, functions, aliases, and
>>    metadata. I'm working on supporting a more structured view of DWARF DIEs,
>>    but that is not complete.
>>    - Tree nodes are created lazily as needed.
>>    - The tree node system is highly extensible, each different LLVM
>>    object type is represented by a tree node class, adding new node classes is
>>    extremely easy.
>>    - The code is very straightforward and easy to read.
>>    - All image resources are embedded in the final executable, so the
>>    compiles program is just a single binary file, very easily installed.
>>
>> This is still a work in progress, but I think it's ready for people to
>> start hacking on.
>>
>> If there is interest, I can check the code into the llvm.org svn
>> somewhere - I just need to know where to put it. Otherwise, I'm happy to
>> email a zip archive to folks who are interested. I'm willing to release the
>> code under whatever license is most convenient.
>>
>> Here's a screenshot of what it looks like:
>>
>> [image: llbrowse.png]
>>
>> And here's what the node class for displaying variables looks like, as an
>> example:
>>
>> class VariableItem : public TreeItemBase {
>> public:
>>   VariableItem(const llvm::Module* module, const llvm::GlobalVariable*
>> var)
>>     : module_(module), var_(var) {}
>>
>>   // Overrides
>>
>>   int GetIcon() const;
>>   wxString GetCaption() const;
>>   void CreateChildren(wxTreeCtrl* tree, const wxTreeItemId& id);
>>   bool CanCreateChildren() const;
>>   void ShowDetails(DetailsView* detailsView);
>>
>> private:
>>   const llvm::Module* const module_;
>>   const llvm::GlobalVariable* const var_;
>> };
>>
>>
>> --
>> -- Talin
>>
>
>
>
> --
> -- Talin
>



-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110213/ec9d4376/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llbrowse3.png
Type: image/png
Size: 67361 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110213/ec9d4376/attachment.png>


More information about the llvm-dev mailing list