openMSX
ImGuiBreakPoints.hh
Go to the documentation of this file.
1#ifndef IMGUI_BREAKPOINT_HH
2#define IMGUI_BREAKPOINT_HH
3
4#include "ImGuiPart.hh"
5
6#include "TclObject.hh"
7
8#include <cstdint>
9#include <optional>
10#include <string>
11#include <string_view>
12
13namespace openmsx {
14
15class BreakPoint;
16class DebugCondition;
17class Debugger;
18class MSXCPUInterface;
19class SymbolManager;
20class WatchPoint;
21
23 ParsedSlotCond(std::string_view checkCmd, std::string_view cond);
24 [[nodiscard]] std::string toTclExpression(std::string_view checkCmd) const;
25 [[nodiscard]] std::string toDisplayString() const;
26
27 std::string rest;
28
29 int ps = 0;
30 int ss = 0;
31 uint8_t seg = 0;
32 bool hasPs = false; // if false then the whole slot-substructure is invalid
33 bool hasSs = false;
34 bool hasSeg = false;
35};
36
37class ImGuiBreakPoints final : public ImGuiPart
38{
39public:
41
42 [[nodiscard]] zstring_view iniName() const override { return "breakpoints"; }
43 void save(ImGuiTextBuffer& buf) override;
44 void loadLine(std::string_view name, zstring_view value) override;
45 void paint(MSXMotherBoard* motherBoard) override;
46
47 void refreshSymbols();
48
49 void paintBpTab(MSXCPUInterface& cpuInterface, uint16_t addr);
50
51private:
52 template<typename Type> void paintTab(MSXCPUInterface& cpuInterface, std::optional<uint16_t> addr = {});
53 template<typename Item> void drawRow(MSXCPUInterface& cpuInterface, int row, Item& item);
54 [[nodiscard]] std::string displayAddr(const TclObject& addr) const;
55 [[nodiscard]] std::string parseDisplayAddress(std::string_view str) const;
56 void editRange(MSXCPUInterface& cpuInterface, std::shared_ptr<WatchPoint>& wp, std::string& begin, std::string& end);
57 bool editCondition(ParsedSlotCond& slot);
58
59public:
60 bool show = false;
61
62private:
63 SymbolManager& symbolManager;
64
65 int selectedRow = -1;
66
67 static constexpr auto persistentElements = std::tuple{
69 };
70};
71
72} // namespace openmsx
73
74#endif
void save(ImGuiTextBuffer &buf) override
void loadLine(std::string_view name, zstring_view value) override
void paint(MSXMotherBoard *motherBoard) override
void paintBpTab(MSXCPUInterface &cpuInterface, uint16_t addr)
zstring_view iniName() const override
ImGuiManager & manager
Definition ImGuiPart.hh:30
Like std::string_view, but with the extra guarantee that it refers to a zero-terminated string.
This file implemented 3 utility functions:
Definition Autofire.cc:11
std::string toDisplayString() const
std::string toTclExpression(std::string_view checkCmd) const
constexpr auto begin(const zstring_view &x)
constexpr auto end(const zstring_view &x)