Removed TC state code from insight and debug server components
This commit is contained in:
@@ -121,10 +121,6 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
Logger::info("GDB RSP address: " + this->debugServerConfig.listeningAddress);
|
Logger::info("GDB RSP address: " + this->debugServerConfig.listeningAddress);
|
||||||
Logger::info("GDB RSP port: " + std::to_string(this->debugServerConfig.listeningPortNumber));
|
Logger::info("GDB RSP port: " + std::to_string(this->debugServerConfig.listeningPortNumber));
|
||||||
|
|
||||||
this->eventListener.registerCallbackForEventType<Events::TargetControllerStateChanged>(
|
|
||||||
std::bind(&GdbRspDebugServer::onTargetControllerStateChanged, this, std::placeholders::_1)
|
|
||||||
);
|
|
||||||
|
|
||||||
this->eventListener.registerCallbackForEventType<Events::TargetExecutionStopped>(
|
this->eventListener.registerCallbackForEventType<Events::TargetExecutionStopped>(
|
||||||
std::bind(&GdbRspDebugServer::onTargetExecutionStopped, this, std::placeholders::_1)
|
std::bind(&GdbRspDebugServer::onTargetExecutionStopped, this, std::placeholders::_1)
|
||||||
);
|
);
|
||||||
@@ -343,13 +339,6 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
void GdbRspDebugServer::onTargetControllerStateChanged(const Events::TargetControllerStateChanged& event) {
|
|
||||||
if (event.state == TargetControllerState::SUSPENDED && this->activeDebugSession.has_value()) {
|
|
||||||
Logger::warning("TargetController suspended unexpectedly - terminating debug session");
|
|
||||||
this->activeDebugSession.reset();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GdbRspDebugServer::onTargetExecutionStopped(const Events::TargetExecutionStopped&) {
|
void GdbRspDebugServer::onTargetExecutionStopped(const Events::TargetExecutionStopped&) {
|
||||||
try {
|
try {
|
||||||
if (this->activeDebugSession.has_value() && this->activeDebugSession->waitingForBreak) {
|
if (this->activeDebugSession.has_value() && this->activeDebugSession->waitingForBreak) {
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include "Feature.hpp"
|
#include "Feature.hpp"
|
||||||
#include "CommandPackets/CommandPacket.hpp"
|
#include "CommandPackets/CommandPacket.hpp"
|
||||||
|
|
||||||
#include "src/EventManager/Events/TargetControllerStateChanged.hpp"
|
|
||||||
#include "src/EventManager/Events/TargetExecutionStopped.hpp"
|
#include "src/EventManager/Events/TargetExecutionStopped.hpp"
|
||||||
#include "src/EventManager/Events/TargetExecutionResumed.hpp"
|
#include "src/EventManager/Events/TargetExecutionResumed.hpp"
|
||||||
|
|
||||||
@@ -186,13 +185,6 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
*/
|
*/
|
||||||
virtual const TargetDescriptor& getGdbTargetDescriptor() = 0;
|
virtual const TargetDescriptor& getGdbTargetDescriptor() = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Responds to any unexpected TargetController state changes.
|
|
||||||
*
|
|
||||||
* @param event
|
|
||||||
*/
|
|
||||||
void onTargetControllerStateChanged(const Events::TargetControllerStateChanged& event);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the GDB client is currently waiting for the target execution to stop, this event handler will issue
|
* If the GDB client is currently waiting for the target execution to stop, this event handler will issue
|
||||||
* a "stop reply" packet to the client once the target execution stops.
|
* a "stop reply" packet to the client once the target execution stops.
|
||||||
|
|||||||
@@ -75,10 +75,6 @@ namespace Bloom
|
|||||||
Logger::info("Starting Insight");
|
Logger::info("Starting Insight");
|
||||||
this->setThreadState(ThreadState::STARTING);
|
this->setThreadState(ThreadState::STARTING);
|
||||||
|
|
||||||
this->eventListener.registerCallbackForEventType<Events::TargetControllerStateChanged>(
|
|
||||||
std::bind(&Insight::onTargetControllerStateChangedEvent, this, std::placeholders::_1)
|
|
||||||
);
|
|
||||||
|
|
||||||
this->eventListener.registerCallbackForEventType<Events::TargetExecutionStopped>(
|
this->eventListener.registerCallbackForEventType<Events::TargetExecutionStopped>(
|
||||||
std::bind(&Insight::onTargetStoppedEvent, this, std::placeholders::_1)
|
std::bind(&Insight::onTargetStoppedEvent, this, std::placeholders::_1)
|
||||||
);
|
);
|
||||||
@@ -350,33 +346,6 @@ namespace Bloom
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Insight::onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event) {
|
|
||||||
using TargetController::TargetControllerState;
|
|
||||||
|
|
||||||
if (event.state == TargetControllerState::SUSPENDED) {
|
|
||||||
emit this->insightSignals->targetControllerSuspended();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.state == TargetControllerState::ACTIVE) {
|
|
||||||
const auto getTargetDescriptorTask = QSharedPointer<GetTargetDescriptor>(
|
|
||||||
new GetTargetDescriptor(),
|
|
||||||
&QObject::deleteLater
|
|
||||||
);
|
|
||||||
|
|
||||||
QObject::connect(
|
|
||||||
getTargetDescriptorTask.get(),
|
|
||||||
&GetTargetDescriptor::targetDescriptor,
|
|
||||||
this,
|
|
||||||
[this] (Targets::TargetDescriptor targetDescriptor) {
|
|
||||||
emit this->insightSignals->targetControllerResumed(targetDescriptor);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
InsightWorker::queueTask(getTargetDescriptorTask);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Insight::onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event) {
|
void Insight::onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event) {
|
||||||
emit this->insightSignals->programmingModeEnabled();
|
emit this->insightSignals->programmingModeEnabled();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,6 @@ namespace Bloom
|
|||||||
void onTargetResetEvent(const Events::TargetReset& event);
|
void onTargetResetEvent(const Events::TargetReset& event);
|
||||||
void onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event);
|
void onTargetRegistersWrittenEvent(const Events::RegistersWrittenToTarget& event);
|
||||||
void onTargetMemoryWrittenEvent(const Events::MemoryWrittenToTarget& event);
|
void onTargetMemoryWrittenEvent(const Events::MemoryWrittenToTarget& event);
|
||||||
void onTargetControllerStateChangedEvent(const Events::TargetControllerStateChanged& event);
|
|
||||||
void onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event);
|
void onProgrammingModeEnabledEvent(const Events::ProgrammingModeEnabled& event);
|
||||||
void onProgrammingModeDisabledEvent(const Events::ProgrammingModeDisabled& event);
|
void onProgrammingModeDisabledEvent(const Events::ProgrammingModeDisabled& event);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ namespace Bloom
|
|||||||
void targetReset();
|
void targetReset();
|
||||||
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters, const QDateTime& timestamp);
|
void targetRegistersWritten(const Bloom::Targets::TargetRegisters& targetRegisters, const QDateTime& timestamp);
|
||||||
void targetMemoryWritten(Bloom::Targets::TargetMemoryType memoryType, Targets::TargetMemoryAddressRange addressRange);
|
void targetMemoryWritten(Bloom::Targets::TargetMemoryType memoryType, Targets::TargetMemoryAddressRange addressRange);
|
||||||
void targetControllerSuspended();
|
|
||||||
void targetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
|
||||||
void programmingModeEnabled();
|
void programmingModeEnabled();
|
||||||
void programmingModeDisabled();
|
void programmingModeDisabled();
|
||||||
|
|
||||||
|
|||||||
@@ -260,18 +260,6 @@ namespace Bloom
|
|||||||
// InsightSignal connections
|
// InsightSignal connections
|
||||||
auto* insightSignals = InsightSignals::instance();
|
auto* insightSignals = InsightSignals::instance();
|
||||||
|
|
||||||
QObject::connect(
|
|
||||||
insightSignals,
|
|
||||||
&InsightSignals::targetControllerSuspended,
|
|
||||||
this,
|
|
||||||
&InsightWindow::onTargetControllerSuspended
|
|
||||||
);
|
|
||||||
QObject::connect(
|
|
||||||
insightSignals,
|
|
||||||
&InsightSignals::targetControllerResumed,
|
|
||||||
this,
|
|
||||||
&InsightWindow::onTargetControllerResumed
|
|
||||||
);
|
|
||||||
QObject::connect(
|
QObject::connect(
|
||||||
insightSignals,
|
insightSignals,
|
||||||
&InsightSignals::targetStateUpdated,
|
&InsightSignals::targetStateUpdated,
|
||||||
@@ -905,19 +893,6 @@ namespace Bloom
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InsightWindow::onTargetControllerSuspended() {
|
|
||||||
if (this->activated) {
|
|
||||||
this->deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void InsightWindow::onTargetControllerResumed(const TargetDescriptor& targetDescriptor) {
|
|
||||||
if (!this->activated) {
|
|
||||||
this->targetDescriptor = targetDescriptor;
|
|
||||||
this->activate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void InsightWindow::onTargetStateUpdate(TargetState newState) {
|
void InsightWindow::onTargetStateUpdate(TargetState newState) {
|
||||||
this->targetState = newState;
|
this->targetState = newState;
|
||||||
|
|
||||||
|
|||||||
@@ -128,8 +128,6 @@ namespace Bloom
|
|||||||
void adjustPanels();
|
void adjustPanels();
|
||||||
void adjustMinimumSize();
|
void adjustMinimumSize();
|
||||||
|
|
||||||
void onTargetControllerSuspended();
|
|
||||||
void onTargetControllerResumed(const Bloom::Targets::TargetDescriptor& targetDescriptor);
|
|
||||||
void onTargetStateUpdate(Targets::TargetState newState);
|
void onTargetStateUpdate(Targets::TargetState newState);
|
||||||
void refresh();
|
void refresh();
|
||||||
void refreshPinStates();
|
void refreshPinStates();
|
||||||
|
|||||||
Reference in New Issue
Block a user