dolphin/Source/Core/Core/Debugger/PPCDebugInterface.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

96 lines
3.2 KiB
C
Raw Normal View History

// Copyright 2008 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <cstddef>
2017-08-24 19:45:26 +01:00
#include <memory>
#include <string>
#include "Common/Debug/MemoryPatches.h"
#include "Common/Debug/Watches.h"
#include "Common/DebugInterface.h"
2017-08-24 19:45:26 +01:00
#include "Core/NetworkCaptureLogger.h"
class PPCPatches : public Common::Debug::MemoryPatches
{
private:
void Patch(std::size_t index) override;
};
// wrapper between disasm control and Dolphin debugger
class PPCDebugInterface final : public Common::DebugInterface
{
public:
PPCDebugInterface();
~PPCDebugInterface() override;
// Watches
std::size_t SetWatch(u32 address, std::string name = "") override;
const Common::Debug::Watch& GetWatch(std::size_t index) const override;
const std::vector<Common::Debug::Watch>& GetWatches() const override;
void UnsetWatch(u32 address) override;
void UpdateWatch(std::size_t index, u32 address, std::string name) override;
void UpdateWatchAddress(std::size_t index, u32 address) override;
void UpdateWatchName(std::size_t index, std::string name) override;
void EnableWatch(std::size_t index) override;
void DisableWatch(std::size_t index) override;
bool HasEnabledWatch(u32 address) const override;
void RemoveWatch(std::size_t index) override;
void LoadWatchesFromStrings(const std::vector<std::string>& watches) override;
std::vector<std::string> SaveWatchesToStrings() const override;
void ClearWatches() override;
// Memory Patches
2018-05-27 14:39:01 +02:00
void SetPatch(u32 address, u32 value) override;
void SetPatch(u32 address, std::vector<u8> value) override;
const std::vector<Common::Debug::MemoryPatch>& GetPatches() const override;
void UnsetPatch(u32 address) override;
void EnablePatch(std::size_t index) override;
void DisablePatch(std::size_t index) override;
bool HasEnabledPatch(u32 address) const override;
void RemovePatch(std::size_t index) override;
void ClearPatches() override;
// Threads
Common::Debug::Threads GetThreads() const override;
std::string Disassemble(u32 address) const override;
std::string GetRawMemoryString(int memory, u32 address) const override;
bool IsAlive() const override;
bool IsBreakpoint(u32 address) const override;
void SetBreakpoint(u32 address) override;
void ClearBreakpoint(u32 address) override;
2015-07-30 06:47:02 -04:00
void ClearAllBreakpoints() override;
void ToggleBreakpoint(u32 address) override;
2015-07-30 06:47:02 -04:00
void ClearAllMemChecks() override;
bool IsMemCheck(u32 address, size_t size = 1) const override;
void ToggleMemCheck(u32 address, bool read = true, bool write = true, bool log = true) override;
u32 ReadMemory(u32 address) const override;
2014-08-30 17:23:13 -04:00
enum
{
EXTRAMEM_ARAM = 1,
};
2014-08-30 17:23:13 -04:00
u32 ReadExtraMemory(int memory, u32 address) const override;
u32 ReadInstruction(u32 address) const override;
u32 GetPC() const override;
void SetPC(u32 address) override;
2015-07-30 06:47:02 -04:00
void Step() override {}
void RunToBreakpoint() override;
u32 GetColor(u32 address) const override;
std::string GetDescription(u32 address) const override;
2017-08-24 19:45:26 +01:00
std::shared_ptr<Core::NetworkCaptureLogger> NetworkLogger();
void Clear() override;
private:
Common::Debug::Watches m_watches;
PPCPatches m_patches;
2017-08-24 19:45:26 +01:00
std::shared_ptr<Core::NetworkCaptureLogger> m_network_logger;
};