continuations.h revision 1.6
10Sduke/* Continuations for GDB, the GNU debugger.
22362Sohair
30Sduke   Copyright (C) 1999-2016 Free Software Foundation, Inc.
40Sduke
50Sduke   This file is part of GDB.
60Sduke
70Sduke   This program is free software; you can redistribute it and/or modify
80Sduke   it under the terms of the GNU General Public License as published by
90Sduke   the Free Software Foundation; either version 3 of the License, or
100Sduke   (at your option) any later version.
110Sduke
120Sduke   This program is distributed in the hope that it will be useful,
130Sduke   but WITHOUT ANY WARRANTY; without even the implied warranty of
140Sduke   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
150Sduke   GNU General Public License for more details.
160Sduke
170Sduke   You should have received a copy of the GNU General Public License
180Sduke   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
192362Sohair
202362Sohair#ifndef CONTINUATIONS_H
212362Sohair#define CONTINUATIONS_H
220Sduke
230Sdukestruct inferior;
240Sduke
250Sduke/* To continue the execution commands when running gdb asynchronously.
260Sduke   A continuation structure contains a pointer to a function to be called
270Sduke   to finish the command, once the target has stopped.  Such mechanism is
280Sduke   used by the finish and until commands, and in the remote protocol
290Sduke   when opening an extended-remote connection.  */
300Sduke
310Sduke/* Prototype of the continuation callback functions.  ARG is the
320Sduke   continuation argument registered in the corresponding
330Sduke   add_*_continuation call.  ERR is true when the command should be
340Sduke   cancelled instead of finished normally.  In that case, the
350Sduke   continuation should clean up whatever state had been set up for the
360Sduke   command in question (e.g., remove momentary breakpoints).  This
370Sduke   happens e.g., when an error was thrown while handling a target
380Sduke   event, or when the inferior thread the command was being executed
390Sduke   on exits.  */
400Sduketypedef void (continuation_ftype) (void *arg, int err);
410Sduke
420Sduke/* Prototype of the function responsible for releasing the argument
430Sduke   passed to the continuation callback functions, either when the
440Sduke   continuation is called, or discarded.  */
450Sduketypedef void (continuation_free_arg_ftype) (void *);
460Sduke
470Sduke/* Inferior specific (any thread) continuations.  */
480Sduke
490Sdukeextern void add_inferior_continuation (continuation_ftype *,
500Sduke				       void *,
510Sduke				       continuation_free_arg_ftype *);
520Sdukeextern void do_all_inferior_continuations (int err);
530Sdukeextern void discard_all_inferior_continuations (struct inferior *inf);
54
55#endif
56