pcsx2/pcsx2-qt/Debugger/SymbolTree/SymbolTreeLocation.h
chaoticgd 79dbc272b8 Debugger: Add symbol tree widgets for functions and variables
This adds three new tabs in the debugger: The Globals tab, the Locals
tab and the Parameters tab. In addition, it rewrites the Functions tab.

All four of these tabs use the new symbol tree widgets and the
associated model. This allows the user the inspect complex data
structures in memory with full type information.

Lastly, new dialogs have been added for creating symbols.
2024-08-27 12:48:40 -04:00

46 lines
1.2 KiB
C++

// SPDX-FileCopyrightText: 2002-2024 PCSX2 Dev Team
// SPDX-License-Identifier: LGPL-3.0+
#pragma once
#include <QtCore/QString>
#include "common/Pcsx2Types.h"
#include "DebugTools/DebugInterface.h"
class DebugInterface;
// A memory location, either a register or an address.
struct SymbolTreeLocation
{
enum Type
{
REGISTER,
MEMORY,
NONE // Put NONE last so nodes of this type sort to the bottom.
};
Type type = NONE;
u32 address = 0;
SymbolTreeLocation();
SymbolTreeLocation(Type type_arg, u32 address_arg);
QString toString(DebugInterface& cpu) const;
SymbolTreeLocation addOffset(u32 offset) const;
u8 read8(DebugInterface& cpu) const;
u16 read16(DebugInterface& cpu) const;
u32 read32(DebugInterface& cpu) const;
u64 read64(DebugInterface& cpu) const;
u128 read128(DebugInterface& cpu) const;
void write8(u8 value, DebugInterface& cpu) const;
void write16(u16 value, DebugInterface& cpu) const;
void write32(u32 value, DebugInterface& cpu) const;
void write64(u64 value, DebugInterface& cpu) const;
void write128(u128 value, DebugInterface& cpu) const;
friend auto operator<=>(const SymbolTreeLocation& lhs, const SymbolTreeLocation& rhs) = default;
};