Skip to content

Commit

Permalink
fixed segfault that happen when Bochs has configuration error and bin…
Browse files Browse the repository at this point in the history
…ary is compiled with debugger support

solves the issue #397
  • Loading branch information
Stanislav Shwartsman committed Nov 27, 2024
1 parent 990d1f5 commit 05954ee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
4 changes: 0 additions & 4 deletions bochs/bx_debug/dbg_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,6 @@ void bx_dbg_exit(int code)
fclose(debugger_log);
debugger_log = NULL;

for (int cpu=0; cpu < BX_SMP_PROCESSORS; cpu++) {
if (BX_CPU(cpu)) BX_CPU(cpu)->atexit();
}

delete [] dbg_cpu_list;
dbg_cpu_list = NULL;

Expand Down
11 changes: 2 additions & 9 deletions bochs/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1378,15 +1378,8 @@ int bx_atexit(void)
// so that the user can see any messages left behind on the console.
SIM->set_display_mode(DISP_MODE_CONFIG);

#if BX_DEBUGGER == 0
if (SIM && SIM->get_init_done()) {
for (int cpu=0; cpu<BX_SMP_PROCESSORS; cpu++)
#if BX_SUPPORT_SMP
if (BX_CPU(cpu))
#endif
BX_CPU(cpu)->atexit();
}
#endif
for (int cpu=0; cpu<BX_SMP_PROCESSORS; cpu++)
if (BX_CPU(cpu)) BX_CPU(cpu)->atexit();

BX_MEM(0)->cleanup_memory();

Expand Down

0 comments on commit 05954ee

Please sign in to comment.