MCPcopy Create free account
hub / github.com/Vector35/debugger / BreakpointToggleCallback

Function BreakpointToggleCallback

ui/ui.cpp:71–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69GlobalDebuggerUI::~GlobalDebuggerUI() {}
70
71static void BreakpointToggleCallback(BinaryView* view, uint64_t addr)
72{
73 auto controller = DebuggerController::GetController(view);
74 bool isAbsoluteAddress = false;
75 // TODO: check if this works
76 if (view->GetTypeName() == "Debugger")
77 isAbsoluteAddress = true;
78
79 if (isAbsoluteAddress)
80 {
81 if (controller->ContainsBreakpoint(addr))
82 {
83 controller->DeleteBreakpoint(addr);
84 }
85 else
86 {
87 controller->AddBreakpoint(addr);
88 }
89 }
90 else
91 {
92 std::string filename = controller->GetInputFile();
93 uint64_t offset = addr - view->GetStart();
94 ModuleNameAndOffset info = {filename, offset};
95 if (controller->ContainsBreakpoint(info))
96 {
97 controller->DeleteBreakpoint(info);
98 }
99 else
100 {
101 controller->AddBreakpoint(info);
102 }
103 }
104}
105
106static void JumpToIPCallback(BinaryView* view, UIContext* context)
107{

Callers 1

SetupMenuMethod · 0.85

Calls 4

ContainsBreakpointMethod · 0.80
DeleteBreakpointMethod · 0.45
AddBreakpointMethod · 0.45
GetInputFileMethod · 0.45

Tested by

no test coverage detected