Common/DebugInterface: Use forward declarations where applicable

We're allowed (by the standard) to forward declare types within
std::vector, so we can replace direct includes with forward declarations
and then include the types where they're directly needed.

While we're at it, we can remove an unused inclusion of <cstring>, given
nothing in the header uses anything from it. This also revealed an
indirect inclusion, which this also resolves.
This commit is contained in:
Lioncash 2019-07-08 18:07:11 -04:00
parent 98101bbbe4
commit a9a9b193bb
4 changed files with 14 additions and 6 deletions

View File

@ -5,13 +5,16 @@
#pragma once #pragma once
#include <cstddef> #include <cstddef>
#include <cstring>
#include <string> #include <string>
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Debug/MemoryPatches.h"
#include "Common/Debug/Watches.h" namespace Common::Debug
{
struct MemoryPatch;
struct Watch;
} // namespace Common::Debug
namespace Common namespace Common
{ {
@ -23,8 +26,8 @@ protected:
public: public:
// Watches // Watches
virtual std::size_t SetWatch(u32 address, std::string name = "") = 0; virtual std::size_t SetWatch(u32 address, std::string name = "") = 0;
virtual const Common::Debug::Watch& GetWatch(std::size_t index) const = 0; virtual const Debug::Watch& GetWatch(std::size_t index) const = 0;
virtual const std::vector<Common::Debug::Watch>& GetWatches() const = 0; virtual const std::vector<Debug::Watch>& GetWatches() const = 0;
virtual void UnsetWatch(u32 address) = 0; virtual void UnsetWatch(u32 address) = 0;
virtual void UpdateWatch(std::size_t index, u32 address, std::string name) = 0; virtual void UpdateWatch(std::size_t index, u32 address, std::string name) = 0;
virtual void UpdateWatchAddress(std::size_t index, u32 address) = 0; virtual void UpdateWatchAddress(std::size_t index, u32 address) = 0;
@ -40,7 +43,7 @@ public:
// Memory Patches // Memory Patches
virtual void SetPatch(u32 address, u32 value) = 0; virtual void SetPatch(u32 address, u32 value) = 0;
virtual void SetPatch(u32 address, std::vector<u8> value) = 0; virtual void SetPatch(u32 address, std::vector<u8> value) = 0;
virtual const std::vector<Common::Debug::MemoryPatch>& GetPatches() const = 0; virtual const std::vector<Debug::MemoryPatch>& GetPatches() const = 0;
virtual void UnsetPatch(u32 address) = 0; virtual void UnsetPatch(u32 address) = 0;
virtual void EnablePatch(std::size_t index) = 0; virtual void EnablePatch(std::size_t index) = 0;
virtual void DisablePatch(std::size_t index) = 0; virtual void DisablePatch(std::size_t index) = 0;

View File

@ -7,6 +7,8 @@
#include <cstddef> #include <cstddef>
#include <string> #include <string>
#include "Common/Debug/MemoryPatches.h"
#include "Common/Debug/Watches.h"
#include "Common/DebugInterface.h" #include "Common/DebugInterface.h"
class PPCPatches : public Common::Debug::MemoryPatches class PPCPatches : public Common::Debug::MemoryPatches

View File

@ -8,6 +8,8 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Debug/MemoryPatches.h"
#include "Common/Debug/Watches.h"
#include "Common/DebugInterface.h" #include "Common/DebugInterface.h"
namespace DSP::LLE namespace DSP::LLE

View File

@ -5,6 +5,7 @@
#include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PPCSymbolDB.h"
#include <algorithm> #include <algorithm>
#include <cstring>
#include <map> #include <map>
#include <string> #include <string>
#include <utility> #include <utility>