[Patch]: libbacktrace - add support of PE/COFF

Tristan Gingold gingold@adacore.com
Thu May 28 12:15:00 GMT 2015


> On 27 May 2015, at 15:36, Jeff Law <law@redhat.com> wrote:

>> +static int
>> +coff_is_symbol (const b_coff_internal_symbol *isym)
>> +{
>> +  return isym->type == 0x20 && isym->sec > 0;
>> +}
> You probably want const or enum so that you can have a symbolic name rather than 0x20 here.  It also seems like the name ought to better indicate it's testing for function symbols.

Yes, this is now changed.

> It's a given  that you know COFF specifics better than I ever did, so I'm comfortable assuming you got the COFF specifics right.
> 
> The overall structure of elf.c & coff.c is the same with code templates that are very similar, except they work on different underlying types.  Presumably there wasn't a good way to factor any of the generic looking bits out?  And no, I'm not requesting you rewrite all this in BFD :-)

The dummy callback could indeed be easily shared.  For the remaining, that’s not so simple given the types.  Maybe we can create a ‘C class’ for symbol infos.

Tristan.



More information about the Gcc-patches mailing list