This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] event-top.c: compile w/o sbrk()
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 20 Jun 2002 20:13:31 -0400
- Subject: [PATCH] event-top.c: compile w/o sbrk()
As reported in http://sources.redhat.com/ml/gdb/2002-06/msg00153.html
event-top.c fails to compile if the host system doesn't have sbrk().
This patch fixes the problem, and corrects an assignment.
I've committed this to the 5.2 branch as well, per Andrew's suggestion.
Elena
2002-06-20 Elena Zannoni <ezannoni@redhat.com>
* event-top.c (command_handler): Don't use space_at_cmd_start
unless there is sbrk() on the host. Assign time and space data
to union fields of the appropriate length.
Index: event-top.c
===================================================================
RCS file: /cvs/uberbaum/gdb/event-top.c,v
retrieving revision 1.20
diff -u -p -r1.20 event-top.c
--- event-top.c 27 Mar 2002 21:20:15 -0000 1.20
+++ event-top.c 21 Jun 2002 00:04:24 -0000
@@ -514,8 +514,10 @@ command_handler (char *command)
(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
arg1->next = arg2;
arg2->next = NULL;
- arg1->data.integer = time_at_cmd_start;
- arg2->data.integer = space_at_cmd_start;
+ arg1->data.longint = time_at_cmd_start;
+#ifdef HAVE_SBRK
+ arg2->data.longint = space_at_cmd_start;
+#endif
add_continuation (command_line_handler_continuation, arg1);
}