linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [0/4] inspector for sparse
@ 2010-04-02 18:36 Christopher Li
  2010-04-02 18:59 ` Christopher Li
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Li @ 2010-04-02 18:36 UTC (permalink / raw)
  To: Linux-Sparse; +Cc: Kamil Dudka, Josh Triplett

Hi,

When I debug the enum int patch, some times I wish I have a better tools
to help me understand what is going on with the internal sprase data structure.
There is debug_symbol() to help in some degree, but it does not show anything
other than symbol type. E.g. expression and statments.

test-parsing's output is more like assembly rather than a syntax tree.
There is debug_symbol() but it only print out the symbol type. It does not
go into expression. So the interesting stuff like expression  is hard to see.

I want some thing it can display different types of C structure with expandable
sub node for its member. Some thing like a file folder you can expand it see its
content.

I first look at the GtkTreeView. It seems capable of doing what I want.
The interface is cumbersome to use and I am really not a GUI person.
So I build some custom tree model to simplify the interaction with GTK.
That is the first patch in the series.

The second patch of the series try to inspect C structure one at time.
It is driven by the gtk tree model. It use a some glib function but it does
not have any GTK knowledge.

The interface is generic enough that you should be able to do a cursor
version from it without changing the code.

The third patch adds the test-inspect program which launch a gtk window.
Oh, I did not bother to make the first two patches compile itself
until this one.

Please play with it. As always, feed back are welcome.

The C structure inspection is rather incomplete currently. It is very easy to
expand it to show additional types and members. The last patch is an example.
It is going to be very rewarding to extend the inspector. It does not
require you have deep understanding of the sparse AST tree, it helps
*you* to understand how sparse internal AST works.

So patches are very welcome as well. Any one want to help?

Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [0/4] inspector for sparse
  2010-04-02 18:36 [0/4] inspector for sparse Christopher Li
@ 2010-04-02 18:59 ` Christopher Li
  2010-04-23 20:30   ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Li @ 2010-04-02 18:59 UTC (permalink / raw)
  To: Linux-Sparse

I add a treeview branch on sparse/chrisl so you can pull from it.

http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=shortlog;h=refs/heads/treeview

In fedora, you need to install gtk2-devel package to enable it.

Chris

On Fri, Apr 2, 2010 at 11:36 AM, Christopher Li <sparse@chrisli.org> wrote:
> Hi,
>
> When I debug the enum int patch, some times I wish I have a better tools
> to help me understand what is going on with the internal sprase data structure.
> There is debug_symbol() to help in some degree, but it does not show anything
> other than symbol type. E.g. expression and statments.
>
> test-parsing's output is more like assembly rather than a syntax tree.
> There is debug_symbol() but it only print out the symbol type. It does not
> go into expression. So the interesting stuff like expression  is hard to see.
>
> I want some thing it can display different types of C structure with expandable
> sub node for its member. Some thing like a file folder you can expand it see its
> content.
>
> I first look at the GtkTreeView. It seems capable of doing what I want.
> The interface is cumbersome to use and I am really not a GUI person.
> So I build some custom tree model to simplify the interaction with GTK.
> That is the first patch in the series.
>
> The second patch of the series try to inspect C structure one at time.
> It is driven by the gtk tree model. It use a some glib function but it does
> not have any GTK knowledge.
>
> The interface is generic enough that you should be able to do a cursor
> version from it without changing the code.
>
> The third patch adds the test-inspect program which launch a gtk window.
> Oh, I did not bother to make the first two patches compile itself
> until this one.
>
> Please play with it. As always, feed back are welcome.
>
> The C structure inspection is rather incomplete currently. It is very easy to
> expand it to show additional types and members. The last patch is an example.
> It is going to be very rewarding to extend the inspector. It does not
> require you have deep understanding of the sparse AST tree, it helps
> *you* to understand how sparse internal AST works.
>
> So patches are very welcome as well. Any one want to help?
>
> Chris
>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [0/4] inspector for sparse
  2010-04-02 18:59 ` Christopher Li
@ 2010-04-23 20:30   ` Dan Carpenter
  2010-04-23 20:37     ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2010-04-23 20:30 UTC (permalink / raw)
  To: Christopher Li; +Cc: Linux-Sparse

On Fri, Apr 02, 2010 at 11:59:39AM -0700, Christopher Li wrote:
> I add a treeview branch on sparse/chrisl so you can pull from it.
> 
> http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=shortlog;h=refs/heads/treeview
> 
> In fedora, you need to install gtk2-devel package to enable it.
> 
> Chris

This is an really useful program.

Inline functions don't show up in the list of functions.  Is there a way 
to inspect these as well?  This is more a general sparse question, since
smatch doesn't parse inline functions either.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [0/4] inspector for sparse
  2010-04-23 20:30   ` Dan Carpenter
@ 2010-04-23 20:37     ` Dan Carpenter
  2010-04-25  8:37       ` Christopher Li
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2010-04-23 20:37 UTC (permalink / raw)
  To: Christopher Li; +Cc: Linux-Sparse

On Fri, Apr 23, 2010 at 10:30:40PM +0200, Dan Carpenter wrote:
> On Fri, Apr 02, 2010 at 11:59:39AM -0700, Christopher Li wrote:
> > I add a treeview branch on sparse/chrisl so you can pull from it.
> > 
> > http://git.kernel.org/?p=devel/sparse/chrisl/sparse.git;a=shortlog;h=refs/heads/treeview
> > 
> > In fedora, you need to install gtk2-devel package to enable it.
> > 
> > Chris
> 
> This is an really useful program.
> 
> Inline functions don't show up in the list of functions.  Is there a way 
> to inspect these as well?  This is more a general sparse question, since
> smatch doesn't parse inline functions either.

Crap.  I'm dumb.  You actually can click through your program to where the
inline function is called and see it.

Really useful program as I said before.

regards,
dan carpenter

> 
> regards,
> dan carpenter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [0/4] inspector for sparse
  2010-04-23 20:37     ` Dan Carpenter
@ 2010-04-25  8:37       ` Christopher Li
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Li @ 2010-04-25  8:37 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Linux-Sparse

On Fri, Apr 23, 2010 at 1:37 PM, Dan Carpenter <error27@gmail.com> wrote:
> On Fri, Apr 23, 2010 at 10:30:40PM +0200, Dan Carpenter wrote:
> Crap.  I'm dumb.  You actually can click through your program to where the
> inline function is called and see it.
>
> Really useful program as I said before.

I am glad you like it. It is actually far from complete. It is very easy to
extend though.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-04-25  8:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02 18:36 [0/4] inspector for sparse Christopher Li
2010-04-02 18:59 ` Christopher Li
2010-04-23 20:30   ` Dan Carpenter
2010-04-23 20:37     ` Dan Carpenter
2010-04-25  8:37       ` Christopher Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).