From: Andris Pavenis <andris@stargate.astr.lu.lv>
To: Andrew Cagney <ac131313@cygnus.com>, gdb-patches@cygnus.com
Subject: Re: libgdb.a
Date: Thu, 01 Apr 1999 00:00:00 -0000 [thread overview]
Message-ID: <99031110271800.05108@hal> (raw)
In-Reply-To: <36E70EE3.3D0937F1@cygnus.com>
On Thu, 11 Mar 1999, Andrew Cagney wrote:
>Andris Pavenis wrote:
>
>> 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).
>
>This has been discussed before (but on another list) and on the last occasion it
>was actually me suggested something along similar lines to your proposal. I lost
>the the discussion :-)
>
>The consensus was that if GDB started down the path of having two initialization
>levels it could quickly find itself heading for a situtation where there were N
>initialization levels and a really confused startup sequence. It was thought that,
>if anything, we should be trying to discourage additional complexity being
>introduced during startup.
>
>As an example, consider the idea (that was recently floated) of GDB suporting
>several target-architectures. Instead of fully initializing the code for all the
>target-architectures during startup, it would probably be more prudent to leave
>most of that task until the point where GDB knew exactly which architecture was
>being debugged.
>
Yes I agree that introducing more initialization levels maybe not acceptable.
Anyway if we should change interface for libgdb.a then it's best do
do it now in such way we probably won't need to do it again soon (Introducing
typedef GDB_FILE is already such change) . I suggest follwing:
1) move definitions of such variables to separate file out of main.c
2) move initialization of these variables to the same file and create
procedure that initializes tham.
3) call this newly introduced procedure from very begin of main
As the result we'll be able to place newly introduced file in libgdb.a. Perhaps
it would be best to add some C preprocessor macro so programs that uses
libgdb.a could found that at compile time.
So we could move such initialization to a separate file that could be included
in libgdb.a. Of course programs that uses libgdb.a will have to call init
function at first.
Andris
PS. I'm not subscribed to this list. So please CC: answer to me
WARNING: multiple messages have this Message-ID
From: Andris Pavenis <andris@stargate.astr.lu.lv>
To: Andrew Cagney <ac131313@cygnus.com>, gdb-patches@cygnus.com
Subject: Re: libgdb.a
Date: Thu, 11 Mar 1999 00:27:00 -0000 [thread overview]
Message-ID: <99031110271800.05108@hal> (raw)
Message-ID: <19990311002700.WRroBiq_1MIVfzAlC8DZhpEKsAC_VYsCizRzP6eOiIY@z> (raw)
In-Reply-To: <36E70EE3.3D0937F1@cygnus.com>
On Thu, 11 Mar 1999, Andrew Cagney wrote:
>Andris Pavenis wrote:
>
>> 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).
>
>This has been discussed before (but on another list) and on the last occasion it
>was actually me suggested something along similar lines to your proposal. I lost
>the the discussion :-)
>
>The consensus was that if GDB started down the path of having two initialization
>levels it could quickly find itself heading for a situtation where there were N
>initialization levels and a really confused startup sequence. It was thought that,
>if anything, we should be trying to discourage additional complexity being
>introduced during startup.
>
>As an example, consider the idea (that was recently floated) of GDB suporting
>several target-architectures. Instead of fully initializing the code for all the
>target-architectures during startup, it would probably be more prudent to leave
>most of that task until the point where GDB knew exactly which architecture was
>being debugged.
>
Yes I agree that introducing more initialization levels maybe not acceptable.
Anyway if we should change interface for libgdb.a then it's best do
do it now in such way we probably won't need to do it again soon (Introducing
typedef GDB_FILE is already such change) . I suggest follwing:
1) move definitions of such variables to separate file out of main.c
2) move initialization of these variables to the same file and create
procedure that initializes tham.
3) call this newly introduced procedure from very begin of main
As the result we'll be able to place newly introduced file in libgdb.a. Perhaps
it would be best to add some C preprocessor macro so programs that uses
libgdb.a could found that at compile time.
So we could move such initialization to a separate file that could be included
in libgdb.a. Of course programs that uses libgdb.a will have to call init
function at first.
Andris
PS. I'm not subscribed to this list. So please CC: answer to me
next prev parent reply other threads:[~1999-04-01 0:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-08 7:10 No Subject Andris Pavenis
1999-03-08 11:15 ` none Jim Blandy
1999-04-01 0:00 ` libgdb (was none) Robert Hoehne
1999-03-08 14:31 ` Robert Hoehne
1999-04-01 0:00 ` Stan Shebs
1999-03-10 15:39 ` Stan Shebs
1999-03-10 16:29 ` Todd Whitesel
1999-04-01 0:00 ` Todd Whitesel
1999-03-14 4:18 ` Robert Hoehne
1999-04-01 0:00 ` Robert Hoehne
1999-04-01 0:00 ` DJGPP support (was libgdb) Stan Shebs
1999-03-14 14:41 ` Stan Shebs
1999-04-01 0:00 ` none Stan Shebs
1999-03-08 13:09 ` none Stan Shebs
1999-03-09 12:54 ` none Robert Hoehne
1999-04-01 0:00 ` none Robert Hoehne
1999-04-01 0:00 ` none Jim Blandy
[not found] ` <99031011141900.03735.cygnus.patches.gdb@hal>
1999-03-10 16:31 ` libgdb.a Andrew Cagney
1999-04-01 0:00 ` libgdb.a Todd Whitesel
1999-03-10 16:56 ` libgdb.a Todd Whitesel
1999-03-11 12:40 ` libgdb.a Stan Shebs
1999-04-01 0:00 ` libgdb.a Stan Shebs
1999-04-01 0:00 ` Andris Pavenis [this message]
1999-03-11 0:27 ` libgdb.a Andris Pavenis
1999-04-01 0:00 ` libgdb.a Andrew Cagney
1999-04-01 0:00 ` libgdb.a J.T. Conklin
1999-03-11 14:29 ` libgdb.a J.T. Conklin
1999-04-01 0:00 ` libgdb.a Andris Pavenis
1999-03-10 1:14 ` libgdb.a Andris Pavenis
1999-04-01 0:00 ` No Subject Andris Pavenis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=99031110271800.05108@hal \
--to=andris@stargate.astr.lu.lv \
--cc=ac131313@cygnus.com \
--cc=gdb-patches@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox