From 1ce1bef859b136d6525d33a94057cef3cec7eea2 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 11 Jul 2001 17:33:08 +0000 Subject: [PATCH] Better error reporting on DebugActiveProcess failure. --- debugger/dbg.y | 2 +- debugger/winedbg.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debugger/dbg.y b/debugger/dbg.y index b014c7ca426..7c899c98afc 100644 --- a/debugger/dbg.y +++ b/debugger/dbg.y @@ -142,7 +142,7 @@ command: | tCOND tNUM expr tEOL { DEBUG_AddBPCondition($2, $3); } | tSYMBOLFILE pathname tEOL { DEBUG_ReadSymbolTable($2); } | tWHATIS expr_addr tEOL { DEBUG_PrintType(&$2); DEBUG_FreeExprMem(); } - | tATTACH tNUM tEOL { DEBUG_Attach($2, FALSE); return TRUE; } + | tATTACH tNUM tEOL { if (DEBUG_Attach($2, FALSE)) return TRUE; } | list_command | disassemble_command | set_command diff --git a/debugger/winedbg.c b/debugger/winedbg.c index c7db7547a67..dfc15720c2d 100644 --- a/debugger/winedbg.c +++ b/debugger/winedbg.c @@ -277,8 +277,9 @@ BOOL DEBUG_Attach(DWORD pid, BOOL cofe) if (!(DEBUG_CurrProcess = DEBUG_AddProcess(pid, 0))) return FALSE; if (!DebugActiveProcess(pid)) { - DEBUG_Printf(DBG_CHN_ERR, "Can't attach process %ld: %ld\n", - pid, GetLastError()); + DEBUG_Printf(DBG_CHN_MESG, "Can't attach process %lx: error %ld\n", pid, GetLastError()); + DEBUG_DelProcess(DEBUG_CurrProcess); + DEBUG_CurrProcess = NULL; return FALSE; } DEBUG_CurrProcess->continue_on_first_exception = cofe;