GDB (xrefs)
Loading...
Searching...
No Matches
top.h
Go to the documentation of this file.
1/* Top level stuff for GDB, the GNU debugger.
2
3 Copyright (C) 1986-2023 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#ifndef TOP_H
21#define TOP_H
22
23#include "gdbsupport/event-loop.h"
24#include "gdbsupport/next-iterator.h"
25#include "value.h"
26
27/* From top.c. */
28extern bool confirm;
29extern int inhibit_gdbinit;
31
32/* Print the GDB version banner to STREAM. If INTERACTIVE is false,
33 then information referring to commands (e.g., "show configuration")
34 is omitted; this mode is used for the --version command line
35 option. If INTERACTIVE is true, then interactive commands are
36 mentioned. */
37extern void print_gdb_version (struct ui_file *stream, bool interactive);
38
39extern void print_gdb_configuration (struct ui_file *);
40
41extern void read_command_file (FILE *);
42extern void init_history (void);
43extern void command_loop (void);
44extern int quit_confirm (void);
45extern void quit_force (int *, int) ATTRIBUTE_NORETURN;
46extern void quit_command (const char *, int);
47extern void quit_cover (void);
48extern void execute_command (const char *, int);
49
50/* If the interpreter is in sync mode (we're running a user command's
51 list, running command hooks or similars), and we just ran a
52 synchronous command that started the target, wait for that command
53 to end. WAS_SYNC indicates whether sync_execution was set before
54 the command was run. */
55
56extern void maybe_wait_sync_command_done (int was_sync);
57
58/* Wait for a synchronous execution command to end. */
59extern void wait_sync_command_done (void);
60
61extern void check_frame_language_change (void);
62
63/* Prepare for execution of a command.
64 Call this before every command, CLI or MI.
65 Returns a cleanup to be run after the command is completed. */
67
68/* This function returns a pointer to the string that is used
69 by gdb for its command prompt. */
70extern const std::string &get_prompt ();
71
72/* This function returns a pointer to the string that is used
73 by gdb for its command prompt. */
74extern void set_prompt (const char *s);
75
76/* Return 1 if UI's current input handler is a secondary prompt, 0
77 otherwise. */
78
79extern int gdb_in_secondary_prompt_p (struct ui *ui);
80
81/* Perform _initialize initialization. */
82extern void gdb_init ();
83
84/* For use by event-top.c. */
85/* Variables from top.c. */
86extern int source_line_number;
87extern std::string source_file_name;
88extern bool history_expansion_p;
89extern bool server_command;
90extern char *lim_at_start;
91
92extern void gdb_add_history (const char *);
93
94extern void show_commands (const char *args, int from_tty);
95
96extern void set_verbose (const char *, int, struct cmd_list_element *);
97
98extern const char *handle_line_of_input (std::string &cmd_line_buffer,
99 const char *rl, int repeat,
100 const char *annotation_suffix);
101
102/* Call at startup to see if the user has requested that gdb start up
103 quietly. */
104
105extern bool check_quiet_mode ();
106
107/* Unbuffer STREAM. This is a wrapper around setbuf(STREAM, nullptr)
108 which applies some special rules for MS-Windows hosts. */
109
110extern void unbuffer_stream (FILE *stream);
111
112#endif
auto_boolean
Definition defs.h:247
Definition ui.h:55
void print_gdb_version(struct ui_file *stream, bool interactive)
Definition top.c:1321
void wait_sync_command_done(void)
Definition top.c:414
int inhibit_gdbinit
Definition top.c:129
void print_gdb_configuration(struct ui_file *)
Definition top.c:1393
const char * handle_line_of_input(std::string &cmd_line_buffer, const char *rl, int repeat, const char *annotation_suffix)
Definition event-top.c:605
void unbuffer_stream(FILE *stream)
Definition top.c:261
int source_line_number
Definition top.c:312
void init_history(void)
Definition top.c:1977
bool history_expansion_p
Definition top.c:843
char * lim_at_start
void show_commands(const char *args, int from_tty)
Definition top.c:1861
void set_prompt(const char *s)
Definition top.c:1635
bool server_command
Definition top.c:173
void quit_command(const char *, int)
Definition cli-cmds.c:477
void quit_cover(void)
const std::string & get_prompt()
Definition top.c:1627
int gdb_in_secondary_prompt_p(struct ui *ui)
Definition top.c:942
int quit_confirm(void)
Definition top.c:1689
void maybe_wait_sync_command_done(int was_sync)
Definition top.c:435
void execute_command(const char *, int)
Definition top.c:459
void command_loop(void)
auto_boolean interactive_mode
Definition top.c:1831
void set_verbose(const char *, int, struct cmd_list_element *)
Definition top.c:1945
bool confirm
Definition top.c:134
std::string source_file_name
Definition top.c:318
void gdb_add_history(const char *)
Definition top.c:1120
void check_frame_language_change(void)
Definition top.c:372
scoped_value_mark prepare_execute_command(void)
Definition top.c:356
void quit_force(int *, int) ATTRIBUTE_NORETURN
Definition top.c:1732
void read_command_file(FILE *)
Definition top.c:322
bool check_quiet_mode()
Definition top.c:2122
void gdb_init()
Definition top.c:2303