Merge branch 'master' into performance_improvement
This commit is contained in:
commit
1ddef656f3
|
|
@ -132,7 +132,6 @@ BRIDGE_IMPEXP const char* BridgeStart()
|
|||
if(!_dbg_dbginit || !_gui_guiinit)
|
||||
return "\"_dbg_dbginit\" || \"_gui_guiinit\" was not loaded yet, call BridgeInit!";
|
||||
_gui_guiinit(0, 0); //remove arguments
|
||||
_dbg_dbgexitsignal(); //send exit signal to debugger
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -360,6 +359,11 @@ BRIDGE_IMPEXP const char* DbgInit()
|
|||
return _dbg_dbginit();
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP void DbgExit()
|
||||
{
|
||||
_dbg_dbgexitsignal(); //send exit signal to debugger
|
||||
}
|
||||
|
||||
BRIDGE_IMPEXP BPXTYPE DbgGetBpxTypeAt(duint addr)
|
||||
{
|
||||
return _dbg_bpgettypeat(addr);
|
||||
|
|
|
|||
|
|
@ -473,6 +473,7 @@ struct FUNCTION_LOOP_INFO
|
|||
|
||||
//Debugger functions
|
||||
BRIDGE_IMPEXP const char* DbgInit();
|
||||
BRIDGE_IMPEXP void DbgExit();
|
||||
BRIDGE_IMPEXP bool DbgMemRead(duint va, unsigned char* dest, duint size);
|
||||
BRIDGE_IMPEXP bool DbgMemWrite(duint va, const unsigned char* src, duint size);
|
||||
BRIDGE_IMPEXP duint DbgMemGetPageSize(duint base);
|
||||
|
|
|
|||
|
|
@ -1143,11 +1143,15 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
{
|
||||
if(!value or !string)
|
||||
return false;
|
||||
uint finalMul=1;
|
||||
if(*string=='-') //negative
|
||||
{
|
||||
finalMul=~0;
|
||||
string++;
|
||||
uint val;
|
||||
if(!valfromstring(string+1, &val, silent, baseonly, value_size, isvar, hexonly))
|
||||
return false;
|
||||
val*=~0;
|
||||
if(value)
|
||||
*value=val;
|
||||
return true;
|
||||
}
|
||||
if(!*string)
|
||||
{
|
||||
|
|
@ -1190,7 +1194,6 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
}
|
||||
bool ret=mathfromstring(string_+add, value, silent, baseonly, value_size, isvar);
|
||||
efree(string_, "valfromstring:string_");
|
||||
*value*=finalMul;
|
||||
return ret;
|
||||
}
|
||||
else if(*string=='@' or strstr(string, "[")) //memory location
|
||||
|
|
@ -1254,7 +1257,6 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
*value_size=read_size;
|
||||
if(isvar)
|
||||
*isvar=true;
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(isregister(string)) //register
|
||||
|
|
@ -1273,7 +1275,6 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
*value=getregister(value_size, string);
|
||||
if(isvar)
|
||||
*isvar=true;
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(*string=='!' and isflag(string+1)) //flag
|
||||
|
|
@ -1298,7 +1299,6 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
*value_size=0;
|
||||
if(isvar)
|
||||
*isvar=true;
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(isdecnumber(string)) //decimal numbers come 'first'
|
||||
|
|
@ -1308,7 +1308,6 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
if(isvar)
|
||||
*isvar=false;
|
||||
sscanf(string+1, "%"fext"u", value);
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(ishexnumber(string)) //then hex numbers
|
||||
|
|
@ -1322,32 +1321,21 @@ bool valfromstring(const char* string, uint* value, bool silent, bool baseonly,
|
|||
if(*string=='x')
|
||||
inc=1;
|
||||
sscanf(string+inc, "%"fext"x", value);
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
|
||||
if(baseonly)
|
||||
return false;
|
||||
else if(valapifromstring(string, value, value_size, true, silent, hexonly)) //then come APIs
|
||||
{
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(labelfromstring(string, value)) //then come labels
|
||||
{
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(symfromname(string, value)) //then come symbols
|
||||
{
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
else if(varget(string, value, value_size, 0)) //finally variables
|
||||
{
|
||||
if(isvar)
|
||||
*isvar=true;
|
||||
*value*=finalMul;
|
||||
return true;
|
||||
}
|
||||
if(!silent)
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ void HexDump::mouseReleaseEvent(QMouseEvent* event)
|
|||
{
|
||||
mGuiState = HexDump::NoState;
|
||||
|
||||
this->viewport()->repaint();
|
||||
repaint();
|
||||
|
||||
wAccept = false;
|
||||
}
|
||||
|
|
@ -221,8 +221,10 @@ void HexDump::printSelected(QPainter* painter, int_t rowBase, int rowOffset, int
|
|||
wSelectionX = x + wI * wItemPixWidth;
|
||||
wSelectionWidth = wItemPixWidth > w - (wSelectionX - x) ? w - (wSelectionX - x) : wItemPixWidth;
|
||||
wSelectionWidth = wSelectionWidth < 0 ? 0 : wSelectionWidth;
|
||||
painter->save();
|
||||
painter->setPen(textColor);
|
||||
painter->fillRect(QRect(wSelectionX, y, wSelectionWidth, h), QBrush(selectionColor));
|
||||
painter->restore();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ void StdTable::mouseMoveEvent(QMouseEvent* event)
|
|||
else
|
||||
setSingleSelection(wRowIndex);
|
||||
|
||||
this->viewport()->repaint();
|
||||
repaint();
|
||||
|
||||
wAccept = false;
|
||||
}
|
||||
|
|
@ -82,7 +82,7 @@ void StdTable::mousePressEvent(QMouseEvent* event)
|
|||
|
||||
mGuiState = StdTable::MultiRowsSelectionState;
|
||||
|
||||
viewport()->repaint();
|
||||
repaint();
|
||||
|
||||
wAccept = true;
|
||||
}
|
||||
|
|
@ -111,7 +111,7 @@ void StdTable::mouseReleaseEvent(QMouseEvent* event)
|
|||
{
|
||||
mGuiState = StdTable::NoState;
|
||||
|
||||
this->viewport()->repaint();
|
||||
repaint();
|
||||
|
||||
wAccept = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,6 +153,30 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||
|
||||
//setup menu api
|
||||
initMenuApi();
|
||||
|
||||
bClose=false;
|
||||
}
|
||||
|
||||
DWORD WINAPI MainWindow::closeThread(void* ptr)
|
||||
{
|
||||
static bool closing=false;
|
||||
if(closing)
|
||||
return 0;
|
||||
closing=true;
|
||||
DbgExit();
|
||||
MainWindow* mainWindow=(MainWindow*)ptr;
|
||||
mainWindow->bClose=true;
|
||||
mainWindow->close();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
CloseHandle(CreateThread(0, 0, closeThread, this, 0, 0));
|
||||
if(bClose)
|
||||
event->accept();
|
||||
else
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
|
|
|
|||
|
|
@ -34,7 +34,10 @@ class MainWindow : public QMainWindow
|
|||
public:
|
||||
explicit MainWindow(QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
static DWORD WINAPI closeThread(void* ptr);
|
||||
void closeEvent(QCloseEvent* event);
|
||||
void setTab(QWidget* widget);
|
||||
bool bClose;
|
||||
|
||||
public slots:
|
||||
void executeCommand();
|
||||
|
|
|
|||
Loading…
Reference in New Issue