Talin
2011-Feb-12 07:22 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110211/aac344f7/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: llbrowse.png Type: image/png Size: 66648 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110211/aac344f7/attachment.png>
Renato Golin
2011-Feb-12 09:31 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
Nice! I'm interested... would also be nice to cross this with llvm diff, eh? :) Cheers, Renato On 12-Feb-2011 7:28 AM, "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 tostart> 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/8ae9cc2a/attachment.html>
Raghu Prabhakar
2011-Feb-12 10:42 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
Hi Talin, This looks interesting..! Can you email me your tool? Cheers, Raghu. ----- Original Message ----- From: "Renato Golin" <rengolin at systemcall.org> To: "Talin" <viridia at gmail.com> Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> Sent: Saturday, February 12, 2011 1:31:10 AM Subject: Re: [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules Nice! I'm interested... would also be nice to cross this with llvm diff, eh? :) Cheers, Renato On 12-Feb-2011 7:28 AM, "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_______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Garrison Venn
2011-Feb-12 14:40 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
Looks cool Talin. Personally it would be nice if it was checked into llvm.org, but is wxWidgets LGPL like license an issue for llvm's repository? Anyway I would be interested in a copy otherwise under a BSD like license. Thanks in advance Garrison On Feb 12, 2011, at 2:22, Talin 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: > > <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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/6b67dbe4/attachment.html>
Talin
2011-Feb-12 18:14 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
A lot of people have requested a source archive, so I'm making available here: http://code.google.com/p/tart/downloads/detail?name=llbrowse.tgz Have fun! 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/25940955/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: llbrowse.png Type: image/png Size: 66648 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/25940955/attachment.png>
Talin
2011-Feb-12 18:28 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
On Sat, Feb 12, 2011 at 6:40 AM, Garrison Venn <gvenn.cfe.dev at gmail.com>wrote:> Looks cool Talin. > > Personally it would be nice if it was checked into llvm.org, but is > wxWidgets LGPL like license > an issue for llvm's repository? >There should be no problem with the license. wxWidgets is indeed distributed under a modified version of the LGPL (with a special exception to allow people to distribute binaries of their app without requiring the source). The LGPL allows derived works to be distributed under a more permissive license (such as BSD-like licenses) as long as all of the license terms are *less restrictive* than the LGPL. Also, since we're talking LGPL, not GPL, the "derived work" does not include applications based on the library, it only includes modifications to the library itself. Since LLBrowse does not include any wxWidgets source code, the source archive can be distributed under a BSD license. Binaries of LLBrowse can be distributed freely, without source, due to the special exception in the wxWidgets license. Thus, even though the University of Illinois license is not GPL-compatible (because of the copyright and endorsement clauses), this should not matter. Here's a page which lists which open source licenses are GPL-compatible: http://www.gnu.org/licenses/license-list.html<http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses>> Anyway I would be interested in a copy otherwise under a BSD like license. > > Thanks in advance > > Garrison > > On Feb 12, 2011, at 2:22, Talin 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: > > <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 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-- -- Talin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110212/79fa90bb/attachment.html>
Talin
2011-Feb-13 22:59 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110213/27ec943c/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: llbrowse.png Type: image/png Size: 66648 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110213/27ec943c/attachment.png>
Talin
2011-Feb-14 03:55 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
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>
Renato Golin
2011-Feb-14 09:17 UTC
[LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
I think this deserves a blog post... --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110214/7ce81293/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
- [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
- [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
- [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules
- [LLVMdev] Introducing LLBrowse: A graphical browser for LLVM modules