| 310 | |
| 311 | |
| 312 | void DSCTriageView::initSymbolTable() |
| 313 | { |
| 314 | m_symbolTable = new SymbolTableView(this); |
| 315 | |
| 316 | // Apply custom column styling |
| 317 | m_symbolTable->setItemDelegateForColumn(0, new AddressColorDelegate(m_symbolTable)); |
| 318 | |
| 319 | auto symbolFilterEdit = new FilterEdit(m_symbolTable); |
| 320 | connect(symbolFilterEdit, &FilterEdit::textChanged, [this](const QString& filter) { |
| 321 | m_symbolTable->setFilter(filter.toStdString()); |
| 322 | }); |
| 323 | |
| 324 | auto loadSymbolImageButton = new QPushButton(); |
| 325 | connect(loadSymbolImageButton, &QPushButton::clicked, [this](bool) { |
| 326 | auto selected = m_symbolTable->selectionModel()->selectedRows(); |
| 327 | std::vector<uint64_t> addresses; |
| 328 | for (const auto& row : selected) |
| 329 | addresses.push_back(row.data().toString().toULongLong(nullptr, 16)); |
| 330 | loadImagesWithAddr(addresses); |
| 331 | }); |
| 332 | loadSymbolImageButton->setText("Load Image"); |
| 333 | |
| 334 | // Shows the current selected rows image name. |
| 335 | auto currentImageLabel = new QLabel(this); |
| 336 | currentImageLabel->setText(""); |
| 337 | currentImageLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); |
| 338 | connect(m_symbolTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this, [this, currentImageLabel](const QModelIndex ¤t, const QModelIndex &) { |
| 339 | auto symbol = m_symbolTable->getSymbolAtRow(current.row()); |
| 340 | auto controller = SharedCacheController::GetController(*this->m_data); |
| 341 | if (!controller) |
| 342 | return; |
| 343 | auto image = controller->GetImageContaining(symbol.address); |
| 344 | if (image) |
| 345 | currentImageLabel->setText("Image: " + QString::fromStdString(image->name)); |
| 346 | else |
| 347 | currentImageLabel->setText(""); |
| 348 | }); |
| 349 | |
| 350 | auto symbolFooterLayout = new QHBoxLayout; |
| 351 | symbolFooterLayout->addWidget(loadSymbolImageButton); |
| 352 | symbolFooterLayout->addWidget(currentImageLabel); |
| 353 | symbolFooterLayout->setAlignment(Qt::AlignLeft); |
| 354 | |
| 355 | auto symbolLayout = new QVBoxLayout; |
| 356 | symbolLayout->addWidget(symbolFilterEdit); |
| 357 | symbolLayout->addWidget(m_symbolTable); |
| 358 | symbolLayout->addLayout(symbolFooterLayout); |
| 359 | |
| 360 | auto symbolWidget = new QWidget; |
| 361 | symbolWidget->setLayout(symbolLayout); |
| 362 | |
| 363 | connect(m_symbolTable, &SymbolTableView::activated, this, [=](const QModelIndex& index){ |
| 364 | auto symbol = m_symbolTable->getSymbolAtRow(index.row()); |
| 365 | auto dialog = new QMessageBox(this); |
| 366 | |
| 367 | auto controller = SharedCacheController::GetController(*this->m_data); |
| 368 | if (!controller) |
| 369 | return; |
nothing calls this directly
no test coverage detected