From be34f8494e0befe68d8071f46edc16d9aa3c9238 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 27 May 2011 18:28:18 +0000 Subject: 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. --- gdb/ChangeLog | 17 ++++++++++++++ gdb/breakpoint.c | 1 + gdb/continuations.c | 1 + gdb/continuations.h | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++ gdb/defs.h | 43 ---------------------------------- gdb/event-top.c | 2 +- gdb/inf-loop.c | 1 + gdb/infcmd.c | 1 + gdb/inferior.c | 1 + gdb/infrun.c | 1 + gdb/interps.c | 1 + gdb/thread.c | 1 + 12 files changed, 93 insertions(+), 44 deletions(-) create mode 100644 gdb/continuations.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c9a0ff5..b57fa08 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 fc30d26..d26a347 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 1f5c8a4..c6f45a2 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 0000000..aaba362 --- /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 7deee69..1795297 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 660f137..a8a3e0f 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 e347451..1645c38 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 e95f753..f499e3e 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 db4dd41..d3e3585 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 46b2fe1..efc35f9 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 8b74a23..bd9a352 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 5f07c83..3090b69 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. */ -- cgit v1.1