LLBrowse has now been checked in to the <a href="http://llvm.org">llvm.org</a> subversion repository:<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://llvm.org/svn/llvm-project/llbrowse/trunk/">http://llvm.org/svn/llvm-project/llbrowse/trunk/</a></div>

<div><br></div><div>There are instructions for building and running in the doc/ directory.</div><div><br></div><div><a href="http://llvm.org/svn/llvm-project/llbrowse/trunk/"></a>First task if someone wants to take it on - update all of the source files to have the <meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">UIUC license info at the top, and add a LICENSE.txt file :)</span></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Other TODO items, many of which are fairly trivial:</span></font></div>

<div><ul><li><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">Update the status bar when a module is loaded (currently says "no module loaded")</span></li><li><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">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.</span></font></li>

<li><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Change the subversion property for the HTML files in the doc directory to have the proper mime type.</span></font></li>

<li><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">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.</span></font></li>

<li><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"></span></font><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">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.)</span></li>

<li><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; ">Make sure the app isn't leaking memory when loading a new module over an old one.</span></li></ul><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">In the mean time, I'll be working on getting DWARF derived type DIEs to display as much information as possible... :)</span></font></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div class="gmail_quote">On Fri, Feb 11, 2011 at 11:22 PM, Talin <span dir="ltr"><<a href="mailto:viridia@gmail.com">viridia@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>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:</div>

<div><ul><li>Based on wxWidgets, so it's completely cross-platform.</li>
<li>CMake build script can locate both LLVM and wxWidgets installations automatically.</li><li>Loads either .ll or .bc files.</li><li>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.</li>


<li>Tree nodes are created lazily as needed.</li><li>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.</li><li>The code is very straightforward and easy to read.</li>


<li>All image resources are embedded in the final executable, so the compiles program is just a single binary file, very easily installed.</li></ul></div><div>This is still a work in progress, but I think it's ready for people to start hacking on.</div>


<div><br></div><div>If there is interest, I can check the code into the <a href="http://llvm.org" target="_blank">llvm.org</a> 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.</div>


<div><br></div><div>Here's a screenshot of what it looks like:</div><div><br></div><img src="cid:ii_12e18aa739450dbf" alt="llbrowse.png" title="llbrowse.png"><br clear="all"><br><div>And here's what the node class for displaying variables looks like, as an example:</div>


<div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div><font face="'courier new', monospace">class VariableItem : public TreeItemBase {</font></div>
</div><div><div><font face="'courier new', monospace">public:</font></div></div><div><div><font face="'courier new', monospace">  VariableItem(const llvm::Module* module, const llvm::GlobalVariable* var)</font></div>


</div><div><div><font face="'courier new', monospace">    : module_(module), var_(var) {}</font></div></div><div><div><font face="'courier new', monospace"><br>
</font></div></div><div><div><font face="'courier new', monospace">  // Overrides</font></div></div><div><div><font face="'courier new', monospace"><br></font></div>
</div><div><div><font face="'courier new', monospace">  int GetIcon() const;</font></div></div><div><div><font face="'courier new', monospace">  wxString GetCaption() const;</font></div>
</div><div><div><font face="'courier new', monospace">  void CreateChildren(wxTreeCtrl* tree, const wxTreeItemId& id);</font></div></div><div><div><font face="'courier new', monospace">  bool CanCreateChildren() const;</font></div>


</div><div><div><font face="'courier new', monospace">  void ShowDetails(DetailsView* detailsView);</font></div></div><div><div><font face="'courier new', monospace"><br>
</font></div></div><div><div><font face="'courier new', monospace">private:</font></div></div><div><div><font face="'courier new', monospace">  const llvm::Module* const module_;</font></div>
</div><div><div><font face="'courier new', monospace">  const llvm::GlobalVariable* const var_;</font></div></div><div><div><font face="'courier new', monospace">};</font></div>
</div></blockquote><div><br></div><div>-- <br>-- Talin<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>-- Talin<br>
</div>