summaryrefslogtreecommitdiff
path: root/ao-tools/ao-dbg/ao-dbg.h
blob: edc650a506c8d99c2c2a20de7ba43443a0726b3e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*
 * Copyright © 2008 Keith Packard <keithp@keithp.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
 */

#include <ccdbg.h>
#include <cc.h>

extern char *s51_prompt;
extern struct ccdbg *s51_dbg;
extern int s51_interrupted;
extern int s51_monitor;
extern char *s51_tty;
extern char *s51_device;

enum command_result {
	command_success, command_debug, command_syntax, command_interrupt, command_error,
};

struct command_function {
	char			*name;
	char			*alias;
	enum command_result	(*func)(int argc, char **argv);
	char			*usage;
	char			*help;
};

struct command_function *
command_string_to_function(struct command_function *functions, char *name);

enum command_result
command_function_help(struct command_function *functions, int argc, char **argv);

void
command_syntax_error(int argc, char **argv);

enum command_result
command_quit (int argc, char **argv);

enum command_result
command_help (int argc, char **argv);

enum command_result
command_stop (int argc, char **argv);

enum command_result
command_di (int argc, char **argv);

enum command_result
command_ds (int argc, char **argv);

enum command_result
command_dx (int argc, char **argv);

enum command_result
command_set (int argc, char **argv);

enum command_result
command_dump (int argc, char **argv);

enum command_result
command_file (int argc, char **argv);

enum command_result
command_pc (int argc, char **argv);

enum command_result
command_break (int argc, char **argv);

enum command_result
command_clear (int argc, char **argv);

enum command_result
command_run (int argc, char **argv);

enum command_result
command_next (int argc, char **argv);

enum command_result
command_step (int argc, char **argv);

enum command_result
command_load (int argc, char **argv);

enum command_result
command_halt (int argc, char **argv);

enum command_result
command_reset (int argc, char **argv);

enum command_result
command_status (int argc, char **argv);

enum command_result
command_info (int argc, char **argv);

enum command_result
cc_wait(void);

void
command_read (void);

void
s51_printf(char *format, ...);

void
s51_putc(int c);

int
s51_check_input(void);

int
s51_read_line(char *line, int len);