Cxbx-reloaded: Cxbx-Debugger does not work with multi-xbe titles

Created on 4 Sep 2018  路  3Comments  路  Source: Cxbx-Reloaded/Cxbx-Reloaded


Cxbx-Debugger does not work with multi-xbe titles - it just ends debugging session when game switches to another xbe.
Test-case: The Elder Scrolls III - Morrowind.

All 3 comments

@PatrickvL Here's an idea, use existing message ID_GUI_STATUS_KRNL_IS_READY listener to send a message to debugger. Then Cxbx-Debugger will continue to work with multi-xbe titles.

https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/eff6da755159e3f1d78401a47debc4ddcd8082ef/src/Cxbx/WndMain.cpp#L349-L358

A cheap fix is just to relaunch the debugger -

https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/ea7007090c0d1084cf9e49ae3516e18291020122/src/core/kernel/exports/EmuKrnlHal.cpp#L594-L596

with the patch

bool Debugging{ false };
g_EmuShared->GetDebuggingFlag(&Debugging);

if (!CxbxExec(Debugging, nullptr, false)) {
   CxbxKrnlCleanup("Could not launch %s", XbePath.c_str());
}

There's a monitoring thread that cares about this process though

With above suggestion, I do see design flaws such as...

  1. Debugger does not auto-start. If attach to debugger for reboot, it will produce an error message. (See screenshot below.)
  2. Previous debugger window remain open. Even if reboot do occur, there will be multiple of debugger windows.
    Plus if we self-close previous window then keep new debugger window open. Click start again (if reboot crashed) will not work as intention since it can be target to different xbe file than first booted xbe file.
  3. Original issue was when someone click "start debugger" from emulation menu more than once, it will show multiple of debugger windows until they close it. I had to fix it by check if previous debugger window was opened then close it and open new debugger window.

image
P.S. Ignore build info since I was doing some test with tags in the past.

In summary, cxbxr-debugger isn't multi-xbe compatible design wise at the moment. Unless there is some sort of bug with monitoring thread in cxbxr-debugger?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LukeUsher picture LukeUsher  路  4Comments

jackchentwkh picture jackchentwkh  路  3Comments

AzurikRiseOfPerathia picture AzurikRiseOfPerathia  路  4Comments

PatrickvL picture PatrickvL  路  3Comments

gandalfthewhite19890404 picture gandalfthewhite19890404  路  3Comments