--- previous/src/debug/debugui.c 2018/04/24 19:25:54 1.1.1.2 +++ previous/src/debug/debugui.c 2018/04/24 19:34:01 1.1.1.4 @@ -27,8 +27,6 @@ const char DebugUI_fileid[] = "Hatari de #include "file.h" #include "log.h" #include "m68000.h" -#include "memorySnapShot.h" -#include "options.h" #include "screen.h" #include "statusbar.h" #include "str.h" @@ -43,7 +41,7 @@ const char DebugUI_fileid[] = "Hatari de int bExceptionDebugging; -FILE *debugOutput; +FILE *debugOutput = NULL; static dbgcommand_t *debugCommand; static int debugCommands; @@ -273,28 +271,6 @@ static char *DebugUI_EvaluateExpressions return input; } - -/** - * Command: Store and restore emulation state - */ -static int DebugUI_DoMemorySnap(int argc, char *argv[]) -{ - const char *file; - - if (argc > 1) - file = argv[1]; - else - file = ConfigureParams.Memory.szMemoryCaptureFileName; - - if (strcmp(argv[0], "stateload") == 0) - MemorySnapShot_Restore(file, true); - else - MemorySnapShot_Capture(file, true); - - return DEBUGGER_CMDDONE; -} - - /** * Command: Set command line and debugger options */ @@ -338,7 +314,7 @@ static int DebugUI_SetOptions(int argc, /* get configuration changes */ current = ConfigureParams; - +#if 0 /* Parse and apply options */ if (Opt_ParseParameters(argc, (const char * const *)argv)) { @@ -346,6 +322,7 @@ static int DebugUI_SetOptions(int argc, Change_CopyChangedParamsToConfiguration(¤t, &ConfigureParams, false); } else +#endif { ConfigureParams = current; } @@ -802,7 +779,7 @@ static const dbgcommand_t uicommand[] = "[filename]\n" "\tRead debugger commands from given file and do them.", false }, - { DebugUI_SetOptions, Opt_MatchOption, + { DebugUI_SetOptions, NULL /* Opt_MatchOption */, "setopt", "o", "set Hatari command line and debugger options", "[|]\n" @@ -811,25 +788,13 @@ static const dbgcommand_t uicommand[] = "\t'bin', 'dec' and 'hex' arguments change the default number base\n" "\tused in debugger.", false }, - { DebugUI_DoMemorySnap, NULL, - "stateload", "", - "restore emulation state", - "[filename]\n" - "\tRestore emulation snapshot from default or given file", - false }, - { DebugUI_DoMemorySnap, NULL, - "statesave", "", - "save emulation state", - "[filename]\n" - "\tSave emulation snapshot to default or given file", - false }, { DebugUI_SetTracing, Log_MatchTrace, "trace", "t", "select Hatari tracing settings", "[set1,set2...]\n" "\tSelect Hatari tracing settings. 'help' shows all the available\n" "\tsettings. For example, to enable CPU disassembly and VBL\n" - "\ttracing, use:\n\t\ttrace cpu_disasm,video_hbl", + "\ttracing, use:\n\t\ttrace cpu_disasm", false }, { DebugUI_QuitEmu, NULL, "quit", "q", @@ -845,9 +810,13 @@ static const dbgcommand_t uicommand[] = */ void DebugUI_Init(void) { - const dbgcommand_t *cpucmd, *dspcmd; - int cpucmds, dspcmds; + const dbgcommand_t *cpucmd; + int cpucmds; + if(!(debugOutput)){ + debugOutput = stderr; + } + /* already intialized? */ if (debugCommands) return; @@ -887,7 +856,7 @@ bool DebugUI_SetParseFile(const char *pa parseFileName = path; return true; } - fprintf(stderr, "ERROR: debugger input file '%s' missing.\n", path); + //fprintf(stderr, "ERROR: debugger input file '%s' missing.\n", path); return false; } @@ -920,7 +889,7 @@ void DebugUI(void) /* override paused message so that user knows to look into console * on how to continue in case he invoked the debugger by accident. */ - Statusbar_AddMessage("Console Debugger", 100); + Statusbar_AddMessage("M68K Console Debugger", 100); Statusbar_Update(sdlscrn); /* disable normal GUI alerts while on console */ @@ -948,9 +917,10 @@ void DebugUI(void) while (cmdret != DEBUGGER_END); /* free (and ignore) exit command */ - if (psCmd) - free(psCmd); - + if (psCmd) { + free(psCmd); + } + Log_SetAlertLevel(alertLevel); DebugUI_SetLogDefault();