source: vendor/emx/current/src/pmgdb/command.h

Last change on this file was 18, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 4.9 KB
Line 
1/* command.h -*- C++ -*-
2 Copyright (c) 1996 Eberhard Mattes
3
4This file is part of pmgdb.
5
6pmgdb is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11pmgdb is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with pmgdb; see the file COPYING. If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA. */
20
21
22class capture;
23class annotation;
24class gdbio;
25class display_window;
26class threads_window;
27class breakpoints_window;
28class breakpoint;
29class source_window;
30class source_files_window;
31class register_window;
32
33
34class command_window : public pmtty
35{
36public:
37 typedef pmtty parent;
38
39 // Contructors and destructors
40 command_window (pmapp *app, unsigned id, const char *fontnamesize,
41 char **argv);
42 ~command_window ();
43
44 // Querying members
45 const breakpoint_list::brkpt_node *get_breakpoint_list () const
46 { return breakpoints.list; }
47 const breakpoint *get_breakpoint (int n) const;
48 const char *get_debuggee () const { return debuggee; }
49 const source_files_window *get_srcs () const { return srcs; }
50
51 // Override member functions of pmframe
52 MRESULT wm_activate (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
53 MRESULT wm_command (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
54
55 // etc.
56 void show_source (const char *short_fname, const char *long_fname,
57 bool set_focus, int lineno = -1);
58 void capture_error (const capture *p);
59 void run_command ();
60 void prepare_run ();
61 void show_annotation (const annotation *ann);
62 void exec_file (const char *s, int len);
63 void where ();
64 void handle_output (const char *text, int len);
65 void associate_help (HWND hwnd);
66 void update_registers ();
67 void get_breakpoints ();
68
69 // Constants
70
71 enum
72 {
73 GSC_PROMPT = 0x0001,
74 GSC_RUNNING = 0x0002,
75 GSC_BREAKPOINTS = 0x0004,
76 GSC_EXEC_FILE = 0x0008
77 };
78
79private:
80
81 struct new_source;
82
83 void lock ();
84 void unlock ();
85 void key (char c);
86 void kill_input ();
87 void complete ();
88 void complete (const char *p);
89 HWND create_hwnd_menu ();
90 void completion_menu (HWND hwnd, int start, int count, int skip);
91 void from_history (bool next);
92 void replace_command (const char *s);
93 void exec_command ();
94 void font ();
95 void arg_add (const char *str);
96 void arg_delete_all ();
97 void thread ();
98 void notify (unsigned change);
99 void show_new_source (const new_source *ns);
100 void delete_source (source_window *src);
101 bool open_dialog (char *buf, const char *title, const char *fname);
102 void open_exec ();
103 void open_core ();
104 void open_source ();
105 void brkpt_update (int index, const breakpoint *old_bpt,
106 const breakpoint *new_bpt);
107 void get_breakpoints (source_window *src, bool paint);
108 source_window *find_source_short (const char *fname);
109 source_window *find_source_long (const char *fname);
110 void pmdbg_start ();
111 void pmdbg_stop ();
112 void pmdbg_term ();
113 MRESULT pmdebugmode_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
114 MRESULT startup_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
115 MRESULT history_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
116 void new_debuggee ();
117 void help_disable (const pmframe *frame);
118
119 // Override member functions of pmtxt
120 MRESULT wm_char (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
121 bool wm_user (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
122 MRESULT wm_close (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
123
124 struct src_node // Perhaps we should use a container class...
125 {
126 struct src_node *next;
127 source_window *src;
128 HWND hwndWinMenu;
129 unsigned menu_id;
130 };
131
132 struct cmd_hist;
133
134 // Data members
135
136 bool exec_file_pending;
137 bool help_ok;
138 char **argv;
139 int argv_used;
140 int argv_size;
141 fstring debuggee;
142
143 _fmutex mutex; // Hide pmtxt::mutex
144
145 astring input_line;
146 lstring completions;
147 cmd_hist *history;
148 cmd_hist *cur_cmd;
149
150 src_node *src_list;
151 int src_menu_id_count;
152 char *src_menu_id_used;
153
154 breakpoint_list breakpoints;
155
156 breakpoints_window *brk;
157 display_window *dsp;
158 threads_window *thr;
159 source_files_window *srcs;
160 register_window *reg;
161
162 gdbio *gdb;
163
164 // Friends
165 // TODO: Use more friends instead of public members?
166
167 friend source_window;
168 friend gdbio;
169 friend void command_window_thread (void *arg);
170 friend MRESULT EXPENTRY
171 dlg_pmdebugmode (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
172 friend MRESULT EXPENTRY
173 dlg_startup (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
174 friend MRESULT EXPENTRY
175 dlg_history (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
176};
Note: See TracBrowser for help on using the repository browser.