diff options
| author | Lioncash <mai.iam2048@gmail.com> | 2023-04-24 09:05:49 -0400 |
|---|---|---|
| committer | Lioncash <mai.iam2048@gmail.com> | 2023-04-24 09:10:43 -0400 |
| commit | d991cbaf3c098044323e0330cb66dd76138f8d43 (patch) | |
| tree | 43c0ab04aba889cb9c3bf8402fa8bc80526c86b3 /Source/Core/Common/Debug/CodeTrace.h | |
| parent | ffbbd72741aa74d8bc602635ac9fdf9f9d0bb1bd (diff) | |
Common: Move CodeTrace.cpp/.h into Core
This interface relies on Core details and shouldn't be in Common to
begin with, since it's not a general utility.
Diffstat (limited to 'Source/Core/Common/Debug/CodeTrace.h')
| -rw-r--r-- | Source/Core/Common/Debug/CodeTrace.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/Source/Core/Common/Debug/CodeTrace.h b/Source/Core/Common/Debug/CodeTrace.h deleted file mode 100644 index ae99b6d9a2..0000000000 --- a/Source/Core/Common/Debug/CodeTrace.h +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2022 Dolphin Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -#pragma once - -#include <optional> -#include <set> -#include <string> -#include <vector> - -#include "Common/CommonTypes.h" - -namespace Core -{ -class CPUThreadGuard; -} - -struct InstructionAttributes -{ - u32 address = 0; - std::string instruction = ""; - std::string reg0 = ""; - std::string reg1 = ""; - std::string reg2 = ""; - std::string reg3 = ""; - std::optional<u32> memory_target = std::nullopt; - u32 memory_target_size = 4; - bool is_store = false; - bool is_load = false; -}; - -struct TraceOutput -{ - u32 address = 0; - std::optional<u32> memory_target = std::nullopt; - std::string instruction; -}; - -struct AutoStepResults -{ - std::vector<std::string> reg_tracked; - std::set<u32> mem_tracked; - u32 count = 0; - bool timed_out = false; - bool trackers_empty = false; -}; - -enum class HitType : u32 -{ - SKIP = (1 << 0), // Not a hit - OVERWRITE = (1 << 1), // Tracked value gets overwritten by untracked. Typically skipped. - MOVED = (1 << 2), // Target duplicated to another register, unchanged. - SAVELOAD = (1 << 3), // Target saved or loaded. Priority over Pointer. - POINTER = (1 << 4), // Target used as pointer/offset for save or load - PASSIVE = (1 << 5), // Conditional, etc, but not pointer. Unchanged - ACTIVE = (1 << 6), // Math, etc. Changed. - UPDATED = (1 << 7), // Masked or math without changing register. -}; - -class CodeTrace -{ -public: - enum class AutoStop - { - Always, - Used, - Changed - }; - - void SetRegTracked(const std::string& reg); - AutoStepResults AutoStepping(const Core::CPUThreadGuard& guard, bool continue_previous = false, - AutoStop stop_on = AutoStop::Always); - -private: - InstructionAttributes GetInstructionAttributes(const TraceOutput& line) const; - TraceOutput SaveCurrentInstruction(const Core::CPUThreadGuard& guard) const; - HitType TraceLogic(const TraceOutput& current_instr, bool first_hit = false); - - bool m_recording = false; - std::vector<std::string> m_reg_autotrack; - std::set<u32> m_mem_autotrack; -}; |
