|
|
|
@ -8,6 +8,7 @@ |
|
|
|
|
uint64_t memory_size = 512 * 1024 * 1024; |
|
|
|
|
char* file_path; |
|
|
|
|
bool gdbstub = false; |
|
|
|
|
bool trace = false; |
|
|
|
|
|
|
|
|
|
static void print_usage(); |
|
|
|
|
static void print_help(); |
|
|
|
@ -100,6 +101,11 @@ void parse_options(int argc, char** argv) |
|
|
|
|
gdbstub = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case 't': |
|
|
|
|
{ |
|
|
|
|
trace = true; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
fprintf(stderr, "Error: Unknown short option -%c\n", argv[i][k]); |
|
|
|
@ -161,6 +167,11 @@ static int parse_long_option(char* str, char* argq) |
|
|
|
|
gdbstub = true; |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
else if(strcmp(str, "trace") == 0) |
|
|
|
|
{ |
|
|
|
|
trace = true; |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
fprintf(stderr, "Error: Unknown long option " OPTION_SEPARATOR OPTION_SEPARATOR "%s\n", str); |
|
|
|
@ -181,6 +192,7 @@ static void print_help() |
|
|
|
|
printf(" " OPTION_SEPARATOR "h, " OPTION_SEPARATOR "?, --help\t\tPrint this help message\n"); |
|
|
|
|
printf(" " OPTION_SEPARATOR "v, --version\t\t\tPrint version information\n"); |
|
|
|
|
printf(" " OPTION_SEPARATOR "m, --memory\t\t\tSet the simulated memory size, in MiB (max 4096)\n"); |
|
|
|
|
printf(" " OPTION_SEPARATOR "t, --trace\t\t\tTrace executed instructions in stdout\n"); |
|
|
|
|
printf(" " OPTION_SEPARATOR "s, --gdb-stub\t\tLaunch a gdb stub server (remote gdb debugging)\n"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|