Remove single-module and all-thread symbol commands from callstack view. Fix an edge case where the command wouldn't work on entries of the first listed thread.

This commit is contained in:
Miloš 2024-04-14 16:11:35 +02:00
parent 911e269456
commit c69b49dd1c
2 changed files with 5 additions and 34 deletions

View File

@ -49,18 +49,8 @@ void CallStackView::setupContextMenu()
{
return !getCellContent(getInitialSelection(), ColFrom).isEmpty() && isSelectionValid();
});
QAction* loadSymbols = makeAction(DIcon("pdb"), tr("Download Symbols for Module"), SLOT(loadSymbolsSlot()));
mMenuBuilder->addAction(loadSymbols, [this](QMenu*)
{
return isSelectionValid();
});
QAction* loadSymbolsSingleThread = makeAction(DIcon("pdb"), tr("Download Symbols for All Modules (This Thread)"), SLOT(loadSymbolsSingleThreadSlot()));
mMenuBuilder->addAction(loadSymbolsSingleThread, [this](QMenu*)
{
return isSelectionValid();
});
QAction* loadSymbolsAllThreads = makeAction(DIcon("pdb"), tr("Download Symbols for All Modules (All Threads)"), SLOT(loadSymbolsAllThreadsSlot()));
mMenuBuilder->addAction(loadSymbolsAllThreads, [this](QMenu*)
QAction* loadSymbolsForThread = makeAction(DIcon("pdb"), tr("Download Symbols for This Thread"), SLOT(loadSymbolsForThreadSlot()));
mMenuBuilder->addAction(loadSymbolsForThread, [this](QMenu*)
{
return isSelectionValid();
});
@ -280,17 +270,10 @@ void CallStackView::renameThreadSlot()
DbgCmdExec(QString("setthreadname %1, \"%2\"").arg(ToHexString(threadId)).arg(DbgCmdEscape(threadName)));
}
void CallStackView::loadSymbolsSlot()
void CallStackView::loadSymbolsForThreadSlot()
{
char module[MAX_MODULE_SIZE] = "";
if(DbgGetModuleAt(getCellUserdata(getInitialSelection(), ColFrom), module))
DbgCmdExec(QString("symdownload \"%0\"").arg(module));
}
void CallStackView::loadSymbolsSingleThreadSlot()
{
char module[MAX_MODULE_SIZE] = "";
duint firstRowForThread = 0;
duint firstRowForThread = 1;
const duint threadId = getCellUserdata(getInitialSelection(), ColThread);
for(duint row = getInitialSelection(); row > 0; --row)
{
@ -309,16 +292,6 @@ void CallStackView::loadSymbolsSingleThreadSlot()
}
}
void CallStackView::loadSymbolsAllThreadsSlot()
{
char module[MAX_MODULE_SIZE] = "";
for(duint row = 0; row < getRowCount(); ++row)
{
if(DbgGetModuleAt(getCellUserdata(row, ColFrom), module))
DbgCmdExec(QString("symdownload \"%0\"").arg(module));
}
}
void CallStackView::followInThreadsSlot()
{
QStringList threadIDName = getCellContent(getInitialSelection(), ColThread).split(" - ");

View File

@ -23,9 +23,7 @@ protected slots:
void showSuspectedCallStackSlot();
void followInThreadsSlot();
void renameThreadSlot();
void loadSymbolsSlot();
void loadSymbolsSingleThreadSlot();
void loadSymbolsAllThreadsSlot();
void loadSymbolsForThreadSlot();
private:
enum