On 11/14/12, Andrew Pinski <pins...@gmail.com> wrote:
> On Nov 14, 2012, Lawrence Crowl <cr...@googlers.com> wrote:
>> Diego and I seek your comments on the following (loose) proposal.
>>
>>
>> It is sometimes hard to remember which printing function is used
>> for debugging a type, or even which type you have.
>>
>> We propose to rely on overloading to unify the interface to a small
>> set of function names.  Every major data type should have associated
>> debug/dump functionality.  We will unify the current *_dump/*_debug
>> functions under the same common overloaded name.
>>
>> We intend to only apply this approach to functions that take the
>> type to display as an argument, and that are routinely used in
>> debugging.
>>
>> We propose to provide several function overload sets, as below.
>
> Here is my proposal though I don't have time to work on it.  Make some
> python scripts which do the basic function of the debug_* functions.
> This way you can use them while debugging a core file and when the
> stack has become full.  As I said I don't have time to work on this
> and really don't know python well enough to do it either.  But I think
> would be more useful than changing the debug functions inside gcc.

The intent was to include debugging by adding source code. Python
would not be available then.  (It is a good solution for many tasks
from within gdb.)

>
> Thanks.
> Andrew Pinski
>
>>
>>
>> dump_pretty
>>
>>     This function overload set provides the bulk of the printing.
>>     They will use the existing pretty-printer functions in their
>>     implementation.
>>
>> dump_raw
>>
>>     This function overload set provides the raw oriented dump,
>>     e.g. a tuple.
>>
>> dump_verbose
>>
>>     This function overload set provides the extra details dump.
>>
>>
>> All of these functions come in two forms.
>>
>>     function (FILE *, item_to_dump, formatting)
>>     function (item_to_dump, formatting)
>>
>> If the FILE* is not specified, the output is to stderr.  The
>> formatting argument is optional, with a default suitable to the kind
>> of item to dump.
>>
>>
>> We should remove tree-browser.c.  It is not used at all and it is
>> likely broken.
>>
>> --
>> Lawrence Crowl
>


-- 
Lawrence Crowl

Reply via email to