Debugger: Fix crash by breakpoint on message literal

This commit is contained in:
kichikuou
2021-08-15 18:19:37 +09:00
parent 3e46c54ce6
commit f8b7adf3d0
4 changed files with 7 additions and 4 deletions
+3
View File
@@ -240,6 +240,9 @@ struct debug_symbols *dsym_load(const char *path) {
return NULL;
}
}
if (fgetc(fp) != EOF)
WARNING("%s: broken debug information structure\n", path);
fclose(fp);
return dsym;
}
+2 -2
View File
@@ -113,7 +113,7 @@ boolean dbg_delete_breakpoint(int no) {
return false;
}
int dbg_handle_breakpoint(int page, int addr) {
BYTE dbg_handle_breakpoint(int page, int addr) {
Breakpoint *bp = dbg_find_breakpoint(page, addr);
if (!bp)
SYSERROR("Illegal BREAKPOINT instruction");
@@ -121,7 +121,7 @@ int dbg_handle_breakpoint(int page, int addr) {
dbg_state = bp->no == INTERNAL_BREAKPOINT_NO ?
DBG_STOPPED_NEXT : DBG_STOPPED_BREAKPOINT;
char restore_op = bp->restore_op;
BYTE restore_op = bp->restore_op;
dbg_main(); // this may destroy bp
return restore_op;
}
+1 -1
View File
@@ -39,6 +39,6 @@ extern DebuggerState dbg_state;
#define dbg_interrupted() (dbg_state == DBG_STOPPED_INTERRUPT)
void dbg_init(const char *symbols_path);
void dbg_main(void);
int dbg_handle_breakpoint(int page, int addr);
BYTE dbg_handle_breakpoint(int page, int addr);
#endif // __DEBUGGER_H__
+1 -1
View File
@@ -30,7 +30,7 @@ typedef struct breakpoint {
int no;
int page;
int addr;
char restore_op;
BYTE restore_op;
dridata *dfile; // keeps modified scenario page alive in the cache
} Breakpoint;