Moved debugger to libwine to make it available to WineLib apps.
Try to invoke external debugger if internal debugger crashes.
Try to handle early invocation of debugger more gracefully.

diff --git a/include/debugger.h b/include/debugger.h
index f79dd2d..7bbc97a 100644
--- a/include/debugger.h
+++ b/include/debugger.h
@@ -325,6 +325,9 @@
 extern void DEBUG_GetCurrentAddress( DBG_ADDR * );
 extern void DEBUG_Disassemble( const DBG_ADDR *, const DBG_ADDR*, int offset );
 
+  /* debugger/external.c */
+extern void DEBUG_ExternalDebugger(void);
+
   /* debugger/dbg.y */
 extern DWORD wine_debugger( EXCEPTION_RECORD *rec, CONTEXT *context, BOOL first_chance );
 extern void DEBUG_Exit( DWORD exit_code );
diff --git a/include/thread.h b/include/thread.h
index e1813b4..70c82c4 100644
--- a/include/thread.h
+++ b/include/thread.h
@@ -63,7 +63,7 @@
     void        *signal_stack;   /* --3  58 Signal stack (was: exit_stack) */
     void        *emu_data;       /* --n  5c Related to 80387 emulation */
     DWORD        last_error;     /* 1--  60 Last error code */
-    HANDLE       event;          /* --3  64 Thread event (was: debugger context block) */
+    HANDLE       debug_cb;       /* 1-n  64 Debugger context block */
     DWORD        debug_thread;   /* 1-n  68 Thread debugging this one (?) */
     void        *pcontext;       /* 1-n  6c Thread register context */
     DWORD        cur_stack;      /* --3  70 Current stack (was: unknown) */
diff --git a/include/wine/exception.h b/include/wine/exception.h
index bfbe694..d184de9 100644
--- a/include/wine/exception.h
+++ b/include/wine/exception.h
@@ -172,9 +172,6 @@
                                   PEXCEPTION_RECORD, DWORD, CONTEXT * );
 extern void WINAPI EXC_DebugBreak( CONTEXT *context );
 
-typedef DWORD (*DEBUGHOOK)( EXCEPTION_RECORD *, CONTEXT *, BOOL );
-extern void EXC_SetDebugEventHook( DEBUGHOOK hook );
-extern DEBUGHOOK EXC_GetDebugEventHook(void);
 extern BOOL SIGNAL_Init(void);
 #endif