From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA 5/5] New patches to support --enable-targets=all for mingw64
Date: Fri, 10 Sep 2010 15:43:00 -0000 [thread overview]
Message-ID: <004201cb50f2$18d8f310$4a8ad930$@muller@ics-cnrs.unistra.fr> (raw)
I tried to compile GDB with
--enable-targets=all for x86_64-w64-mingw32
target.
As 'long' type is 4-byte while pointer type is 8-byte,
this target is quite sensitive to so 'dirty' code
lying around like casting 'long' or 'unsigned long' to pointers...
I had to fix several sources to be able to
successfully compile GDB with those configuration options.
5) solib-som.c is a tdep file (it is listed in ALL_TARGET_OBS)
but it tries to get the hpux system version trough
a direct system call, which probably leads to wrong results
on other systems too.
If you compile using --enable-targets=all on linux,
the compilation will complete because sys/utsname.h
is available on linux, but if you remote debug a HPUX
program, the current version of get_hpux_major_release
will return a number related to the current Linux system
you are running GDB on... which is totally useless.
A proper fix would be to get this information via a remote
packet if not native... but I have no access nor time to spend
on that.
Pierre Muller
Pascal language support maintainer for GDB
2010-09-10 Pierre Muller <muller@ics.u-strasbg.fr>
* solib-som.c (sys/utsname.h include): Only include on HPUX system.
(get_hpux_major_release): Return 0 if not on HPUX system.
Index: src/gdb/solib-som.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-som.c,v
retrieving revision 1.29
diff -u -p -r1.29 solib-som.c
--- src/gdb/solib-som.c 16 May 2010 23:49:58 -0000 1.29
+++ src/gdb/solib-som.c 9 Sep 2010 16:39:59 -0000
@@ -32,7 +32,9 @@
#include "solib.h"
#include "solib-som.h"
+#ifdef __hpux
#include <sys/utsname.h>
+#endif
#include <string.h>
#undef SOLIB_SOM_DBG
@@ -137,7 +139,7 @@ static int
get_hpux_major_release (void)
{
static int hpux_major_release = -1;
-
+#ifdef __hpux
if (hpux_major_release == -1)
{
struct utsname x;
@@ -147,7 +149,9 @@ get_hpux_major_release (void)
p = strchr (x.release, '.');
hpux_major_release = p ? atoi (p + 1) : 0;
}
-
+#else
+ hpux_major_release = 0;
+#endif
return hpux_major_release;
}
next reply other threads:[~2010-09-10 14:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 15:43 Pierre Muller [this message]
2010-09-13 19:14 ` Joel Brobecker
2010-09-14 11:44 ` Pierre Muller
2010-09-14 15:24 ` [RFC] hpux code fix ( was [RFA 5/5] New patches to support --enable-targets=all for mingw64) Pierre Muller
2010-09-27 17:34 ` [PING][RFC] " Pierre Muller
2010-09-27 17:43 ` Pedro Alves
2010-09-14 19:39 ` [RFA 5/5] New patches to support --enable-targets=all for mingw64 Joel Brobecker
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='004201cb50f2$18d8f310$4a8ad930$@muller@ics-cnrs.unistra.fr' \
--to=pierre.muller@ics-cnrs.unistra.fr \
--cc=gdb-patches@sourceware.org \
/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