2018-01-29 09:58:02 -07:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-01-29 09:58:02 -07:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstddef>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
namespace Common::Debug
|
|
|
|
{
|
|
|
|
struct Watch
|
|
|
|
{
|
|
|
|
enum class State : bool
|
|
|
|
{
|
|
|
|
Enabled = true,
|
|
|
|
Disabled = false
|
|
|
|
};
|
|
|
|
|
|
|
|
u32 address;
|
|
|
|
std::string name;
|
|
|
|
State is_enabled;
|
|
|
|
|
2019-07-08 15:28:07 -06:00
|
|
|
Watch(u32 address, std::string name, State is_enabled);
|
2018-01-29 09:58:02 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
class Watches
|
|
|
|
{
|
|
|
|
public:
|
2019-07-08 15:28:07 -06:00
|
|
|
std::size_t SetWatch(u32 address, std::string name);
|
2018-01-29 09:58:02 -07:00
|
|
|
const Watch& GetWatch(std::size_t index) const;
|
|
|
|
const std::vector<Watch>& GetWatches() const;
|
|
|
|
void UnsetWatch(u32 address);
|
2019-07-08 15:28:07 -06:00
|
|
|
void UpdateWatch(std::size_t index, u32 address, std::string name);
|
2018-01-29 09:58:02 -07:00
|
|
|
void UpdateWatchAddress(std::size_t index, u32 address);
|
2019-07-08 15:28:07 -06:00
|
|
|
void UpdateWatchName(std::size_t index, std::string name);
|
2018-01-29 09:58:02 -07:00
|
|
|
void EnableWatch(std::size_t index);
|
|
|
|
void DisableWatch(std::size_t index);
|
|
|
|
bool HasEnabledWatch(u32 address) const;
|
|
|
|
void RemoveWatch(std::size_t index);
|
|
|
|
void LoadFromStrings(const std::vector<std::string>& watches);
|
|
|
|
std::vector<std::string> SaveToStrings() const;
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<Watch> m_watches;
|
|
|
|
};
|
|
|
|
} // namespace Common::Debug
|