diff --git a/uppsrc/ide/Debug.cpp b/uppsrc/ide/Debug.cpp index b4f1f16cd..99daf6509 100644 --- a/uppsrc/ide/Debug.cpp +++ b/uppsrc/ide/Debug.cpp @@ -340,6 +340,7 @@ bool Ide::EditorTip(CodeEditor::MouseTip& mt) { if(!debugger) return false; + DR_LOG("EditorTip"); int pos = mt.pos; String e; String sep; @@ -350,7 +351,7 @@ bool Ide::EditorTip(CodeEditor::MouseTip& mt) e = b + sep + e; sep = "."; while(pos > 0 && editor.GetChar(pos - 1) == ' ') - pos++; + pos--; if(pos > 0 && editor.GetChar(pos - 1) == '.') --pos; else @@ -364,7 +365,8 @@ bool Ide::EditorTip(CodeEditor::MouseTip& mt) else break; while(pos > 0 && editor.GetChar(pos - 1) == ' ') - pos++; + pos--; } + DR_LOG("debugger->Tip"); return debugger->Tip(e, mt); } diff --git a/uppsrc/ide/Debuggers/Data.cpp b/uppsrc/ide/Debuggers/Data.cpp index a3c711009..927aed2b4 100644 --- a/uppsrc/ide/Debuggers/Data.cpp +++ b/uppsrc/ide/Debuggers/Data.cpp @@ -278,6 +278,7 @@ bool Pdb::Tip(const String& exp, CodeEditor::MouseTip& mt) mt.value = exp; mt.sz = Size(100, 20); return true;*/ + DR_LOG("Pdb::Tip"); Visual r; try { CParser p(exp); @@ -287,10 +288,12 @@ bool Pdb::Tip(const String& exp, CodeEditor::MouseTip& mt) mt.sz = r.GetSize() + Size(4, 4); mt.value = RawPickToValue(r); mt.display = &Single(); + DR_LOG("Pdb::Tip true"); return true; } } catch(CParser::Error) {} + DR_LOG("Pdb::Tip false"); return false; } diff --git a/uppsrc/ide/Debuggers/Debug.cpp b/uppsrc/ide/Debuggers/Debug.cpp index 2f3f4632f..a5406d28b 100644 --- a/uppsrc/ide/Debuggers/Debug.cpp +++ b/uppsrc/ide/Debuggers/Debug.cpp @@ -173,6 +173,7 @@ void Pdb::Unlock() Pdb::Context Pdb::ReadContext(HANDLE hThread) { + DR_LOG("ReadContext"); Context r; #ifdef CPU_64 if(win64) { @@ -201,6 +202,7 @@ Pdb::Context Pdb::ReadContext(HANDLE hThread) void Pdb::WriteContext(HANDLE hThread, Context& context) { + DR_LOG("WriteContext"); #ifdef CPU_64 if(win64) { CONTEXT ctx; @@ -229,6 +231,7 @@ void Pdb::AddThread(dword dwThreadId, HANDLE hThread) { if(threads.Find(dwThreadId) >= 0) return; + DR_LOG("AddThread"); Thread& f = threads.GetAdd(dwThreadId); // Retrive "base-level" stack-pointer, to have limit for stackwalks: Context c = ReadContext(hThread); @@ -312,6 +315,7 @@ void Pdb::ToForeground() bool Pdb::RunToException() { + DR_LOG("RunToException"); LLOG("RUN TO EXCEPTION"); TimeStop ts; bool disasfocus = disas.HasFocus(); @@ -327,12 +331,15 @@ bool Pdb::RunToException() return false; } opn++; + DR_LOG("WaitForDebugEvent"); if(WaitForDebugEvent(&event, 0)) { + DR_LOG("WaitForDebugEvent ended"); debug_threadid = event.dwThreadId; opn = 0; running = false; switch(event.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: { + DR_LOG("EXCEPTION_DEBUG_EVENT"); LLOG("Exception: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionCode) << " at: " << FormatIntHex(event.u.Exception.ExceptionRecord.ExceptionAddress) << " first: " << event.u.Exception.dwFirstChance); @@ -399,14 +406,17 @@ bool Pdb::RunToException() return true; } case CREATE_THREAD_DEBUG_EVENT: + DR_LOG("CREATE_THREAD_DEBUG_EVENT"); LLOG("Create thread: " << event.dwThreadId); AddThread(event.dwThreadId, event.u.CreateThread.hThread); break; case EXIT_THREAD_DEBUG_EVENT: + DR_LOG("EXIT_THREAD_DEBUG_EVENT"); LLOG("Exit thread: " << event.dwThreadId); RemoveThread(event.dwThreadId); break; case CREATE_PROCESS_DEBUG_EVENT: + DR_LOG("CREATE_PROCESS_DEBUG_EVENT"); LLOG("Create process: " << event.dwProcessId); processid = event.dwProcessId; AddThread(event.dwThreadId, event.u.CreateProcessInfo.hThread); @@ -414,22 +424,26 @@ bool Pdb::RunToException() CloseHandle(event.u.CreateProcessInfo.hProcess); break; case EXIT_PROCESS_DEBUG_EVENT: + DR_LOG("EXIT_PROCESS_DEBUG_EVENT"); LLOG("Exit process: " << event.dwProcessId); if(locked) Unlock(); terminated = true; return false; case LOAD_DLL_DEBUG_EVENT: { + DR_LOG("LOAD_DLL_DEBUG_EVENT"); LLOG("Load dll: " << event.u.LoadDll.lpBaseOfDll); CloseHandle(event.u.LoadDll.hFile); refreshmodules = true; break; } case UNLOAD_DLL_DEBUG_EVENT: + DR_LOG("UNLOAD_DLL_DEBUG_EVENT"); LLOG("UnLoad dll: " << event.u.UnloadDll.lpBaseOfDll); refreshmodules = true; break; case RIP_EVENT: + DR_LOG("RIP_EVENT"); LLOG("RIP!"); Exclamation("Process being debugged died unexpectedly!"); terminated = true; @@ -437,10 +451,12 @@ bool Pdb::RunToException() Unlock(); return false; } + DR_LOG("ContinueDebugEvent"); ContinueDebugEvent(event.dwProcessId, event.dwThreadId, DBG_EXCEPTION_NOT_HANDLED); running = true; } if(ts.Elapsed() > 200) { + DR_LOG("ts.Elpsed() > 200"); if(!lock) { Lock(); locked = true; @@ -451,11 +467,14 @@ bool Pdb::RunToException() } } if(lock) { + DR_LOG("GuiSleep"); GuiSleep(opn < 1000 ? 0 : 100); Ctrl::ProcessEvents(); } - else + else { + DR_LOG("Sleep"); Sleep(opn < 1000 ? 0 : 100); + } } } diff --git a/uppsrc/ide/Debuggers/Debuggers.h b/uppsrc/ide/Debuggers/Debuggers.h index e72dccf87..fea77c850 100644 --- a/uppsrc/ide/Debuggers/Debuggers.h +++ b/uppsrc/ide/Debuggers/Debuggers.h @@ -1,6 +1,8 @@ #ifndef __Debuggers__ #define __Debuggers__ +#define DR_LOG(x) // RLOG(x) + #include #include diff --git a/uppsrc/ide/Debuggers/Exp.cpp b/uppsrc/ide/Debuggers/Exp.cpp index 96ec1d91b..9ba39dc43 100644 --- a/uppsrc/ide/Debuggers/Exp.cpp +++ b/uppsrc/ide/Debuggers/Exp.cpp @@ -550,6 +550,7 @@ Pdb::Val Pdb::LogOr(CParser& p) Pdb::Val Pdb::Exp0(CParser& p) { + DR_LOG("Evaluating Expression: " << p.GetPtr()); LLOG("Evaluating Expression: " << p.GetPtr()); return LogOr(p); } diff --git a/uppsrc/ide/Debuggers/Visualise.cpp b/uppsrc/ide/Debuggers/Visualise.cpp index 8769b716d..59cffd298 100644 --- a/uppsrc/ide/Debuggers/Visualise.cpp +++ b/uppsrc/ide/Debuggers/Visualise.cpp @@ -55,6 +55,7 @@ void Pdb::CatInt(Visual& result, int64 val) void Pdb::Visualise(Visual& result, Pdb::Val val, int expandptr, int slen) { + DR_LOG("Visualise"); const int maxlen = 300; if(result.length > maxlen) return;