This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

Re: libgdb.a


On Mon, 08 Mar 1999, Andris Pavenis wrote:
>Hi!
>
>Tried gdb-4.17.85 on i586-pc-linux-gnu (with glibc-2.1) and met following
>problem that was no with gdb-4.17:
>
>Some global symbols are defined in gdb/main.c (eg. gdb_stdout,
>gdb-stderr, etc). As the result if I'm building all except main.c in
>object library to use with some IDE that uses gdb for debugging 
>(rhide-1.4.7),  I'm getting unresolved references. 
>
>So I'm suggesting rather ugly hack (moving these definitions to top.c
>and puting there static constructor that initializes gdb_std*). I agree does
>not look nice, but I'm sending it only to point to possible problem.
>I cannot use _initialize_* here as files must be defined before running
>all _initialize_* procedures.
>

Maybe it would be usefull to implement init functions of higher priority that
are executed before ones which names begins with _initialize_. 
So we would be able to avoid gcc related extensions such as 
__attribute__((constructor)). 

For that we should use a different name prefix (eg. _preinit_ or something like)
and require that these functions are independent one from another one (should
not use results of other similar init functions).

Andris

Please send answers also to me as I'm not subscribed to gdb-patches