This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[COMMIT] Fix --enable-64-bit-bfd compilation warnings on *BSD
- From: Mark Kettenis <kettenis at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 19 Nov 2004 22:57:39 +0100 (CET)
- Subject: [COMMIT] Fix --enable-64-bit-bfd compilation warnings on *BSD
Some native code assumed that sizeof(CORE_ADDR) == sizeof(void *).
This isn't true on 32-bit systems if you compile with
--enable-64-bit-bfd. Fixed by the attached patch.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* bsd-kvm.c (bsd_kvm_pcb_cmd): Cast return value from
parse_and_eval_address to u_long before converting it to a pointer
type.
* i386fbsd-nat.c (_initialize_i386fbsd_nat): Change type of
ps_strings from int to u_long.
* i386obsd-nat.c (_initialize_i386obsd_nat): Cast _ps.val to
u_long instead of CORE_ADDR.
Index: bsd-kvm.c
===================================================================
RCS file: /cvs/src/src/gdb/bsd-kvm.c,v
retrieving revision 1.9
diff -u -p -r1.9 bsd-kvm.c
--- bsd-kvm.c 29 Oct 2004 20:23:05 -0000 1.9
+++ bsd-kvm.c 19 Nov 2004 21:51:32 -0000
@@ -259,7 +259,7 @@ bsd_kvm_pcb_cmd (char *arg, int fromtty)
if (core_kd == NULL)
error ("No kernel memory image.");
- bsd_kvm_paddr = (struct pcb *) parse_and_eval_address (arg);
+ bsd_kvm_paddr = (struct pcb *)(u_long) parse_and_eval_address (arg);
target_fetch_registers (-1);
Index: i386fbsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386fbsd-nat.c,v
retrieving revision 1.8
diff -u -p -r1.8 i386fbsd-nat.c
--- i386fbsd-nat.c 26 Sep 2004 19:44:50 -0000 1.8
+++ i386fbsd-nat.c 19 Nov 2004 21:51:32 -0000
@@ -143,7 +143,7 @@ _initialize_i386fbsd_nat (void)
#ifdef KERN_PS_STRINGS
{
int mib[2];
- int ps_strings;
+ u_long ps_strings;
size_t len;
mib[0] = CTL_KERN;
Index: i386obsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386obsd-nat.c,v
retrieving revision 1.5
diff -u -p -r1.5 i386obsd-nat.c
--- i386obsd-nat.c 22 Feb 2004 11:19:15 -0000 1.5
+++ i386obsd-nat.c 19 Nov 2004 21:51:32 -0000
@@ -52,8 +52,8 @@ _initialize_i386obsd_nat (void)
len = sizeof (_ps);
if (sysctl (mib, 2, &_ps, &len, NULL, 0) == 0)
{
- i386obsd_sigtramp_start_addr = (CORE_ADDR)_ps.val - 128;
- i386obsd_sigtramp_end_addr = (CORE_ADDR)_ps.val;
+ i386obsd_sigtramp_start_addr = (u_long) _ps.val - 128;
+ i386obsd_sigtramp_end_addr = (u_long) _ps.val;
}
}
#endif