[PATCH 1/8] Rename read_unsigned_leb128 to gdb_read_unsigned_leb128

Pedro Alves palves@redhat.com
Thu Feb 16 20:01:00 GMT 2017


On 02/16/2017 07:40 PM, Jan Kratochvil wrote:
> On Thu, 16 Feb 2017 16:23:51 +0100, Pedro Alves wrote:
>> Can't we just use bfd's version?
> 
> bfd's version is in libbfd.c:
> /* Assorted BFD support routines, only used internally.
> and libbfd.h:
> /* libbfd.h -- Declarations used by bfd library *implementation*.
>    (This include file is not for users of the library.)
> 
> And I think GDB is a user of libbfd library.
> 
> (One could argue libbfd should use visibility and/or C++ namespaces but for
> historical reasons libbfd does not use either.)
> 
> I do not mind any solution, I have just complied with the libbfd policy.
> 

Bah, there are copies of leb128 reading code all over the toolchain.
binutils/ has read_leb128, gold/ has read_unsigned_LEB_128, gcc
has a copy or two as well.  And then the bfd version (and gdb's
version, which seems to have been copied from bfd's) needs a bfd
pointer, but it's not really necessary.  Cleaning this all
up quickly falls out of scope, so...

Patch is OK.

-- 
Pedro Alves



More information about the Gdb-patches mailing list