X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=ao-tools%2Fao-dbg%2Fao-dbg-command.c;h=f0e6b6cec51049e657a716e1fcc2a5586be312f8;hp=eab7bc689d7502f5832f61957ac06e22e8556fb2;hb=6f729ff46b2f4531db68f0af85e7e9fe0f6d1969;hpb=1c2a0b6653623b689d68d7349a6b2dce3e20a4a6 diff --git a/ao-tools/ao-dbg/ao-dbg-command.c b/ao-tools/ao-dbg/ao-dbg-command.c index eab7bc68..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; } @@ -202,8 +205,8 @@ command_dump (int argc, char **argv) enum command_result command_file (int argc, char **argv) { - struct hex_file *hex; - struct hex_image *image; + struct ao_hex_file *hex; + struct ao_hex_image *image; FILE *file; if (argc != 2) @@ -211,16 +214,16 @@ command_file (int argc, char **argv) file = fopen (argv[1], "r"); if (!file) return command_error; - hex = ccdbg_hex_file_read(file, argv[1]); + hex = ao_hex_file_read(file, argv[1]); fclose(file); if (!hex) return command_error; if (hex->nrecord == 0) { - ccdbg_hex_file_free(hex); + ao_hex_file_free(hex); return command_error; } - image = ccdbg_hex_image_create(hex); - ccdbg_hex_file_free(hex); + image = ao_hex_image_create(hex); + ao_hex_file_free(hex); start_address = image->address; ccdbg_set_rom(s51_dbg, image); 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; @@ -495,8 +495,8 @@ command_load (int argc, char **argv) { char *filename = argv[1]; FILE *file; - struct hex_file *hex; - struct hex_image *image; + struct ao_hex_file *hex; + struct ao_hex_image *image; if (!filename) return command_error; @@ -505,13 +505,13 @@ command_load (int argc, char **argv) perror(filename); return command_error; } - hex = ccdbg_hex_file_read(file, filename); + hex = ao_hex_file_read(file, filename); fclose(file); if (!hex) { return command_error; } - image = ccdbg_hex_image_create(hex); - ccdbg_hex_file_free(hex); + image = ao_hex_image_create(hex); + ao_hex_file_free(hex); if (!image) { fprintf(stderr, "image create failed\n"); return command_error; @@ -523,7 +523,7 @@ command_load (int argc, char **argv) } else { fprintf(stderr, "Can only load to RAM\n"); } - ccdbg_hex_image_free(image); + ao_hex_image_free(image); return command_success; } @@ -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