Merge branch 'patch000000ac' into development
# Conflicts: # src/gui/Src/Gui/CPUDisassembly.cpp # src/gui/Src/Gui/CPUDisassembly.h # src/gui/Src/Gui/CPUStack.h # src/gui/Src/Gui/DisassemblerGraphView.h # src/gui/Src/Tracer/TraceBrowser.cpp # src/gui/Src/Tracer/TraceBrowser.h # src/gui/Src/Utils/CommonActions.cpp # src/gui/Src/Utils/CommonActions.h
This commit is contained in:
commit
69c67f2456
|
@ -188,7 +188,7 @@ void CPUInfoBox::disasmSelectionChanged(dsint parVA)
|
|||
|
||||
for(int i = 0, j = start; i < instr.argcount && j < 2; i++)
|
||||
{
|
||||
DISASM_ARG arg = instr.arg[i];
|
||||
const DISASM_ARG & arg = instr.arg[i];
|
||||
QString argMnemonic = QString(arg.mnemonic);
|
||||
if(bUpper)
|
||||
argMnemonic = argMnemonic.toUpper();
|
||||
|
|
|
@ -554,8 +554,10 @@ void CPUStack::stackDumpAt(duint addr, duint csp)
|
|||
}
|
||||
BridgeFree(callstack.entries);
|
||||
}
|
||||
bool isInvisible;
|
||||
isInvisible = (addr < mMemPage->va(getTableOffsetRva())) || (addr >= mMemPage->va(getTableOffsetRva() + getViewableRowsCount() * getBytePerRowCount()));
|
||||
|
||||
printDumpAt(addr);
|
||||
printDumpAt(addr, true, true, isInvisible || addr == csp);
|
||||
}
|
||||
|
||||
void CPUStack::updateSlot()
|
||||
|
@ -588,6 +590,29 @@ void CPUStack::updateSlot()
|
|||
}
|
||||
}
|
||||
|
||||
void CPUStack::disasmSelectionChanged(dsint parVA)
|
||||
{
|
||||
// When the selected instruction is changed, select the argument that is in the stack.
|
||||
DISASM_INSTR instr;
|
||||
if(!DbgIsDebugging() || !DbgMemIsValidReadPtr(parVA))
|
||||
return;
|
||||
DbgDisasmAt(parVA, &instr);
|
||||
|
||||
for(int i = 0; i < instr.argcount; i++)
|
||||
{
|
||||
const DISASM_ARG & arg = instr.arg[i];
|
||||
if(arg.type == arg_memory)
|
||||
{
|
||||
if(arg.value >= mMemPage->getBase() && arg.value < mMemPage->getBase() + mMemPage->getSize())
|
||||
{
|
||||
//TODO: When the stack is unaligned?
|
||||
stackDumpAt(arg.value & (~(sizeof(void*) - 1)), mCsp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CPUStack::gotoCspSlot()
|
||||
{
|
||||
DbgCmdExec("sdump csp");
|
||||
|
|
|
@ -54,6 +54,7 @@ public slots:
|
|||
void realignSlot();
|
||||
void freezeStackSlot();
|
||||
void dbgStateChangedSlot(DBGSTATE state);
|
||||
void disasmSelectionChanged(dsint parVA);
|
||||
void updateSlot();
|
||||
|
||||
private:
|
||||
|
|
|
@ -83,6 +83,9 @@ CPUWidget::CPUWidget(QWidget* parent) : QWidget(parent), ui(new Ui::CPUWidget)
|
|||
|
||||
mStack = new CPUStack(mDump, 0); //stack widget
|
||||
ui->mBotRightFrameLayout->addWidget(mStack);
|
||||
if(Config()->getBool("Gui", "AutoFollowInStack"))
|
||||
connect(mDisas, SIGNAL(selectionChanged(dsint)), mStack, SLOT(disasmSelectionChanged(dsint)));
|
||||
connect(Config(), SIGNAL(guiOptionsUpdated()), this, SLOT(guiOptionsUpdated()));
|
||||
|
||||
// load column config
|
||||
mDisas->loadColumnFromConfig("CPUDisassembly");
|
||||
|
@ -160,6 +163,14 @@ void CPUWidget::setDefaultDisposition()
|
|||
ui->mTopLeftUpperHSplitter->setStretchFactor(1, 64);
|
||||
}
|
||||
|
||||
void CPUWidget::guiOptionsUpdated()
|
||||
{
|
||||
if(Config()->getBool("Gui", "AutoFollowInStack"))
|
||||
connect(mDisas, SIGNAL(selectionChanged(dsint)), mStack, SLOT(disasmSelectionChanged(dsint)), Qt::UniqueConnection);
|
||||
else
|
||||
disconnect(mDisas, SIGNAL(selectionChanged(dsint)), mStack, SLOT(disasmSelectionChanged(dsint)));
|
||||
}
|
||||
|
||||
void CPUWidget::setDisasmFocus()
|
||||
{
|
||||
if(disasMode == 1)
|
||||
|
|
|
@ -66,6 +66,7 @@ private:
|
|||
|
||||
private slots:
|
||||
void splitterMoved(int pos, int index);
|
||||
void guiOptionsUpdated();
|
||||
void attachGraph(QWidget* widget);
|
||||
void detachGraph();
|
||||
};
|
||||
|
|
|
@ -159,9 +159,14 @@ void MemoryMapView::setupContextMenu()
|
|||
connect(mFindPattern, SIGNAL(triggered()), this, SLOT(findPatternSlot()));
|
||||
|
||||
//Dump
|
||||
//TODO: These two actions should also appear in CPUDump
|
||||
mDumpMemory = new QAction(DIcon("binary_save.png"), tr("&Dump Memory to File"), this);
|
||||
connect(mDumpMemory, SIGNAL(triggered()), this, SLOT(dumpMemory()));
|
||||
|
||||
//Load
|
||||
mLoadMemory = new QAction(DIcon(""), tr("&Overwrite with Data from File"), this);
|
||||
connect(mLoadMemory, SIGNAL(triggered()), this, SLOT(loadMemory()));
|
||||
|
||||
//Add virtual module
|
||||
mAddVirtualMod = new QAction(DIcon("virtual.png"), tr("Add virtual module"), this);
|
||||
connect(mAddVirtualMod, SIGNAL(triggered()), this, SLOT(addVirtualModSlot()));
|
||||
|
@ -204,6 +209,7 @@ void MemoryMapView::contextMenuSlot(const QPoint & pos)
|
|||
wMenu.addAction(mFollowDisassembly);
|
||||
wMenu.addAction(mFollowDump);
|
||||
wMenu.addAction(mDumpMemory);
|
||||
//wMenu.addAction(mLoadMemory); //TODO:loaddata command
|
||||
wMenu.addAction(mComment);
|
||||
wMenu.addAction(mFindPattern);
|
||||
wMenu.addAction(mSwitchView);
|
||||
|
@ -584,6 +590,24 @@ void MemoryMapView::dumpMemory()
|
|||
}
|
||||
}
|
||||
|
||||
void MemoryMapView::loadMemory()
|
||||
{
|
||||
char modname[MAX_MODULE_SIZE] = "";
|
||||
if(!DbgFunctions()->ModNameFromAddr(DbgEval("mod.main()"), modname, false))
|
||||
*modname = '\0';
|
||||
auto addr = getCellContent(getInitialSelection(), 0);
|
||||
QString defaultFile = QString("%1/%2%3.bin").arg(QDir::currentPath(), *modname ? modname + QString("_") : "", addr);
|
||||
QString fileName = QFileDialog::getOpenFileName(this, tr("Load Memory Region"), defaultFile, tr("Binary files (*.bin);;All files (*.*)"));
|
||||
|
||||
if(fileName.length())
|
||||
{
|
||||
fileName = QDir::toNativeSeparators(fileName);
|
||||
//TODO: loaddata command (Does ODbgScript support that?)
|
||||
QString cmd = QString("savedata \"%1\",%2,%3").arg(fileName, addr, getCellContent(getInitialSelection(), 1));
|
||||
DbgCmdExec(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void MemoryMapView::selectAddress(duint va)
|
||||
{
|
||||
auto base = DbgMemFindBaseAddr(va, nullptr);
|
||||
|
|
|
@ -31,6 +31,7 @@ public slots:
|
|||
void refreshMap();
|
||||
void findPatternSlot();
|
||||
void dumpMemory();
|
||||
void loadMemory();
|
||||
void commentSlot();
|
||||
void selectAddress(duint va);
|
||||
void gotoOriginSlot();
|
||||
|
@ -51,6 +52,7 @@ private:
|
|||
QAction* mSwitchView;
|
||||
QAction* mPageMemoryRights;
|
||||
QAction* mDumpMemory;
|
||||
QAction* mLoadMemory;
|
||||
|
||||
QMenu* mBreakpointMenu;
|
||||
QMenu* mMemoryAccessMenu;
|
||||
|
|
|
@ -86,6 +86,7 @@ void SettingsDialog::LoadSettings()
|
|||
settings.guiNoForegroundWindow = true;
|
||||
settings.guiLoadSaveTabOrder = true;
|
||||
settings.guiDisableAutoComplete = false;
|
||||
settings.guiAutoFollowInStack = false;
|
||||
|
||||
//Events tab
|
||||
GetSettingBool("Events", "SystemBreakpoint", &settings.eventSystemBreakpoint);
|
||||
|
@ -269,6 +270,7 @@ void SettingsDialog::LoadSettings()
|
|||
GetSettingBool("Gui", "GraphZoomMode", &settings.guiGraphZoomMode);
|
||||
GetSettingBool("Gui", "ShowExitConfirmation", &settings.guiShowExitConfirmation);
|
||||
GetSettingBool("Gui", "DisableAutoComplete", &settings.guiDisableAutoComplete);
|
||||
GetSettingBool("Gui", "AutoFollowInStack", &settings.guiAutoFollowInStack);
|
||||
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
|
||||
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
|
||||
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
|
||||
|
@ -280,6 +282,7 @@ void SettingsDialog::LoadSettings()
|
|||
ui->chkGraphZoomMode->setChecked(settings.guiGraphZoomMode);
|
||||
ui->chkShowExitConfirmation->setChecked(settings.guiShowExitConfirmation);
|
||||
ui->chkDisableAutoComplete->setChecked(settings.guiDisableAutoComplete);
|
||||
ui->chkAutoFollowInStack->setChecked(settings.guiAutoFollowInStack);
|
||||
|
||||
//Misc tab
|
||||
if(DbgFunctions()->GetJit)
|
||||
|
@ -429,6 +432,7 @@ void SettingsDialog::SaveSettings()
|
|||
BridgeSettingSetUint("Gui", "GraphZoomMode", settings.guiGraphZoomMode);
|
||||
BridgeSettingSetUint("Gui", "ShowExitConfirmation", settings.guiShowExitConfirmation);
|
||||
BridgeSettingSetUint("Gui", "DisableAutoComplete", settings.guiDisableAutoComplete);
|
||||
BridgeSettingSetUint("Gui", "AutoFollowInStack", settings.guiAutoFollowInStack);
|
||||
|
||||
//Misc tab
|
||||
if(DbgFunctions()->GetJit)
|
||||
|
@ -832,6 +836,12 @@ void SettingsDialog::on_chkNoCloseDialog_toggled(bool checked)
|
|||
settings.guiNoCloseDialog = checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_chkAutoFollowInStack_toggled(bool checked)
|
||||
{
|
||||
bGuiOptionsUpdated = true;
|
||||
settings.guiAutoFollowInStack = checked;
|
||||
}
|
||||
|
||||
void SettingsDialog::on_chkSkipInt3Stepping_toggled(bool checked)
|
||||
{
|
||||
settings.engineSkipInt3Stepping = checked;
|
||||
|
|
|
@ -94,6 +94,7 @@ private slots:
|
|||
void on_chkNoForegroundWindow_toggled(bool checked);
|
||||
void on_chkShowExitConfirmation_toggled(bool checked);
|
||||
void on_chkDisableAutoComplete_toggled(bool checked);
|
||||
void on_chkAutoFollowInStack_toggled(bool checked);
|
||||
//Misc tab
|
||||
void on_chkSetJIT_stateChanged(int arg1);
|
||||
void on_chkConfirmBeforeAtt_stateChanged(int arg1);
|
||||
|
@ -202,6 +203,7 @@ private:
|
|||
bool guiGraphZoomMode;
|
||||
bool guiShowExitConfirmation;
|
||||
bool guiDisableAutoComplete;
|
||||
bool guiAutoFollowInStack;
|
||||
//Misc Tab
|
||||
bool miscSetJIT;
|
||||
bool miscSetJITAuto;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>381</width>
|
||||
<width>386</width>
|
||||
<height>525</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -40,6 +40,37 @@
|
|||
<string>Events</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="chkEntryBreakpoint">
|
||||
<property name="text">
|
||||
<string>Entry Breakpoint*</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadStart">
|
||||
<property name="text">
|
||||
<string>Thread Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="chkDllLoadSystem">
|
||||
<property name="text">
|
||||
<string>System DLL Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadEntry">
|
||||
<property name="text">
|
||||
<string>Thread Entry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QCheckBox" name="chkDllUnloadSystem">
|
||||
<property name="text">
|
||||
|
@ -47,7 +78,7 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<item row="13" column="0">
|
||||
<spacer name="verticalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -60,20 +91,48 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="chkEntryBreakpoint">
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="chkNtTerminateProcess">
|
||||
<property name="text">
|
||||
<string>Entry Breakpoint*</string>
|
||||
<string>NtTerminateProcess*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="chkTlsCallbacks">
|
||||
<property name="text">
|
||||
<string>TLS Callbacks*</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="chkDllEntrySystem">
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadEnd">
|
||||
<property name="text">
|
||||
<string>System DLL Entry</string>
|
||||
<string>Thread End</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QCheckBox" name="chkDllEntry">
|
||||
<property name="text">
|
||||
<string>DLL Entry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QCheckBox" name="chkDllLoad">
|
||||
<property name="text">
|
||||
<string>DLL Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblBreakOn">
|
||||
<property name="text">
|
||||
<string>Break on:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -87,55 +146,6 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="chkNtTerminateProcess">
|
||||
<property name="text">
|
||||
<string>NtTerminateProcess*</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QCheckBox" name="chkDllLoadSystem">
|
||||
<property name="text">
|
||||
<string>System DLL Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadStart">
|
||||
<property name="text">
|
||||
<string>Thread Start</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lblBreakOn">
|
||||
<property name="text">
|
||||
<string>Break on:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadEnd">
|
||||
<property name="text">
|
||||
<string>Thread End</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QCheckBox" name="chkDebugStrings">
|
||||
<property name="text">
|
||||
<string>Debug Strings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="chkThreadEntry">
|
||||
<property name="text">
|
||||
<string>Thread Entry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QCheckBox" name="chkTlsCallbacksSystem">
|
||||
<property name="text">
|
||||
|
@ -143,37 +153,27 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QCheckBox" name="chkTlsCallbacks">
|
||||
<item row="8" column="1">
|
||||
<widget class="QCheckBox" name="chkDllEntrySystem">
|
||||
<property name="text">
|
||||
<string>TLS Callbacks*</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
<string>System DLL Entry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="chkDllEntry">
|
||||
<property name="text">
|
||||
<string>DLL Entry</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QCheckBox" name="chkDllLoad">
|
||||
<property name="text">
|
||||
<string>DLL Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<item row="11" column="0">
|
||||
<widget class="QCheckBox" name="chkDllUnload">
|
||||
<property name="text">
|
||||
<string>DLL Unload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QCheckBox" name="chkDebugStrings">
|
||||
<property name="text">
|
||||
<string>Debug Strings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabEngine">
|
||||
|
@ -778,6 +778,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkAutoFollowInStack">
|
||||
<property name="text">
|
||||
<string>Auto follow operand in stack</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkShowExitConfirmation">
|
||||
<property name="text">
|
||||
|
|
|
@ -285,6 +285,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
guiBool.insert("DisableAutoComplete", false);
|
||||
guiBool.insert("CaseSensitiveAutoComplete", false);
|
||||
guiBool.insert("AutoRepeatOnEnter", false);
|
||||
guiBool.insert("AutoFollowInStack", true);
|
||||
//Named menu settings
|
||||
insertMenuBuilderBools(&guiBool, "CPUDisassembly", 50); //CPUDisassembly
|
||||
insertMenuBuilderBools(&guiBool, "CPUDump", 50); //CPUDump
|
||||
|
|
Loading…
Reference in New Issue