Re: gdb-7.5 branch ready for first release?

Ralf Corsepius
2012-08-06T19:38:10Z

[-- Attachment #1: Type: text/plain, Size: 836 bytes --]

On 08/03/2012 03:45 PM, Joel Brobecker wrote:
> Hello,
>
> It looks like we no longer have any blocking issue with the 7.5 branch,
> so perhaps we are ready to create the first release off that branch?
>
> Please let me know if I should wait. Otherwise, I will try to create
> the release early next week.
>

I am facing various (IMO pretty serious) "cast from pointer to integer
of different size" warnings when building gdb-7.4.91 Canadian cross for
several targets (w/ simulators enabled) for mingw32-w64 hosts on Linux
build-hosts.

My personal attempt to work around these issues (so far) is the patch
below, which involves using inttypes.h and stdint.h (This is not meant
to be a proper patch submission - This is WIP).

Would such a patch be acceptable or is using inttypes.h/stdint.h being
considered a "no-go"?

Ralf

[-- Attachment #2: gdb.diff --]
[-- Type: text/x-patch, Size: 8353 bytes --]

diff --git a/gdb/symfile.c b/gdb/symfile.c
index 01252e2..01720fa 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -2889,8 +2889,8 @@ allocate_symtab (const char *filename, struct objfile *objfile)
last_objfile_name);
}
fprintf_unfiltered (gdb_stdlog,
- "Created symtab 0x%lx for module %s.\n",
- (long) symtab, filename);
+ "Created symtab 0x%p for module %s.\n",
+ symtab, filename);
}

return (symtab);
diff --git a/sim/common/sim-events.c b/sim/common/sim-events.c
index 4e06a2c..da91e14 100644
--- a/sim/common/sim-events.c
+++ b/sim/common/sim-events.c
@@ -38,6 +38,8 @@
#include <stdlib.h>
#endif

+#include <inttypes.h>
+
#include <signal.h> /* For SIGPROCMASK et al. */

typedef enum {
@@ -418,14 +420,14 @@ update_time_from_event (SIM_DESC sd)
event = event->next, i++)
{
ETRACE ((_ETRACE,
- "event time-from-event - time %ld, delta %ld - event %d, tag 0x%lx, time %ld, handler 0x%lx, data 0x%lx%s%s\n",
- (long)current_time,
- (long)events->time_from_event,
+ "event time-from-event - time %" PRId64 ", delta %" PRId64 " - event %d, tag 0x%p, time %" PRId64 ", handler 0x%p, data 0x%p%s%s\n",
+ current_time,
+ events->time_from_event,
i,
- (long)event,
- (long)event->time_of_event,
- (long)event->handler,
- (long)event->data,
+ event,
+ event->time_of_event,
+ event->handler,
+ event->data,
(event->trace != NULL) ? ", " : "",
(event->trace != NULL) ? event->trace : ""));
}
@@ -525,12 +527,12 @@ sim_events_schedule_vtracef (SIM_DESC sd,
new_event->trace = NULL;
insert_sim_event (sd, new_event, delta_time);
ETRACE ((_ETRACE,
- "event scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx%s%s\n",
+ "event scheduled at %ld - tag 0x%p - time %ld, handler 0x%p, data 0x%p%s%s\n",
(long)sim_events_time (sd),
- (long)new_event,
+ new_event,
(long)new_event->time_of_event,
- (long)new_event->handler,
- (long)new_event->data,
+ new_event->handler,
+ new_event->data,
(new_event->trace != NULL) ? ", " : "",
(new_event->trace != NULL) ? new_event->trace : ""));
return new_event;
@@ -577,12 +579,12 @@ sim_events_schedule_after_signal (SIM_DESC sd,
#endif

ETRACE ((_ETRACE,
- "signal scheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx\n",
- (long)sim_events_time (sd),
- (long)new_event,
- (long)new_event->time_of_event,
- (long)new_event->handler,
- (long)new_event->data));
+ "signal scheduled at %" PRId64 " - tag 0x%p - time %" PRId64 ", handler 0x%p, data 0x%p\n",
+ sim_events_time (sd),
+ new_event,
+ new_event->time_of_event,
+ new_event->handler,
+ new_event->data));
}
#endif

@@ -613,12 +615,12 @@ sim_events_watch_clock (SIM_DESC sd,
events->watchpoints = new_event;
events->work_pending = 1;
ETRACE ((_ETRACE,
- "event watching clock at %ld - tag 0x%lx - wallclock %ld, handler 0x%lx, data 0x%lx\n",
- (long)sim_events_time (sd),
- (long)new_event,
- (long)new_event->wallclock,
- (long)new_event->handler,
- (long)new_event->data));
+ "event watching clock at %" PRId64 " - tag 0x%p - wallclock %d, handler 0x%p, data 0x%p\n",
+ sim_events_time (sd),
+ new_event,
+ new_event->wallclock,
+ new_event->handler,
+ new_event->data));
return new_event;
}
#endif
@@ -689,14 +691,14 @@ sim_events_watch_sim (SIM_DESC sd,
events->watchpoints = new_event;
events->work_pending = 1;
ETRACE ((_ETRACE,
- "event watching host at %ld - tag 0x%lx - host-addr 0x%lx, 0x%lx..0x%lx, handler 0x%lx, data 0x%lx\n",
- (long)sim_events_time (sd),
- (long)new_event,
- (long)new_event->host_addr,
- (long)new_event->lb,
- (long)new_event->ub,
- (long)new_event->handler,
- (long)new_event->data));
+ "event watching host at %" PRId64 " - tag 0x%p - host-addr 0x%p, 0x%x..0x%x, handler 0x%p, data 0x%p\n",
+ sim_events_time (sd),
+ new_event,
+ new_event->host_addr,
+ new_event->lb,
+ new_event->ub,
+ new_event->handler,
+ new_event->data));
return new_event;
}
#endif
@@ -769,14 +771,14 @@ sim_events_watch_core (SIM_DESC sd,
events->watchpoints = new_event;
events->work_pending = 1;
ETRACE ((_ETRACE,
- "event watching host at %ld - tag 0x%lx - host-addr 0x%lx, 0x%lx..0x%lx, handler 0x%lx, data 0x%lx\n",
- (long)sim_events_time (sd),
- (long)new_event,
- (long)new_event->host_addr,
- (long)new_event->lb,
- (long)new_event->ub,
- (long)new_event->handler,
- (long)new_event->data));
+ "event watching host at %" PRId64 " - tag 0x%p - host-addr 0x%p, 0x%x..0x%x, handler 0x%p, data 0x%p\n",
+ sim_events_time (sd),
+ new_event,
+ new_event->host_addr,
+ new_event->lb,
+ new_event->ub,
+ new_event->handler,
+ new_event->data));
return new_event;
}
#endif
@@ -803,12 +805,12 @@ sim_events_deschedule (SIM_DESC sd,
sim_event *dead = *ptr_to_current;
*ptr_to_current = dead->next;
ETRACE ((_ETRACE,
- "event/watch descheduled at %ld - tag 0x%lx - time %ld, handler 0x%lx, data 0x%lx%s%s\n",
- (long) sim_events_time (sd),
- (long) event_to_remove,
- (long) dead->time_of_event,
- (long) dead->handler,
- (long) dead->data,
+ "event/watch descheduled at %" PRId64 " - tag 0x%p - time %" PRId64 ", handler 0x%p, data 0x%p%s%s\n",
+ sim_events_time (sd),
+ event_to_remove,
+ dead->time_of_event,
+ dead->handler,
+ dead->data,
(dead->trace != NULL) ? ", " : "",
(dead->trace != NULL) ? dead->trace : ""));
sim_events_free (sd, dead);
@@ -819,9 +821,9 @@ sim_events_deschedule (SIM_DESC sd,
}
}
ETRACE ((_ETRACE,
- "event/watch descheduled at %ld - tag 0x%lx - not found\n",
- (long) sim_events_time (sd),
- (long) event_to_remove));
+ "event/watch descheduled at %" PRId64 " - tag 0x%p - not found\n",
+ sim_events_time (sd),
+ event_to_remove));
}
#endif

@@ -1146,11 +1148,11 @@ sim_events_process (SIM_DESC sd)
sim_event_handler *handler = to_do->handler;
void *data = to_do->data;
ETRACE ((_ETRACE,
- "event issued at %ld - tag 0x%lx - handler 0x%lx, data 0x%lx%s%s\n",
- (long) event_time,
- (long) to_do,
- (long) handler,
- (long) data,
+ "event issued at %" PRId64 " - tag 0x%p - handler 0x%p, data 0x%p%s%s\n",
+ event_time,
+ to_do,
+ handler,
+ data,
(to_do->trace != NULL) ? ", " : "",
(to_do->trace != NULL) ? to_do->trace : ""));
sim_events_free (sd, to_do);
@@ -1174,11 +1176,11 @@ sim_events_process (SIM_DESC sd)
events->queue = to_do->next;
update_time_from_event (sd);
ETRACE ((_ETRACE,
- "event issued at %ld - tag 0x%lx - handler 0x%lx, data 0x%lx%s%s\n",
- (long) event_time,
- (long) to_do,
- (long) handler,
- (long) data,
+ "event issued at %" PRId64 " - tag 0x%p - handler 0x%p, data 0x%p%s%s\n",
+ event_time,
+ to_do,
+ handler,
+ data,
(to_do->trace != NULL) ? ", " : "",
(to_do->trace != NULL) ? to_do->trace : ""));
sim_events_free (sd, to_do);
diff --git a/sim/ppc/hw_glue.c b/sim/ppc/hw_glue.c
index d7ad929..aff7dd6 100644
--- a/sim/ppc/hw_glue.c
+++ b/sim/ppc/hw_glue.c
@@ -194,13 +194,13 @@ hw_glue_init_address(device *me)
if (glue->sizeof_output == 0)
device_error(me, "at least one reg property size must be nonzero");
if (glue->sizeof_output % sizeof(unsigned_word) != 0)
- device_error(me, "reg property size must be %d aligned", sizeof(unsigned_word));
+ device_error(me, "reg property size must be %zd aligned", sizeof(unsigned_word));
/* and the address */
device_address_to_attach_address(device_parent(me),
&unit.address, &glue->space, &glue->address,
me);
if (glue->address % (sizeof(unsigned_word) * max_nr_interrupts) != 0)
- device_error(me, "reg property address must be %d aligned",
+ device_error(me, "reg property address must be %zd aligned",
sizeof(unsigned_word) * max_nr_interrupts);
glue->nr_outputs = glue->sizeof_output / sizeof(unsigned_word);
glue->output = zalloc(glue->sizeof_output);