summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
23aca1f)
Not all SFRs are visible in the unified address space, so the SFR-specific
accessors are required.
The dump command is the same as the various 'd*'
commands, but also supports dumping program memory.
The new -m (monitor) flag watches the command stream between s51 and sdcdb.
Signed-off-by: Keith Packard <keithp@keithp.com>
return command_success;
}
return command_success;
}
+static enum command_result
+parse_uint8(char *value, uint8_t *uint8)
+{
+ int v;
+ enum command_result result;
+
+ result = parse_int(value, &v);
+ if (result != command_success)
+ return command_error;
+ if (v < 0 || v > 0xff)
+ return command_error;
+ *uint8 = v;
+ return command_success;
+}
+
enum command_result
command_quit (int argc, char **argv)
{
enum command_result
command_quit (int argc, char **argv)
{
enum command_result
command_ds (int argc, char **argv)
{
enum command_result
command_ds (int argc, char **argv)
{
- uint16_t start, end;
- uint8_t memory[65536];
+ uint8_t start, end;
+ uint8_t memory[0x100];
uint8_t status;
int length;
if (argc != 3)
return command_error;
uint8_t status;
int length;
if (argc != 3)
return command_error;
- if (parse_uint16(argv[1], &start) != command_success)
+ if (parse_uint8(argv[1], &start) != command_success)
- if (parse_uint16(argv[2], &end) != command_success)
+ if (parse_uint8(argv[2], &end) != command_success)
return command_error;
length = (int) end - (int) start + 1;
return command_error;
length = (int) end - (int) start + 1;
- status = ccdbg_read_memory(s51_dbg, start + 0xdf00, memory, length);
+ status = ccdbg_read_sfr(s51_dbg, start, memory, length);
dump_bytes(memory, length, start);
return command_success;
}
dump_bytes(memory, length, start);
return command_success;
}
enum command_result
command_dump (int argc, char **argv)
{
enum command_result
command_dump (int argc, char **argv)
{
+ if (argv[1]) {
+ if (strcmp(argv[1], "rom") == 0 ||
+ strcmp(argv[1], "xram") == 0)
+ return command_dx(argc-1, argv+1);
+ if (strcmp(argv[1], "iram") == 0)
+ return command_di(argc-1, argv+1);
+ if (strcmp(argv[1], "sfr") == 0)
+ return command_ds(argc-1, argv+1);
+ }
char *s51_prompt = "> ";
struct ccdbg *s51_dbg;
int s51_interrupted = 0;
char *s51_prompt = "> ";
struct ccdbg *s51_dbg;
int s51_interrupted = 0;
static FILE *s51_input;
static FILE *s51_output;
static FILE *s51_input;
static FILE *s51_output;
char *endptr;
struct sigvec vec, ovec;
char *endptr;
struct sigvec vec, ovec;
- while ((opt = getopt(argc, argv, "PVvHht:X:c:r:Z:s:S:p:")) != -1) {
+ while ((opt = getopt(argc, argv, "PVvHhmt:X:c:r:Z:s:S:p:")) != -1) {
switch (opt) {
case 't':
cpu = optarg;
switch (opt) {
case 't':
cpu = optarg;
case 'h':
usage ();
break;
case 'h':
usage ();
break;
+ case 'm':
+ s51_monitor = 1;
+ break;
va_start(ap, format);
vfprintf(s51_output, format, ap);
va_start(ap, format);
vfprintf(s51_output, format, ap);
vfprintf(stdout, format, ap);
vfprintf(stdout, format, ap);
s51_putc('\0');
fflush(s51_output);
ret = fgets(line, len, s51_input) != NULL;
s51_putc('\0');
fflush(s51_output);
ret = fgets(line, len, s51_input) != NULL;
fflush(stdout);
return ret;
}
fflush(stdout);
return ret;
}
extern char *s51_prompt;
extern struct ccdbg *s51_dbg;
extern int s51_interrupted;
extern char *s51_prompt;
extern struct ccdbg *s51_dbg;
extern int s51_interrupted;
enum command_result {
command_success, command_debug, command_syntax, command_interrupt, command_error,
enum command_result {
command_success, command_debug, command_syntax, command_interrupt, command_error,