]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2000-03-30 Michael Snyder <msnyder@cleaver.cygnus.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 30 Mar 2000 18:54:28 +0000 (18:54 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 30 Mar 2000 18:54:28 +0000 (18:54 +0000)
        * defs.h (struct continuation_arg): make 'data' a union, to avoid
        casting problems when int and pointer are not the  same size.
        * event-top.c (command_handler): use data as a union.
        (command_line_handler_continuation): ditto.
        * infcmd.c (step_1_continuation): use data as a union.  Re-indent.
        (step_once): ditto.  (finish_command_continuation): ditto.
        (finish_command): ditto.
        * breakpoint.c (until_break_command): use data as a union.
        (until_break_command_continuation): ditto.
        * utils.c (add_intermediate_continuation): fix typo in comment.

gdb/ChangeLog
gdb/breakpoint.c
gdb/defs.h
gdb/event-top.c
gdb/infcmd.c
gdb/utils.c

index 3dd1efa68bc16397ac519bc302a5831c47ed67e7..d783c200cf1a468d9b8d6fabb8bd149546801592 100644 (file)
@@ -1,3 +1,16 @@
+2000-03-30  Michael Snyder  <msnyder@cleaver.cygnus.com>
+
+       * defs.h (struct continuation_arg): make 'data' a union, to avoid
+       casting problems when int and pointer are not the  same size.
+       * event-top.c (command_handler): use data as a union.
+       (command_line_handler_continuation): ditto.
+       * infcmd.c (step_1_continuation): use data as a union.  Re-indent.
+       (step_once): ditto.  (finish_command_continuation): ditto.
+       (finish_command): ditto.  
+       * breakpoint.c (until_break_command): use data as a union.
+       (until_break_command_continuation): ditto.
+       * utils.c (add_intermediate_continuation): fix typo in comment.
+
 Thu Mar 30 12:09:50 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * gdbarch.h, gdbarch.c: Re-indent.  Remove FIXMEs.
index 1efa23bb5aa970f5d1ac27cd7dcdf36530a082eb..89b15909a71777579acefd89e09d28a5356f7c55 100644 (file)
@@ -5708,7 +5708,7 @@ until_break_command_continuation (struct continuation_arg *arg)
 {
   struct cleanup *cleanups;
 
-  cleanups = (struct cleanup *) arg->data;
+  cleanups = (struct cleanup *) arg->data.pointer;
   do_exec_cleanups (cleanups);
 }
 
@@ -5772,8 +5772,8 @@ until_break_command (arg, from_tty)
          the exec_cleanup_chain. */
       arg1 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
-      arg1->next = NULL;
-      arg1->data = (PTR) old_chain;
+      arg1->next         = NULL;
+      arg1->data.pointer = old_chain;
 
       add_continuation (until_break_command_continuation, arg1);
     }
index 737ef1c872666283184bb08ad13321c455922899..0270ddd1d8dbb6fd1cef835ee65f33ff4c20d821 100644 (file)
@@ -650,7 +650,11 @@ extern void free_command_lines (struct command_line **);
 struct continuation_arg
   {
     struct continuation_arg *next;
-    void *data;
+    union continuation_data {
+      void *pointer;
+      int   integer;
+      long  longint;
+    } data;
   };
 
 struct continuation
index d9a0a7c0efba786c4e309dba21490e11d36a55e9..622b70f020d36e22a723645af5dd83a7c6f241d1 100644 (file)
@@ -525,8 +525,8 @@ command_handler (char *command)
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
       arg1->next = arg2;
       arg2->next = NULL;
-      arg1->data = (void *) time_at_cmd_start;
-      arg2->data = (void *) space_at_cmd_start;
+      arg1->data.integer = time_at_cmd_start;
+      arg2->data.integer = space_at_cmd_start;
       add_continuation (command_line_handler_continuation, arg1);
     }
 
@@ -572,8 +572,8 @@ command_line_handler_continuation (struct continuation_arg *arg)
   extern int display_time;
   extern int display_space;
 
-  long time_at_cmd_start = (long) arg->data;
-  long space_at_cmd_start = (long) arg->next->data;
+  long time_at_cmd_start  = arg->data.longint;
+  long space_at_cmd_start = arg->next->data.longint;
 
   bpstat_do_actions (&stop_bpstat);
   /*do_cleanups (old_chain); *//*?????FIXME????? */
index 84bc9204bbf455e7e0abbc2da864e63a63f54ad0..06439d0248d1f7bdeab36f0cb5e3f00e64f2bc56 100644 (file)
@@ -576,27 +576,27 @@ static void
 step_1_continuation (arg)
      struct continuation_arg *arg;
 {
- int count;
- int skip_subroutines;
- int single_inst;
-
skip_subroutines = (int) arg->data;
single_inst = (int) (arg->next)->data;
count = (int) ((arg->next)->next)->data;
-
- if (stop_step)
-   {
-     /* FIXME: On nexti, this may have already been done (when we hit the
-       step resume break, I think).  Probably this should be moved to
-       wait_for_inferior (near the top).  */
 int count;
 int skip_subroutines;
 int single_inst;
+
 skip_subroutines = arg->data.integer;
 single_inst      = arg->next->data.integer;
 count            = arg->next->next->data.integer;
+
 if (stop_step)
+    {
+      /* FIXME: On nexti, this may have already been done (when we hit the
+        step resume break, I think).  Probably this should be moved to
+        wait_for_inferior (near the top).  */
 #if defined (SHIFT_INST_REGS)
-     SHIFT_INST_REGS ();
+      SHIFT_INST_REGS ();
 #endif
-     step_once (skip_subroutines, single_inst, count - 1);
-   }
- else
-   if (!single_inst || skip_subroutines)
-     do_exec_cleanups (ALL_CLEANUPS);
+      step_once (skip_subroutines, single_inst, count - 1);
+    }
 else
+    if (!single_inst || skip_subroutines)
+      do_exec_cleanups (ALL_CLEANUPS);
 }
 
 /* Do just one step operation. If count >1 we will have to set up a
@@ -662,11 +662,11 @@ which has no line number information.\n", name);
       arg3 =
        (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
       arg1->next = arg2;
-      arg1->data = (PTR) skip_subroutines;
+      arg1->data.integer = skip_subroutines;
       arg2->next = arg3;
-      arg2->data = (PTR) single_inst;
+      arg2->data.integer = single_inst;
       arg3->next = NULL;
-      arg3->data = (PTR) count;
+      arg3->data.integer = count;
       add_intermediate_continuation (step_1_continuation, arg1);
       proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
     }
@@ -1108,9 +1108,9 @@ finish_command_continuation (arg)
   struct breakpoint *breakpoint;
   struct cleanup *cleanups;
 
-  breakpoint = (struct breakpoint *) arg->data;
-  function = (struct symbol *) (arg->next)->data;
-  cleanups = (struct cleanup *) (arg->next->next)->data;
+  breakpoint = (struct breakpoint *) arg->data.pointer;
+  function   = (struct symbol *)     arg->next->data.pointer;
+  cleanups   = (struct cleanup *)    arg->next->next->data.pointer;
 
   if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL
       && function != 0)
@@ -1225,9 +1225,9 @@ finish_command (arg, from_tty)
       arg1->next = arg2;
       arg2->next = arg3;
       arg3->next = NULL;
-      arg1->data = (PTR) breakpoint;
-      arg2->data = (PTR) function;
-      arg3->data = (PTR) old_chain;
+      arg1->data.pointer = breakpoint;
+      arg2->data.pointer = function;
+      arg3->data.pointer = old_chain;
       add_continuation (finish_command_continuation, arg1);
     }
 
index 824dabedad5831fcb4e8677d5382b057df6e61aa..1e081552f07dd7f156d3fffeedacd56f5b667cf2 100644 (file)
@@ -456,7 +456,7 @@ discard_all_continuations ()
     }
 }
 
-/* Add a continuation to the continuation list, the gloabl list
+/* Add a continuation to the continuation list, the global list
    intermediate_continuation. The new continuation will be added at the front.*/
 void
 add_intermediate_continuation (continuation_hook, arg_list)