Re: [PATCH] Add debug_function_to_file

2016-02-19 Thread Tom de Vries
On 19/02/16 10:44, Richard Biener wrote: On Fri, Feb 19, 2016 at 1:37 AM, Tom de Vries 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

Re: [PATCH] Add debug_function_to_file

2016-02-19 Thread Tom de Vries
On 18/02/16 20:41, David Malcolm wrote: On Thu, 2016-02-18 at 18:26 +0100, Tom de Vries wrote: On 18/02/16 16:43, Tom de Vries wrote: On 18/02/16 16:27, Richard Biener wrote: I would be nice if we could avoid the ${1,2,3} printouts and value history assignments, but I'm not sure how to do tha

Re: [PATCH] Add debug_function_to_file

2016-02-19 Thread Richard Biener
On Fri, Feb 19, 2016 at 1:37 AM, Tom de Vries 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

Re: [PATCH] Add debug_function_to_file

2016-02-19 Thread Richard Biener
On Thu, Feb 18, 2016 at 8:41 PM, David Malcolm wrote: > On Thu, 2016-02-18 at 18:26 +0100, Tom de Vries wrote: >> On 18/02/16 16:43, Tom de Vries wrote: >> > On 18/02/16 16:27, Richard Biener wrote: >> > > > > > I would be nice if we could avoid the ${1,2,3} printouts >> > > > > > and value >> > >

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
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

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread David Malcolm
On Thu, 2016-02-18 at 18:26 +0100, Tom de Vries wrote: > On 18/02/16 16:43, Tom de Vries wrote: > > On 18/02/16 16:27, Richard Biener wrote: > > > > > > I would be nice if we could avoid the ${1,2,3} printouts > > > > > > and value > > > > > > > > > > history > > > > > > > > > > assignments, but I'

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
On 18/02/16 16:43, Tom de Vries wrote: On 18/02/16 16:27, Richard Biener wrote: I would be nice if we could avoid the ${1,2,3} printouts and value >>> >history >>> >assignments, but I'm not sure how to do that. >>> > Using gdb.parse_and_eval does the trick. This updated version uses gdb.pa

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
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. Richard. 2016-02-18 Richard Biener + /* Overload with additional flag argumen

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
On 18/02/16 16:27, Richard Biener wrote: I would be nice if we could avoid the ${1,2,3} printouts and value >>> >history >>> >assignments, but I'm not sure how to do that. >>> > Using gdb.parse_and_eval does the trick. This updated version uses gdb.parse_and_eval, and adds error handling.

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Richard Biener
On Thu, Feb 18, 2016 at 4:18 PM, Tom de Vries wrote: > On 18/02/16 16:10, Richard Biener wrote: >> >> On Thu, Feb 18, 2016 at 3:29 PM, Tom de Vries >> wrote: >>> >>> >On 17/02/16 14:42, Richard Biener wrote: >> >>On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries >>wrote: >

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
On 18/02/16 16:10, Richard Biener wrote: On Thu, Feb 18, 2016 at 3:29 PM, Tom de Vries wrote: >On 17/02/16 14:42, Richard Biener wrote: >> >>On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries >>wrote: >>> >>>Hi, >>> >>>once in a while I'm in a gdb debug session debugging cc1, and want to >>>print

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Richard Biener
On Thu, Feb 18, 2016 at 3:29 PM, Tom de Vries wrote: > On 17/02/16 14:42, Richard Biener wrote: >> >> On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries >> wrote: >>> >>> Hi, >>> >>> once in a while I'm in a gdb debug session debugging cc1, and want to >>> print >>> the current function to file. >>> >

Re: [PATCH] Add debug_function_to_file

2016-02-18 Thread Tom de Vries
On 17/02/16 14:42, Richard Biener wrote: On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries wrote: Hi, once in a while I'm in a gdb debug session debugging cc1, and want to print the current function to file. There's a debug function debug_function that prints a function to stderr, and there are m

Re: [PATCH] Add debug_function_to_file

2016-02-17 Thread Tom de Vries
On 17/02/16 14:42, Richard Biener wrote: On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries wrote: >Hi, > >once in a while I'm in a gdb debug session debugging cc1, and want to print >the current function to file. > >There's a debug function debug_function that prints a function to stderr, >and ther

Re: [PATCH] Add debug_function_to_file

2016-02-17 Thread Richard Biener
On Wed, Feb 17, 2016 at 1:41 PM, Tom de Vries wrote: > Hi, > > once in a while I'm in a gdb debug session debugging cc1, and want to print > the current function to file. > > There's a debug function debug_function that prints a function to stderr, > and there are methods to redirect output of a c

[PATCH] Add debug_function_to_file

2016-02-17 Thread Tom de Vries
Hi, once in a while I'm in a gdb debug session debugging cc1, and want to print the current function to file. There's a debug function debug_function that prints a function to stderr, and there are methods to redirect output of a command to a file ( https://sourceware.org/gdb/onlinedocs/gdb/