mirror of
https://github.com/libretro/Mesen.git
synced 2025-03-03 22:07:10 +00:00
Debugger: Fixed issue that sometimes caused an empty code window when opening debugger after opening other debugger tools
This commit is contained in:
parent
589ad612d1
commit
c0cfea6d6e
@ -746,8 +746,9 @@ const char* Debugger::GetCode(uint32_t &length)
|
||||
{
|
||||
string previousCode = _disassemblerOutput;
|
||||
GenerateCodeOutput();
|
||||
bool forceRefresh = length == UINT32_MAX;
|
||||
length = (uint32_t)_disassemblerOutput.size();
|
||||
if(previousCode.compare(_disassemblerOutput) == 0) {
|
||||
if(!forceRefresh && previousCode.compare(_disassemblerOutput) == 0) {
|
||||
//Return null pointer if the code is identical to last call
|
||||
//This avois the UTF8->UTF16 conversion that the UI needs to do
|
||||
//before comparing the strings
|
||||
|
@ -322,7 +322,7 @@ namespace Mesen.GUI.Debugger
|
||||
UpdateDebuggerFlags();
|
||||
UpdateVectorAddresses();
|
||||
|
||||
string newCode = InteropEmu.DebugGetCode();
|
||||
string newCode = InteropEmu.DebugGetCode(_firstBreak);
|
||||
if(newCode != null) {
|
||||
ctrlDebuggerCode.Code = newCode;
|
||||
}
|
||||
|
@ -300,11 +300,11 @@ namespace Mesen.GUI
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport(DLLPath, EntryPoint = "DebugGetCode")] private static extern IntPtr DebugGetCodeWrapper(out UInt32 length);
|
||||
public static string DebugGetCode()
|
||||
[DllImport(DLLPath, EntryPoint = "DebugGetCode")] private static extern IntPtr DebugGetCodeWrapper(ref UInt32 length);
|
||||
public static string DebugGetCode(bool forceRefresh)
|
||||
{
|
||||
UInt32 length;
|
||||
IntPtr ptrCodeString = InteropEmu.DebugGetCodeWrapper(out length);
|
||||
UInt32 length = forceRefresh ? UInt32.MaxValue : 0;
|
||||
IntPtr ptrCodeString = InteropEmu.DebugGetCodeWrapper(ref length);
|
||||
if(ptrCodeString == IntPtr.Zero) {
|
||||
return null;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user