diff options
author | Pedro Alves <palves@redhat.com> | 2011-05-27 14:56:14 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2011-05-27 14:56:14 +0000 |
commit | b0f260d61e5b5b3de1fcac6042f4b225bf132d45 (patch) | |
tree | d6c6d60e9d6cd28a97de2f461c56cf88a5b4b77c /gdb/continuations.c | |
parent | af1e9a32aae3e5c088e3fb661a17c763edb80291 (diff) | |
download | gdb-b0f260d61e5b5b3de1fcac6042f4b225bf132d45.zip gdb-b0f260d61e5b5b3de1fcac6042f4b225bf132d45.tar.gz gdb-b0f260d61e5b5b3de1fcac6042f4b225bf132d45.tar.bz2 |
2011-05-27 Pedro Alves <pedro@codesourcery.com>
gdb/
* defs.h (continuation_ftype, continuation_free_arg_ftype): New
typedefs.
(add_continuation, add_intermediate_continuation)
(add_inferior_continuation): Use them.
* continuations.c (struct continuation): Use them.
(make_continuation_ftype): Delete.
(make_continuation, add_inferior_continuation, add_continuation)
(add_intermediate_continuation): Use continuation_ftype and
continuation_free_arg_ftype. Rename parameters to shorter names.
Diffstat (limited to 'gdb/continuations.c')
-rw-r--r-- | gdb/continuations.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/gdb/continuations.c b/gdb/continuations.c index 2601a23..1f5c8a4 100644 --- a/gdb/continuations.c +++ b/gdb/continuations.c @@ -26,20 +26,18 @@ struct continuation { struct continuation *next; - void (*function) (void *); - void (*free_arg) (void *); + continuation_ftype *function; + continuation_free_arg_ftype *free_arg; void *arg; }; -typedef void (make_continuation_ftype) (void *); - /* Add a new continuation to the continuation chain. Args are FUNCTION to run the continuation up with, and ARG to pass to it. */ static void make_continuation (struct continuation **pmy_chain, - make_continuation_ftype *function, + continuation_ftype *function, void *arg, void (*free_arg) (void *)) { struct continuation *new = XNEW (struct continuation); @@ -113,13 +111,12 @@ discard_my_continuations (struct continuation **list) continuation will be added at the front. */ void -add_inferior_continuation (void (*continuation_hook) (void *), void *args, - void (*continuation_free_args) (void *)) +add_inferior_continuation (continuation_ftype *hook, void *args, + continuation_free_arg_ftype *free_arg) { struct inferior *inf = current_inferior (); - make_continuation (&inf->continuations, continuation_hook, - args, continuation_free_args); + make_continuation (&inf->continuations, hook, args, free_arg); } /* Do all continuations of the current inferior. */ @@ -144,11 +141,10 @@ discard_all_inferior_continuations (struct inferior *inf) void add_continuation (struct thread_info *thread, - void (*continuation_hook) (void *), void *args, - void (*continuation_free_args) (void *)) + continuation_ftype *hook, void *args, + continuation_free_arg_ftype *free_arg) { - make_continuation (&thread->continuations, continuation_hook, - args, continuation_free_args); + make_continuation (&thread->continuations, hook, args, free_arg); } static void @@ -256,12 +252,12 @@ discard_all_continuations (void) void add_intermediate_continuation (struct thread_info *thread, - void (*continuation_hook) - (void *), void *args, - void (*continuation_free_args) (void *)) + continuation_ftype *hook, + void *args, + continuation_free_arg_ftype *free_arg) { - make_continuation (&thread->intermediate_continuations, continuation_hook, - args, continuation_free_args); + make_continuation (&thread->intermediate_continuations, hook, + args, free_arg); } /* Walk down the cmd_continuation list, and execute all the |