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
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Thread %X created at %s %p(Argument=%X)\n"), ThreadId, label, Entry, Argument);
|
||||
#endif
|
||||
varset("$result", ThreadId, false);
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
}
|
||||
|
@ -2287,7 +2288,10 @@ CMDRESULT cbDebugSetJITAuto(int argc, char* argv[])
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -2321,8 +2325,12 @@ CMDRESULT cbDebugSetJITAuto(int argc, char* argv[])
|
|||
if(rw_error == ERROR_RW_NOTWOW64)
|
||||
dputs(QT_TRANSLATE_NOOP("DBG", "Error using x64 arg the debugger is not a WOW64 process\n"));
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ CMDRESULT cbInstrMov(int argc, char* argv[])
|
|||
int len = (int)dataText.length();
|
||||
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;
|
||||
}
|
||||
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]);
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
dprintf("%s=\"%s\"\n", argv[1], string());
|
||||
dprintf_untranslated("%s=\"%s\"\n", argv[1], string());
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
|
||||
|
@ -2128,19 +2128,19 @@ CMDRESULT cbInstrLog(int argc, char* argv[])
|
|||
{
|
||||
if(argc == 1) //just log newline
|
||||
{
|
||||
dprintf("\n");
|
||||
dputs("\n");
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
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
|
||||
{
|
||||
FormatValueVector formatArgs;
|
||||
for(auto i = 2; i < argc; i++)
|
||||
formatArgs.push_back(argv[i]);
|
||||
dputs(stringformat(argv[1], formatArgs).c_str());
|
||||
dputs_untranslated(stringformat(argv[1], formatArgs).c_str());
|
||||
}
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
|
@ -2889,7 +2889,7 @@ CMDRESULT cbInstrImageinfo(int argc, char* argv[])
|
|||
duint mod;
|
||||
if(argc < 2 || !valfromstring(argv[1], &mod) || !ModBaseFromAddr(mod))
|
||||
{
|
||||
dputs("invalid argument");
|
||||
dputs(QT_TRANSLATE_NOOP("DBG", "invalid argument"));
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
|
||||
|
@ -2911,7 +2911,7 @@ CMDRESULT cbInstrImageinfo(int argc, char* argv[])
|
|||
char modname[MAX_MODULE_SIZE] = "";
|
||||
ModNameFromAddr(mod, modname, true);
|
||||
|
||||
dputs("---------------");
|
||||
dputs_untranslated("---------------");
|
||||
|
||||
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_TERMINAL_SERVER_AWARE, QT_TRANSLATE_NOOP("DBG", "IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE: Remote Desktop Services aware."));
|
||||
|
||||
dputs("---------------");
|
||||
dputs_untranslated("---------------");
|
||||
|
||||
return STATUS_CONTINUE;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "Configuration.h"
|
||||
#include "Breakpoints.h"
|
||||
#include "CPUDisassembly.h"
|
||||
#include "CachedFontMetrics.h"
|
||||
#include <QToolTip>
|
||||
|
||||
CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollArea(parent)
|
||||
|
@ -9,6 +10,7 @@ CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollAr
|
|||
topVA = -1;
|
||||
selectedVA = -1;
|
||||
viewableRows = 0;
|
||||
mFontMetrics = nullptr;
|
||||
|
||||
mDisas = Ptr;
|
||||
|
||||
|
@ -24,6 +26,7 @@ CPUSideBar::CPUSideBar(CPUDisassembly* Ptr, QWidget* parent) : QAbstractScrollAr
|
|||
|
||||
CPUSideBar::~CPUSideBar()
|
||||
{
|
||||
delete mFontMetrics;
|
||||
}
|
||||
|
||||
void CPUSideBar::updateSlots()
|
||||
|
@ -66,9 +69,10 @@ void CPUSideBar::updateFonts()
|
|||
m_DefaultFont = mDisas->font();
|
||||
this->setFont(m_DefaultFont);
|
||||
|
||||
QFontMetrics metrics(m_DefaultFont);
|
||||
fontWidth = metrics.width(' ');
|
||||
fontHeight = metrics.height();
|
||||
delete mFontMetrics;
|
||||
mFontMetrics = new CachedFontMetrics(this, m_DefaultFont);
|
||||
fontWidth = mFontMetrics->width(' ');
|
||||
fontHeight = mFontMetrics->height();
|
||||
|
||||
mBulletYOffset = 2;
|
||||
mBulletRadius = fontHeight - 2 * mBulletYOffset;
|
||||
|
@ -193,6 +197,18 @@ void CPUSideBar::paintEvent(QPaintEvent* event)
|
|||
appendReg("ESI", regDump.regcontext.csi);
|
||||
appendReg("EDI", regDump.regcontext.cdi);
|
||||
#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<LabelArrow> labelArrows;
|
||||
|
@ -612,12 +628,11 @@ CPUSideBar::LabelArrow CPUSideBar::drawLabel(QPainter* painter, int Line, const
|
|||
{
|
||||
painter->save();
|
||||
const int LineCoordinate = fontHeight * (1 + Line);
|
||||
int length = Text.length();
|
||||
|
||||
const QColor & IPLabel = mCipLabelColor;
|
||||
const QColor & IPLabelBG = mCipLabelBackgroundColor;
|
||||
|
||||
int width = length * fontWidth + 2;
|
||||
int width = mFontMetrics->width(Text);
|
||||
int x = 1;
|
||||
int y = LineCoordinate - fontHeight;
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ protected:
|
|||
CodeFoldingHelper mCodeFoldingManager;
|
||||
|
||||
private:
|
||||
CachedFontMetrics* mFontMetrics;
|
||||
dsint topVA;
|
||||
dsint selectedVA;
|
||||
QFont m_DefaultFont;
|
||||
|
|
|
@ -305,15 +305,15 @@ void MemoryMapView::refreshMap()
|
|||
MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct.page)[wI].mbi;
|
||||
|
||||
// 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);
|
||||
|
||||
// Size
|
||||
wS = QString("%1").arg((duint)wMbi.RegionSize, sizeof(duint) * 2, 16, QChar('0')).toUpper();
|
||||
wS = ToPtrString((duint)wMbi.RegionSize);
|
||||
setCellContent(wI, 1, wS);
|
||||
|
||||
// Information
|
||||
wS = QString((wMemMapStruct.page)[wI].info);
|
||||
wS = QString::fromUtf8((wMemMapStruct.page)[wI].info);
|
||||
setCellContent(wI, 2, wS);
|
||||
|
||||
// State
|
||||
|
|
|
@ -186,10 +186,12 @@ void SettingsDialog::LoadSettings()
|
|||
GetSettingBool("Gui", "SaveColumnOrder", &settings.guiSaveColumnOrder);
|
||||
GetSettingBool("Gui", "NoCloseDialog", &settings.guiNoCloseDialog);
|
||||
GetSettingBool("Gui", "PidInHex", &settings.guiPidInHex);
|
||||
GetSettingBool("Gui", "SidebarWatchLabels", &settings.guiSidebarWatchLabels);
|
||||
ui->chkFpuRegistersLittleEndian->setChecked(settings.guiFpuRegistersLittleEndian);
|
||||
ui->chkSaveColumnOrder->setChecked(settings.guiSaveColumnOrder);
|
||||
ui->chkNoCloseDialog->setChecked(settings.guiNoCloseDialog);
|
||||
ui->chkPidInHex->setChecked(settings.guiPidInHex);
|
||||
ui->chkSidebarWatchLabels->setChecked(settings.guiSidebarWatchLabels);
|
||||
|
||||
//Misc tab
|
||||
if(DbgFunctions()->GetJit)
|
||||
|
@ -304,6 +306,7 @@ void SettingsDialog::SaveSettings()
|
|||
BridgeSettingSetUint("Gui", "SaveColumnOrder", settings.guiSaveColumnOrder);
|
||||
BridgeSettingSetUint("Gui", "NoCloseDialog", settings.guiNoCloseDialog);
|
||||
BridgeSettingSetUint("Gui", "PidInHex", settings.guiPidInHex);
|
||||
BridgeSettingSetUint("Gui", "SidebarWatchLabels", settings.guiSidebarWatchLabels);
|
||||
|
||||
//Misc tab
|
||||
if(DbgFunctions()->GetJit)
|
||||
|
@ -682,3 +685,8 @@ void SettingsDialog::on_chkNoScriptTimeout_stateChanged(int arg1)
|
|||
{
|
||||
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_chkNoCloseDialog_toggled(bool checked);
|
||||
void on_chkPidInHex_clicked(bool checked);
|
||||
void on_chkSidebarWatchLabels_stateChanged(int arg1);
|
||||
//Misc tab
|
||||
void on_chkSetJIT_stateChanged(int arg1);
|
||||
void on_chkConfirmBeforeAtt_stateChanged(int arg1);
|
||||
|
@ -142,6 +143,7 @@ private:
|
|||
bool guiSaveColumnOrder;
|
||||
bool guiNoCloseDialog;
|
||||
bool guiPidInHex;
|
||||
bool guiSidebarWatchLabels;
|
||||
//Misc Tab
|
||||
bool miscSetJIT;
|
||||
bool miscSetJITAuto;
|
||||
|
|
|
@ -501,6 +501,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkSidebarWatchLabels">
|
||||
<property name="text">
|
||||
<string>Show Watch Labels in Side Bar</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
|
|
|
@ -205,6 +205,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
guiBool.insert("SaveColumnOrder", true);
|
||||
guiBool.insert("NoCloseDialog", false);
|
||||
guiBool.insert("PidInHex", true);
|
||||
guiBool.insert("SidebarWatchLabels", true);
|
||||
defaultBools.insert("Gui", guiBool);
|
||||
|
||||
QMap<QString, duint> guiUint;
|
||||
|
|
Loading…
Reference in New Issue