Fix watchpoint reporting
This commit is contained in:
@@ -215,13 +215,13 @@ extern "C" fn on_read(
|
||||
// There is no way for the userdata to be null or otherwise invalid.
|
||||
let data: &mut VBState = unsafe { &mut *vb_get_user_data(sim).cast() };
|
||||
|
||||
if data.read_watchpoints.contains(address) {
|
||||
if let Some(start) = data.read_watchpoints.start_of_range_containing(address) {
|
||||
let watch = if data.write_watchpoints.contains(address) {
|
||||
VBWatchpointType::Access
|
||||
} else {
|
||||
VBWatchpointType::Read
|
||||
};
|
||||
data.stop_reason = Some(StopReason::Watchpoint(watch, address));
|
||||
data.stop_reason = Some(StopReason::Watchpoint(watch, start));
|
||||
}
|
||||
|
||||
// Don't stop here, the debugger expects us to break after the memory access.
|
||||
@@ -242,13 +242,13 @@ extern "C" fn on_write(
|
||||
// There is no way for the userdata to be null or otherwise invalid.
|
||||
let data: &mut VBState = unsafe { &mut *vb_get_user_data(sim).cast() };
|
||||
|
||||
if data.write_watchpoints.contains(address) {
|
||||
if let Some(start) = data.write_watchpoints.start_of_range_containing(address) {
|
||||
let watch = if data.read_watchpoints.contains(address) {
|
||||
VBWatchpointType::Access
|
||||
} else {
|
||||
VBWatchpointType::Write
|
||||
};
|
||||
data.stop_reason = Some(StopReason::Watchpoint(watch, address));
|
||||
data.stop_reason = Some(StopReason::Watchpoint(watch, start));
|
||||
}
|
||||
|
||||
// Don't stop here, the debugger expects us to break after the memory access.
|
||||
|
||||
Reference in New Issue
Block a user