Merge pull request #3333 from ynwarcs/symbol-commands-from-callstack-view

Add symbol loading commands to the callstack view context menu.
This commit is contained in:
Duncan Ogilvie 2024-04-14 23:33:02 +02:00 committed by GitHub
commit 4d631707b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 28 additions and 0 deletions

View File

@ -49,6 +49,11 @@ void CallStackView::setupContextMenu()
{
return !getCellContent(getInitialSelection(), ColFrom).isEmpty() && isSelectionValid();
});
QAction* loadSymbolsForThread = makeAction(DIcon("pdb"), tr("Download Symbols for This Thread"), SLOT(loadSymbolsForThreadSlot()));
mMenuBuilder->addAction(loadSymbolsForThread, [this](QMenu*)
{
return isSelectionValid();
});
mFollowFrom->setShortcutContext(Qt::WidgetShortcut);
mFollowFrom->setShortcut(QKeySequence("enter"));
connect(this, SIGNAL(enterPressedSignal()), this, SLOT(followFromSlot()));
@ -265,6 +270,28 @@ void CallStackView::renameThreadSlot()
DbgCmdExec(QString("setthreadname %1, \"%2\"").arg(ToHexString(threadId)).arg(DbgCmdEscape(threadName)));
}
void CallStackView::loadSymbolsForThreadSlot()
{
char module[MAX_MODULE_SIZE] = "";
duint firstRowForThread = 1;
const duint threadId = getCellUserdata(getInitialSelection(), ColThread);
for(duint row = getInitialSelection(); row > 0; --row)
{
if(getCellUserdata(row, ColThread) != threadId)
{
firstRowForThread = row + 1;
break;
}
}
for(duint row = firstRowForThread; row < getRowCount(); ++row)
{
if(getCellUserdata(row, ColThread) != threadId)
break;
if(DbgGetModuleAt(getCellUserdata(row, ColFrom), module))
DbgCmdExec(QString("symdownload \"%0\"").arg(module));
}
}
void CallStackView::followInThreadsSlot()
{
QStringList threadIDName = getCellContent(getInitialSelection(), ColThread).split(" - ");

View File

@ -23,6 +23,7 @@ protected slots:
void showSuspectedCallStackSlot();
void followInThreadsSlot();
void renameThreadSlot();
void loadSymbolsForThreadSlot();
private:
enum