From: Andris Pavenis <andris@stargate.astr.lu.lv>
To: gdb-patches@cygnus.com
Subject: No Subject
Date: Thu, 01 Apr 1999 00:00:00 -0000 [thread overview]
Message-ID: <99030817102600.14026@hal> (raw)
Message-ID: <19990401000000.0sMK8ACPfMjfn1atzpLdpCCrs9u-I7uPXyQoRinlNVI@z> (raw)
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.
An alternative idea could be duplicating init code and global vrariables in
rhide.
Andris
--- main.c~1 Wed Feb 24 22:55:05 1999
+++ main.c Mon Mar 8 16:38:44 1999
@@ -54,18 +54,6 @@
int display_space;
-/* Whether this is the command line version or not */
-int tui_version = 0;
-
-/* Whether xdb commands will be handled */
-int xdb_commands = 0;
-
-/* Whether dbx commands will be handled */
-int dbx_commands = 0;
-
-GDB_FILE *gdb_stdout;
-GDB_FILE *gdb_stderr;
-
/* Whether to enable writing into executable and core files */
extern int write_files;
@@ -161,20 +149,6 @@
getcwd (gdb_dirbuf, sizeof (gdb_dirbuf));
current_directory = gdb_dirbuf;
-
- gdb_file_size = sizeof(GDB_FILE);
-
- gdb_stdout = (GDB_FILE *)xmalloc (gdb_file_size);
- gdb_stdout->ts_streamtype = afile;
- gdb_stdout->ts_filestream = stdout;
- gdb_stdout->ts_strbuf = NULL;
- gdb_stdout->ts_buflen = 0;
-
- gdb_stderr = (GDB_FILE *)xmalloc (gdb_file_size);
- gdb_stderr->ts_streamtype = afile;
- gdb_stderr->ts_filestream = stderr;
- gdb_stderr->ts_strbuf = NULL;
- gdb_stderr->ts_buflen = 0;
/* Parse arguments and options. */
{
--- top.c~1 Fri Jan 29 11:46:03 1999
+++ top.c Mon Mar 8 16:37:03 1999
@@ -53,6 +53,19 @@
extern void initialize_utils PARAMS ((void));
+
+/* Whether this is the command line version or not */
+int tui_version = 0;
+
+/* Whether xdb commands will be handled */
+int xdb_commands = 0;
+
+/* Whether dbx commands will be handled */
+int dbx_commands = 0;
+
+GDB_FILE *gdb_stdout;
+GDB_FILE *gdb_stderr;
+
/* Prototypes for local functions */
static void dont_repeat_command PARAMS ((char *, int));
@@ -467,6 +480,28 @@
SIGJMP_BUF error_return;
/* Where to go for return_to_top_level (RETURN_QUIT). */
SIGJMP_BUF quit_return;
+
+
+
+void __attribute__((constructor))
+_init_gdb_stdio (void)
+{
+ int gdb_file_size;
+ gdb_file_size = sizeof(GDB_FILE);
+
+ gdb_stdout = (GDB_FILE *)xmalloc (gdb_file_size);
+ gdb_stdout->ts_streamtype = afile;
+ gdb_stdout->ts_filestream = stdout;
+ gdb_stdout->ts_strbuf = NULL;
+ gdb_stdout->ts_buflen = 0;
+
+ gdb_stderr = (GDB_FILE *)xmalloc (gdb_file_size);
+ gdb_stderr->ts_streamtype = afile;
+ gdb_stderr->ts_filestream = stderr;
+ gdb_stderr->ts_strbuf = NULL;
+ gdb_stderr->ts_buflen = 0;
+}
+
/* Return for reason REASON. This generally gets back to the command
loop, but can be caught via catch_errors. */
next reply other threads:[~1999-04-01 0:00 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-08 7:10 Andris Pavenis [this message]
1999-03-08 11:15 ` none Jim Blandy
1999-04-01 0:00 ` 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
[not found] ` <99031011141900.03735.cygnus.patches.gdb@hal>
1999-03-10 16:31 ` libgdb.a Andrew Cagney
1999-04-01 0:00 ` libgdb.a Andrew Cagney
1999-04-01 0:00 ` libgdb.a Andris Pavenis
1999-03-11 0:27 ` libgdb.a Andris Pavenis
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 ` libgdb.a J.T. Conklin
1999-03-11 14:29 ` libgdb.a J.T. Conklin
1999-04-01 0:00 ` No Subject Andris Pavenis
1999-04-01 0:00 ` libgdb.a Andris Pavenis
1999-03-10 1:14 ` libgdb.a Andris Pavenis
-- strict thread matches above, loose matches on Subject: below --
1998-04-06 4:43 No Subject Philippe De Muyter
1998-04-06 14:16 ` Stan Shebs
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=99030817102600.14026@hal \
--to=andris@stargate.astr.lu.lv \
--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