summaryrefslogtreecommitdiff
path: root/ao-tools/ao-dbg
diff options
context:
space:
mode:
Diffstat (limited to 'ao-tools/ao-dbg')
-rw-r--r--ao-tools/ao-dbg/ao-dbg-command.c20
-rw-r--r--ao-tools/ao-dbg/ao-dbg-main.c6
-rw-r--r--ao-tools/ao-dbg/ao-dbg-parse.c35
-rw-r--r--ao-tools/ao-dbg/ao-dbg.h1
4 files changed, 13 insertions, 49 deletions
diff --git a/ao-tools/ao-dbg/ao-dbg-command.c b/ao-tools/ao-dbg/ao-dbg-command.c
index 11c521e8..f0e6b6ce 100644
--- a/ao-tools/ao-dbg/ao-dbg-command.c
+++ b/ao-tools/ao-dbg/ao-dbg-command.c
@@ -106,6 +106,7 @@ command_di (int argc, char **argv)
return command_error;
length = (int) end - (int) start + 1;
status = ccdbg_read_memory(s51_dbg, start + 0xff00, memory, length);
+ (void) status;
dump_bytes(memory, length, start, "0x%02x ");
return command_success;
}
@@ -126,6 +127,7 @@ command_ds (int argc, char **argv)
return command_error;
length = (int) end - (int) start + 1;
status = ccdbg_read_sfr(s51_dbg, start, memory, length);
+ (void) status;
dump_bytes(memory, length, start, "0x%02x ");
return command_success;
}
@@ -146,6 +148,7 @@ command_dx (int argc, char **argv)
return command_error;
length = (int) end - (int) start + 1;
status = ccdbg_read_memory(s51_dbg, start, memory, length);
+ (void) status;
dump_bytes(memory, length, start, "0x%04x ");
return command_success;
}
@@ -282,11 +285,10 @@ enable_breakpoints(void)
enable_breakpoint(b);
}
-enum command_result
+static enum command_result
set_breakpoint(uint16_t address, int temporary)
{
int b;
- uint8_t status;
for (b = 0; b < CC_NUM_BREAKPOINTS; b++) {
if (breakpoints[b].enabled == 0)
break;
@@ -307,11 +309,10 @@ set_breakpoint(uint16_t address, int temporary)
return command_success;
}
-enum command_result
+static enum command_result
clear_breakpoint(uint16_t address, int temporary)
{
int b;
- uint8_t status;
for (b = 0; b < CC_NUM_BREAKPOINTS; b++) {
if (breakpoints[b].enabled != 0 &&
@@ -333,7 +334,7 @@ clear_breakpoint(uint16_t address, int temporary)
}
-int
+static int
find_breakpoint(uint16_t address)
{
int b;
@@ -372,7 +373,6 @@ command_break (int argc, char **argv)
enum command_result
command_clear (int argc, char **argv)
{
- int b;
uint16_t address;
enum command_result result;
@@ -384,7 +384,7 @@ command_clear (int argc, char **argv)
return clear_breakpoint(address, 0);
}
-void
+static void
cc_stopped(uint8_t status)
{
uint16_t pc;
@@ -411,7 +411,7 @@ cc_stopped(uint8_t status)
}
}
-uint8_t
+static uint8_t
cc_step(uint16_t pc)
{
int b;
@@ -585,8 +585,6 @@ static enum command_result
info_breakpoints(int argc, char **argv)
{
int b;
- uint16_t address;
- enum command_result result;
if (argc == 1) {
s51_printf("Num Type Disp Hit Cnt Address What\n");
@@ -599,7 +597,7 @@ info_breakpoints(int argc, char **argv)
}
return command_success;
}
-
+ return command_syntax;
}
static enum command_result
diff --git a/ao-tools/ao-dbg/ao-dbg-main.c b/ao-tools/ao-dbg/ao-dbg-main.c
index 8c879035..772701a9 100644
--- a/ao-tools/ao-dbg/ao-dbg-main.c
+++ b/ao-tools/ao-dbg/ao-dbg-main.c
@@ -50,7 +50,8 @@ usage(void)
exit(1);
}
-void s51_sigint()
+static void
+s51_sigint(int signum)
{
s51_interrupted = 1;
}
@@ -64,7 +65,7 @@ static const struct option options[] = {
int
main(int argc, char **argv)
{
- int flags, opt;
+ int opt;
char *endptr;
while ((opt = getopt_long(argc, argv, "PVvHhmt:X:c:r:Z:s:S:p:T:", options, NULL)) != -1) {
@@ -242,7 +243,6 @@ s51_check_input(void)
{
struct pollfd input;
int r;
- int c;
input.fd = fileno(s51_input);
input.events = POLLIN;
diff --git a/ao-tools/ao-dbg/ao-dbg-parse.c b/ao-tools/ao-dbg/ao-dbg-parse.c
index ba691834..b61d68b8 100644
--- a/ao-tools/ao-dbg/ao-dbg-parse.c
+++ b/ao-tools/ao-dbg/ao-dbg-parse.c
@@ -68,41 +68,6 @@ static struct command_function functions[] = {
#define TRUE 1
#endif
-static int
-string_to_int(char *s, int *v)
-{
- char *endptr;
-
- if (isdigit(s[0]) || s[0] == '-' || s[0] == '+') {
- *v = strtol(s, &endptr, 0);
- if (endptr == s)
- return FALSE;
- } else if (*s == '\'') {
- s++;
- if (*s == '\\') {
- s++;
- switch (*s) {
- case 'n':
- *v = '\n';
- break;
- case 't':
- *v = '\t';
- break;
- default:
- *v = (int) *s;
- break;
- }
- } else
- *v = (int) *s;
- s++;
- if (*s != '\'')
- return FALSE;
- }
- else
- return FALSE;
- return TRUE;
-}
-
struct command_function *
command_string_to_function(struct command_function *functions, char *name)
{
diff --git a/ao-tools/ao-dbg/ao-dbg.h b/ao-tools/ao-dbg/ao-dbg.h
index edc650a5..2ced54b5 100644
--- a/ao-tools/ao-dbg/ao-dbg.h
+++ b/ao-tools/ao-dbg/ao-dbg.h
@@ -18,6 +18,7 @@
#include <ccdbg.h>
#include <cc.h>
+#include <ctype.h>
extern char *s51_prompt;
extern struct ccdbg *s51_dbg;