Tidying
This commit is contained in:
@@ -16,6 +16,7 @@ Checks: >
|
|||||||
readability-*,
|
readability-*,
|
||||||
-modernize-use-trailing-return-type,
|
-modernize-use-trailing-return-type,
|
||||||
-modernize-avoid-bind,
|
-modernize-avoid-bind,
|
||||||
|
-modernize-pass-by-value,
|
||||||
-readability-named-parameter,
|
-readability-named-parameter,
|
||||||
-readability-magic-numbers,
|
-readability-magic-numbers,
|
||||||
-readability-convert-member-functions-to-static,
|
-readability-convert-member-functions-to-static,
|
||||||
|
|||||||
@@ -419,17 +419,18 @@ void GdbRspDebugServer::waitForConnection() {
|
|||||||
throw Exception("Failed to listen on server socket");
|
throw Exception("Failed to listen on server socket");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<struct epoll_event, 5> events = {};
|
constexpr int maxEvents = 5;
|
||||||
|
std::array<struct epoll_event, maxEvents> events = {};
|
||||||
int eventCount = ::epoll_wait(
|
int eventCount = ::epoll_wait(
|
||||||
this->eventFileDescriptor,
|
this->eventFileDescriptor,
|
||||||
events.data(),
|
events.data(),
|
||||||
5,
|
maxEvents,
|
||||||
-1
|
-1
|
||||||
);
|
);
|
||||||
|
|
||||||
if (eventCount > 0) {
|
if (eventCount > 0) {
|
||||||
for (size_t i = 0; i < eventCount; i++) {
|
for (size_t i = 0; i < eventCount; i++) {
|
||||||
auto fileDescriptor = events[i].data.fd;
|
auto fileDescriptor = events.at(i).data.fd;
|
||||||
|
|
||||||
if (fileDescriptor == this->interruptEventNotifier->getFileDescriptor()) {
|
if (fileDescriptor == this->interruptEventNotifier->getFileDescriptor()) {
|
||||||
// Interrupted
|
// Interrupted
|
||||||
|
|||||||
@@ -9,13 +9,9 @@ namespace Bloom::Exceptions
|
|||||||
public:
|
public:
|
||||||
explicit Exception(): std::runtime_error("") {}
|
explicit Exception(): std::runtime_error("") {}
|
||||||
|
|
||||||
explicit Exception(const std::string& message): std::runtime_error(message.c_str()) {
|
explicit Exception(const std::string& message): std::runtime_error(message.c_str()), message(message) {}
|
||||||
this->message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
explicit Exception(const char* message): std::runtime_error(message) {
|
explicit Exception(const char* message): std::runtime_error(message), message(std::string(message)) {}
|
||||||
this->message = std::string(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* what() const noexcept override {
|
const char* what() const noexcept override {
|
||||||
return this->message.c_str();
|
return this->message.c_str();
|
||||||
|
|||||||
@@ -224,10 +224,9 @@ namespace Bloom
|
|||||||
if (std::holds_alternative<SharedEventPointer<TargetControllerErrorOccurred>>(responseEvent.value())) {
|
if (std::holds_alternative<SharedEventPointer<TargetControllerErrorOccurred>>(responseEvent.value())) {
|
||||||
auto& tcErrorEvent = std::get<SharedEventPointer<TargetControllerErrorOccurred>>(responseEvent.value());
|
auto& tcErrorEvent = std::get<SharedEventPointer<TargetControllerErrorOccurred>>(responseEvent.value());
|
||||||
throw Bloom::Exceptions::Exception(tcErrorEvent->errorMessage);
|
throw Bloom::Exceptions::Exception(tcErrorEvent->errorMessage);
|
||||||
|
|
||||||
} else {
|
|
||||||
throw Bloom::Exceptions::Exception("Unexpected response from TargetController");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw Bloom::Exceptions::Exception("Unexpected response from TargetController");
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::get<SharedEventPointer<ResponseEventType>>(responseEvent.value());
|
return std::get<SharedEventPointer<ResponseEventType>>(responseEvent.value());
|
||||||
|
|||||||
Reference in New Issue
Block a user