[PATCH] [DbgHelp]: live target detection

Eric Pouech eric.pouech at wanadoo.fr
Sat Mar 18 03:32:33 CST 2006


- DBGHELP_NOLIVE env variable is tested earlier to avoid 
  some strange effects in live target detection
- in WineDbg, delete DBGHELP_NOLIVE before attaching to
  a process, because we know it must be a live target

A+
---

 dlls/dbghelp/dbghelp.c        |    4 ++--
 programs/winedbg/tgt_active.c |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c
index f776190..bd75a60 100644
--- a/dlls/dbghelp/dbghelp.c
+++ b/dlls/dbghelp/dbghelp.c
@@ -170,8 +170,8 @@ static BOOL WINAPI process_invade_cb(cha
 static BOOL check_live_target(struct process* pcs)
 {
     if (!GetProcessId(pcs->handle)) return FALSE;
-    if (!elf_read_wine_loader_dbg_info(pcs)) return FALSE;
-    return getenv("DBGHELP_NOLIVE") == NULL;
+    if (GetEnvironmentVariableA("DBGHELP_NOLIVE", NULL, 0)) return FALSE;
+    return elf_read_wine_loader_dbg_info(pcs);
 }
 
 /******************************************************************
diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c
index d4eaade..a76f193 100644
--- a/programs/winedbg/tgt_active.c
+++ b/programs/winedbg/tgt_active.c
@@ -83,6 +83,8 @@ BOOL dbg_attach_debuggee(DWORD pid, BOOL
     }
     dbg_curr_process->continue_on_first_exception = cofe;
 
+    SetEnvironmentVariableA("DBGHELP_NOLIVE", NULL);
+
     if (wfe) /* shall we proceed all debug events until we get an exception ? */
     {
         dbg_interactiveP = FALSE;





More information about the wine-patches mailing list