| 336 | |
| 337 | |
| 338 | void DebugBreakpointsWidget::add() |
| 339 | { |
| 340 | UIContext* ctxt = UIContext::contextForWidget(this); |
| 341 | if (!ctxt) |
| 342 | return; |
| 343 | |
| 344 | ViewFrame* frame = ctxt->getCurrentViewFrame(); |
| 345 | if (!frame) |
| 346 | return; |
| 347 | |
| 348 | auto view = frame->getCurrentBinaryView(); |
| 349 | if (!view) |
| 350 | return; |
| 351 | |
| 352 | uint64_t address = 0; |
| 353 | if (!ViewFrame::getAddressFromInput(frame, view, address, |
| 354 | frame->getCurrentOffset(), "Add Breakpoint", "The address of the breakpoint:", true)) |
| 355 | return; |
| 356 | |
| 357 | bool isAbsoluteAddress = false; |
| 358 | if (view->GetTypeName() == "Debugger") |
| 359 | isAbsoluteAddress = true; |
| 360 | |
| 361 | if (isAbsoluteAddress) |
| 362 | { |
| 363 | m_controller->AddBreakpoint(address); |
| 364 | } |
| 365 | else |
| 366 | { |
| 367 | std::string filename = m_controller->GetInputFile(); |
| 368 | uint64_t offset = address - view->GetStart(); |
| 369 | ModuleNameAndOffset info = {filename, offset}; |
| 370 | m_controller->AddBreakpoint(info); |
| 371 | } |
| 372 | } |
| 373 | |
| 374 | |
| 375 | void DebugBreakpointsWidget::remove() |
nothing calls this directly
no test coverage detected