* win32-nat.c (get_relocated_section_addrs): New function. Find section load
[deliverable/binutils-gdb.git] / gdb / event-top.h
CommitLineData
c2c6d25f 1/* Definitions used by GDB event-top.c.
72290732 2 Copyright 1999, 2001 Free Software Foundation, Inc.
c2c6d25f
JM
3 Written by Elena Zannoni <ezannoni@cygnus.com> of Cygnus Solutions.
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 2 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, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
21
0af5533d
MK
22/* Stack for prompts. Each prompt is composed as a prefix, a prompt
23 and a suffix. The prompt to be displayed at any given time is the
c2c6d25f
JM
24 one on top of the stack. A stack is necessary because of cases in
25 which the execution of a gdb command requires further input from
26 the user, like for instance 'commands' for breakpoints and
0af5533d 27 'actions' for tracepoints. In these cases, the prompt is '>' and
c2c6d25f
JM
28 gdb should process input using the asynchronous readline interface
29 and the event loop. In order to achieve this, we need to save
30 somewhere the state of GDB, i.e. that it is processing user input
31 as part of a command and not as part of the top level command loop.
0af5533d 32 The prompt stack represents part of the saved state. Another part
c2c6d25f 33 would be the function that readline would invoke after a whole line
0af5533d 34 of input has ben entered. This second piece would be something
c2c6d25f
JM
35 like, for instance, where to return within the code for the actions
36 commands after a line has been read. This latter portion has not
37 beeen implemented yet. The need for a 3-part prompt arises from
0af5533d
MK
38 the annotation level. When this is set to 2, the prompt is
39 actually composed of a prefix, the prompt itself and a suffix. */
c2c6d25f
JM
40
41/* At any particular time there will be always at least one prompt on
0af5533d 42 the stack, the one being currently displayed by gdb. If gdb is
c2c6d25f
JM
43 using annotation level equal 2, there will be 2 prompts on the
44 stack: the usual one, w/o prefix and suffix (at top - 1), and the
0af5533d
MK
45 'composite' one with prefix and suffix added (at top). At this
46 time, this is the only use of the prompt stack. Resetting annotate
c2c6d25f 47 to 0 or 1, pops the top of the stack, resetting its size to one
0af5533d 48 element. The MAXPROMPTS limit is safe, for now. Once other cases
c2c6d25f
JM
49 are dealt with (like the different prompts used for 'commands' or
50 'actions') this array implementation of the prompt stack may have
0af5533d 51 to change. */
c2c6d25f
JM
52
53#define MAXPROMPTS 10
54struct prompts
55 {
56 struct
57 {
58 char *prefix;
59 char *prompt;
60 char *suffix;
61 }
62 prompt_stack[MAXPROMPTS];
63 int top;
64 };
65
66#define PROMPT(X) the_prompts.prompt_stack[the_prompts.top + X].prompt
67#define PREFIX(X) the_prompts.prompt_stack[the_prompts.top + X].prefix
68#define SUFFIX(X) the_prompts.prompt_stack[the_prompts.top + X].suffix
69
70/* Exported functions from event-top.c.
0af5533d 71 FIXME: these should really go into top.h. */
c2c6d25f
JM
72
73extern void display_gdb_prompt (char *new_prompt);
4389a95a
AC
74void gdb_setup_readline (void);
75void gdb_disable_readline (void);
c2c6d25f 76extern void async_init_signals (void);
0af5533d
MK
77extern void set_async_editing_command (char *args, int from_tty,
78 struct cmd_list_element *c);
79extern void set_async_annotation_level (char *args, int from_tty,
80 struct cmd_list_element *c);
81extern void set_async_prompt (char *args, int from_tty,
82 struct cmd_list_element *c);
c2c6d25f
JM
83
84/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT. */
85#ifndef STOP_SIGNAL
72290732 86#include <signal.h>
c2c6d25f
JM
87#ifdef SIGTSTP
88#define STOP_SIGNAL SIGTSTP
89extern void handle_stop_sig (int sig);
90#endif
91#endif
92extern void handle_sigint (int sig);
93extern void pop_prompt (void);
94extern void push_prompt (char *prefix, char *prompt, char *suffix);
2acceee2
JM
95extern void gdb_readline2 (void *client_data);
96extern void mark_async_signal_handler_wrapper (void *token);
97extern void async_request_quit (void *arg);
98extern void stdin_event_handler (int error, void *client_data);
6426a772
JM
99extern void async_disable_stdin (void);
100extern void async_enable_stdin (void *dummy);
c2c6d25f
JM
101
102/* Exported variables from event-top.c.
0af5533d 103 FIXME: these should really go into top.h. */
c2c6d25f
JM
104
105extern int async_command_editing_p;
106extern int exec_done_display_p;
107extern char *async_annotation_suffix;
108extern char *new_async_prompt;
109extern struct prompts the_prompts;
2acceee2 110extern void (*call_readline) (void *);
c2c6d25f
JM
111extern void (*input_handler) (char *);
112extern int input_fd;
467d8519 113extern void (*after_char_processing_hook) (void);
This page took 0.227166 seconds and 4 git commands to generate.