This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch]: libbacktrace - add support of PE/COFF
- From: Tristan Gingold <gingold at adacore dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Thu, 28 May 2015 13:56:35 +0200
- Subject: Re: [Patch]: libbacktrace - add support of PE/COFF
- Authentication-results: sourceware.org; auth=none
- References: <2DD28AFE-AAB7-4B92-9ED0-A0F5763923CC at adacore dot com> <5565C843 dot 6080807 at redhat dot com>
> 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.