Tidying
This commit is contained in:
@@ -25,6 +25,10 @@ Checks: >
|
|||||||
-cppcoreguidelines-non-private-member-variables-in-classes,
|
-cppcoreguidelines-non-private-member-variables-in-classes,
|
||||||
-misc-non-private-member-variables-in-classes,
|
-misc-non-private-member-variables-in-classes,
|
||||||
-bugprone-easily-swappable-parameters,
|
-bugprone-easily-swappable-parameters,
|
||||||
|
|
||||||
|
# Disabling this until https://github.com/llvm/llvm-project/issues/47384 is fixed.
|
||||||
|
-cppcoreguidelines-avoid-non-const-global-variables,
|
||||||
|
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
|
- key: readability-function-cognitive-complexity.DescribeBasicIncrements
|
||||||
value: 1
|
value: 1
|
||||||
|
|||||||
@@ -184,19 +184,17 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
std::array<unsigned char, bufferSize> buffer = {};
|
std::array<unsigned char, bufferSize> buffer = {};
|
||||||
ssize_t bytesRead = 0;
|
ssize_t bytesRead = 0;
|
||||||
|
|
||||||
if (interruptible) {
|
if (this->readInterruptEnabled != interruptible) {
|
||||||
if (this->readInterruptEnabled != interruptible) {
|
if (interruptible) {
|
||||||
this->enableReadInterrupts();
|
this->enableReadInterrupts();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Clear any previous interrupts that are still hanging around
|
this->disableReadInterrupts();
|
||||||
this->interruptEventNotifier.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->readInterruptEnabled != interruptible && !interruptible) {
|
// Clear any previous interrupts that are still hanging around
|
||||||
this->disableReadInterrupts();
|
this->interruptEventNotifier.clear();
|
||||||
}
|
|
||||||
|
|
||||||
const auto eventFileDescriptor = this->epollInstance.waitForEvent(timeout);
|
const auto eventFileDescriptor = this->epollInstance.waitForEvent(timeout);
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
auto connection = this->waitForConnection();
|
auto connection = this->waitForConnection();
|
||||||
|
|
||||||
if (!connection.has_value()) {
|
if (!connection.has_value()) {
|
||||||
// Likely an interrupt
|
// Likely an interrupt - return control to DebugServerComponent::run() so it can process any events
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ namespace Bloom::DebugServer::Gdb
|
|||||||
|
|
||||||
std::unique_ptr<CommandPacket> GdbRspDebugServer::resolveCommandPacket(const RawPacketType& rawPacket) {
|
std::unique_ptr<CommandPacket> GdbRspDebugServer::resolveCommandPacket(const RawPacketType& rawPacket) {
|
||||||
if (rawPacket.size() == 5 && rawPacket[1] == 0x03) {
|
if (rawPacket.size() == 5 && rawPacket[1] == 0x03) {
|
||||||
// This is an interrupt request - create a fake packet for it
|
// Interrupt request
|
||||||
return std::make_unique<CommandPackets::InterruptExecution>(rawPacket);
|
return std::make_unique<CommandPackets::InterruptExecution>(rawPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Key points:
|
|||||||
[eventfd object](https://man7.org/linux/man-pages/man2/eventfd.2.html). It implements the
|
[eventfd object](https://man7.org/linux/man-pages/man2/eventfd.2.html). It implements the
|
||||||
[`NotifierInterface`](../Helpers/NotifierInterface.hpp). An event can be recorded against the eventfd
|
[`NotifierInterface`](../Helpers/NotifierInterface.hpp). An event can be recorded against the eventfd
|
||||||
object via a call to `EventFdNotifier::notify()`.
|
object via a call to `EventFdNotifier::notify()`.
|
||||||
- The [`EventListener`](../EventManager/EventListener.hpp) class can accept an `NotifierInterface` object via
|
- The [`EventListener`](../EventManager/EventListener.hpp) class can accept a `NotifierInterface` object via
|
||||||
`EventListener::setInterruptEventNotifier()`. If a `NotifierInterface` has been set on an `EventListener`, the
|
`EventListener::setInterruptEventNotifier()`. If a `NotifierInterface` has been set on an `EventListener`, the
|
||||||
`EventListener` will call `NotifierInterface::notify()` everytime an event is registered for that listener.
|
`EventListener` will call `NotifierInterface::notify()` everytime an event is registered for that listener.
|
||||||
- The `EpollInstance` class is an RAII wrapper for a Linux
|
- The `EpollInstance` class is an RAII wrapper for a Linux
|
||||||
|
|||||||
Reference in New Issue
Block a user