This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Problem] gnu-v3 abi loaded wronly.


On Wed, Sep 18, 2002 at 12:00:22PM +0200, Pierre Muller wrote:
> 
> 
>    The code for loading gnu-v3-abi is symply to
> look if there is a minimal symbol starting with 
>   _Z
> underscore followed by a capital Z:
> 
> Why is this test so imprecise?
> To what symbol generated by GCC
> v3 does it correspond?
> Why is it not a full name test?
> 
> Currently this creates a problem for me when
> I mix GCC 2.95.X code with Free Pascal generated
> code on linux, because Free Pascal defines
> a minimal symbol _ZONE_NAMES
> that is recognized as a GCC v3 marker...
> 
> if you create a c code with a static variable 
> called _Zzzz
> you will probably get the same error...
> 
> I consider this to be a bug in GDB, but 
> I would like to get the arguments of the 
> interested people.

Every mangled name in v3 starts with _Z.  We've always held that if you
use names in the reserved namespace for your own functions, you get
what you deserve - but we hadn't thought any other compilers used this
namespace...

We could require that the first _Z symbol be a valid mangled C++ name.
That would sometimes break the test in the other direction if you had
v3 code linked with Free Pascal code.  Does Free Pascal define a large
number of symbols starting with _Z, or just the one?  If it's just the
one we can fix this by checking all _Z symbols until we find one that
is v3 mangled.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]