One more screen shot: The version I just checked now allows you to see all of the children of a given compile unit:<div><br></div><div><img src="cid:ii_12e224b8899ad6f4" alt="llbrowse3.png" title="llbrowse3.png"><br><br><div class="gmail_quote">


I've already found at least one bug in my compiler's frontend using this tool :)</div><div class="gmail_quote"><br></div><div class="gmail_quote">Oh, and before I forget, I need three small changes to DebugInfo.h:</div>

<div class="gmail_quote"><ul><li>DebugInfoFinder's 'module' parameter should be const.</li><li>isArtificial should return a bool, not an unsigned.</li><li>DIDerivedType should have an method that allows access to the 'name' attribute of the DIE.</li>

</ul></div><div class="gmail_quote">On Sun, Feb 13, 2011 at 2:59 PM, Talin <span dir="ltr"><<a href="mailto:viridia@gmail.com" target="_blank">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">LLBrowse has now been checked in to the <a href="http://llvm.org" target="_blank">llvm.org</a> subversion repository:<div>


<br></div><div><a href="http://llvm.org/svn/llvm-project/llbrowse/trunk/" target="_blank">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/" target="_blank"></a>First task if someone wants to take it on - update all of the source files to have the <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 face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div><font face="arial, sans-serif"><span style="border-collapse:collapse">Other TODO items, many of which are fairly trivial:</span></font></div>



<div><ul><li><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 face="arial, sans-serif"><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 face="arial, sans-serif"><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 face="arial, sans-serif"><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 face="arial, sans-serif"><span style="border-collapse:collapse"></span></font><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 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 face="arial, sans-serif"><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 face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div><div class="gmail_quote"><div>On Fri, Feb 11, 2011 at 11:22 PM, Talin <span dir="ltr"><<a href="mailto:viridia@gmail.com" target="_blank">viridia@gmail.com</a>></span> wrote:<br>



</div><div><div></div><div><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="https://mail.google.com/mail/u/0/?ui=2&ik=af335352ab&view=att&th=12e224bf1a4aeb51&attid=0.1&disp=emb&realattid=ii_12e18aa739450dbf&zw" 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></div></div><br><br clear="all"><br>-- <br>-- Talin<br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>-- Talin<br>
</div>