GDB (API)
/home/stan/gdb/src/gdb/continuations.h
Go to the documentation of this file.
00001 /* Continuations for GDB, the GNU debugger.
00002 
00003    Copyright (C) 1999-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef CONTINUATIONS_H
00021 #define CONTINUATIONS_H
00022 
00023 struct thread_info;
00024 struct inferior;
00025 
00026 /* To continue the execution commands when running gdb asynchronously.
00027    A continuation structure contains a pointer to a function to be called
00028    to finish the command, once the target has stopped.  Such mechanism is
00029    used by the finish and until commands, and in the remote protocol
00030    when opening an extended-remote connection.  */
00031 
00032 /* Prototype of the continuation callback functions.  ARG is the
00033    continuation argument registered in the corresponding
00034    add_*_continuation call.  ERR is true when the command should be
00035    cancelled instead of finished normally.  In that case, the
00036    continuation should clean up whatever state had been set up for the
00037    command in question (e.g., remove momentary breakpoints).  This
00038    happens e.g., when an error was thrown while handling a target
00039    event, or when the inferior thread the command was being executed
00040    on exits.  */
00041 typedef void (continuation_ftype) (void *arg, int err);
00042 
00043 /* Prototype of the function responsible for releasing the argument
00044    passed to the continuation callback functions, either when the
00045    continuation is called, or discarded.  */
00046 typedef void (continuation_free_arg_ftype) (void *);
00047 
00048 /* Thread specific continuations.  */
00049 
00050 extern void add_continuation (struct thread_info *,
00051                               continuation_ftype *, void *,
00052                               continuation_free_arg_ftype *);
00053 extern void do_all_continuations (int err);
00054 extern void do_all_continuations_thread (struct thread_info *, int err);
00055 extern void discard_all_continuations (void);
00056 extern void discard_all_continuations_thread (struct thread_info *);
00057 
00058 extern void add_intermediate_continuation (struct thread_info *,
00059                                            continuation_ftype *, void *,
00060                                            continuation_free_arg_ftype *);
00061 extern void do_all_intermediate_continuations (int err);
00062 extern void do_all_intermediate_continuations_thread (struct thread_info *, int err);
00063 extern void discard_all_intermediate_continuations (void);
00064 extern void discard_all_intermediate_continuations_thread (struct thread_info *);
00065 
00066 /* Inferior specific (any thread) continuations.  */
00067 
00068 extern void add_inferior_continuation (continuation_ftype *,
00069                                        void *,
00070                                        continuation_free_arg_ftype *);
00071 extern void do_all_inferior_continuations (int err);
00072 extern void discard_all_inferior_continuations (struct inferior *inf);
00073 
00074 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines