From df6b94b0ded85ee5f1ad82def6edf0a5353ade8c Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 2 Oct 2021 17:39:27 +0100 Subject: [PATCH] Tidying/consistency of includes --- src/ApplicationConfig.cpp | 1 + src/DebugServers/DebugServer.cpp | 3 ++- .../GdbRsp/CommandPackets/CommandPacket.cpp | 3 ++- .../GdbRsp/CommandPackets/CommandPacketFactory.cpp | 4 ++-- .../GdbRsp/CommandPackets/ContinueExecution.cpp | 3 ++- .../GdbRsp/CommandPackets/InterruptExecution.cpp | 1 + src/DebugServers/GdbRsp/CommandPackets/ReadMemory.cpp | 1 + .../GdbRsp/CommandPackets/ReadRegisters.cpp | 1 + .../GdbRsp/CommandPackets/RemoveBreakpoint.cpp | 3 ++- .../GdbRsp/CommandPackets/SetBreakpoint.cpp | 1 + .../GdbRsp/CommandPackets/SupportedFeaturesQuery.cpp | 3 ++- .../GdbRsp/CommandPackets/WriteMemory.cpp | 1 + .../GdbRsp/CommandPackets/WriteRegister.cpp | 1 + src/DebugServers/GdbRsp/Connection.cpp | 11 ++++++----- src/DebugServers/GdbRsp/GdbRspDebugServer.cpp | 3 ++- src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp | 3 ++- .../CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.cpp | 1 + .../CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrResponse.cpp | 4 ++-- .../EDBG/AVR/CommandFrames/AvrCommandFrame.cpp | 4 ++-- .../EDBG/AVR/Events/AVR8Generic/BreakEvent.cpp | 3 ++- .../EDBG/AVR/ResponseFrames/AvrResponseFrame.cpp | 3 ++- src/Helpers/Paths.cpp | 5 +++-- src/Logger/Logger.cpp | 3 ++- src/SignalHandler/SignalHandler.cpp | 3 ++- src/Targets/Microchip/AVR/AVR8/Avr8.cpp | 3 ++- .../TargetDescription/TargetDescriptionFile.cpp | 4 ++-- src/main.cpp | 4 ++-- 27 files changed, 51 insertions(+), 29 deletions(-) diff --git a/src/ApplicationConfig.cpp b/src/ApplicationConfig.cpp index a8cf67d0..637d11e6 100644 --- a/src/ApplicationConfig.cpp +++ b/src/ApplicationConfig.cpp @@ -1,4 +1,5 @@ #include "ApplicationConfig.hpp" + #include "src/Logger/Logger.hpp" #include "src/Exceptions/InvalidConfig.hpp" diff --git a/src/DebugServers/DebugServer.cpp b/src/DebugServers/DebugServer.cpp index 56e3fb72..1b6a1e07 100644 --- a/src/DebugServers/DebugServer.cpp +++ b/src/DebugServers/DebugServer.cpp @@ -1,6 +1,7 @@ +#include "DebugServer.hpp" + #include -#include "DebugServer.hpp" #include "src/Exceptions/InvalidConfig.hpp" #include "src/Logger/Logger.hpp" diff --git a/src/DebugServers/GdbRsp/CommandPackets/CommandPacket.cpp b/src/DebugServers/GdbRsp/CommandPackets/CommandPacket.cpp index c051bf6a..6a285f6d 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/CommandPacket.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/CommandPacket.cpp @@ -1,8 +1,9 @@ #include "CommandPacket.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; void CommandPacket::dispatchToHandler(Gdb::GdbRspDebugServer& gdbRspDebugServer) { gdbRspDebugServer.handleGdbPacket(*this); -} \ No newline at end of file +} diff --git a/src/DebugServers/GdbRsp/CommandPackets/CommandPacketFactory.cpp b/src/DebugServers/GdbRsp/CommandPackets/CommandPacketFactory.cpp index 34e12483..f239b7ff 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/CommandPacketFactory.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/CommandPacketFactory.cpp @@ -1,9 +1,9 @@ +#include "CommandPacketFactory.hpp" + #include #include #include -#include "CommandPacketFactory.hpp" - using namespace Bloom::DebugServers::Gdb; using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/ContinueExecution.cpp b/src/DebugServers/GdbRsp/CommandPackets/ContinueExecution.cpp index 776b6ae4..b1bbcd3e 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/ContinueExecution.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/ContinueExecution.cpp @@ -1,7 +1,8 @@ +#include "ContinueExecution.hpp" + #include #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" -#include "ContinueExecution.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/InterruptExecution.cpp b/src/DebugServers/GdbRsp/CommandPackets/InterruptExecution.cpp index 041d4cd0..dd6a1a1a 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/InterruptExecution.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/InterruptExecution.cpp @@ -1,4 +1,5 @@ #include "InterruptExecution.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/ReadMemory.cpp b/src/DebugServers/GdbRsp/CommandPackets/ReadMemory.cpp index e24d1b37..e3043e76 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/ReadMemory.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/ReadMemory.cpp @@ -1,4 +1,5 @@ #include "ReadMemory.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/ReadRegisters.cpp b/src/DebugServers/GdbRsp/CommandPackets/ReadRegisters.cpp index 1b6095d9..31aa86a9 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/ReadRegisters.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/ReadRegisters.cpp @@ -1,4 +1,5 @@ #include "ReadRegisters.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/RemoveBreakpoint.cpp b/src/DebugServers/GdbRsp/CommandPackets/RemoveBreakpoint.cpp index e117756b..fe7b8e7c 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/RemoveBreakpoint.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/RemoveBreakpoint.cpp @@ -1,6 +1,7 @@ +#include "RemoveBreakpoint.hpp" + #include -#include "RemoveBreakpoint.hpp" #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/SetBreakpoint.cpp b/src/DebugServers/GdbRsp/CommandPackets/SetBreakpoint.cpp index 43289fb6..47da012e 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/SetBreakpoint.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/SetBreakpoint.cpp @@ -1,4 +1,5 @@ #include "SetBreakpoint.hpp" + #include #include diff --git a/src/DebugServers/GdbRsp/CommandPackets/SupportedFeaturesQuery.cpp b/src/DebugServers/GdbRsp/CommandPackets/SupportedFeaturesQuery.cpp index 31f6eea3..db193158 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/SupportedFeaturesQuery.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/SupportedFeaturesQuery.cpp @@ -1,6 +1,7 @@ +#include "SupportedFeaturesQuery.hpp" + #include -#include "SupportedFeaturesQuery.hpp" #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/WriteMemory.cpp b/src/DebugServers/GdbRsp/CommandPackets/WriteMemory.cpp index b4c53e7e..3bcb9ab7 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/WriteMemory.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/WriteMemory.cpp @@ -1,4 +1,5 @@ #include "WriteMemory.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/CommandPackets/WriteRegister.cpp b/src/DebugServers/GdbRsp/CommandPackets/WriteRegister.cpp index c599ee0a..34f4055f 100644 --- a/src/DebugServers/GdbRsp/CommandPackets/WriteRegister.cpp +++ b/src/DebugServers/GdbRsp/CommandPackets/WriteRegister.cpp @@ -1,4 +1,5 @@ #include "WriteRegister.hpp" + #include "src/DebugServers/GdbRsp/GdbRspDebugServer.hpp" #include "src/Exceptions/Exception.hpp" diff --git a/src/DebugServers/GdbRsp/Connection.cpp b/src/DebugServers/GdbRsp/Connection.cpp index db81a45b..c43cb0bd 100644 --- a/src/DebugServers/GdbRsp/Connection.cpp +++ b/src/DebugServers/GdbRsp/Connection.cpp @@ -1,15 +1,16 @@ +#include "Connection.hpp" + #include #include #include #include -#include "src/Logger/Logger.hpp" -#include "src/Exceptions/Exception.hpp" -#include "src/Exceptions/DebugServerInterrupted.hpp" -#include "Connection.hpp" +#include "CommandPackets/CommandPacketFactory.hpp" #include "Exceptions/ClientDisconnected.hpp" #include "Exceptions/ClientCommunicationError.hpp" -#include "CommandPackets/CommandPacketFactory.hpp" +#include "src/Exceptions/Exception.hpp" +#include "src/Exceptions/DebugServerInterrupted.hpp" +#include "src/Logger/Logger.hpp" using namespace Bloom::DebugServers::Gdb; using namespace Bloom::DebugServers::Gdb::CommandPackets; diff --git a/src/DebugServers/GdbRsp/GdbRspDebugServer.cpp b/src/DebugServers/GdbRsp/GdbRspDebugServer.cpp index 52f6094e..2f7b5a99 100644 --- a/src/DebugServers/GdbRsp/GdbRspDebugServer.cpp +++ b/src/DebugServers/GdbRsp/GdbRspDebugServer.cpp @@ -1,8 +1,9 @@ +#include "GdbRspDebugServer.hpp" + #include #include #include -#include "GdbRspDebugServer.hpp" #include "Exceptions/ClientDisconnected.hpp" #include "Exceptions/ClientNotSupported.hpp" #include "Exceptions/ClientCommunicationError.hpp" diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp index e14e0e23..d2af235c 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/Response.cpp @@ -1,6 +1,7 @@ -#include "src/Exceptions/Exception.hpp" #include "Response.hpp" +#include "src/Exceptions/Exception.hpp" + using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap; void Response::init(const std::vector& rawResponse) { diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.cpp index 94f7a77a..ae35c492 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrEvent.cpp @@ -1,4 +1,5 @@ #include "AvrEvent.hpp" + #include "src/Exceptions/Exception.hpp" using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr; diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrResponse.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrResponse.cpp index 50db1d43..04ab7f1f 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrResponse.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/AvrResponse.cpp @@ -1,6 +1,7 @@ +#include "AvrResponse.hpp" + #include -#include "AvrResponse.hpp" #include "src/Exceptions/Exception.hpp" using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr; @@ -40,4 +41,3 @@ void AvrResponse::init(const std::vector& rawResponse) { this->setResponsePacket(responsePacket); } - diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrame.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrame.cpp index 828be884..3a743494 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrame.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/CommandFrames/AvrCommandFrame.cpp @@ -1,7 +1,7 @@ -#include - #include "AvrCommandFrame.hpp" +#include + using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr; std::vector AvrCommandFrame::generateAvrCommands(std::size_t maximumCommandPacketSize) const { diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/Events/AVR8Generic/BreakEvent.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/Events/AVR8Generic/BreakEvent.cpp index fcfb6210..519253e8 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/Events/AVR8Generic/BreakEvent.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/Events/AVR8Generic/BreakEvent.cpp @@ -1,6 +1,7 @@ +#include "BreakEvent.hpp" + #include -#include "BreakEvent.hpp" #include "src/Exceptions/Exception.hpp" using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr; diff --git a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AvrResponseFrame.cpp b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AvrResponseFrame.cpp index f7b7e538..1adf7428 100644 --- a/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AvrResponseFrame.cpp +++ b/src/DebugToolDrivers/Protocols/CMSIS-DAP/VendorSpecific/EDBG/AVR/ResponseFrames/AvrResponseFrame.cpp @@ -1,6 +1,7 @@ +#include "AvrResponseFrame.hpp" + #include -#include "AvrResponseFrame.hpp" #include "src/Exceptions/Exception.hpp" using namespace Bloom::DebugToolDrivers::Protocols::CmsisDap::Edbg::Avr; diff --git a/src/Helpers/Paths.cpp b/src/Helpers/Paths.cpp index 3ff70885..9baf138a 100644 --- a/src/Helpers/Paths.cpp +++ b/src/Helpers/Paths.cpp @@ -1,10 +1,11 @@ +#include "Paths.hpp" + #include #include #include #include -#include -#include "Paths.hpp" +#include "src/Exceptions/Exception.hpp" using namespace Bloom; diff --git a/src/Logger/Logger.cpp b/src/Logger/Logger.cpp index 30d4af01..33cb8863 100644 --- a/src/Logger/Logger.cpp +++ b/src/Logger/Logger.cpp @@ -1,6 +1,7 @@ +#include "Logger.hpp" + #include #include -#include "Logger.hpp" using namespace Bloom; diff --git a/src/SignalHandler/SignalHandler.cpp b/src/SignalHandler/SignalHandler.cpp index 8197a8d2..70b67968 100644 --- a/src/SignalHandler/SignalHandler.cpp +++ b/src/SignalHandler/SignalHandler.cpp @@ -1,7 +1,8 @@ +#include "SignalHandler.hpp" + #include #include -#include "SignalHandler.hpp" #include "src/Logger/Logger.hpp" #include "src/Exceptions/Exception.hpp" diff --git a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp index 4d27b40f..e0524465 100644 --- a/src/Targets/Microchip/AVR/AVR8/Avr8.cpp +++ b/src/Targets/Microchip/AVR/AVR8/Avr8.cpp @@ -1,3 +1,5 @@ +#include "Avr8.hpp" + #include #include #include @@ -5,7 +7,6 @@ #include #include -#include "Avr8.hpp" #include "PadDescriptor.hpp" #include "PhysicalInterface.hpp" #include "src/Logger/Logger.hpp" diff --git a/src/Targets/TargetDescription/TargetDescriptionFile.cpp b/src/Targets/TargetDescription/TargetDescriptionFile.cpp index 20d1dd3f..31f0332c 100644 --- a/src/Targets/TargetDescription/TargetDescriptionFile.cpp +++ b/src/Targets/TargetDescription/TargetDescriptionFile.cpp @@ -1,7 +1,8 @@ +#include "TargetDescriptionFile.hpp" + #include #include -#include "TargetDescriptionFile.hpp" #include "Exceptions/TargetDescriptionParsingFailureException.hpp" #include "src/Logger/Logger.hpp" @@ -462,7 +463,6 @@ void TargetDescriptionFile::loadPinouts() { } } - void TargetDescriptionFile::loadInterfaces() { auto interfaceNodes = this->deviceElement.elementsByTagName("interfaces").item(0).toElement() .elementsByTagName("interface"); diff --git a/src/main.cpp b/src/main.cpp index 1b66af3c..770ca988 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,8 +1,8 @@ +#include "Application.hpp" + #include #include -#include "Application.hpp" - using namespace Bloom; int main(int argc, char* argv[]) {