gdb/continuations.h - gdb

Data types defined

Macros defined

Source code

  1. /* Continuations for GDB, the GNU debugger.

  2.    Copyright (C) 1999-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #ifndef CONTINUATIONS_H
  15. #define CONTINUATIONS_H

  16. struct thread_info;
  17. struct inferior;

  18. /* To continue the execution commands when running gdb asynchronously.
  19.    A continuation structure contains a pointer to a function to be called
  20.    to finish the command, once the target has stopped.  Such mechanism is
  21.    used by the finish and until commands, and in the remote protocol
  22.    when opening an extended-remote connection.  */

  23. /* Prototype of the continuation callback functions.  ARG is the
  24.    continuation argument registered in the corresponding
  25.    add_*_continuation call.  ERR is true when the command should be
  26.    cancelled instead of finished normally.  In that case, the
  27.    continuation should clean up whatever state had been set up for the
  28.    command in question (e.g., remove momentary breakpoints).  This
  29.    happens e.g., when an error was thrown while handling a target
  30.    event, or when the inferior thread the command was being executed
  31.    on exits.  */
  32. typedef void (continuation_ftype) (void *arg, int err);

  33. /* Prototype of the function responsible for releasing the argument
  34.    passed to the continuation callback functions, either when the
  35.    continuation is called, or discarded.  */
  36. typedef void (continuation_free_arg_ftype) (void *);

  37. /* Thread specific continuations.  */

  38. extern void add_continuation (struct thread_info *,
  39.                               continuation_ftype *, void *,
  40.                               continuation_free_arg_ftype *);
  41. extern void do_all_continuations (int err);
  42. extern void do_all_continuations_thread (struct thread_info *, int err);
  43. extern void discard_all_continuations (void);
  44. extern void discard_all_continuations_thread (struct thread_info *);

  45. extern void add_intermediate_continuation (struct thread_info *,
  46.                                            continuation_ftype *, void *,
  47.                                            continuation_free_arg_ftype *);
  48. extern void do_all_intermediate_continuations (int err);
  49. extern void do_all_intermediate_continuations_thread (struct thread_info *, int err);
  50. extern void discard_all_intermediate_continuations (void);
  51. extern void discard_all_intermediate_continuations_thread (struct thread_info *);

  52. /* Inferior specific (any thread) continuations.  */

  53. extern void add_inferior_continuation (continuation_ftype *,
  54.                                        void *,
  55.                                        continuation_free_arg_ftype *);
  56. extern void do_all_inferior_continuations (int err);
  57. extern void discard_all_inferior_continuations (struct inferior *inf);

  58. #endif