From: Pedro Alves Date: Fri, 27 May 2011 18:28:18 +0000 (+0000) Subject: 2011-05-27 Pedro Alves X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=be34f8494e0befe68d8071f46edc16d9aa3c9238;p=binutils-gdb.git 2011-05-27 Pedro Alves * defs.h (struct continuation, continuation_ftype) (continuation_free_arg_ftype, add_continuation) (do_all_continuations, do_all_continuations_thread) (discard_all_continuations, discard_all_continuations_thread) (add_intermediate_continuation, do_all_intermediate_continuations) (do_all_intermediate_continuations_thread) (discard_all_intermediate_continuations) (discard_all_intermediate_continuations_thread) (add_inferior_continuation, do_all_inferior_continuations) (discard_all_inferior_continuations): Move to ... * continuations.h: ... this new file. * breakpoint.c, continuations.c, event-top.c, inf-loop.c, infcmd.c, inferior.c, infrun.c, interps.c: Include continuations.h. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c9a0ff501e2..b57fa0821a1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,20 @@ +2011-05-27 Pedro Alves + + * defs.h (struct continuation, continuation_ftype) + (continuation_free_arg_ftype, add_continuation) + (do_all_continuations, do_all_continuations_thread) + (discard_all_continuations, discard_all_continuations_thread) + (add_intermediate_continuation, do_all_intermediate_continuations) + (do_all_intermediate_continuations_thread) + (discard_all_intermediate_continuations) + (discard_all_intermediate_continuations_thread) + (add_inferior_continuation, do_all_inferior_continuations) + (discard_all_inferior_continuations): Move to ... + * continuations.h: ... this new file. + * breakpoint.c, continuations.c, event-top.c, inf-loop.c, + infcmd.c, inferior.c, infrun.c, interps.c: Include + continuations.h. + 2011-05-27 Jan Kratochvil Doug Evans diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fc30d265b21..d26a347ba1a 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -64,6 +64,7 @@ #include "xml-syscall.h" #include "parser-defs.h" #include "cli/cli-utils.h" +#include "continuations.h" /* readline include files */ #include "readline/readline.h" diff --git a/gdb/continuations.c b/gdb/continuations.c index 1f5c8a466ae..c6f45a23e8f 100644 --- a/gdb/continuations.c +++ b/gdb/continuations.c @@ -22,6 +22,7 @@ #include "defs.h" #include "gdbthread.h" #include "inferior.h" +#include "continuations.h" struct continuation { diff --git a/gdb/continuations.h b/gdb/continuations.h new file mode 100644 index 00000000000..aaba362f0b9 --- /dev/null +++ b/gdb/continuations.h @@ -0,0 +1,67 @@ +/* Continuations for GDB, the GNU debugger. + + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, + 2009, 2010, 2011 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef CONTINUATIONS_H +#define CONTINUATIONS_H + +struct thread_info; +struct inferior; + +/* To continue the execution commands when running gdb asynchronously. + A continuation structure contains a pointer to a function to be called + to finish the command, once the target has stopped. Such mechanism is + used by the finish and until commands, and in the remote protocol + when opening an extended-remote connection. */ + +/* Prototype of the continuation callback functions. */ +typedef void (continuation_ftype) (void *); + +/* Prototype of the function responsible for releasing the argument + passed to the continuation callback functions, either when the + continuation is called, or discarded. */ +typedef void (continuation_free_arg_ftype) (void *); + +/* Thread specific continuations. */ + +extern void add_continuation (struct thread_info *, + continuation_ftype *, void *, + continuation_free_arg_ftype *); +extern void do_all_continuations (void); +extern void do_all_continuations_thread (struct thread_info *); +extern void discard_all_continuations (void); +extern void discard_all_continuations_thread (struct thread_info *); + +extern void add_intermediate_continuation (struct thread_info *, + continuation_ftype *, void *, + continuation_free_arg_ftype *); +extern void do_all_intermediate_continuations (void); +extern void do_all_intermediate_continuations_thread (struct thread_info *); +extern void discard_all_intermediate_continuations (void); +extern void discard_all_intermediate_continuations_thread (struct thread_info *); + +/* Inferior specific (any thread) continuations. */ + +extern void add_inferior_continuation (continuation_ftype *, + void *, + continuation_free_arg_ftype *); +extern void do_all_inferior_continuations (void); +extern void discard_all_inferior_continuations (struct inferior *inf); + +#endif diff --git a/gdb/defs.h b/gdb/defs.h index 7deee6927ac..1795297fff8 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -730,52 +730,9 @@ extern struct command_line *read_command_lines_1 (char * (*) (void), int, extern void free_command_lines (struct command_line **); -/* To continue the execution commands when running gdb asynchronously. - A continuation structure contains a pointer to a function to be called - to finish the command, once the target has stopped. Such mechanism is - used by the finish and until commands, and in the remote protocol - when opening an extended-remote connection. */ - -struct continuation; struct thread_info; struct inferior; -/* From continuations.c */ - -/* Prototype of the continuation callback functions. */ -typedef void (continuation_ftype) (void *); - -/* Prototype of the function responsible for releasing the argument - passed to the continuation callback functions, either when the - continuation is called, or discarded. */ -typedef void (continuation_free_arg_ftype) (void *); - -/* Thread specific continuations. */ - -extern void add_continuation (struct thread_info *, - continuation_ftype *, void *, - continuation_free_arg_ftype *); -extern void do_all_continuations (void); -extern void do_all_continuations_thread (struct thread_info *); -extern void discard_all_continuations (void); -extern void discard_all_continuations_thread (struct thread_info *); - -extern void add_intermediate_continuation (struct thread_info *, - continuation_ftype *, void *, - continuation_free_arg_ftype *); -extern void do_all_intermediate_continuations (void); -extern void do_all_intermediate_continuations_thread (struct thread_info *); -extern void discard_all_intermediate_continuations (void); -extern void discard_all_intermediate_continuations_thread (struct thread_info *); - -/* Inferior specific (any thread) continuations. */ - -extern void add_inferior_continuation (continuation_ftype *, - void *, - continuation_free_arg_ftype *); -extern void do_all_inferior_continuations (void); -extern void discard_all_inferior_continuations (struct inferior *inf); - /* String containing the current directory (what getwd would return). */ extern char *current_directory; diff --git a/gdb/event-top.c b/gdb/event-top.c index 660f137b088..a8a3e0f5bf5 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -33,7 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "main.h" #include "gdbthread.h" - +#include "continuations.h" #include "gdbcmd.h" /* for dont_repeat() */ /* readline include files. */ diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c index e347451dcc8..1645c38b6e1 100644 --- a/gdb/inf-loop.c +++ b/gdb/inf-loop.c @@ -28,6 +28,7 @@ #include "exceptions.h" #include "language.h" #include "gdbthread.h" +#include "continuations.h" static int fetch_inferior_event_wrapper (gdb_client_data client_data); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index e95f7536282..f499e3e64bf 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -56,6 +56,7 @@ #include "inline-frame.h" #include "tracepoint.h" #include "inf-loop.h" +#include "continuations.h" /* Functions exported for general use, in inferior.h: */ diff --git a/gdb/inferior.c b/gdb/inferior.c index db4dd41e6b5..d3e3585a334 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -31,6 +31,7 @@ #include "symfile.h" #include "environ.h" #include "cli/cli-utils.h" +#include "continuations.h" void _initialize_inferiors (void); diff --git a/gdb/infrun.c b/gdb/infrun.c index 46b2fe1061c..efc35f96f8a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -54,6 +54,7 @@ #include "inline-frame.h" #include "jit.h" #include "tracepoint.h" +#include "continuations.h" /* Prototypes for local functions */ diff --git a/gdb/interps.c b/gdb/interps.c index 8b74a23cd56..bd9a352ce2c 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -41,6 +41,7 @@ #include "gdb_assert.h" #include "top.h" /* For command_loop. */ #include "exceptions.h" +#include "continuations.h" struct interp { diff --git a/gdb/thread.c b/gdb/thread.c index 5f07c83ff3b..3090b692556 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -45,6 +45,7 @@ #include "cli/cli-decode.h" #include "gdb_regex.h" #include "cli/cli-utils.h" +#include "continuations.h" /* Definition of struct thread_info exported to gdbthread.h. */