1
0
Fork 0

DBG+BRIDGE+GUI: more performance improvements related to GuiSetDebugState

This commit is contained in:
mrexodia 2017-04-20 12:06:54 +02:00
parent 09c80658ec
commit aa2a4afb0f
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
6 changed files with 15 additions and 6 deletions

View File

@ -1055,7 +1055,12 @@ BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip)
BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state) BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state)
{ {
_gui_sendmessage(GUI_SET_DEBUG_STATE, (void*)state, 0); _gui_sendmessage(GUI_SET_DEBUG_STATE, (void*)state, (void*)false);
}
BRIDGE_IMPEXP void GuiSetDebugStateFast(DBGSTATE state)
{
_gui_sendmessage(GUI_SET_DEBUG_STATE, (void*)state, (void*)true);
} }
BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg) BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg)

View File

@ -1064,6 +1064,7 @@ typedef struct _TYPEDESCRIPTOR
BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source); BRIDGE_IMPEXP const char* GuiTranslateText(const char* Source);
BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip); BRIDGE_IMPEXP void GuiDisasmAt(duint addr, duint cip);
BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state); BRIDGE_IMPEXP void GuiSetDebugState(DBGSTATE state);
BRIDGE_IMPEXP void GuiSetDebugStateFast(DBGSTATE state);
BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg); BRIDGE_IMPEXP void GuiAddLogMessage(const char* msg);
BRIDGE_IMPEXP void GuiLogClear(); BRIDGE_IMPEXP void GuiLogClear();
BRIDGE_IMPEXP void GuiUpdateAllViews(); BRIDGE_IMPEXP void GuiUpdateAllViews();

View File

@ -639,7 +639,8 @@ void DebugUpdateGui(duint disasm_addr, bool stack)
void GuiSetDebugStateAsync(DBGSTATE state) void GuiSetDebugStateAsync(DBGSTATE state)
{ {
static TaskThread_<decltype(&GuiSetDebugState), DBGSTATE> GuiSetDebugStateTask(&GuiSetDebugState); GuiSetDebugStateFast(state);
static TaskThread_<decltype(&GuiSetDebugState), DBGSTATE> GuiSetDebugStateTask(&GuiSetDebugState, 300);
GuiSetDebugStateTask.WakeUp(state); GuiSetDebugStateTask.WakeUp(state);
} }
@ -652,7 +653,7 @@ void DebugUpdateGuiAsync(duint disasm_addr, bool stack)
void DebugUpdateGuiSetStateAsync(duint disasm_addr, bool stack, DBGSTATE state) void DebugUpdateGuiSetStateAsync(duint disasm_addr, bool stack, DBGSTATE state)
{ {
// call paused routine to clean up various tracing states. // call paused routine to clean up various tracing states.
if(state == DBGSTATE::paused) if(state == paused)
cbDebuggerPaused(); cbDebuggerPaused();
GuiSetDebugStateAsync(state); GuiSetDebugStateAsync(state);
DebugUpdateGuiAsync(disasm_addr, stack); DebugUpdateGuiAsync(disasm_addr, stack);

View File

@ -104,6 +104,7 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
case GUI_SET_DEBUG_STATE: case GUI_SET_DEBUG_STATE:
mIsRunning = DBGSTATE(duint(param1)) == running; mIsRunning = DBGSTATE(duint(param1)) == running;
if(!param2)
emit dbgStateChanged((DBGSTATE)(dsint)param1); emit dbgStateChanged((DBGSTATE)(dsint)param1);
break; break;

View File

@ -19,12 +19,12 @@ NotesManager::NotesManager(QWidget* parent) : QTabWidget(parent)
void NotesManager::dbgStateChangedSlot(DBGSTATE state) void NotesManager::dbgStateChangedSlot(DBGSTATE state)
{ {
if(state == DBGSTATE::initialized) if(state == initialized)
{ {
mDebuggee->show(); mDebuggee->show();
addTab(mDebuggee, tr("Debuggee")); addTab(mDebuggee, tr("Debuggee"));
} }
else if(state == DBGSTATE::stopped) else if(state == stopped)
{ {
mDebuggee->hide(); mDebuggee->hide();
removeTab(1); removeTab(1);

View File

@ -14,6 +14,7 @@
SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView) SymbolView::SymbolView(QWidget* parent) : QWidget(parent), ui(new Ui::SymbolView)
{ {
ui->setupUi(this); ui->setupUi(this);
setAutoFillBackground(false);
// Set main layout // Set main layout
mMainLayout = new QVBoxLayout; mMainLayout = new QVBoxLayout;