This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add debug_function_to_file
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Tom de Vries <Tom_deVries at mentor dot com>
- Cc: "gcc-patches at gnu dot org" <gcc-patches at gnu dot org>
- Date: Fri, 19 Feb 2016 10:44:26 +0100
- Subject: Re: [PATCH] Add debug_function_to_file
- Authentication-results: sourceware.org; auth=none
- References: <56C46A70 dot 4070605 at mentor dot com> <CAFiYyc3NS+PCAe3ZLvEwpsZgHD7O65PgkJYRp7UCErPMnKohoA at mail dot gmail dot com> <56C5D52E dot 9040302 at mentor dot com> <CAFiYyc0Wst0xUTsF6tX0XX8WbthNW=kDwZ1wncBJra1RM_WiCw at mail dot gmail dot com> <56C5E0A9 dot 1040900 at mentor dot com> <CAFiYyc3u87bKprL+L-41QKmr=2nPo0OZVn-M5ECXdaVNVr9A4g at mail dot gmail dot com> <56C663BC dot 6000905 at mentor dot com>
On Fri, Feb 19, 2016 at 1:37 AM, Tom de Vries <Tom_deVries@mentor.com> wrote:
> On 18/02/16 16:27, Richard Biener wrote:
>>
>> Attached is what I have for now, it works if you call it like
>>
>> (gdb) dot-fn cfun
>> (gdb) dot-fn cfun, 1<<6
>>
>> w/o that arg parsing;)
>>
>> I'll play with it some more tomorrow.
>
>
> This version:
> - uses arg parsing
> - adds error handling
> - uses a temp file instead of a pipe
> - uses python os.system to call dot
I used popen specifically to allow you continue debugging while keeping the dot
process open and functional. That would be restored with adding a '&' after
the command but then we race with the file removal ...
The following works for me though:
# Show graph in temp file
os.system("( dot -Tx11 %s; rm %s ) &" % (filename, filename) )
dot_fn()
ok for trunk with that change and thanks for the help!
Now if the TDF_ flags were available in gdb (without -g3) that would be
awsome. I guess moving them into a enum would work but also require
some extra casts everywhere...
Thanks,
Richard.
> - adds documentation
>
> Thanks,
> - Tom