summaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-07-12 19:07:38 +0000
committerPedro Alves <pedro@codesourcery.com>2008-07-12 19:07:38 +0000
commit80c78add4d9210932d785257a3b591a7b228161e (patch)
treeea83ba38c7530ba25cd0d243991f3dcba4d2b3c1 /gdb/breakpoint.c
parent845ccc5358e2c91c3a68f54ae79f6dc71ea815b3 (diff)
downloadgdb-80c78add4d9210932d785257a3b591a7b228161e.tar.gz
Replace struct continuation_args by void* and per command structs.
* top.c (execute_command): Remove unused arg1 and arg2 locals. * breakpoint.c (struct until_break_command_continuation_args): New. (until_break_command_continuation): Take a void* instead of a continuations_arg. Adjust. (until_break_command): Adjust to use struct until_break_command_continuation_args instead of struct continuation_arg. * infcmd.c (struct step_1_continuation_args): New. (step_1_continuation): Take a void* instead of a continuations_arg. Adjust to use struct step_1_continuation_args. (step_once): Adjust to use struct step_1_continuation_args. (struct finish_command_continuation_args): New. (finish_command_continuation): Take a void* instead of a continuations_arg. Adjust to use struct finish_command_continuation_args. (finish_command): Adjust to use struct finish_command_continuation_args. (struct attach_command_continuation_args): New. (attach_command_continuation): Take a void* instead of a continuations_arg. Adjust to use struct attach_command_continuation_args. (attach_command): Adjust to use struct attach_command_continuation_args. * defs.h (struct continuation_arg): Delete. (struct continuation): Replace the struct continuation_arg* parameter of continuation_hook by a void*. Replace "arg_list" member by a new "args" member with void* type. (add_continuation, add_intermediate_continuation): Replace struct continuation_arg type usages by void* usages. * utils.c (add_continuation, do_all_continuations) (add_intermediate_continuation) (do_all_intermediate_continuations): Replace struct continuation_arg type usages by void* usages. Pass "args" instead of "arg_list".
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index ed99ca7778a..ecef7fd5945 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -62,8 +62,7 @@
/* Prototypes for local functions. */
-static void until_break_command_continuation (struct continuation_arg *arg,
- int error);
+static void until_break_command_continuation (void *arg, int error);
static void catch_command_1 (char *, int, int);
@@ -6151,16 +6150,24 @@ awatch_command (char *arg, int from_tty)
/* Helper routines for the until_command routine in infcmd.c. Here
because it uses the mechanisms of breakpoints. */
+struct until_break_command_continuation_args
+{
+ struct breakpoint *breakpoint;
+ struct breakpoint *breakpoint2;
+};
+
/* This function is called by fetch_inferior_event via the
cmd_continuation pointer, to complete the until command. It takes
care of cleaning up the temporary breakpoints set up by the until
command. */
static void
-until_break_command_continuation (struct continuation_arg *arg, int error)
+until_break_command_continuation (void *arg, int error)
{
- delete_breakpoint ((struct breakpoint *)(arg->data.pointer));
- if (arg->next)
- delete_breakpoint ((struct breakpoint *)(arg->next->data.pointer));
+ struct until_break_command_continuation_args *a = arg;
+
+ delete_breakpoint (a->breakpoint);
+ if (a->breakpoint2)
+ delete_breakpoint (a->breakpoint2);
}
void
@@ -6173,9 +6180,6 @@ until_break_command (char *arg, int from_tty, int anywhere)
struct breakpoint *breakpoint;
struct breakpoint *breakpoint2 = NULL;
struct cleanup *old_chain;
- struct continuation_arg *arg1;
- struct continuation_arg *arg2;
-
clear_proceed_status ();
@@ -6232,22 +6236,14 @@ until_break_command (char *arg, int from_tty, int anywhere)
if (target_can_async_p () && is_running (inferior_ptid))
{
- arg1 =
- (struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));
- arg1->next = NULL;
- arg1->data.pointer = breakpoint;
+ struct until_break_command_continuation_args *args;
+ args = xmalloc (sizeof (*args));
- if (breakpoint2)
- {
- arg2 = (struct continuation_arg *)
- xmalloc ( sizeof (struct continuation_arg));
- arg2->next = NULL;
- arg2->data.pointer = breakpoint2;
- arg1->next = arg2;
- }
+ args->breakpoint = breakpoint;
+ args->breakpoint2 = breakpoint2;
discard_cleanups (old_chain);
- add_continuation (until_break_command_continuation, arg1);
+ add_continuation (until_break_command_continuation, args);
}
else
do_cleanups (old_chain);