This commit is contained in:
parent
7e976f0a78
commit
517db4657a
3 changed files with 711 additions and 674 deletions
1371
debugger.cpp
1371
debugger.cpp
File diff suppressed because it is too large
Load diff
|
@ -7,6 +7,6 @@
|
||||||
|
|
||||||
|
|
||||||
int disassemble(cpu *const c, console *const cnsl, const uint16_t pc, const bool instruction_only);
|
int disassemble(cpu *const c, console *const cnsl, const uint16_t pc, const bool instruction_only);
|
||||||
void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event);
|
void debugger(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event, const std::optional<std::string> & init);
|
||||||
|
|
||||||
void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event, const uint16_t bic_start);
|
void run_bic(console *const cnsl, bus *const b, std::atomic_uint32_t *const stop_event, const uint16_t bic_start);
|
||||||
|
|
12
main.cpp
12
main.cpp
|
@ -258,6 +258,7 @@ void help()
|
||||||
printf("-b enable bootloader (builtin)\n");
|
printf("-b enable bootloader (builtin)\n");
|
||||||
printf("-n ncurses UI\n");
|
printf("-n ncurses UI\n");
|
||||||
printf("-d enable debugger\n");
|
printf("-d enable debugger\n");
|
||||||
|
printf("-f x first process the commands from file x before entering the debugger\n");
|
||||||
printf("-S x set ram size (in number of 8 kB pages)\n");
|
printf("-S x set ram size (in number of 8 kB pages)\n");
|
||||||
printf("-s x,y set console switche state: set bit x (0...15) to y (0/1)\n");
|
printf("-s x,y set console switche state: set bit x (0...15) to y (0/1)\n");
|
||||||
printf("-t enable tracing (disassemble to stderr, requires -d as well)\n");
|
printf("-t enable tracing (disassemble to stderr, requires -d as well)\n");
|
||||||
|
@ -276,7 +277,8 @@ int main(int argc, char *argv[])
|
||||||
std::vector<disk_backend *> disk_files;
|
std::vector<disk_backend *> disk_files;
|
||||||
std::string disk_type = "rk05";
|
std::string disk_type = "rk05";
|
||||||
|
|
||||||
bool run_debugger = false;
|
bool run_debugger = false;
|
||||||
|
std::optional<std::string> debugger_init;
|
||||||
|
|
||||||
bool enable_bootloader = false;
|
bool enable_bootloader = false;
|
||||||
bootloader_t bootloader = BL_NONE;
|
bootloader_t bootloader = BL_NONE;
|
||||||
|
@ -311,13 +313,17 @@ int main(int argc, char *argv[])
|
||||||
std::optional<std::string> dc11_device;
|
std::optional<std::string> dc11_device;
|
||||||
|
|
||||||
int opt = -1;
|
int opt = -1;
|
||||||
while((opt = getopt(argc, argv, "hqD:MT:Br:R:p:ndtL:bl:s:Q:N:J:XS:P1:")) != -1)
|
while((opt = getopt(argc, argv, "hqD:MT:Br:R:p:ndf:tL:bl:s:Q:N:J:XS:P1:")) != -1)
|
||||||
{
|
{
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'h':
|
case 'h':
|
||||||
help();
|
help();
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
case 'f':
|
||||||
|
debugger_init = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
case '1':
|
case '1':
|
||||||
dc11_device = optarg;
|
dc11_device = optarg;
|
||||||
break;
|
break;
|
||||||
|
@ -612,7 +618,7 @@ int main(int argc, char *argv[])
|
||||||
if (is_bic)
|
if (is_bic)
|
||||||
run_bic(cnsl, b, &event, bic_start.value());
|
run_bic(cnsl, b, &event, bic_start.value());
|
||||||
else if (run_debugger || (bootloader == BL_NONE && test.empty() && tape.empty()))
|
else if (run_debugger || (bootloader == BL_NONE && test.empty() && tape.empty()))
|
||||||
debugger(cnsl, b, &event);
|
debugger(cnsl, b, &event, debugger_init);
|
||||||
else if (benchmark) {
|
else if (benchmark) {
|
||||||
// FILL MEMORY
|
// FILL MEMORY
|
||||||
memory *m = b->getRAM();
|
memory *m = b->getRAM();
|
||||||
|
|
Loading…
Add table
Reference in a new issue