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,
bool forceScroll);
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 showSymbolInfo =
false;
87 bool greyOutZeroes =
true;
89 std::string searchString;
90 unsigned currentAddr = 0;
91 int addrMode = CURSOR;
92 int searchType =
static_cast<int>(SearchType::HEX);
93 int searchHighlight =
static_cast<int>(SearchHighlight::SINGLE);
94 int searchDirection =
static_cast<int>(SearchDirection::FWD);
95 int previewEndianess = LE;
96 ImGuiDataType previewDataType = ImGuiDataType_U8;
98 static constexpr auto persistentElements = std::tuple{
100 PersistentElementMax{
"columns", &DebuggableEditor::columns, MAX_COLUMNS + 1},
110 PersistentElementMax{
"addrMode", &DebuggableEditor::addrMode, 2},
111 PersistentElementMax{
"searchType", &DebuggableEditor::searchType, 2},
112 PersistentElementMax{
"searchHighlight", &DebuggableEditor::searchHighlight, 2},
113 PersistentElementMax{
"searchDirection", &DebuggableEditor::searchDirection, 2},
114 PersistentElementMax{
"previewEndianess", &DebuggableEditor::previewEndianess, 2},
115 PersistentElementMax{
"previewDataType", &DebuggableEditor::previewDataType, 8}
119 std::string dataInput;
121 std::optional<std::vector<uint8_t>> searchPattern;
122 std::optional<unsigned> searchResult;
123 enum EditType { HEX, ASCII };
124 EditType dataEditingActive = HEX;
125 bool dataEditingTakeFocus =
true;
126 bool updateAddr =
false;