This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]