This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[ob] (void*) (long) rather than (void*) (int)
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 24 Feb 2003 19:00:09 -0500
- Subject: [ob] (void*) (long) rather than (void*) (int)
Hello,
An x86-64 gcc was complaining about a construct roughly equivalent to:
int foo;
void *bar = (void*)foo;
problem is, sizeof(int) probably isn't sizeof(void*). This tweaks
things to use a `long' (tradition has it that sizeof (long) == sizeof
(void*)).
committed,
Andrew
2003-02-24 Andrew Cagney <cagney at redhat dot com>
* infptrace.c (udot_info): Change type of udot_off to long. Use
paddr when printing udot_off's value.
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.22
diff -u -r1.22 infptrace.c
--- infptrace.c 8 Nov 2002 23:48:38 -0000 1.22
+++ infptrace.c 24 Feb 2003 23:53:05 -0000
@@ -629,7 +629,7 @@
udot_info (char *dummy1, int dummy2)
{
#if defined (KERNEL_U_SIZE)
- int udot_off; /* Offset into user struct */
+ long udot_off; /* Offset into user struct */
int udot_val; /* Value from user struct at udot_off */
char mess[128]; /* For messages */
#endif
@@ -657,12 +657,13 @@
{
printf_filtered ("\n");
}
- printf_filtered ("%04x:", udot_off);
+ printf_filtered ("%s:", paddr (udot_off));
}
udot_val = ptrace (PT_READ_U, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) udot_off, 0);
if (errno != 0)
{
- sprintf (mess, "\nreading user struct at offset 0x%x", udot_off);
+ sprintf (mess, "\nreading user struct at offset 0x%s",
+ paddr_nz (udot_off));
perror_with_name (mess);
}
/* Avoid using nonportable (?) "*" in print specs */