diff options
author | Pedro Alves <palves@redhat.com> | 2008-07-12 19:07:38 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-07-12 19:07:38 +0000 |
commit | bfec99b27cdfd81789214ba9e7b648c9d0dccb77 (patch) | |
tree | 6c9770b500b23109a20f2605099ab27f311e5c2a /gdb/breakpoint.c | |
parent | 2afb61aa0b5671f860be9d5185ae1c53abb2aa07 (diff) | |
download | gdb-bfec99b27cdfd81789214ba9e7b648c9d0dccb77.zip gdb-bfec99b27cdfd81789214ba9e7b648c9d0dccb77.tar.gz gdb-bfec99b27cdfd81789214ba9e7b648c9d0dccb77.tar.bz2 |
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.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index ed99ca7..ecef7fd 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); |