On Wed, Feb 17, 2016 at 2:04 PM, Tom de Vries <tom_devr...@mentor.com> wrote: > Hi, > > once in a while I'm in a gdb debug session debugging cc1, and want to print > the current function graph to file (see also > https://gcc.gnu.org/ml/gcc-patches/2016-02/msg01160.html for the non-graph > variant). > > That is currently possible by doing: > ... > (gdb) call clean_graph_dump_file ("foo.1") > (gdb) call print_graph_cfg ("foo.1", cfun) > (gdb) call finish_graph_dump_file ("foo.1") > ... > which will generate a file "foo.1.dot". > > But I think a short-hand is easier. > > This patch adds a function debug_function_graph_to_file. It can f.i. be > called as: > ... > (gdb) call debug_function_graph_to_file (cfun.decl, "foo.1.dot") > ... > > [ I'll post a follow-up WIP patch that adds the flags parameter. ] > > OK for stage1 trunk if bootstrap and reg-test succeeds?
See other mail - python? 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. I'm using this a lot. I always wondered what it takes to do this in gdbhooks.py and thus look forward for somebody else to try sth similar there. Richard. > Thanks, > - Tom > >
p
Description: Binary data