GDB (xrefs)
Loading...
Searching...
No Matches
event-top.h
Go to the documentation of this file.
1/* Definitions used by event-top.c, for GDB, the GNU debugger.
2
3 Copyright (C) 1999-2023 Free Software Foundation, Inc.
4
5 Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22#ifndef EVENT_TOP_H
23#define EVENT_TOP_H
24
25#include <signal.h>
26
27struct cmd_list_element;
28
29/* Exported functions from event-top.c.
30 FIXME: these should really go into top.h. */
31
32extern void display_gdb_prompt (const char *new_prompt);
33extern void gdb_setup_readline (int);
34extern void gdb_disable_readline (void);
35extern void gdb_init_signals (void);
36extern void change_line_handler (int);
37
38extern void command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl);
39extern void command_handler (const char *command);
40
41#ifdef SIGTSTP
42extern void handle_sigtstp (int sig);
43#endif
44
45extern void handle_sigint (int sig);
46extern void handle_sigterm (int sig);
47extern void async_request_quit (void *arg);
48extern void async_disable_stdin (void);
49extern void async_enable_stdin (void);
50
51/* Exported variables from event-top.c.
52 FIXME: these should really go into top.h. */
53
54extern bool set_editing_cmd_var;
55extern bool exec_done_display_p;
56extern struct prompts the_prompts;
57extern void (*after_char_processing_hook) (void);
59extern void gdb_readline_no_editing_callback (void *client_data);
60
61/* Wrappers for rl_callback_handler_remove and
62 rl_callback_handler_install that keep track of whether the callback
63 handler is installed in readline. Do not call the readline
64 versions directly. */
65extern void gdb_rl_callback_handler_remove (void);
66extern void gdb_rl_callback_handler_install (const char *prompt);
67
68/* Reinstall the readline callback handler (with no prompt), if not
69 currently installed. */
70extern void gdb_rl_callback_handler_reinstall (void);
71
72/* Called by readline after a complete line has been gathered from the
73 user, but before the line is dispatched to back to GDB. This function
74 is a wrapper around readline's builtin rl_deprep_terminal function, and
75 handles the case where readline received EOF. */
76extern void gdb_rl_deprep_term_function (void);
77
78typedef void (*segv_handler_t) (int);
79
80/* On construction, replaces the current thread's SIGSEGV handler with
81 the provided one. On destruction, restores the handler to the
82 original one. */
92
93#endif
segv_handler_t m_old_handler
Definition event-top.h:90
scoped_segv_handler_restore(segv_handler_t new_handler)
Definition event-top.c:1328
void async_request_quit(void *arg)
void gdb_rl_deprep_term_function(void)
Definition event-top.c:692
bool set_editing_cmd_var
Definition event-top.c:94
void display_gdb_prompt(const char *new_prompt)
Definition event-top.c:398
void async_enable_stdin(void)
Definition event-top.c:507
void(* after_char_processing_hook)(void)
Definition event-top.c:138
void command_handler(const char *command)
Definition event-top.c:537
int call_stdin_event_handler_again_p
Definition event-top.c:103
struct prompts the_prompts
bool exec_done_display_p
Definition event-top.c:98
void(* segv_handler_t)(int)
Definition event-top.h:78
void gdb_rl_callback_handler_install(const char *prompt)
Definition event-top.c:352
void gdb_rl_callback_handler_remove(void)
Definition event-top.c:339
void gdb_init_signals(void)
Definition event-top.c:991
void gdb_disable_readline(void)
Definition event-top.c:1319
void change_line_handler(int)
Definition event-top.c:291
void handle_sigint(int sig)
Definition event-top.c:1085
void handle_sigterm(int sig)
Definition event-top.c:1158
void command_line_handler(gdb::unique_xmalloc_ptr< char > &&rl)
Definition event-top.c:717
void gdb_rl_callback_handler_reinstall(void)
Definition event-top.c:368
void gdb_readline_no_editing_callback(void *client_data)
void gdb_setup_readline(int)
Definition event-top.c:1278
void async_disable_stdin(void)
Definition event-top.c:523