| 161 | } |
| 162 | |
| 163 | void APIInspector::on_apiEvents_itemSelectionChanged() |
| 164 | { |
| 165 | RDTreeWidgetItem *node = ui->apiEvents->selectedItem(); |
| 166 | |
| 167 | SDChunk *chunk = NULL; |
| 168 | // search up the tree to find the next parent with a chunk tag |
| 169 | while(node) |
| 170 | { |
| 171 | chunk = (SDChunk *)node->tag().value<quintptr>(); |
| 172 | |
| 173 | // if we found one, break |
| 174 | if(chunk) |
| 175 | break; |
| 176 | |
| 177 | // move to the parent |
| 178 | node = node->parent(); |
| 179 | } |
| 180 | |
| 181 | if(chunk && !chunk->metadata.callstack.isEmpty()) |
| 182 | { |
| 183 | if(m_Ctx.Replay().GetCaptureAccess()) |
| 184 | { |
| 185 | m_Ctx.Replay().AsyncInvoke([this, chunk](IReplayController *) { |
| 186 | rdcarray<rdcstr> stack = |
| 187 | m_Ctx.Replay().GetCaptureAccess()->GetResolve(chunk->metadata.callstack); |
| 188 | |
| 189 | GUIInvoke::call(this, [this, stack]() { addCallstack(stack); }); |
| 190 | }); |
| 191 | } |
| 192 | else |
| 193 | { |
| 194 | ui->callstack->setUpdatesEnabled(false); |
| 195 | ui->callstack->clear(); |
| 196 | ui->callstack->addItem(tr("Callstack resolution not available.")); |
| 197 | ui->callstack->setUpdatesEnabled(true); |
| 198 | } |
| 199 | } |
| 200 | else |
| 201 | { |
| 202 | ui->callstack->setUpdatesEnabled(false); |
| 203 | ui->callstack->clear(); |
| 204 | ui->callstack->addItem(tr("No Callstack available.")); |
| 205 | ui->callstack->setUpdatesEnabled(true); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | void APIInspector::fillAPIView() |
| 210 | { |
nothing calls this directly
no test coverage detected