Removed debugging code. Other small bits of tidying
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -707,11 +703,9 @@ std::map<int, TargetPinState> Avr8::getPinStates(int variantId) {
|
||||
if (pad.ddrSetAddress.has_value()) {
|
||||
auto dataDirectionRegisterValue = readMemoryBitset(pad.ddrSetAddress.value());
|
||||
pinState.ioDirection = dataDirectionRegisterValue.test(pad.gpioPinNumber.value()) ?
|
||||
TargetPinState::IoDirection::OUTPUT : TargetPinState::IoDirection::INPUT;
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user