BRIDGE: added GuiUpdateWindowTitle & GuiUpdateCPUTitle
DBG: changed memory map modname (now with extension) DBG: change the window title to the currently debugged file + modname in CPU window for currently disassembled module GUI: added update window title + cpu title
This commit is contained in:
parent
b1359addee
commit
cc9bd15013
|
@ -408,6 +408,16 @@ BRIDGE_IMPEXP void GuiUpdateBreakpointsView()
|
|||
_gui_sendmessage(GUI_UPDATE_BREAKPOINTS_VIEW, 0, 0);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename)
|
||||
{
|
||||
_gui_sendmessage(GUI_UPDATE_WINDOW_TITLE, (void*)filename, 0);
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void GuiUpdateCPUTitle(const char* modname)
|
||||
{
|
||||
_gui_sendmessage(GUI_UPDATE_CPU_TITLE, (void*)modname, 0);
|
||||
}
|
||||
|
||||
//Main
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
{
|
||||
|
|
|
@ -52,7 +52,9 @@ enum MSGTYPE
|
|||
GUI_CLEAR_LOG, // param1=unused, param2=unused
|
||||
GUI_UPDATE_REGISTER_VIEW, // param1=unused, param2=unused
|
||||
GUI_UPDATE_DISASSEMBLY_VIEW, // param1=unused, param2=unused
|
||||
GUI_UPDATE_BREAKPOINTS_VIEW // param1=unused, param2=unused
|
||||
GUI_UPDATE_BREAKPOINTS_VIEW, // param1=unused, param2=unused
|
||||
GUI_UPDATE_WINDOW_TITLE, // param1=(const char*)file, param2=unused
|
||||
GUI_UPDATE_CPU_TITLE // param1=(const char*)mod, param2=unused
|
||||
};
|
||||
|
||||
//Debugger enums
|
||||
|
@ -215,6 +217,8 @@ BRIDGE_IMPEXP void GuiUpdateAllViews();
|
|||
BRIDGE_IMPEXP void GuiUpdateRegisterView();
|
||||
BRIDGE_IMPEXP void GuiUpdateDisassemblyView();
|
||||
BRIDGE_IMPEXP void GuiUpdateBreakpointsView();
|
||||
BRIDGE_IMPEXP void GuiUpdateWindowTitle(const char* filename);
|
||||
BRIDGE_IMPEXP void GuiUpdateCPUTitle(const char* modname);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ extern "C" DLL_EXPORT bool _dbg_memmap(MEMMAP* memmap)
|
|||
{
|
||||
MEMPAGE curPage;
|
||||
*curPage.mod=0;
|
||||
modnamefromaddr(MyAddress, curPage.mod, false);
|
||||
modnamefromaddr(MyAddress, curPage.mod, true);
|
||||
memcpy(&curPage.mbi, &mbi, sizeof(mbi));
|
||||
pageVector.push_back(curPage);
|
||||
memmap->count++;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
static PROCESS_INFORMATION g_pi= {0,0,0,0};
|
||||
static char szFileName[MAX_PATH]="";
|
||||
static char szBaseFileName[MAX_PATH]="";
|
||||
static bool bFileIsDll=false;
|
||||
static uint pDebuggedBase=0;
|
||||
static uint pDebuggedEntry=0;
|
||||
|
@ -64,6 +65,10 @@ void DebugUpdateGui(uint disasm_addr)
|
|||
{
|
||||
GuiUpdateAllViews();
|
||||
GuiDisasmAt(disasm_addr, (duint)GetContextData(UE_CIP));
|
||||
char modname[MAX_MODULE_SIZE]="";
|
||||
if(!modnamefromaddr(disasm_addr, modname, true))
|
||||
*modname=0;
|
||||
GuiUpdateCPUTitle(modname);
|
||||
}
|
||||
|
||||
static void cbUserBreakpoint()
|
||||
|
@ -565,6 +570,14 @@ static DWORD WINAPI threadDebugLoop(void* lpParameter)
|
|||
SetCustomHandler(UE_CH_UNHANDLEDEXCEPTION, (void*)cbException);
|
||||
//inform GUI start we started without problems
|
||||
GuiSetDebugState(initialized);
|
||||
//set GUI title
|
||||
strcpy(szBaseFileName, szFileName);
|
||||
int len=strlen(szBaseFileName);
|
||||
while(szBaseFileName[len]!='\\' and len)
|
||||
len--;
|
||||
if(len)
|
||||
strcpy(szBaseFileName, szBaseFileName+len+1);
|
||||
GuiUpdateWindowTitle(szBaseFileName);
|
||||
//call plugin callback
|
||||
PLUG_CB_INITDEBUG initInfo;
|
||||
initInfo.szFileName=szFileName;
|
||||
|
@ -1457,6 +1470,14 @@ static DWORD WINAPI threadAttachLoop(void* lpParameter)
|
|||
SetCustomHandler(UE_CH_UNHANDLEDEXCEPTION, (void*)cbException);
|
||||
//inform GUI start we started without problems
|
||||
GuiSetDebugState(initialized);
|
||||
//set GUI title
|
||||
strcpy(szBaseFileName, szFileName);
|
||||
int len=strlen(szBaseFileName);
|
||||
while(szBaseFileName[len]!='\\' and len)
|
||||
len--;
|
||||
if(len)
|
||||
strcpy(szBaseFileName, szBaseFileName+len+1);
|
||||
GuiUpdateWindowTitle(szBaseFileName);
|
||||
//call plugin callback
|
||||
PLUG_CB_INITDEBUG initInfo;
|
||||
initInfo.szFileName=szFileName;
|
||||
|
|
|
@ -6,12 +6,12 @@ MemoryMapView::MemoryMapView(StdTable *parent) : StdTable(parent)
|
|||
|
||||
int charwidth=QFontMetrics(this->font()).width(QChar(' '));
|
||||
|
||||
addColumnAt(8+charwidth*2*sizeof(uint_t), "", false); //addr
|
||||
addColumnAt(8+charwidth*2*sizeof(uint_t), "", false); //size
|
||||
addColumnAt(8+charwidth*32, "", false); //module
|
||||
addColumnAt(8+charwidth*3, "", false);
|
||||
addColumnAt(8+charwidth*5, "", false);
|
||||
addColumnAt(8+charwidth*5, "", false);
|
||||
addColumnAt(8+charwidth*2*sizeof(uint_t), "ADDR", false); //addr
|
||||
addColumnAt(8+charwidth*2*sizeof(uint_t), "SIZE", false); //size
|
||||
addColumnAt(8+charwidth*32, "MOD", false); //module
|
||||
addColumnAt(8+charwidth*3, "TYP", false);
|
||||
addColumnAt(8+charwidth*5, "CPROT", false);
|
||||
addColumnAt(8+charwidth*5, "APROT", false);
|
||||
addColumnAt(100, "", false);
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,16 @@ void Bridge::emitUpdateBreakpoints()
|
|||
emit updateBreakpoints();
|
||||
}
|
||||
|
||||
void Bridge::emitUpdateWindowTitle(QString filename)
|
||||
{
|
||||
emit updateWindowTitle(filename);
|
||||
}
|
||||
|
||||
void Bridge::emitUpdateCPUTitle(QString modname)
|
||||
{
|
||||
emit updateCPUTitle(modname);
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
Static Functions
|
||||
|
@ -121,9 +131,20 @@ __declspec(dllexport) void _gui_sendmessage(MSGTYPE type, void* param1, void* pa
|
|||
}
|
||||
break;
|
||||
|
||||
case GUI_UPDATE_WINDOW_TITLE:
|
||||
{
|
||||
Bridge::getBridge()->emitUpdateWindowTitle(QString(reinterpret_cast<const char*>(param1)));
|
||||
}
|
||||
break;
|
||||
|
||||
case GUI_UPDATE_CPU_TITLE:
|
||||
{
|
||||
Bridge::getBridge()->emitUpdateCPUTitle(QString(reinterpret_cast<const char*>(param1)));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,8 @@ public:
|
|||
void emitClearLog();
|
||||
void emitUpdateRegisters();
|
||||
void emitUpdateBreakpoints();
|
||||
void emitUpdateWindowTitle(QString filename);
|
||||
void emitUpdateCPUTitle(QString modname);
|
||||
|
||||
signals:
|
||||
void disassembleAt(int_t va, int_t eip);
|
||||
|
@ -38,6 +40,8 @@ signals:
|
|||
void clearLog();
|
||||
void updateRegisters();
|
||||
void updateBreakpoints();
|
||||
void updateWindowTitle(QString filename);
|
||||
void updateCPUTitle(QString modname);
|
||||
|
||||
public slots:
|
||||
|
||||
|
|
|
@ -6,28 +6,28 @@ BreakpointsView::BreakpointsView(QWidget *parent) :QWidget(parent)
|
|||
mHardBPTable = new StdTable(this);
|
||||
int wCharWidth = QFontMetrics(mHardBPTable->font()).width(QChar(' '));
|
||||
mHardBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mHardBPTable->addColumnAt(wCharWidth*10, "Hardware", false);
|
||||
mHardBPTable->addColumnAt(wCharWidth*10, "Name", false);
|
||||
mHardBPTable->addColumnAt(wCharWidth*10, "Module", false);
|
||||
mHardBPTable->addColumnAt(wCharWidth*10, "State", false);
|
||||
mHardBPTable->addColumnAt(8+wCharWidth*2*sizeof(uint_t), "Hardware", false);
|
||||
mHardBPTable->addColumnAt(8+wCharWidth*32, "Name", false);
|
||||
mHardBPTable->addColumnAt(8+wCharWidth*32, "Module", false);
|
||||
mHardBPTable->addColumnAt(8+wCharWidth*8, "State", false);
|
||||
mHardBPTable->addColumnAt(wCharWidth*10, "Comment", false);
|
||||
|
||||
// Software
|
||||
mSoftBPTable = new StdTable(this);
|
||||
mSoftBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mSoftBPTable->addColumnAt(wCharWidth*10, "Software", false);
|
||||
mSoftBPTable->addColumnAt(wCharWidth*10, "Name", false);
|
||||
mSoftBPTable->addColumnAt(wCharWidth*10, "Module", false);
|
||||
mSoftBPTable->addColumnAt(wCharWidth*10, "State", false);
|
||||
mSoftBPTable->addColumnAt(8+wCharWidth*2*sizeof(uint_t), "Software", false);
|
||||
mSoftBPTable->addColumnAt(8+wCharWidth*32, "Name", false);
|
||||
mSoftBPTable->addColumnAt(8+wCharWidth*32, "Module", false);
|
||||
mSoftBPTable->addColumnAt(8+wCharWidth*8, "State", false);
|
||||
mSoftBPTable->addColumnAt(wCharWidth*10, "Comment", false);
|
||||
|
||||
// Memory
|
||||
mMemBPTable = new StdTable(this);
|
||||
mMemBPTable->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
mMemBPTable->addColumnAt(wCharWidth*10, "Memory", false);
|
||||
mMemBPTable->addColumnAt(wCharWidth*10, "Name", false);
|
||||
mMemBPTable->addColumnAt(wCharWidth*10, "Module", false);
|
||||
mMemBPTable->addColumnAt(wCharWidth*10, "State", false);
|
||||
mMemBPTable->addColumnAt(8+wCharWidth*2*sizeof(uint_t), "Memory", false);
|
||||
mMemBPTable->addColumnAt(8+wCharWidth*32, "Name", false);
|
||||
mMemBPTable->addColumnAt(8+wCharWidth*32, "Module", false);
|
||||
mMemBPTable->addColumnAt(8+wCharWidth*8, "State", false);
|
||||
mMemBPTable->addColumnAt(wCharWidth*10, "Comment", false);
|
||||
|
||||
// Splitter
|
||||
|
|
|
@ -7,13 +7,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
|
||||
this->showMaximized();
|
||||
|
||||
//Set window title
|
||||
#ifdef _WIN64
|
||||
setWindowTitle("x64_dbg");
|
||||
mWindowMainTitle="x64_dbg";
|
||||
#else
|
||||
setWindowTitle("x32_dbg");
|
||||
mWindowMainTitle="x32_dbg";
|
||||
#endif
|
||||
|
||||
//Set window title
|
||||
setWindowTitle(QString(mWindowMainTitle));
|
||||
|
||||
//Load application icon
|
||||
HICON hIcon=LoadIcon(GetModuleHandleA(0), MAKEINTRESOURCE(100));
|
||||
SendMessageA((HWND)MainWindow::winId(), WM_SETICON, ICON_BIG, (LPARAM)hIcon);
|
||||
|
@ -51,17 +53,17 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
|
||||
//Create QMdiSubWindow
|
||||
QMdiSubWindow* subWindow = new QMdiSubWindow();
|
||||
subWindow->setWindowTitle("CPU");
|
||||
subWindow->showMaximized();
|
||||
mSubWindow = new QMdiSubWindow();
|
||||
mSubWindow->setWindowTitle("CPU");
|
||||
mSubWindow->showMaximized();
|
||||
|
||||
mCpuWin = new CPUWidget();
|
||||
mCpuWin->setWindowIcon(QIcon(":/icons/images/processor-cpu.png"));
|
||||
|
||||
subWindow->setWidget(mCpuWin);
|
||||
mSubWindow->setWidget(mCpuWin);
|
||||
|
||||
//Add subWindow to Main QMdiArea here
|
||||
mdiArea->addSubWindow(subWindow);
|
||||
mdiArea->addSubWindow(mSubWindow);
|
||||
mdiArea->addSubWindow(mMemMapView);
|
||||
mdiArea->addSubWindow(mLogView);
|
||||
mdiArea->addSubWindow(mBreakpointsView);
|
||||
|
@ -81,7 +83,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
ui->statusBar->addPermanentWidget(mLastLogLabel, 1);
|
||||
|
||||
// Setup Signals/Slots
|
||||
connect(ui->actionStepOver, SIGNAL(triggered()), mCpuWin, SLOT(stepOverSlot()));
|
||||
connect(mCmdLineEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand()));
|
||||
connect(ui->actionStepOver,SIGNAL(triggered()),this,SLOT(execStepOver()));
|
||||
connect(ui->actionStepInto,SIGNAL(triggered()),this,SLOT(execStepInto()));
|
||||
|
@ -97,6 +98,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
connect(ui->actionScylla,SIGNAL(triggered()),this,SLOT(startScylla()));
|
||||
connect(ui->actionRestart,SIGNAL(triggered()),this,SLOT(restartDebugging()));
|
||||
connect(ui->actionBreakpoints,SIGNAL(triggered()),this,SLOT(displayBreakpointWidget()));
|
||||
connect(Bridge::getBridge(), SIGNAL(updateWindowTitle(QString)), this, SLOT(updateWindowTitleSlot(QString)));
|
||||
connect(Bridge::getBridge(), SIGNAL(updateCPUTitle(QString)), this, SLOT(updateCPUTitleSlot(QString)));
|
||||
|
||||
const char* errormsg=DbgInit();
|
||||
if(errormsg)
|
||||
|
@ -253,3 +256,19 @@ void MainWindow::dropEvent(QDropEvent* pEvent)
|
|||
pEvent->acceptProposedAction();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::updateWindowTitleSlot(QString filename)
|
||||
{
|
||||
if(filename.length())
|
||||
setWindowTitle(QString(mWindowMainTitle)+QString(" - ")+filename);
|
||||
else
|
||||
setWindowTitle(QString(mWindowMainTitle));
|
||||
}
|
||||
|
||||
void MainWindow::updateCPUTitleSlot(QString modname)
|
||||
{
|
||||
if(modname.length())
|
||||
mSubWindow->setWindowTitle(QString("CPU - ")+modname);
|
||||
else
|
||||
mSubWindow->setWindowTitle(QString("CPU"));
|
||||
}
|
||||
|
|
|
@ -42,6 +42,8 @@ public slots:
|
|||
void startScylla();
|
||||
void restartDebugging();
|
||||
void displayBreakpointWidget();
|
||||
void updateWindowTitleSlot(QString filename);
|
||||
void updateCPUTitleSlot(QString modname);
|
||||
|
||||
private slots:
|
||||
void on_actionGoto_triggered();
|
||||
|
@ -53,6 +55,7 @@ private:
|
|||
|
||||
CommandLineEdit* mCmdLineEdit;
|
||||
|
||||
QMdiSubWindow* mSubWindow;
|
||||
QMdiSubWindow* mMemMapView;
|
||||
QMdiSubWindow* mLogView;
|
||||
QMdiSubWindow* mBreakpointsView;
|
||||
|
@ -60,6 +63,8 @@ private:
|
|||
StatusLabel* mStatusLabel;
|
||||
StatusLabel* mLastLogLabel;
|
||||
|
||||
const char* mWindowMainTitle;
|
||||
|
||||
protected:
|
||||
void dragEnterEvent(QDragEnterEvent* pEvent);
|
||||
void dropEvent(QDropEvent* pEvent);
|
||||
|
|
|
@ -32,6 +32,8 @@ void StatusLabel::debugStateChangedSlot(DBGSTATE state)
|
|||
case stopped:
|
||||
this->setText("<font color='#ff0000'>Terminated</font>");
|
||||
this->setStyleSheet("QLabel { background-color : #c0c0c0; }");
|
||||
GuiUpdateWindowTitle("");
|
||||
GuiUpdateCPUTitle("");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue