Debugger: Display read/written value when breaking execution
This commit is contained in:
parent
8deb63e646
commit
d8097a1c94
3 changed files with 11 additions and 8 deletions
|
@ -397,7 +397,7 @@ bool Debugger::ProcessBreakpoints(BreakpointType type, OperationInfo &operationI
|
|||
if(needBreak && allowBreak) {
|
||||
//Found a matching breakpoint, stop execution
|
||||
Step(1);
|
||||
SleepUntilResume(BreakSource::Breakpoint, breakpointId, type, operationInfo.Address, operationInfo.OperationType);
|
||||
SleepUntilResume(BreakSource::Breakpoint, breakpointId, type, operationInfo.Address, operationInfo.Value, operationInfo.OperationType);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
@ -449,7 +449,7 @@ void Debugger::ProcessAllBreakpoints(OperationInfo &operationInfo, AddressTypeIn
|
|||
//Break on uninit memory read
|
||||
if(_memoryAccessCounter->IsAddressUninitialized(addressInfo)) {
|
||||
Step(1);
|
||||
SleepUntilResume(BreakSource::BreakOnUninitMemoryRead, 0, BreakpointType::ReadRam, addr);
|
||||
SleepUntilResume(BreakSource::BreakOnUninitMemoryRead, 0, BreakpointType::ReadRam, addr, value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -874,7 +874,7 @@ bool Debugger::ProcessRamOperation(MemoryOperationType type, uint16_t &addr, uin
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Debugger::SleepUntilResume(BreakSource source, uint32_t breakpointId, BreakpointType bpType, uint16_t bpAddress, MemoryOperationType bpMemOpType)
|
||||
bool Debugger::SleepUntilResume(BreakSource source, uint32_t breakpointId, BreakpointType bpType, uint16_t bpAddress, uint8_t bpValue, MemoryOperationType bpMemOpType)
|
||||
{
|
||||
int32_t stepCount = _stepCount.load();
|
||||
if(stepCount > 0) {
|
||||
|
@ -902,7 +902,8 @@ bool Debugger::SleepUntilResume(BreakSource source, uint32_t breakpointId, Break
|
|||
_breakSource = BreakSource::Unspecified;
|
||||
|
||||
uint64_t param = (
|
||||
((uint64_t)breakpointId << 32) |
|
||||
((uint64_t)breakpointId << 40) |
|
||||
((uint64_t)bpValue << 32) |
|
||||
((uint64_t)(bpAddress & 0xFFFF) << 16) |
|
||||
((uint64_t)((int)bpMemOpType & 0x0F) << 12) |
|
||||
((uint64_t)(bpType & 0x0F) << 8) |
|
||||
|
|
|
@ -150,7 +150,7 @@ private:
|
|||
void UpdateCallstack(uint8_t currentInstruction, uint32_t addr);
|
||||
|
||||
void ProcessStepConditions(uint16_t addr);
|
||||
bool SleepUntilResume(BreakSource source, uint32_t breakpointId = 0, BreakpointType bpType = BreakpointType::Global, uint16_t bpAddress = 0, MemoryOperationType bpMemOpType = MemoryOperationType::Read);
|
||||
bool SleepUntilResume(BreakSource source, uint32_t breakpointId = 0, BreakpointType bpType = BreakpointType::Global, uint16_t bpAddress = 0, uint8_t bpValue = 0, MemoryOperationType bpMemOpType = MemoryOperationType::Read);
|
||||
|
||||
void AddDebugEvent(DebugEventType type, uint16_t address = -1, uint8_t value = 0, int16_t breakpointId = -1, int8_t ppuLatch = -1);
|
||||
|
||||
|
|
|
@ -498,7 +498,8 @@ namespace Mesen.GUI.Debugger
|
|||
if(ConfigManager.Config.DebugInfo.ShowBreakNotifications) {
|
||||
message = ResourceHelper.GetEnumText(source);
|
||||
if(source == BreakSource.Breakpoint) {
|
||||
int breakpointId = (int)(param >> 32);
|
||||
int breakpointId = (int)(param >> 40);
|
||||
byte bpValue = (byte)((param >> 32) & 0xFF);
|
||||
BreakpointType bpType = (BreakpointType)(byte)((param >> 8) & 0x0F);
|
||||
InteropMemoryOperationType memOpType = (InteropMemoryOperationType)(byte)((param >> 12) & 0x0F);
|
||||
UInt16 bpAddress = (UInt16)(param >> 16);
|
||||
|
@ -507,7 +508,7 @@ namespace Mesen.GUI.Debugger
|
|||
if(breakpointId >= 0 && breakpointId < breakpoints.Count) {
|
||||
Breakpoint bp = breakpoints[breakpointId];
|
||||
if(bpType != BreakpointType.Global) {
|
||||
message += ": " + ResourceHelper.GetEnumText(bpType) + " ($" + bpAddress.ToString("X4") + ")";
|
||||
message += ": " + ResourceHelper.GetEnumText(bpType) + " ($" + bpAddress.ToString("X4") + ":$" + bpValue.ToString("X2") + ")";
|
||||
}
|
||||
if(!string.IsNullOrWhiteSpace(bp.Condition)) {
|
||||
string cond = bp.Condition.Trim();
|
||||
|
@ -520,7 +521,8 @@ namespace Mesen.GUI.Debugger
|
|||
}
|
||||
} else if(source == BreakSource.BreakOnUninitMemoryRead) {
|
||||
UInt16 address = (UInt16)(param >> 16);
|
||||
message += " ($" + address.ToString("X4") + ")";
|
||||
byte value = (byte)((param >> 32) & 0xFF);
|
||||
message += " ($" + address.ToString("X4") + ":$" + value.ToString("X2") + ")";
|
||||
} else if(source == BreakSource.CpuStep || source == BreakSource.PpuStep) {
|
||||
//Don't display anything when breaking due to stepping
|
||||
message = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue