Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7d43bceb
Commit
7d43bceb
authored
Jan 30, 2000
by
Ulrich Weigand
Committed by
Alexandre Julliard
Jan 30, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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.
parent
f3bfa3a4
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
57 deletions
+32
-57
Makefile.in
Makefile.in
+2
-2
dbg.y
debugger/dbg.y
+14
-7
external.c
debugger/external.c
+5
-5
exception.c
dlls/ntdll/exception.c
+3
-32
debugger.h
include/debugger.h
+3
-0
thread.h
include/thread.h
+1
-1
exception.h
include/wine/exception.h
+0
-3
main.c
miscemu/main.c
+1
-5
except.c
win32/except.c
+3
-2
No files found.
Makefile.in
View file @
7d43bceb
...
...
@@ -34,6 +34,7 @@ TOOLSUBDIRS = \
LIBSUBDIRS
=
\
controls
\
console
\
debugger
\
dlls/advapi32
\
dlls/avifil32
\
dlls/comctl32
\
...
...
@@ -115,7 +116,6 @@ X11SUBDIRS = \
windows/x11drv
EMUSUBDIRS
=
\
debugger
\
miscemu
\
server
...
...
@@ -154,6 +154,7 @@ CLEANSUBDIRS = dlls include include/bitmaps include/wine
LIBOBJS
=
\
controls/controls.o
\
console/console.o
\
debugger/debugger.o
\
dlls/advapi32/advapi32.o
\
dlls/avifil32/avifil32.o
\
dlls/comctl32/comctl32.o
\
...
...
@@ -234,7 +235,6 @@ X11OBJS = \
windows/x11drv/x11drv.o
EMUOBJS
=
\
debugger/debugger.o
\
miscemu/miscemu.o
EXTRA_OBJS
=
$(LIBOBJS)
$(X11OBJS)
...
...
debugger/dbg.y
View file @
7d43bceb
...
...
@@ -423,10 +423,16 @@ static void DEBUG_Freeze( BOOL freeze )
if ( freeze && !frozen )
{
/* Don't freeze thread currently holding the X crst! */
EnterCriticalSection( &X11DRV_CritSection );
CLIENT_DebuggerRequest( DEBUGGER_FREEZE_ALL );
LeaveCriticalSection( &X11DRV_CritSection );
if ( X11DRV_CritSection.LockSemaphore )
{
/* Don't freeze thread currently holding the X crst! */
EnterCriticalSection( &X11DRV_CritSection );
CLIENT_DebuggerRequest( DEBUGGER_FREEZE_ALL );
LeaveCriticalSection( &X11DRV_CritSection );
}
else
CLIENT_DebuggerRequest( DEBUGGER_FREEZE_ALL );
frozen = TRUE;
}
...
...
@@ -468,7 +474,8 @@ static void DEBUG_Main( BOOL is_debug )
if (in_debugger)
{
fprintf( stderr, " inside debugger, exiting.\n" );
fprintf( stderr, " inside debugger, trying to invoke external debugger.\n" );
DEBUG_ExternalDebugger();
DEBUG_Exit(1);
}
in_debugger = TRUE;
...
...
@@ -554,7 +561,7 @@ static void DEBUG_Main( BOOL is_debug )
DEBUG_Freeze( TRUE );
/* Put the display in a correct state */
USER_Driver->pBeginDebugging();
if (USER_Driver)
USER_Driver->pBeginDebugging();
#ifdef __i386__
newmode = ISV86(&DEBUG_context) ? 16 : IS_SELECTOR_32BIT(addr.seg) ? 32 : 16;
...
...
@@ -633,7 +640,7 @@ static void DEBUG_Main( BOOL is_debug )
in_debugger = FALSE;
USER_Driver->pEndDebugging();
if (USER_Driver)
USER_Driver->pEndDebugging();
}
...
...
debugger/external.c
View file @
7d43bceb
...
...
@@ -14,7 +14,7 @@
#include <stdio.h>
#include <string.h>
#include "options.h"
#define DBG_BUFF_SIZE 12
...
...
@@ -90,9 +90,9 @@ void DEBUG_ExternalDebugger(void)
if
(
child_pid
==
0
)
{
int
status
;
char
*
dbg_external
;
char
*
dbg_wine_location
;
char
*
dbg_no_xterm
;
c
onst
c
har
*
dbg_external
;
c
onst
c
har
*
dbg_wine_location
;
c
onst
c
har
*
dbg_no_xterm
;
char
pid_string
[
DBG_BUFF_SIZE
];
...
...
@@ -107,7 +107,7 @@ void DEBUG_ExternalDebugger(void)
/* if not set in environment, use default */
if
(
!
dbg_wine_location
)
dbg_wine_location
=
"/usr/local/bin/wine"
;
dbg_wine_location
=
argv0
;
/* check for empty string in WINE_DBG_NO_XTERM */
if
(
dbg_no_xterm
&&
(
strlen
(
dbg_no_xterm
)
<
1
))
...
...
dlls/ntdll/exception.c
View file @
7d43bceb
...
...
@@ -13,6 +13,7 @@
#include "wine/exception.h"
#include "stackframe.h"
#include "miscemu.h"
#include "debugger.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
seh
)
...
...
@@ -25,36 +26,6 @@ typedef struct
}
EXC_NESTED_FRAME
;
/* Default hook for built-in debugger */
static
DWORD
default_hook
(
EXCEPTION_RECORD
*
rec
,
CONTEXT
*
ctx
,
BOOL
first
)
{
if
(
!
first
)
{
DPRINTF
(
"stopping process due to unhandled exception %08lx.
\n
"
,
rec
->
ExceptionCode
);
raise
(
SIGSTOP
);
}
return
0
;
/* not handled */
}
static
DEBUGHOOK
debug_hook
=
default_hook
;
/*******************************************************************
* EXC_SetDebugEventHook
* EXC_GetDebugEventHook
*
* Set/Get the hook for the built-in debugger.
*
* FIXME: the built-in debugger should use the normal debug events.
*/
void
EXC_SetDebugEventHook
(
DEBUGHOOK
hook
)
{
debug_hook
=
hook
;
}
DEBUGHOOK
EXC_GetDebugEventHook
(
void
)
{
return
debug_hook
;
}
/*******************************************************************
* EXC_RaiseHandler
*
...
...
@@ -125,7 +96,7 @@ static void EXC_DefaultHandling( EXCEPTION_RECORD *rec, CONTEXT *context )
(
DEBUG_SendExceptionEvent
(
rec
,
FALSE
,
context
)
==
DBG_CONTINUE
))
return
;
/* continue execution */
if
(
debug_hook
(
rec
,
context
,
FALSE
)
==
DBG_CONTINUE
)
if
(
wine_debugger
(
rec
,
context
,
FALSE
)
==
DBG_CONTINUE
)
return
;
/* continue execution */
if
(
rec
->
ExceptionFlags
&
EH_STACK_INVALID
)
...
...
@@ -155,7 +126,7 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
(
DEBUG_SendExceptionEvent
(
rec
,
TRUE
,
context
)
==
DBG_CONTINUE
))
return
;
/* continue execution */
if
(
debug_hook
(
rec
,
context
,
TRUE
)
==
DBG_CONTINUE
)
if
(
wine_debugger
(
rec
,
context
,
TRUE
)
==
DBG_CONTINUE
)
return
;
/* continue execution */
frame
=
NtCurrentTeb
()
->
except
;
...
...
include/debugger.h
View file @
7d43bceb
...
...
@@ -325,6 +325,9 @@ extern void DEBUG_NukePath(void);
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
);
...
...
include/thread.h
View file @
7d43bceb
...
...
@@ -63,7 +63,7 @@ typedef struct _TEB
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) */
...
...
include/wine/exception.h
View file @
7d43bceb
...
...
@@ -172,9 +172,6 @@ extern void WINAPI EXC_RtlUnwind( PEXCEPTION_FRAME, LPVOID,
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
...
...
miscemu/main.c
View file @
7d43bceb
...
...
@@ -108,12 +108,8 @@ int main( int argc, char *argv[] )
{
NE_MODULE
*
pModule
;
/* Set up debugger hook */
EXC_SetDebugEventHook
(
wine_debugger
);
TASK_AddTaskEntryBreakpoint
=
DEBUG_AddTaskEntryBreakpoint
;
/* Initialize everything */
if
(
!
MAIN_MainInit
(
&
argc
,
argv
))
return
1
;
if
(
!
MAIN_MainInit
(
&
argc
,
argv
,
FALSE
))
return
1
;
MAIN_argc
=
argc
;
MAIN_argv
=
argv
;
/* Create initial task */
...
...
win32/except.c
View file @
7d43bceb
...
...
@@ -31,6 +31,7 @@
#include "process.h"
#include "thread.h"
#include "stackframe.h"
#include "debugger.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
seh
)
...
...
@@ -78,8 +79,8 @@ DWORD WINAPI UnhandledExceptionFilter(PEXCEPTION_POINTERS epointers)
}
/* FIXME: does not belong here */
if
(
((
*
EXC_GetDebugEventHook
())
(
epointers
->
ExceptionRecord
,
epointers
->
ContextRecord
,
FALSE
)
)
==
DBG_CONTINUE
)
if
(
wine_debugger
(
epointers
->
ExceptionRecord
,
epointers
->
ContextRecord
,
FALSE
)
==
DBG_CONTINUE
)
return
EXCEPTION_CONTINUE_EXECUTION
;
/* FIXME: Should check the current error mode */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment