WCH RISC-V software breakpoints, and a few other bits of refactoring/tidying
This commit is contained in:
@@ -242,6 +242,8 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
|
||||
|
||||
void EdbgAvr8Interface::deactivate() {
|
||||
if (this->targetAttached) {
|
||||
this->clearAllBreakpoints();
|
||||
|
||||
if (
|
||||
this->session.targetConfig.physicalInterface == TargetPhysicalInterface::DEBUG_WIRE
|
||||
&& this->session.targetConfig.disableDebugWireOnDeactivate
|
||||
@@ -429,15 +431,6 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
|
||||
this->hardwareBreakpointNumbersByAddress.erase(address);
|
||||
}
|
||||
|
||||
void EdbgAvr8Interface::clearAllBreakpoints() {
|
||||
this->clearAllSoftwareBreakpoints();
|
||||
|
||||
// Clear all hardware breakpoints
|
||||
while (!this->hardwareBreakpointNumbersByAddress.empty()) {
|
||||
this->clearHardwareBreakpoint(this->hardwareBreakpointNumbersByAddress.begin()->first);
|
||||
}
|
||||
}
|
||||
|
||||
TargetRegisterDescriptorAndValuePairs EdbgAvr8Interface::readRegisters(
|
||||
const Targets::TargetRegisterDescriptors& descriptors
|
||||
) {
|
||||
@@ -1244,6 +1237,15 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
|
||||
}
|
||||
}
|
||||
|
||||
void EdbgAvr8Interface::clearAllBreakpoints() {
|
||||
this->clearAllSoftwareBreakpoints();
|
||||
|
||||
// Clear all hardware breakpoints
|
||||
while (!this->hardwareBreakpointNumbersByAddress.empty()) {
|
||||
this->clearHardwareBreakpoint(this->hardwareBreakpointNumbersByAddress.begin()->first);
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<AvrEvent> EdbgAvr8Interface::getAvrEvent() {
|
||||
auto event = this->edbgInterface->requestAvrEvent();
|
||||
|
||||
|
||||
@@ -201,14 +201,6 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
|
||||
*/
|
||||
void clearHardwareBreakpoint(Targets::TargetMemoryAddress address) override;
|
||||
|
||||
/**
|
||||
* Clears all software and hardware breakpoints on the target.
|
||||
*
|
||||
* This function will not clear any untracked hardware breakpoints (breakpoints that were installed in a
|
||||
* previous session).
|
||||
*/
|
||||
void clearAllBreakpoints() override;
|
||||
|
||||
/**
|
||||
* Reads registers from the target.
|
||||
*
|
||||
@@ -463,6 +455,14 @@ namespace DebugToolDrivers::Microchip::Protocols::Edbg::Avr
|
||||
*/
|
||||
void clearAllSoftwareBreakpoints();
|
||||
|
||||
/**
|
||||
* Clears all software and hardware breakpoints on the target.
|
||||
*
|
||||
* This function will not clear any untracked hardware breakpoints (breakpoints that were installed in a
|
||||
* previous session).
|
||||
*/
|
||||
void clearAllBreakpoints();
|
||||
|
||||
/**
|
||||
* Fetches any queued events belonging to the AVR8 Generic protocol (such as target break events).
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user