Re: How to add a second "this" (sort of, or maybe do something totally different)

Tom Tromey <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
>>>>> ">" == Nat!  <[email protected]> writes:

>> The actual method parameters are accessed indirectly through
>> "_param".  So the functions may have looked like this in the
>> Objective-C source code:

>> int     foo1:(int) a :(void *) b;
>> void foo2:(double) a :(void *) b;
>> char  *foo3:(int) a :(int) b :(int) c;

If this is an Objective-C compiler and/or ABI thing, then gdb could be
taught about it directly, I suppose.  I'm not sure how well the existing
Objective-C code in gdb works, so it may require other changes as well.

>> I am looking for the least effort route to support something like this
>> for "_param" as well, in gdb. What would be really great, would be to 
>> also show the struct fields in the stack trace instead of "_param".

gdb has limited support for this kind of thing.  I don't think there's a
good way, currently, do augment 'print' like this.  That would requiring
hooking into expression parsing / evaluation somehow.

For stack traces in particular, a "frame filter" can synthesize
'variables' like this.

>> Getting the compiler to output some fake dwarf
>> "DW_TAG_formal_parameter" for each struct field with a computed dwarf
>> expression, is maybe the proper way it could be done. But that's not
>> least effort for me by a long shot.

Parameters are tricky because gdb can also do inferior calls, so it has
to understand some of these details in a way that DWARF doesn't express.

Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.