| 108 | } |
| 109 | |
| 110 | Result Debugger::setBreakpoint(NodeInstance& node, lldb::SBBreakpoint* bp) { |
| 111 | Result res; |
| 112 | |
| 113 | int linenum = lineNumberFromNode(node); |
| 114 | |
| 115 | // create the breakpoint |
| 116 | auto breakpoint = mTarget.BreakpointCreateByLocation( |
| 117 | node.module().sourceFilePath().string().c_str(), linenum); |
| 118 | |
| 119 | // make sure that it's good |
| 120 | if (!breakpoint.IsValid()) { |
| 121 | res.addEntry("EUKN", "Could not set breakpoint on node", |
| 122 | {{"nodeid", node.stringId()}, |
| 123 | {"File Name", node.module().sourceFilePath().string()}, |
| 124 | {"Line Number", linenum}}); |
| 125 | |
| 126 | return res; |
| 127 | } |
| 128 | |
| 129 | mBreakpoints[&node] = breakpoint; |
| 130 | |
| 131 | if (bp != nullptr) { *bp = breakpoint; } |
| 132 | |
| 133 | breakpoint.SetEnabled(true); |
| 134 | |
| 135 | return res; |
| 136 | } |
| 137 | |
| 138 | bool Debugger::removeBreakpoint(NodeInstance& node) { |
| 139 | auto iter = mBreakpoints.find(&node); |
no test coverage detected