summaryrefslogtreecommitdiff
path: root/gdb/defs.h
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-07-12 19:25:42 +0000
committerPedro Alves <pedro@codesourcery.com>2008-07-12 19:25:42 +0000
commit25689c9841bbf78589d6e3d014d1c018200c8a20 (patch)
treeb3029e8dc0b6fc8af9c7ae82af059001e22cf97e /gdb/defs.h
parent80c78add4d9210932d785257a3b591a7b228161e (diff)
downloadgdb-25689c9841bbf78589d6e3d014d1c018200c8a20.tar.gz
2008-07-12 Pedro Alves <pedro@codesourcery.com>
Rewrite continuations internals on top of cleanups and plug continuation arguments leaks. * defs.h (struct continuation): Make it opaque. (add_continuation, add_intermediate_continuation): Drop the int argument of the continuation hook argument. Add continuation_free_args argument. (do_all_continuations, do_all_intermediate_continuations): Drop the error_p argument. * utils.c (add_continuation): Drop the int argument of the continuation hook argument. Add continuation_free_args argument. Reimplement on top of cleanups. (do_all_continuations): Drop error argument. Reimplement on top of cleanups. (discard_all_continuations): Reimplement on top of cleanups. (add_intermediate_continuation): Drop the int argument of the continuation hook argument. Add continuation_free_args argument. Reimplement on top of cleanups. (do_all_intermediate_continuations): Drop error argument. Reimplement on top of cleanups. (discard_all_intermediate_continuations): Reimplement on top of cleanups. * breakpoint.c (until_break_command_continuation): Drop error argument. Add xfree as continuation argument deleter. * inf-loop.c (inferior_event_handler): On error, discard all continuations. Adjust to new do_all_intermediate_continuations and do_all_continuations interfaces. * infcmd.c (step_1_continuation): Drop error_p argument. Adjust. Pass xfree as continuation argument deleter. (finish_command_continuation): Drop error_p argument. Adjust. (finish_command_continuation_free_arg): New. (finish_command): Pass finish_command_continuation_free_arg as continuation argument deleter. Adjust to new do_all_continuations interfaces. (attach_command_continuation): Drop error_p argument. (attach_command_continuation_free_args): New. (attach_command): Pass attach_command_continuation_free_args as continuation argument deleter. * interps.c (interp_set): Adjust to new do_all_continuations interfaces. * event-top.c (stdin_event_handler): In error, also discard the intermediate continuations.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r--gdb/defs.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/gdb/defs.h b/gdb/defs.h
index 2be982aff54..6e6aa807bdb 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -677,12 +677,7 @@ extern void free_command_lines (struct command_line **);
used by the finish and until commands, and in the remote protocol
when opening an extended-remote connection. */
-struct continuation
- {
- void (*continuation_hook) (void *, int);
- void *args;
- struct continuation *next;
- };
+struct continuation;
/* In infrun.c. */
extern struct continuation *cmd_continuation;
@@ -690,12 +685,14 @@ extern struct continuation *cmd_continuation;
extern struct continuation *intermediate_continuation;
/* From utils.c */
-extern void add_continuation (void (*)(void *, int), void *);
-extern void do_all_continuations (int error);
+extern void add_continuation (void (*)(void *), void *,
+ void (*)(void *));
+extern void do_all_continuations (void);
extern void discard_all_continuations (void);
-extern void add_intermediate_continuation (void (*)(void *, int), void *);
-extern void do_all_intermediate_continuations (int error);
+extern void add_intermediate_continuation (void (*)(void *), void *,
+ void (*)(void *));
+extern void do_all_intermediate_continuations (void);
extern void discard_all_intermediate_continuations (void);
/* String containing the current directory (what getwd would return). */