This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Add debug_function_graph_to_file


On Wed, Feb 17, 2016 at 03:00:00PM +0100, Richard Biener wrote:
> On Wed, Feb 17, 2016 at 2:51 PM, Marek Polacek <polacek@redhat.com> wrote:
> > On Wed, Feb 17, 2016 at 02:45:36PM +0100, Richard Biener wrote:
> >> OTOH I have in my local trees a more convenient form (attached).
> >>
> >> (gdb) call debug_dot_cfg (cfun, 1<<6)
> >>
> >> and a X window with the dotted graph opens.
> >
> > Is there any chance we could get this into the mainline?  I'd love to use
> > this without having to patch my tree locally.  If I remember correctly
> > there were some issues with unportable popen()?
> 
> I think I never posted it for inclusion.  The ??? would also need investigation,
> probably using a temporary file is easier (though would require manual
> cleaning).
> 
> What does it take to write it in python instead?

It should be fairly easy.  I played with python in gdb more than two
years ago and forgot most of it, but the following script still works
and still can use dot to generate and feh to immediately display call
graph from within gdb, the newly installed gdb command for that is
called symtab_visualize:

https://github.com/jamborm/gcc-util/blob/master/python/gdbsymtab.py

And I also think that using python is the way to go.  The only
downside is that you only find out that gcc and the script are out of
sync when debugging no longer works and fails in mysterious ways and
fixing the python script can be a daunting task if you are not its
author or have long forgotten how it worked (or how the whole
gdb-python thing worked).

(And yes, I know it is bad I have my own gdb python scripts and don't
use gcc/gdbhooks.py.  I forgot why that happened.)

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]