Don't block endlessly after last debugged process has exited.

This commit is contained in:
Eric Pouech 2000-06-24 12:52:13 +00:00 committed by Alexandre Julliard
parent 3d89dd3b88
commit 7c43b22cb8
1 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ CONTEXT DEBUG_context;
int curr_frame = 0; int curr_frame = 0;
static char* DEBUG_LastCmdLine = NULL; static char* DEBUG_LastCmdLine = NULL;
static DBG_PROCESS* proc = NULL; static DBG_PROCESS* DEBUG_ProcessList = NULL;
DBG_INTVAR DEBUG_IntVars[DBG_IV_LAST]; DBG_INTVAR DEBUG_IntVars[DBG_IV_LAST];
void DEBUG_Output(int chn, const char* buffer, int len) void DEBUG_Output(int chn, const char* buffer, int len)
@ -129,7 +129,7 @@ static DBG_PROCESS* DEBUG_GetProcess(DWORD pid)
{ {
DBG_PROCESS* p; DBG_PROCESS* p;
for (p = proc; p; p = p->next) for (p = DEBUG_ProcessList; p; p = p->next)
if (p->pid == pid) break; if (p->pid == pid) break;
return p; return p;
} }
@ -148,10 +148,10 @@ static DBG_PROCESS* DEBUG_AddProcess(DWORD pid, HANDLE h)
p->next_index = 0; p->next_index = 0;
p->dbg_hdr_addr = 0; p->dbg_hdr_addr = 0;
p->next = proc; p->next = DEBUG_ProcessList;
p->prev = NULL; p->prev = NULL;
if (proc) proc->prev = p; if (DEBUG_ProcessList) DEBUG_ProcessList->prev = p;
proc = p; DEBUG_ProcessList = p;
return p; return p;
} }
@ -165,7 +165,7 @@ static void DEBUG_DelProcess(DBG_PROCESS* p)
} }
if (p->prev) p->prev->next = p->next; if (p->prev) p->prev->next = p->next;
if (p->next) p->next->prev = p->prev; if (p->next) p->next->prev = p->prev;
if (p == proc) proc = p->next; if (p == DEBUG_ProcessList) DEBUG_ProcessList = p->next;
if (p == DEBUG_CurrProcess) DEBUG_CurrProcess = NULL; if (p == DEBUG_CurrProcess) DEBUG_CurrProcess = NULL;
DBG_free(p); DBG_free(p);
} }
@ -718,10 +718,10 @@ static DWORD DEBUG_MainLoop(void)
for (ret = TRUE; ret; ) { for (ret = TRUE; ret; ) {
/* wait until we get at least one loaded process */ /* wait until we get at least one loaded process */
while (!proc && (ret = DEBUG_Parser())); while (!DEBUG_ProcessList && (ret = DEBUG_Parser()));
if (!ret) break; if (!ret) break;
while (ret && WaitForDebugEvent(&de, INFINITE)) { while (ret && DEBUG_ProcessList && WaitForDebugEvent(&de, INFINITE)) {
ret = DEBUG_HandleDebugEvent(&de, &cont); ret = DEBUG_HandleDebugEvent(&de, &cont);
ContinueDebugEvent(de.dwProcessId, de.dwThreadId, cont); ContinueDebugEvent(de.dwProcessId, de.dwThreadId, cont);
} }