OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [event-top.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* Definitions used by GDB event-top.c.
2
   Copyright 1999, 2001 Free Software Foundation, Inc.
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
 
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
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
27
   'actions' for tracepoints.  In these cases, the prompt is '>' and
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.
32
   The prompt stack represents part of the saved state.  Another part
33
   would be the function that readline would invoke after a whole line
34
   of input has ben entered.  This second piece would be something
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
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.  */
40
 
41
/* At any particular time there will be always at least one prompt on
42
   the stack, the one being currently displayed by gdb.  If gdb is
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
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
47
   to 0 or 1, pops the top of the stack, resetting its size to one
48
   element.  The MAXPROMPTS limit is safe, for now.  Once other cases
49
   are dealt with (like the different prompts used for 'commands' or
50
   'actions') this array implementation of the prompt stack may have
51
   to change.  */
52
 
53
#define MAXPROMPTS 10
54
struct 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.
71
   FIXME: these should really go into top.h.  */
72
 
73
extern void display_gdb_prompt (char *new_prompt);
74
extern void async_init_signals (void);
75
extern void set_async_editing_command (char *args, int from_tty,
76
                                       struct cmd_list_element *c);
77
extern void set_async_annotation_level (char *args, int from_tty,
78
                                        struct cmd_list_element *c);
79
extern void set_async_prompt (char *args, int from_tty,
80
                              struct cmd_list_element *c);
81
 
82
/* Signal to catch ^Z typed while reading a command: SIGTSTP or SIGCONT.  */
83
#ifndef STOP_SIGNAL
84
#include <signal.h>
85
#ifdef SIGTSTP
86
#define STOP_SIGNAL SIGTSTP
87
extern void handle_stop_sig (int sig);
88
#endif
89
#endif
90
extern void handle_sigint (int sig);
91
extern void pop_prompt (void);
92
extern void push_prompt (char *prefix, char *prompt, char *suffix);
93
extern void gdb_readline2 (void *client_data);
94
extern void mark_async_signal_handler_wrapper (void *token);
95
extern void async_request_quit (void *arg);
96
extern void stdin_event_handler (int error, void *client_data);
97
extern void async_disable_stdin (void);
98
extern void async_enable_stdin (void *dummy);
99
 
100
/* Exported variables from event-top.c.
101
   FIXME: these should really go into top.h.  */
102
 
103
extern int async_command_editing_p;
104
extern int exec_done_display_p;
105
extern char *async_annotation_suffix;
106
extern char *new_async_prompt;
107
extern struct prompts the_prompts;
108
extern void (*call_readline) (void *);
109
extern void (*input_handler) (char *);
110
extern int input_fd;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.