fix issue #886
This commit is contained in:
parent
2fe5601374
commit
57a3d2e2f7
|
|
@ -132,7 +132,7 @@ inline bool IsArgumentsLessThan(int argc, int minimumCount)
|
|||
{
|
||||
if(argc < minimumCount)
|
||||
{
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Not enough arguments! At lease %d arguments must be specified."), minimumCount);
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "Not enough arguments! At lease %d arguments must be specified.\n"), minimumCount - 1);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
@ -2615,11 +2615,8 @@ CMDRESULT cbInstrSetMaxFindResult(int argc, char* argv[])
|
|||
|
||||
CMDRESULT cbInstrSavedata(int argc, char* argv[])
|
||||
{
|
||||
if(argc < 4) //savedata filename,addr,size
|
||||
{
|
||||
dputs(QT_TRANSLATE_NOOP("DBG", "Not enough arguments..."));
|
||||
if(IsArgumentsLessThan(argc, 4))
|
||||
return STATUS_ERROR;
|
||||
}
|
||||
duint addr, size;
|
||||
if(!valfromstring(argv[2], &addr, false) || !valfromstring(argv[3], &size, false))
|
||||
return STATUS_ERROR;
|
||||
|
|
|
|||
|
|
@ -130,11 +130,17 @@ bool varnew(const char* Name, duint Value, VAR_TYPE Type)
|
|||
{
|
||||
String name_;
|
||||
Name = names.at(i).c_str();
|
||||
if(*Name != '$')
|
||||
if(*Name == '$')
|
||||
{
|
||||
name_ = Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
name_ = "$";
|
||||
name_ += Name;
|
||||
name_ += Name;
|
||||
}
|
||||
if(!i)
|
||||
firstName = Name;
|
||||
firstName = name_;
|
||||
if(variables.find(name_) != variables.end()) //found
|
||||
return false;
|
||||
VAR var;
|
||||
|
|
@ -163,9 +169,15 @@ bool varget(const char* Name, VAR_VALUE* Value, int* Size, VAR_TYPE* Type)
|
|||
SHARED_ACQUIRE(LockVariables);
|
||||
|
||||
String name_;
|
||||
if(*Name != '$')
|
||||
if(*Name == '$')
|
||||
{
|
||||
name_ = Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
name_ = "$";
|
||||
name_ += Name;
|
||||
name_ += Name;
|
||||
}
|
||||
auto found = variables.find(name_);
|
||||
if(found == variables.end()) //not found
|
||||
return false;
|
||||
|
|
@ -309,14 +321,7 @@ bool vardel(const char* Name, bool DelSystem)
|
|||
|
||||
if(!DelSystem && found->second.type != VAR_USER)
|
||||
return false;
|
||||
found = variables.begin();
|
||||
while(found != variables.end())
|
||||
{
|
||||
auto del = found;
|
||||
found++;
|
||||
if(found->second.name == String(Name))
|
||||
variables.erase(del);
|
||||
}
|
||||
variables.erase(found);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ static bool cbCommandProvider(char* cmd, int maxlen)
|
|||
char* newcmd = (char*)msg.param1;
|
||||
if(strlen(newcmd) >= deflen)
|
||||
{
|
||||
dprintf("command cut at ~%d characters\n", deflen);
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "command cut at ~%d characters\n"), deflen);
|
||||
newcmd[deflen - 2] = 0;
|
||||
}
|
||||
strcpy_s(cmd, deflen, newcmd);
|
||||
|
|
@ -382,7 +382,7 @@ static DWORD WINAPI DbgScriptDllExecThread(void* a)
|
|||
if(FreeLibrary(hScriptDll))
|
||||
dputs(QT_TRANSLATE_NOOP("DBG", "success!\n"));
|
||||
else
|
||||
dprintf("failure (%08X)...\n", GetLastError());
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "failure (%08X)...\n"), GetLastError());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -393,12 +393,12 @@ static bool DbgScriptDllExec(const char* dll)
|
|||
if(dllPath.find('\\') == String::npos)
|
||||
dllPath = String(scriptDllDir) + String(dll);
|
||||
|
||||
dprintf("[Script DLL] Loading Script DLL \"%s\"...\n", dllPath.c_str());
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "[Script DLL] Loading Script DLL \"%s\"...\n"), dllPath.c_str());
|
||||
|
||||
auto hScriptDll = LoadLibraryW(StringUtils::Utf8ToUtf16(dllPath).c_str());
|
||||
if(hScriptDll)
|
||||
{
|
||||
dprintf("[Script DLL] DLL loaded on 0x%p!\n", hScriptDll);
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "[Script DLL] DLL loaded on 0x%p!\n"), hScriptDll);
|
||||
|
||||
auto AsyncStart = SCRIPTDLLSTART(GetProcAddress(hScriptDll, "AsyncStart"));
|
||||
if(AsyncStart)
|
||||
|
|
@ -416,17 +416,17 @@ static bool DbgScriptDllExec(const char* dll)
|
|||
dputs(QT_TRANSLATE_NOOP("DBG", "[Script DLL] \"Start\" returned!\n"));
|
||||
}
|
||||
else
|
||||
dprintf("[Script DLL] Failed to find the exports \"AsyncStart\" or \"Start\" (%08X)!\n", GetLastError());
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "[Script DLL] Failed to find the exports \"AsyncStart\" or \"Start\" (%08X)!\n"), GetLastError());
|
||||
|
||||
dprintf("[Script DLL] Calling FreeLibrary...");
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "[Script DLL] Calling FreeLibrary..."));
|
||||
if(FreeLibrary(hScriptDll))
|
||||
dputs(QT_TRANSLATE_NOOP("DBG", "success!\n"));
|
||||
else
|
||||
dprintf("failure (%08X)...\n", GetLastError());
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "failure (%08X)...\n"), GetLastError());
|
||||
}
|
||||
}
|
||||
else
|
||||
dprintf("[Script DLL] LoadLibary failed (%08X)!\n", GetLastError());
|
||||
dprintf(QT_TRANSLATE_NOOP("DBG", "[Script DLL] LoadLibary failed (%08X)!\n"), GetLastError());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue