Removed debugging code. Other small bits of tidying

This commit is contained in:
Nav
2021-04-12 19:43:42 +01:00
parent 7e6bb420c3
commit 8da2aa3a8d
4 changed files with 12 additions and 8 deletions

View File

@@ -156,6 +156,7 @@ void GdbRspDebugServer::waitForConnection() {
Logger::info("Accepted GDP RSP connection from " + this->clientConnection->getIpAddress());
this->eventManager.triggerEvent(std::make_shared<Events::DebugSessionStarted>());
} else {
// This method should not return until a connection has been established (or an exception is thrown)
return this->waitForConnection();

View File

@@ -29,8 +29,14 @@ namespace Bloom
return this->initialised;
}
/**
* Should establish a connection to the device and prepare it for a debug session.
*/
virtual void init() = 0;
/**
* Should disconnect from the device after performing any tasks required to formally end the debug session.
*/
virtual void close() = 0;
virtual std::string getName() = 0;
@@ -43,6 +49,8 @@ namespace Bloom
*
* For debug tools that do not support AVR8 targets, this method should return a nullptr.
*
* Note: the caller of this method will not manage the lifetime of the returned Avr8Interface instance.
*
* @return
*/
virtual Avr8Interface* getAvr8Interface() {

View File

@@ -235,6 +235,7 @@ void TargetController::shutdown() {
Logger::info("Closing debug tool");
debugTool->close();
}
} catch (const std::exception& exception) {
Logger::error("Failed to properly shutdown TargetController. Error: " + std::string(exception.what()));
}

View File

@@ -564,8 +564,6 @@ void Avr8::writeRegisters(const TargetRegisters& registers) {
gpRegisters.push_back(targetRegister);
} else if (targetRegister.descriptor.type == TargetRegisterType::PROGRAM_COUNTER) {
Logger::debug("Setting PC register");
auto programCounterBytes = targetRegister.value;
if (programCounterBytes.size() < 4) {
@@ -581,11 +579,9 @@ void Avr8::writeRegisters(const TargetRegisters& registers) {
));
} else if (targetRegister.descriptor.type == TargetRegisterType::STATUS_REGISTER) {
Logger::error("Setting status register");
this->avr8Interface->setStatusRegister(targetRegister);
} else if (targetRegister.descriptor.type == TargetRegisterType::STACK_POINTER) {
Logger::error("Setting stack pointer register");
this->avr8Interface->setStackPointerRegister(targetRegister);
}
}
@@ -709,9 +705,7 @@ std::map<int, TargetPinState> Avr8::getPinStates(int variantId) {
pinState.ioDirection = dataDirectionRegisterValue.test(pad.gpioPinNumber.value()) ?
TargetPinState::IoDirection::OUTPUT : TargetPinState::IoDirection::INPUT;
if (pinState.ioDirection == TargetPinState::IoDirection::OUTPUT
&& pad.gpioPortSetAddress.has_value()
) {
if (pinState.ioDirection == TargetPinState::IoDirection::OUTPUT && pad.gpioPortSetAddress.has_value()) {
auto portRegisterValue = readMemoryBitset(pad.gpioPortSetAddress.value());
pinState.ioState = portRegisterValue.test(pad.gpioPinNumber.value()) ?
TargetPinState::IoState::HIGH : TargetPinState::IoState::LOW;