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.
| 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. |
| 735 | BNDebugBreakpoint* 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 | |
| 767 | void BNDebuggerFreeBreakpoints(BNDebugBreakpoint* breakpoints, size_t count) |
no test coverage detected