29 int addrDigitsCount = 0;
30 float lineHeight = 0.0f;
31 float glyphWidth = 0.0f;
32 float hexCellWidth = 0.0f;
33 float spacingBetweenMidCols = 0.0f;
34 float posHexStart = 0.0f;
35 float posAsciiStart = 0.0f;
36 float posAsciiEnd = 0.0f;
37 float windowWidth = 0.0f;
42 [[nodiscard]] std::string_view
getDebuggableName()
const {
return {title.data(), debuggableNameSize}; }
46 void save(ImGuiTextBuffer& buf)
override;
55 [[nodiscard]] Sizes calcSizes(
unsigned memSize)
const;
56 [[nodiscard]] std::string formatAddr(
const Sizes& s,
unsigned addr)
const;
57 void setStrings(
const Sizes& s,
Debuggable& debuggable);
58 bool setAddr(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize,
unsigned addr);
59 void scrollAddr(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize,
unsigned addr);
61 void drawContents(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize);
62 void drawSearch(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize);
63 void parseSearchString(std::string_view str);
64 void search(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize);
65 [[nodiscard]]
bool match(
Debuggable& debuggable,
unsigned memSize,
unsigned addr);
66 void drawPreviewLine(
const Sizes& s,
Debuggable& debuggable,
unsigned memSize);
69 enum AddressMode :
int {CURSOR, EXPRESSION};
70 enum class SearchType :
int {HEX, ASCII};
71 enum class SearchHighlight :
int {NONE, SINGLE, ALL};
72 enum class SearchDirection :
int {FWD, BWD};
73 enum PreviewEndianess :
int {LE, BE};
75 SymbolManager& symbolManager;
77 size_t debuggableNameSize;
80 static constexpr int MAX_COLUMNS = 64;
82 bool showAscii =
true;
83 bool showAddress =
true;
84 bool showSearch =
false;
85 bool showDataPreview =
false;
86 bool greyOutZeroes =
true;
88 std::string searchString;
89 unsigned currentAddr = 0;
90 int addrMode = CURSOR;
91 int searchType =
static_cast<int>(SearchType::HEX);
92 int searchHighlight =
static_cast<int>(SearchHighlight::SINGLE);
93 int searchDirection =
static_cast<int>(SearchDirection::FWD);
94 int previewEndianess = LE;
95 ImGuiDataType previewDataType = ImGuiDataType_U8;
97 static constexpr auto persistentElements = std::tuple{
99 PersistentElementMax{
"columns", &DebuggableEditor::columns, MAX_COLUMNS + 1},
108 PersistentElementMax{
"addrMode", &DebuggableEditor::addrMode, 2},
109 PersistentElementMax{
"searchType", &DebuggableEditor::searchType, 2},
110 PersistentElementMax{
"searchHighlight", &DebuggableEditor::searchHighlight, 2},
111 PersistentElementMax{
"searchDirection", &DebuggableEditor::searchDirection, 2},
112 PersistentElementMax{
"previewEndianess", &DebuggableEditor::previewEndianess, 2},
113 PersistentElementMax{
"previewDataType", &DebuggableEditor::previewDataType, 8}
117 std::string dataInput;
119 std::optional<std::vector<uint8_t>> searchPattern;
120 std::optional<unsigned> searchResult;
121 enum EditType { HEX, ASCII };
122 EditType dataEditingActive = HEX;
123 bool dataEditingTakeFocus =
true;
124 bool updateAddr =
false;