mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-08 14:48:19 +03:00
Debugger: Fix crash by breakpoint on message literal
This commit is contained in:
@@ -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
@@ -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
@@ -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__
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user