GUI: memory map breakpoint color
This commit is contained in:
parent
a9ecc85792
commit
dbf74ae723
|
@ -742,7 +742,8 @@ BRIDGE_IMPEXP void GuiUpdateAllViews()
|
|||
GuiUpdateBreakpointsView();
|
||||
GuiUpdateDumpView();
|
||||
GuiUpdateThreadView();
|
||||
GuiupdateSideBar();
|
||||
GuiUpdateSideBar();
|
||||
GuiRepaintTableView();
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiUpdateRegisterView()
|
||||
|
@ -979,11 +980,16 @@ BRIDGE_IMPEXP void GuiAddStatusBarMessage(const char* msg)
|
|||
_gui_sendmessage(GUI_ADD_MSG_TO_STATUSBAR, (void*)msg, 0);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiupdateSideBar()
|
||||
BRIDGE_IMPEXP void GuiUpdateSideBar()
|
||||
{
|
||||
_gui_sendmessage(GUI_UPDATE_SIDEBAR, 0, 0);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiRepaintTableView()
|
||||
{
|
||||
_gui_sendmessage(GUI_REPAINT_TABLE_VIEW, 0, 0);
|
||||
}
|
||||
|
||||
//Main
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
|
|
|
@ -619,7 +619,7 @@ enum GUIMSG
|
|||
GUI_SCRIPT_ENABLEHIGHLIGHTING, // param1=bool enable, param2=unused
|
||||
GUI_ADD_MSG_TO_STATUSBAR, // param1=const char* msg, param2=unused
|
||||
GUI_UPDATE_SIDEBAR, // param1=unused, param2=unused
|
||||
GUI_REPAINT_REGISTER_VIEW // param1=unused, param2=unused
|
||||
GUI_REPAINT_TABLE_VIEW // param1=unused, param2=unused
|
||||
};
|
||||
|
||||
//GUI structures
|
||||
|
@ -688,7 +688,8 @@ BRIDGE_IMPEXP void GuiAutoCompleteAddCmd(const char* cmd);
|
|||
BRIDGE_IMPEXP void GuiAutoCompleteDelCmd(const char* cmd);
|
||||
BRIDGE_IMPEXP void GuiAutoCompleteClearAll();
|
||||
BRIDGE_IMPEXP void GuiAddStatusBarMessage(const char* msg);
|
||||
BRIDGE_IMPEXP void GuiupdateSideBar();
|
||||
BRIDGE_IMPEXP void GuiUpdateSideBar();
|
||||
BRIDGE_IMPEXP void GuiRepaintTableView();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "StdTable.h"
|
||||
#include "Bridge.h"
|
||||
|
||||
|
||||
/*
|
||||
|
@ -17,6 +18,8 @@ StdTable::StdTable(QWidget *parent) : AbstractTableView(parent)
|
|||
mIsMultiSelctionAllowed = false;
|
||||
|
||||
mData = new QList< QList<QString>* >();
|
||||
|
||||
connect(Bridge::getBridge(), SIGNAL(repaintTableView()), this, SLOT(reloadData()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -362,6 +362,11 @@ void Bridge::emitUpdateSideBar()
|
|||
emit updateSideBar();
|
||||
}
|
||||
|
||||
void Bridge::emitRepaintTableView()
|
||||
{
|
||||
emit repaintTableView();
|
||||
}
|
||||
|
||||
/************************************************************************************
|
||||
Static Functions
|
||||
************************************************************************************/
|
||||
|
@ -718,6 +723,12 @@ __declspec(dllexport) void* _gui_sendmessage(GUIMSG type, void* param1, void* pa
|
|||
}
|
||||
break;
|
||||
|
||||
case GUI_REPAINT_TABLE_VIEW:
|
||||
{
|
||||
Bridge::getBridge()->emitRepaintTableView();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ public:
|
|||
void emitAutoCompleteClearAll();
|
||||
void emitAddMsgToStatusBar(QString msg);
|
||||
void emitUpdateSideBar();
|
||||
void emitRepaintTableView();
|
||||
|
||||
//Public variables
|
||||
void* winId;
|
||||
|
@ -136,6 +137,7 @@ signals:
|
|||
void autoCompleteClearAll();
|
||||
void addMsgToStatusBar(QString msg);
|
||||
void updateSideBar();
|
||||
void repaintTableView();
|
||||
|
||||
private:
|
||||
QMutex* mBridgeMutex;
|
||||
|
|
|
@ -509,6 +509,7 @@ void AppearanceDialog::colorInfoListInit()
|
|||
|
||||
colorInfoListAppend("Other:", "", "");
|
||||
colorInfoListAppend("Current Thread", "ThreadCurrentColor", "ThreadCurrentBackgroundColor");
|
||||
colorInfoListAppend("Memory Map Breakpoint", "MemoryMapBreakpointColor", "MemoryMapBreakpointBackgroundColor");
|
||||
|
||||
//dev helper
|
||||
const QMap<QString, QColor>* Colors=&Config()->defaultColors;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "MemoryMapView.h"
|
||||
#include "Configuration.h"
|
||||
|
||||
MemoryMapView::MemoryMapView(StdTable *parent) : StdTable(parent)
|
||||
{
|
||||
|
@ -54,6 +55,32 @@ QString MemoryMapView::getProtectionString(DWORD Protect)
|
|||
return wS;
|
||||
}
|
||||
|
||||
QString MemoryMapView::paintContent(QPainter *painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h)
|
||||
{
|
||||
if(col==0) //address
|
||||
{
|
||||
QString wStr = getCellContent(rowBase + rowOffset, col);
|
||||
#ifdef _WIN64
|
||||
uint_t addr=wStr.toULongLong(0, 16);
|
||||
#else //x86
|
||||
uint_t addr=wStr.toULong(0, 16);
|
||||
#endif //_WIN64
|
||||
if((DbgGetBpxTypeAt(addr)&bp_memory)==bp_memory)
|
||||
{
|
||||
QString wStr = getCellContent(rowBase + rowOffset, col);
|
||||
QColor bpBackgroundColor=ConfigColor("MemoryMapBreakpointBackgroundColor");
|
||||
if(bpBackgroundColor.alpha())
|
||||
painter->fillRect(QRect(x, y, w - 1, h), QBrush(bpBackgroundColor));
|
||||
painter->setPen(ConfigColor("MemoryMapBreakpointColor"));
|
||||
painter->drawText(QRect(x + 4, y, getColumnWidth(col) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr);
|
||||
return "";
|
||||
}
|
||||
else if(isSelected(rowBase, rowOffset) == true)
|
||||
painter->fillRect(QRect(x, y, w, h), QBrush(selectionColor));
|
||||
}
|
||||
return StdTable::paintContent(painter, rowBase, rowOffset, col, x, y, w, h);
|
||||
}
|
||||
|
||||
void MemoryMapView::stateChangedSlot(DBGSTATE state)
|
||||
{
|
||||
if(state == paused)
|
||||
|
|
|
@ -10,6 +10,7 @@ class MemoryMapView : public StdTable
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit MemoryMapView(StdTable *parent = 0);
|
||||
QString paintContent(QPainter *painter, int_t rowBase, int rowOffset, int col, int x, int y, int w, int h);
|
||||
|
||||
signals:
|
||||
|
||||
|
|
|
@ -130,6 +130,9 @@ Configuration::Configuration() : QObject()
|
|||
defaultColors.insert("ThreadCurrentColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("ThreadCurrentBackgroundColor", QColor("#000000"));
|
||||
|
||||
defaultColors.insert("MemoryMapBreakpointColor", QColor("#FFFBF0"));
|
||||
defaultColors.insert("MemoryMapBreakpointBackgroundColor", QColor("#FF0000"));
|
||||
|
||||
//bool settings
|
||||
QMap<QString, bool> disassemblyBool;
|
||||
disassemblyBool.insert("ArgumentSpaces", false);
|
||||
|
|
Loading…
Reference in New Issue