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());
|
Logger::info("Accepted GDP RSP connection from " + this->clientConnection->getIpAddress());
|
||||||
this->eventManager.triggerEvent(std::make_shared<Events::DebugSessionStarted>());
|
this->eventManager.triggerEvent(std::make_shared<Events::DebugSessionStarted>());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// This method should not return until a connection has been established (or an exception is thrown)
|
// This method should not return until a connection has been established (or an exception is thrown)
|
||||||
return this->waitForConnection();
|
return this->waitForConnection();
|
||||||
|
|||||||
@@ -29,8 +29,14 @@ namespace Bloom
|
|||||||
return this->initialised;
|
return this->initialised;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Should establish a connection to the device and prepare it for a debug session.
|
||||||
|
*/
|
||||||
virtual void init() = 0;
|
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 void close() = 0;
|
||||||
|
|
||||||
virtual std::string getName() = 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.
|
* 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
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual Avr8Interface* getAvr8Interface() {
|
virtual Avr8Interface* getAvr8Interface() {
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ void TargetController::shutdown() {
|
|||||||
Logger::info("Closing debug tool");
|
Logger::info("Closing debug tool");
|
||||||
debugTool->close();
|
debugTool->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (const std::exception& exception) {
|
} catch (const std::exception& exception) {
|
||||||
Logger::error("Failed to properly shutdown TargetController. Error: " + std::string(exception.what()));
|
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);
|
gpRegisters.push_back(targetRegister);
|
||||||
|
|
||||||
} else if (targetRegister.descriptor.type == TargetRegisterType::PROGRAM_COUNTER) {
|
} else if (targetRegister.descriptor.type == TargetRegisterType::PROGRAM_COUNTER) {
|
||||||
Logger::debug("Setting PC register");
|
|
||||||
|
|
||||||
auto programCounterBytes = targetRegister.value;
|
auto programCounterBytes = targetRegister.value;
|
||||||
|
|
||||||
if (programCounterBytes.size() < 4) {
|
if (programCounterBytes.size() < 4) {
|
||||||
@@ -581,11 +579,9 @@ void Avr8::writeRegisters(const TargetRegisters& registers) {
|
|||||||
));
|
));
|
||||||
|
|
||||||
} else if (targetRegister.descriptor.type == TargetRegisterType::STATUS_REGISTER) {
|
} else if (targetRegister.descriptor.type == TargetRegisterType::STATUS_REGISTER) {
|
||||||
Logger::error("Setting status register");
|
|
||||||
this->avr8Interface->setStatusRegister(targetRegister);
|
this->avr8Interface->setStatusRegister(targetRegister);
|
||||||
|
|
||||||
} else if (targetRegister.descriptor.type == TargetRegisterType::STACK_POINTER) {
|
} else if (targetRegister.descriptor.type == TargetRegisterType::STACK_POINTER) {
|
||||||
Logger::error("Setting stack pointer register");
|
|
||||||
this->avr8Interface->setStackPointerRegister(targetRegister);
|
this->avr8Interface->setStackPointerRegister(targetRegister);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -707,11 +703,9 @@ std::map<int, TargetPinState> Avr8::getPinStates(int variantId) {
|
|||||||
if (pad.ddrSetAddress.has_value()) {
|
if (pad.ddrSetAddress.has_value()) {
|
||||||
auto dataDirectionRegisterValue = readMemoryBitset(pad.ddrSetAddress.value());
|
auto dataDirectionRegisterValue = readMemoryBitset(pad.ddrSetAddress.value());
|
||||||
pinState.ioDirection = dataDirectionRegisterValue.test(pad.gpioPinNumber.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
|
if (pinState.ioDirection == TargetPinState::IoDirection::OUTPUT && pad.gpioPortSetAddress.has_value()) {
|
||||||
&& pad.gpioPortSetAddress.has_value()
|
|
||||||
) {
|
|
||||||
auto portRegisterValue = readMemoryBitset(pad.gpioPortSetAddress.value());
|
auto portRegisterValue = readMemoryBitset(pad.gpioPortSetAddress.value());
|
||||||
pinState.ioState = portRegisterValue.test(pad.gpioPinNumber.value()) ?
|
pinState.ioState = portRegisterValue.test(pad.gpioPinNumber.value()) ?
|
||||||
TargetPinState::IoState::HIGH : TargetPinState::IoState::LOW;
|
TargetPinState::IoState::HIGH : TargetPinState::IoState::LOW;
|
||||||
|
|||||||
Reference in New Issue
Block a user