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

Function BNDebuggerGetBreakpoints

core/ffi.cpp:735–764  ·  view source on GitHub ↗

TODO: the structures to hold information about the breakpoints are different in the API and the core, so we need to convert it here. Better unify them later.

Source from the content-addressed store, hash-verified

733// TODO: the structures to hold information about the breakpoints are different in the API and the core, so we need to
734// convert it here. Better unify them later.
735BNDebugBreakpoint* BNDebuggerGetBreakpoints(BNDebuggerController* controller, size_t* count)
736{
737 DebuggerState* state = controller->object->GetState();
738 std::vector<ModuleNameAndOffset> breakpoints = state->GetBreakpoints()->GetBreakpointList();
739 *count = breakpoints.size();
740
741 //std::vector<DebugBreakpoint> remoteList;
742 //if (state->IsConnected() && state->GetAdapter())
743 // remoteList = state->GetAdapter()->GetBreakpointList();
744
745 BNDebugBreakpoint* result = new BNDebugBreakpoint[breakpoints.size()];
746 for (size_t i = 0; i < breakpoints.size(); i++)
747 {
748 uint64_t remoteAddress = state->GetModules()->RelativeAddressToAbsolute(breakpoints[i]);
749 bool enabled = false;
750 //for (const DebugBreakpoint& bp: remoteList)
751 //{
752 // if (bp.m_address == remoteAddress)
753 // {
754 // enabled = true;
755 // break;
756 // }
757 //}
758 result[i].module = BNDebuggerAllocString(breakpoints[i].module.c_str());
759 result[i].offset = breakpoints[i].offset;
760 result[i].address = remoteAddress;
761 result[i].enabled = enabled;
762 }
763 return result;
764}
765
766
767void BNDebuggerFreeBreakpoints(BNDebugBreakpoint* breakpoints, size_t count)

Callers 1

GetBreakpointsMethod · 0.85

Calls 7

BNDebuggerAllocStringFunction · 0.85
GetStateMethod · 0.80
sizeMethod · 0.80
GetBreakpointListMethod · 0.45
GetBreakpointsMethod · 0.45
GetModulesMethod · 0.45

Tested by

no test coverage detected