1
0
Fork 0

get def JIT

This commit is contained in:
dreg_fr33project 2014-08-04 23:32:07 +02:00
parent e14884443f
commit bf27d57116
5 changed files with 32 additions and 18 deletions

View File

@ -695,13 +695,6 @@ extern "C" DLL_EXPORT uint _dbg_sendmessage(DBGMSG type, void* param1, void* par
else
SetEngineVariable(UE_ENGINE_SET_DEBUG_PRIVILEGE, false);
}
/*
if(BridgeSettingGetUint("Misc", "SetJIT", &setting))
{
if(setting)
SetJIT( 0, NULL );
}
*/
char exceptionRange[MAX_SETTING_SIZE]="";
dbgclearignoredexceptions();
if(BridgeSettingGet("Exceptions", "IgnoreRange", exceptionRange))

View File

@ -1526,15 +1526,23 @@ bool dbggetjit(char** jit_entry_out, arch arch_in, arch* arch_out)
return false;
* jit_entry_out = (char *) emalloc( jit_entry_size, "dbggetjit:*jit_entry_out");
//internal allocation functions cannot fail (application will exit with an error)
//if ( * jit_entry_out == NULL )
//return false;
strcpy( * jit_entry_out, jit_entry );
return true;
}
bool dbggetdefjit(char * jit_entry)
{
char path[JIT_ENTRY_DEF_SIZE];
path[0] = '"';
GetModuleFileNameA(GetModuleHandleA(NULL), &path[1], MAX_PATH);
strcat(path, ATTACH_CMD_LINE);
strcpy( jit_entry, path );
return true;
}
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out)
{
DWORD key_flags = KEY_WRITE;

View File

@ -6,6 +6,9 @@
#include "command.h"
#include "breakpoint.h"
#define ATTACH_CMD_LINE "\" -a %ld"
#define JIT_ENTRY_DEF_SIZE (MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2)
//structures
struct INIT_STRUCT
{
@ -50,6 +53,7 @@ bool dbgcmdnew(const char* name, CBCOMMAND cbCommand, bool debugonly);
bool dbgcmddel(const char* name);
bool dbggetjit(char** jit_entry_out, arch arch_in, arch* arch_out);
bool dbgsetjit(char* jit_cmd, arch arch_in, arch* arch_out);
bool dbggetdefjit(char *);
void cbStep();
void cbRtrStep();

View File

@ -1394,20 +1394,16 @@ CMDRESULT cbDebugDownloadSymbol(int argc, char* argv[])
return STATUS_CONTINUE;
}
#define ATTACH_CMD_LINE "\" -a %ld"
CMDRESULT cbDebugSetJIT(int argc, char* argv[])
{
arch actual_arch;
char * jit_debugger_cmd;
if(argc < 2)
{
char path[MAX_PATH + sizeof(ATTACH_CMD_LINE) + 2];
path[0] = '"';
GetModuleFileNameA(GetModuleHandleA(NULL), &path[1], MAX_PATH);
strcat(path, ATTACH_CMD_LINE);
jit_debugger_cmd = path;
char path[JIT_ENTRY_DEF_SIZE];
dbggetdefjit(path);
jit_debugger_cmd = path;
if (!dbgsetjit( jit_debugger_cmd, notfound, & actual_arch ))
{
dprintf( "Error setting JIT %s\n", (actual_arch == x64) ? "x64" : "x32" );

View File

@ -161,6 +161,17 @@ void SettingsDialog::LoadSettings()
//Misc tab
GetSettingBool("Misc", "SetJIT", &settings.eventSetJIT);
ui->chkSetJIT->setCheckState(bool2check(settings.eventSetJIT));
bool isx64=true;
#ifndef _WIN64
isx64=false;
#endif
static char jit[MAX_SETTING_SIZE]="";
DbgFunctions()->GetJit(jit, isx64);
//settings.eventSetJIT = true;
}
void SettingsDialog::SaveSettings()
@ -205,7 +216,7 @@ void SettingsDialog::SaveSettings()
Config()->load();
DbgSettingsUpdated();
GuiUpdateAllViews();
GuiUpdateAllViews();
}
void SettingsDialog::AddRangeToList(RangeStruct range)
@ -297,10 +308,12 @@ void SettingsDialog::on_chkAttachBreakpoint_stateChanged(int arg1)
void SettingsDialog::on_chkSetJIT_stateChanged(int arg1)
{
/*
if(arg1==Qt::Unchecked)
settings.eventSetJIT=false;
else
settings.eventSetJIT=true;
*/
}