| 69 | GlobalDebuggerUI::~GlobalDebuggerUI() {} |
| 70 | |
| 71 | static 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 | |
| 106 | static void JumpToIPCallback(BinaryView* view, UIContext* context) |
| 107 | { |
no test coverage detected