| 207 | |
| 208 | |
| 209 | std::set<std::string> DebugRegistersListModel::getUsedRegisterNames() |
| 210 | { |
| 211 | std::set<std::string> usedRegisterNames; |
| 212 | if (!m_controller->GetLiveView()) |
| 213 | return usedRegisterNames; |
| 214 | |
| 215 | auto pc = m_controller->IP(); |
| 216 | auto arch = m_controller->GetLiveView()->GetDefaultArchitecture(); |
| 217 | if (!arch) |
| 218 | return usedRegisterNames; |
| 219 | |
| 220 | auto functions = m_controller->GetLiveView()->GetAnalysisFunctionsContainingAddress(pc); |
| 221 | if (functions.empty() || (!functions[0])) |
| 222 | return usedRegisterNames; |
| 223 | |
| 224 | auto llil = functions[0]->GetLowLevelILIfAvailable(); |
| 225 | if (!llil) |
| 226 | return usedRegisterNames; |
| 227 | |
| 228 | auto regs = llil->GetRegisters(); |
| 229 | for (const auto reg : regs) |
| 230 | { |
| 231 | const auto name = arch->GetRegisterName(reg); |
| 232 | usedRegisterNames.insert(name); |
| 233 | } |
| 234 | |
| 235 | return usedRegisterNames; |
| 236 | } |
| 237 | |
| 238 | |
| 239 | void DebugRegistersListModel::updateRows(std::vector<DebugRegister> newRows) |
nothing calls this directly
no test coverage detected