Add Watch Items to Labels in Sidebar (#1040)
* Add Watch Items to Labels in Sidebar * fix * fix
This commit is contained in:
parent
fb056bb7bf
commit
cc2875cb3b
|
@ -2027,6 +2027,7 @@ CMDRESULT cbDebugCreatethread(int argc, char* argv[])
|
||||||
#else //x86
|
#else //x86
|
||||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Thread %X created at %s %p(Argument=%X)\n"), ThreadId, label, Entry, Argument);
|
dprintf(QT_TRANSLATE_NOOP("DBG", "Thread %X created at %s %p(Argument=%X)\n"), ThreadId, label, Entry, Argument);
|
||||||
#endif
|
#endif
|
||||||
|
varset("$result", ThreadId, false);
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2287,7 +2288,10 @@ CMDRESULT cbDebugSetJITAuto(int argc, char* argv[])
|
||||||
|
|
||||||
if(!dbgsetjitauto(set_jit_auto, notfound, & actual_arch, NULL))
|
if(!dbgsetjitauto(set_jit_auto, notfound, & actual_arch, NULL))
|
||||||
{
|
{
|
||||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Error setting JIT auto %s\n"), (actual_arch == x64) ? "x64" : "x32");
|
if(actual_arch == x64)
|
||||||
|
dputs(QT_TRANSLATE_NOOP("DBG", "Error setting JIT auto x64"));
|
||||||
|
else
|
||||||
|
dputs(QT_TRANSLATE_NOOP("DBG", "Error setting JIT auto x32"));
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2321,8 +2325,12 @@ CMDRESULT cbDebugSetJITAuto(int argc, char* argv[])
|
||||||
if(rw_error == ERROR_RW_NOTWOW64)
|
if(rw_error == ERROR_RW_NOTWOW64)
|
||||||
dputs(QT_TRANSLATE_NOOP("DBG", "Error using x64 arg the debugger is not a WOW64 process\n"));
|
dputs(QT_TRANSLATE_NOOP("DBG", "Error using x64 arg the debugger is not a WOW64 process\n"));
|
||||||
else
|
else
|
||||||
|
{
|
||||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Error getting JIT auto %s\n"), (actual_arch == x64) ? "x64" : "x32");
|
if(actual_arch == x64)
|
||||||
|
dputs(QT_TRANSLATE_NOOP("DBG", "Error getting JIT auto x64"));
|
||||||
|
else
|
||||||
|
dputs(QT_TRANSLATE_NOOP("DBG", "Error getting JIT auto x32"));
|
||||||
|
}
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,7 +207,7 @@ CMDRESULT cbInstrMov(int argc, char* argv[])
|
||||||
int len = (int)dataText.length();
|
int len = (int)dataText.length();
|
||||||
if(len % 2)
|
if(len % 2)
|
||||||
{
|
{
|
||||||
dprintf("invalid hex string \"%s\" (length not divisible by 2)\n");
|
dprintf(QT_TRANSLATE_NOOP("DBG", "invalid hex string \"%s\" (length not divisible by 2)\n"), dataText.c_str());
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
for(int i = 0; i < len; i++)
|
for(int i = 0; i < len; i++)
|
||||||
|
@ -1139,7 +1139,7 @@ CMDRESULT cbInstrGetstr(int argc, char* argv[])
|
||||||
dprintf(QT_TRANSLATE_NOOP("DBG", "failed to get variable data \"%s\"!\n"), argv[1]);
|
dprintf(QT_TRANSLATE_NOOP("DBG", "failed to get variable data \"%s\"!\n"), argv[1]);
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
dprintf("%s=\"%s\"\n", argv[1], string());
|
dprintf_untranslated("%s=\"%s\"\n", argv[1], string());
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2128,19 +2128,19 @@ CMDRESULT cbInstrLog(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
if(argc == 1) //just log newline
|
if(argc == 1) //just log newline
|
||||||
{
|
{
|
||||||
dprintf("\n");
|
dputs("\n");
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
if(argc == 2) //inline logging: log "format {rax}"
|
if(argc == 2) //inline logging: log "format {rax}"
|
||||||
{
|
{
|
||||||
dputs(stringformatinline(argv[1]).c_str());
|
dputs_untranslated(stringformatinline(argv[1]).c_str());
|
||||||
}
|
}
|
||||||
else //log "format {0} string", arg1, arg2, argN
|
else //log "format {0} string", arg1, arg2, argN
|
||||||
{
|
{
|
||||||
FormatValueVector formatArgs;
|
FormatValueVector formatArgs;
|
||||||
for(auto i = 2; i < argc; i++)
|
for(auto i = 2; i < argc; i++)
|
||||||
formatArgs.push_back(argv[i]);
|
formatArgs.push_back(argv[i]);
|
||||||
dputs(stringformat(argv[1], formatArgs).c_str());
|
dputs_untranslated(stringformat(argv[1], formatArgs).c_str());
|
||||||
}
|
}
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
@ -2889,7 +2889,7 @@ CMDRESULT cbInstrImageinfo(int argc, char* argv[])
|
||||||
duint mod;
|
duint mod;
|
||||||
if(argc < 2 || !valfromstring(argv[1], &mod) || !ModBaseFromAddr(mod))
|
if(argc < 2 || !valfromstring(argv[1], &mod) || !ModBaseFromAddr(mod))
|
||||||
{
|
{
|
||||||
dputs("invalid argument");
|
dputs(QT_TRANSLATE_NOOP("DBG", "invalid argument"));
|
||||||
return STATUS_ERROR;
|
return STATUS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2911,7 +2911,7 @@ CMDRESULT cbInstrImageinfo(int argc, char* argv[])
|
||||||
char modname[MAX_MODULE_SIZE] = "";
|
char modname[MAX_MODULE_SIZE] = "";
|
||||||
ModNameFromAddr(mod, modname, true);
|
ModNameFromAddr(mod, modname, true);
|
||||||
|
|
||||||
dputs("---------------");
|
dputs_untranslated("---------------");
|
||||||
|
|
||||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Image information for %s\n"), modname);
|
dprintf(QT_TRANSLATE_NOOP("DBG", "Image information for %s\n"), modname);
|
||||||
|
|
||||||
|
@ -2946,7 +2946,7 @@ CMDRESULT cbInstrImageinfo(int argc, char* argv[])
|
||||||
pFlag(dllc, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, QT_TRANSLATE_NOOP("DBG", "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: Driver uses WDM model."));
|
pFlag(dllc, IMAGE_DLLCHARACTERISTICS_WDM_DRIVER, QT_TRANSLATE_NOOP("DBG", "IMAGE_DLLCHARACTERISTICS_WDM_DRIVER: Driver uses WDM model."));
|
||||||
pFlag(dllc, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE, QT_TRANSLATE_NOOP("DBG", "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: Remote Desktop Services aware."));
|
pFlag(dllc, IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE, QT_TRANSLATE_NOOP("DBG", "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: Remote Desktop Services aware."));
|
||||||
|
|
||||||
dputs("---------------");
|
dputs_untranslated("---------------");
|
||||||
|
|
||||||
return STATUS_CONTINUE;
|
return STATUS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Breakpoints.h"
|
#include "Breakpoints.h"
|
||||||
#include "CPUDisassembly.h"
|
#include "CPUDisassembly.h"
|
||||||
|
#include "CachedFontMetrics.h"
|
||||||
#include <QToolTip>
|
#include <QToolTip>
|
||||||
|
|
||||||
CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollArea(parent)
|
CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollArea(parent)
|
||||||
|
@ -9,6 +10,7 @@ CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollAr
|
||||||
topVA = -1;
|
topVA = -1;
|
||||||
selectedVA = -1;
|
selectedVA = -1;
|
||||||
viewableRows = 0;
|
viewableRows = 0;
|
||||||
|
mFontMetrics = nullptr;
|
||||||
|
|
||||||
mDisas = Ptr;
|
mDisas = Ptr;
|
||||||
|
|
||||||
|
@ -24,6 +26,7 @@ CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollAr
|
||||||
|
|
||||||
CPUSideBar::~CPUSideBar()
|
CPUSideBar::~CPUSideBar()
|
||||||
{
|
{
|
||||||
|
delete mFontMetrics;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPUSideBar::updateSlots()
|
void CPUSideBar::updateSlots()
|
||||||
|
@ -66,9 +69,10 @@ void CPUSideBar::updateFonts()
|
||||||
m_DefaultFont = mDisas->font();
|
m_DefaultFont = mDisas->font();
|
||||||
this->setFont(m_DefaultFont);
|
this->setFont(m_DefaultFont);
|
||||||
|
|
||||||
QFontMetrics metrics(m_DefaultFont);
|
delete mFontMetrics;
|
||||||
fontWidth = metrics.width(' ');
|
mFontMetrics = new CachedFontMetrics(this, m_DefaultFont);
|
||||||
fontHeight = metrics.height();
|
fontWidth = mFontMetrics->width(' ');
|
||||||
|
fontHeight = mFontMetrics->height();
|
||||||
|
|
||||||
mBulletYOffset = 2;
|
mBulletYOffset = 2;
|
||||||
mBulletRadius = fontHeight - 2 * mBulletYOffset;
|
mBulletRadius = fontHeight - 2 * mBulletYOffset;
|
||||||
|
@ -193,6 +197,18 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
|
||||||
appendReg("ESI", regDump.regcontext.csi);
|
appendReg("ESI", regDump.regcontext.csi);
|
||||||
appendReg("EDI", regDump.regcontext.cdi);
|
appendReg("EDI", regDump.regcontext.cdi);
|
||||||
#endif //_WIN64
|
#endif //_WIN64
|
||||||
|
if(ConfigBool("Gui", "SidebarWatchLabels"))
|
||||||
|
{
|
||||||
|
BridgeList<WATCHINFO> WatchList;
|
||||||
|
DbgGetWatchList(&WatchList);
|
||||||
|
for(int i = 0; i < WatchList.Count(); i++)
|
||||||
|
{
|
||||||
|
if(WatchList[i].varType == WATCHVARTYPE::TYPE_UINT || WatchList[i].varType == WATCHVARTYPE::TYPE_ASCII || WatchList[i].varType == WATCHVARTYPE::TYPE_UNICODE)
|
||||||
|
{
|
||||||
|
appendReg(QString::fromUtf8(WatchList[i].WatchName), WatchList[i].value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<JumpLine> jumpLines;
|
std::vector<JumpLine> jumpLines;
|
||||||
std::vector<LabelArrow> labelArrows;
|
std::vector<LabelArrow> labelArrows;
|
||||||
|
@ -612,12 +628,11 @@ CPUSideBar::LabelArrow CPUSideBar::drawLabel(QPainter* painter, int Line, const
|
||||||
{
|
{
|
||||||
painter->save();
|
painter->save();
|
||||||
const int LineCoordinate = fontHeight * (1 + Line);
|
const int LineCoordinate = fontHeight * (1 + Line);
|
||||||
int length = Text.length();
|
|
||||||
|
|
||||||
const QColor & IPLabel = mCipLabelColor;
|
const QColor & IPLabel = mCipLabelColor;
|
||||||
const QColor & IPLabelBG = mCipLabelBackgroundColor;
|
const QColor & IPLabelBG = mCipLabelBackgroundColor;
|
||||||
|
|
||||||
int width = length * fontWidth + 2;
|
int width = mFontMetrics->width(Text);
|
||||||
int x = 1;
|
int x = 1;
|
||||||
int y = LineCoordinate - fontHeight;
|
int y = LineCoordinate - fontHeight;
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ protected:
|
||||||
CodeFoldingHelper mCodeFoldingManager;
|
CodeFoldingHelper mCodeFoldingManager;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
CachedFontMetrics* mFontMetrics;
|
||||||
dsint topVA;
|
dsint topVA;
|
||||||
dsint selectedVA;
|
dsint selectedVA;
|
||||||
QFont m_DefaultFont;
|
QFont m_DefaultFont;
|
||||||
|
|
|
@ -305,15 +305,15 @@ void MemoryMapView::refreshMap()
|
||||||
MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct.page)[wI].mbi;
|
MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct.page)[wI].mbi;
|
||||||
|
|
||||||
// Base address
|
// Base address
|
||||||
wS = QString("%1").arg((duint)wMbi.BaseAddress, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
wS = ToPtrString((duint)wMbi.BaseAddress);
|
||||||
setCellContent(wI, 0, wS);
|
setCellContent(wI, 0, wS);
|
||||||
|
|
||||||
// Size
|
// Size
|
||||||
wS = QString("%1").arg((duint)wMbi.RegionSize, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
wS = ToPtrString((duint)wMbi.RegionSize);
|
||||||
setCellContent(wI, 1, wS);
|
setCellContent(wI, 1, wS);
|
||||||
|
|
||||||
// Information
|
// Information
|
||||||
wS = QString((wMemMapStruct.page)[wI].info);
|
wS = QString::fromUtf8((wMemMapStruct.page)[wI].info);
|
||||||
setCellContent(wI, 2, wS);
|
setCellContent(wI, 2, wS);
|
||||||
|
|
||||||
// State
|
// State
|
||||||
|
|
|
@ -186,10 +186,12 @@ void SettingsDialog::LoadSettings()
|
||||||
GetSettingBool("Gui", "SaveColumnOrder", &settings.guiSaveColumnOrder);
|
GetSettingBool("Gui", "SaveColumnOrder", &settings.guiSaveColumnOrder);
|
||||||
GetSettingBool("Gui", "NoCloseDialog", &settings.guiNoCloseDialog);
|
GetSettingBool("Gui", "NoCloseDialog", &settings.guiNoCloseDialog);
|
||||||
GetSettingBool("Gui", "PidInHex", &settings.guiPidInHex);
|
GetSettingBool("Gui", "PidInHex", &settings.guiPidInHex);
|
||||||
|
GetSettingBool("Gui", "SidebarWatchLabels", &settings.guiSidebarWatchLabels);
|
||||||
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
|
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
|
||||||
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
|
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
|
||||||
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
|
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
|
||||||
ui->chkPidInHex->setChecked(settings.guiPidInHex);
|
ui->chkPidInHex->setChecked(settings.guiPidInHex);
|
||||||
|
ui->chkSidebarWatchLabels->setChecked(settings.guiSidebarWatchLabels);
|
||||||
|
|
||||||
//Misc tab
|
//Misc tab
|
||||||
if(DbgFunctions()->GetJit)
|
if(DbgFunctions()->GetJit)
|
||||||
|
@ -304,6 +306,7 @@ void SettingsDialog::SaveSettings()
|
||||||
BridgeSettingSetUint("Gui", "SaveColumnOrder", settings.guiSaveColumnOrder);
|
BridgeSettingSetUint("Gui", "SaveColumnOrder", settings.guiSaveColumnOrder);
|
||||||
BridgeSettingSetUint("Gui", "NoCloseDialog", settings.guiNoCloseDialog);
|
BridgeSettingSetUint("Gui", "NoCloseDialog", settings.guiNoCloseDialog);
|
||||||
BridgeSettingSetUint("Gui", "PidInHex", settings.guiPidInHex);
|
BridgeSettingSetUint("Gui", "PidInHex", settings.guiPidInHex);
|
||||||
|
BridgeSettingSetUint("Gui", "SidebarWatchLabels", settings.guiSidebarWatchLabels);
|
||||||
|
|
||||||
//Misc tab
|
//Misc tab
|
||||||
if(DbgFunctions()->GetJit)
|
if(DbgFunctions()->GetJit)
|
||||||
|
@ -682,3 +685,8 @@ void SettingsDialog::on_chkNoScriptTimeout_stateChanged(int arg1)
|
||||||
{
|
{
|
||||||
settings.engineNoScriptTimeout = arg1 != Qt::Unchecked;
|
settings.engineNoScriptTimeout = arg1 != Qt::Unchecked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SettingsDialog::on_chkSidebarWatchLabels_stateChanged(int arg1)
|
||||||
|
{
|
||||||
|
settings.guiSidebarWatchLabels = arg1 != Qt::Unchecked;
|
||||||
|
}
|
||||||
|
|
|
@ -68,6 +68,7 @@ private slots:
|
||||||
void on_chkSaveLoadTabOrder_stateChanged(int arg1);
|
void on_chkSaveLoadTabOrder_stateChanged(int arg1);
|
||||||
void on_chkNoCloseDialog_toggled(bool checked);
|
void on_chkNoCloseDialog_toggled(bool checked);
|
||||||
void on_chkPidInHex_clicked(bool checked);
|
void on_chkPidInHex_clicked(bool checked);
|
||||||
|
void on_chkSidebarWatchLabels_stateChanged(int arg1);
|
||||||
//Misc tab
|
//Misc tab
|
||||||
void on_chkSetJIT_stateChanged(int arg1);
|
void on_chkSetJIT_stateChanged(int arg1);
|
||||||
void on_chkConfirmBeforeAtt_stateChanged(int arg1);
|
void on_chkConfirmBeforeAtt_stateChanged(int arg1);
|
||||||
|
@ -142,6 +143,7 @@ private:
|
||||||
bool guiSaveColumnOrder;
|
bool guiSaveColumnOrder;
|
||||||
bool guiNoCloseDialog;
|
bool guiNoCloseDialog;
|
||||||
bool guiPidInHex;
|
bool guiPidInHex;
|
||||||
|
bool guiSidebarWatchLabels;
|
||||||
//Misc Tab
|
//Misc Tab
|
||||||
bool miscSetJIT;
|
bool miscSetJIT;
|
||||||
bool miscSetJITAuto;
|
bool miscSetJITAuto;
|
||||||
|
|
|
@ -501,6 +501,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="chkSidebarWatchLabels">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Watch Labels in Side Bar</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer_7">
|
<spacer name="verticalSpacer_7">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -205,6 +205,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
||||||
guiBool.insert("SaveColumnOrder", true);
|
guiBool.insert("SaveColumnOrder", true);
|
||||||
guiBool.insert("NoCloseDialog", false);
|
guiBool.insert("NoCloseDialog", false);
|
||||||
guiBool.insert("PidInHex", true);
|
guiBool.insert("PidInHex", true);
|
||||||
|
guiBool.insert("SidebarWatchLabels", true);
|
||||||
defaultBools.insert("Gui", guiBool);
|
defaultBools.insert("Gui", guiBool);
|
||||||
|
|
||||||
QMap<QString, duint> guiUint;
|
QMap<QString, duint> guiUint;
|
||||||
|
|
Loading…
Reference in New Issue