[Patch Debug] Emit pubnames for reorder & partition case.

IainS developer@sandoe-acoustics.co.uk
Mon Dec 20 22:37:00 GMT 2010


On 20 Dec 2010, at 21:38, Richard Henderson wrote:

> On 12/20/2010 01:20 PM, IainS wrote:
>>
>> On 20 Dec 2010, at 21:15, Richard Henderson wrote:
>>
>>> On 12/20/2010 03:18 AM, IainS wrote:
>>>> +          /* There is no real support in DW2 for this .. so we  
>>>> make
>>>> +             a work-around.  First, emit the pub name for the  
>>>> segment
>>>> +             containing the function label.  Then make and emit a
>>>> +             simplified subprogram DIE for the second segment  
>>>> with the
>>>> +             name post-fixed with _$hot$ or _$cold$.  We use the  
>>>> same
>>>> +             linkage name for the second die so that gdb will  
>>>> find both
>>>> +             sections when given "b foo".  */
>>>
>>> This doesn't work when $ is not allowed, aka NO_DOLLAR_IN_LABEL.
>>> Presumably we need this workaround since Darwin is strict dwarf2?
>>
>> Yes, we need the work-around ..

FWIW, the problem is that we support only a sub-set of DW3 - so if you  
try gcc -gdwarf-3 either the linker or dsymutil dies.
so, we're stuck with DW2/strict.

>> but I'm not massively attached to $ (or even £ ;-))
>>
>> is it OK apart from that?
>
> Yeah, and I suppose you're after matching the symbols here with
> the symbols from that previous patch.
>
> Ok with an extra bit akin to the use in clone_function_name:
>
> #ifndef NO_DOT_IN_LABEL
>  prefix[len] = '.';
> #elif !defined NO_DOLLAR_IN_LABEL
>  prefix[len] = '$';
> #else
>  prefix[len] = '_';
> #endif
>
> though of course you may swap the preferencing of [$.] to match
> what you already have in darwin.c.

what I'm after is
(a) avoiding a name clash.
(b) having a generated  tag which is clearly understandable to the  
person debugging ..

If I prefix (rather than the current post-fix) with  "__hot_" and  
"__cold_"  (or even __hot_partition_) that should be safe and not  
require the extra hoops?

(I"m happy to do what you've suggested above, of course, if that's the  
best solution).

thanks,
Iain



More information about the Gcc-patches mailing list