[PATCH] Step over Objective-C dispatch function

Adam Fedor fedor@doc.com
Tue Mar 25 15:56:00 GMT 2003



Andrew Cagney wrote:
>> +      /* Determine if we are currently in the Objective-C dispatch
>> +         function.  If so, get the address of the method function that
>> +         the dispatcher would call and use that as the function to
>> +         step into instead. Also skip over the trampoline for the
>> +         function (if any).  This is better for the user since they
>> +         are only interested in stepping into the method function
>> +         anyway.  */
>> +      {
>> +    CORE_ADDR method_stop_pc;
>> +   
>> +    if (real_stop_pc)
>> +      find_objc_msgcall (real_stop_pc, &method_stop_pc);
>> +    else
>> +      find_objc_msgcall (stop_pc, &method_stop_pc);
>> +   
>> +    if (method_stop_pc)
>> +      ecs->stop_func_start = method_stop_pc;
>> +   
>> +    if (method_stop_pc)
>> +      {
>> +        real_stop_pc = SKIP_TRAMPOLINE_CODE (method_stop_pc);
>> +        if (real_stop_pc != 0)
>> +          ecs->stop_func_start = real_stop_pc;
>> +      }
>> +      }
>> +
> 
> 
> Adam,
> 
> Seems you were waiting on me here :-(
> 
> I've looked at what the underlying code is trying to do and, 
> unfortunatly, the original objc-lang.c botched its portability(1), sigh! 
>  The file is currently native only so infrun.c can't directly refer to 
> objc-lang.c, and hence, will need to go via a dispatch table.  Going via 
> a dispatch table wouldn't hurt anyway.
> 

I think I understand this, but perhaps you can look at the patch and 
tell me if I'm way off.  After looking at this closer myself, I realized 
this is only relevant for the Apple Objective-C runtime (i.e. Darwin), 
not the GNU runtime. On GNU systems the dispatch function gets 
automatically skipped because it typically has no debugging information 
(Wouldn't this work also on the Apple runtime?). Perhaps that changes 
things a little.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: skip_trampoline.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20030325/151fc0f2/attachment.ksh>


More information about the Gdb-patches mailing list