3 * Parser for command lines in the Wine debugger
5 * Copyright 1993 Eric Youngdale
6 * Copyright 1995 Morten Welinder
23 unsigned int dbg_mode
= 0;
26 static enum exec_mode dbg_exec_mode
= EXEC_CONT
;
27 static int dbg_exec_count
= 0;
29 void issue_prompt
(void);
30 void mode_command
(int);
31 void flush_symbols
(void);
43 struct list_id listing
;
44 struct expr
* expression
;
45 struct datatype
* type
;
48 %token tCONT tSTEP tLIST tNEXT tQUIT tHELP tBACKTRACE tINFO tWALK tUP tDOWN
49 %token tENABLE tDISABLE tBREAK tDELETE tSET tMODE tPRINT tEXAM tABORT
50 %token tCLASS tMODULE tSTACK tSEGMENTS tREGS tWND tQUEUE tLOCAL
52 %token tFRAME tSHARE tCOND tDISPLAY tUNDISPLAY
53 %token tSTEPI tNEXTI tFINISH tSHOW tDIR
55 %token
<string> tIDENTIFIER tSTRING
56 %token
<integer
> tNUM tFORMAT
59 %token tCHAR tSHORT tINT tLONG tFLOAT tDOUBLE tUNSIGNED tSIGNED
60 %token tSTRUCT tUNION tENUM
63 /* %left '=' OP_OR_EQUAL OP_XOR_EQUAL OP_AND_EQUAL OP_SHL_EQUAL \
64 OP_SHR_EQUAL OP_PLUS_EQUAL OP_MINUS_EQUAL \
65 OP_TIMES_EQUAL OP_DIVIDE_EQUAL OP_MODULO_EQUAL */
66 /* %left OP_COND */ /* ... ? ... : ... */
73 %left
'<' '>' OP_LE OP_GE
77 %left OP_SIGN
'!' '~' OP_DEREF
/* OP_INC OP_DEC OP_ADDR */
81 %type
<expression
> expr lval lvalue
82 %type
<type
> type_cast type_expr
83 %type
<address
> expr_addr lval_addr
84 %type
<integer
> expr_value
85 %type
<string> pathname
87 %type
<listing
> list_arg
91 input: line
{ issue_prompt
(); }
92 | input line
{ issue_prompt
(); }
96 |
error tEOL
{ yyerrok; }
99 tQUIT tEOL
{ exit
(0); }
100 | tHELP tEOL
{ DEBUG_Help
(); }
101 | tHELP tINFO tEOL
{ DEBUG_HelpInfo
(); }
102 | tCONT tEOL
{ dbg_exec_count
= 1;
103 dbg_exec_mode
= EXEC_CONT
; return
0; }
104 | tCONT tNUM tEOL
{ dbg_exec_count
= $2;
105 dbg_exec_mode
= EXEC_CONT
; return
0; }
106 | tSTEP tEOL
{ dbg_exec_count
= 1;
107 dbg_exec_mode
= EXEC_STEP_INSTR
; return
0; }
108 | tNEXT tEOL
{ dbg_exec_count
= 1;
109 dbg_exec_mode
= EXEC_STEP_OVER
; return
0; }
110 | tSTEP tNUM tEOL
{ dbg_exec_count
= $2;
111 dbg_exec_mode
= EXEC_STEP_INSTR
; return
0; }
112 | tNEXT tNUM tEOL
{ dbg_exec_count
= $2;
113 dbg_exec_mode
= EXEC_STEP_OVER
; return
0; }
114 | tSTEPI tEOL
{ dbg_exec_count
= 1;
115 dbg_exec_mode
= EXEC_STEPI_INSTR
; return
0; }
116 | tNEXTI tEOL
{ dbg_exec_count
= 1;
117 dbg_exec_mode
= EXEC_STEPI_OVER
; return
0; }
118 | tSTEPI tNUM tEOL
{ dbg_exec_count
= $2;
119 dbg_exec_mode
= EXEC_STEPI_INSTR
; return
0; }
120 | tNEXTI tNUM tEOL
{ dbg_exec_count
= $2;
121 dbg_exec_mode
= EXEC_STEPI_OVER
; return
0; }
122 | tABORT tEOL
{ kill
(getpid
(), SIGABRT
); }
123 | tMODE tNUM tEOL
{ mode_command
($2); }
124 | tENABLE tNUM tEOL
{ DEBUG_EnableBreakpoint
( $2, TRUE
); }
125 | tDISABLE tNUM tEOL
{ DEBUG_EnableBreakpoint
( $2, FALSE
); }
126 | tDELETE tBREAK tNUM tEOL
{ DEBUG_DelBreakpoint
( $3 ); }
127 | tBACKTRACE tEOL
{ DEBUG_BackTrace
(); }
128 | tUP tEOL
{ DEBUG_SetFrame
( curr_frame
+ 1 ); }
129 | tUP tNUM tEOL
{ DEBUG_SetFrame
( curr_frame
+ $2 ); }
130 | tDOWN tEOL
{ DEBUG_SetFrame
( curr_frame
- 1 ); }
131 | tDOWN tNUM tEOL
{ DEBUG_SetFrame
( curr_frame
- $2 ); }
132 | tFRAME tNUM tEOL
{ DEBUG_SetFrame
( $2 ); }
133 | tFINISH tEOL
{ dbg_exec_count
= 0;
134 dbg_exec_mode
= EXEC_FINISH
; return
0; }
135 | tSHOW tDIR tEOL
{ DEBUG_ShowDir
(); }
136 | tDIR pathname tEOL
{ DEBUG_AddPath
( $2 ); }
137 | tDIR tEOL
{ DEBUG_NukePath
(); }
138 | tDISPLAY tEOL
{ DEBUG_InfoDisplay
(); }
139 | tDISPLAY expr tEOL
{ DEBUG_AddDisplay
($2, 1, 0); }
140 | tDISPLAY tFORMAT expr tEOL
{ DEBUG_AddDisplay
($3, $2 >> 8, $2 & 0xff); }
141 | tDELETE tDISPLAY tNUM tEOL
{ DEBUG_DelDisplay
( $3 ); }
142 | tDELETE tDISPLAY tEOL
{ DEBUG_DelDisplay
( -1 ); }
143 | tUNDISPLAY tNUM tEOL
{ DEBUG_DelDisplay
( $2 ); }
144 | tUNDISPLAY tEOL
{ DEBUG_DelDisplay
( -1 ); }
145 | tCOND tNUM tEOL
{ DEBUG_AddBPCondition
($2, NULL
); }
146 | tCOND tNUM expr tEOL
{ DEBUG_AddBPCondition
($2, $3); }
156 tSET tREG
'=' expr_value tEOL
{ DEBUG_SetRegister
( $2, $4 );
157 DEBUG_FreeExprMem
(); }
158 | tSET lval_addr
'=' expr_value tEOL
{ DEBUG_WriteMemory
( &$2, $4 );
159 DEBUG_FreeExprMem
(); }
162 tIDENTIFIER
{ $$
= $1; }
166 tLIST tEOL
{ DEBUG_List
( NULL
, NULL
, 10 ); }
167 | tLIST
'-' tEOL
{ DEBUG_List
( NULL
, NULL
, -10 ); }
168 | tLIST list_arg tEOL
{ DEBUG_List
( & $2, NULL
, 10 ); }
169 | tLIST
',' list_arg tEOL
{ DEBUG_List
( NULL
, & $3, -10 ); }
170 | tLIST list_arg
',' list_arg tEOL
{ DEBUG_List
( & $2, & $4, 0 ); }
173 tNUM
{ $$.sourcefile
= NULL
; $$.line
= $1; }
174 | pathname
':' tNUM
{ $$.sourcefile
= $1; $$.line
= $3; }
175 | tIDENTIFIER
{ DEBUG_GetFuncInfo
( & $$
, NULL
, $1); }
176 | pathname
':' tIDENTIFIER
{ DEBUG_GetFuncInfo
( & $$
, $1, $3); }
177 |
'*' expr_addr
{ DEBUG_FindNearestSymbol
( & $2, FALSE
, NULL
,
179 DEBUG_FreeExprMem
(); }
182 tEXAM expr_addr tEOL
{ DEBUG_ExamineMemory
( &$2, 1, 'x');
183 DEBUG_FreeExprMem
(); }
184 | tEXAM tFORMAT expr_addr tEOL
{ DEBUG_ExamineMemory
( &$3, $2>>8, $2&0xff );
185 DEBUG_FreeExprMem
(); }
188 tPRINT expr_addr tEOL
{ DEBUG_Print
( &$2, 1, 0, 0 );
189 DEBUG_FreeExprMem
(); }
190 | tPRINT tFORMAT expr_addr tEOL
{ DEBUG_Print
( &$3, $2 >> 8, $2 & 0xff, 0 );
191 DEBUG_FreeExprMem
(); }
194 tBREAK
'*' expr_addr tEOL
{ DEBUG_AddBreakpoint
( &$3 );
195 DEBUG_FreeExprMem
(); }
196 | tBREAK tIDENTIFIER tEOL
{ DBG_ADDR addr
;
197 if
( DEBUG_GetSymbolValue
($2, -1, &addr
, TRUE
) )
199 DEBUG_AddBreakpoint
( &addr
);
203 fprintf
(stderr
,"Unable to add breakpoint\n");
206 | tBREAK tIDENTIFIER
':' tNUM tEOL
{ DBG_ADDR addr
;
207 if
( DEBUG_GetSymbolValue
($2, $4, &addr
, TRUE
) )
209 DEBUG_AddBreakpoint
( &addr
);
213 fprintf
(stderr
,"Unable to add breakpoint\n");
216 | tBREAK tNUM tEOL
{ struct name_hash
*nh
;
217 DBG_ADDR addr
= { NULL
,
218 CS_reg
(&DEBUG_context
),
219 EIP_reg
(&DEBUG_context
) };
221 DBG_FIX_ADDR_SEG
( &addr
, CS_reg
(&DEBUG_context
) );
222 DEBUG_FindNearestSymbol
(&addr
, TRUE
,
226 DEBUG_GetLineNumberAddr
(nh
,
228 DEBUG_AddBreakpoint
( &addr
);
232 fprintf
(stderr
,"Unable to add breakpoint\n");
236 | tBREAK tEOL
{ DBG_ADDR addr
= { NULL
,
237 CS_reg
(&DEBUG_context
),
238 EIP_reg
(&DEBUG_context
) };
239 DEBUG_AddBreakpoint
( &addr
);
243 tINFO tBREAK tEOL
{ DEBUG_InfoBreakpoints
(); }
244 | tINFO tCLASS expr_value tEOL
{ CLASS_DumpClass
( (CLASS
*)$3 );
245 DEBUG_FreeExprMem
(); }
246 | tINFO tSHARE tEOL
{ DEBUG_InfoShare
(); }
247 | tINFO tMODULE expr_value tEOL
{ MODULE_DumpModule
( $3 );
248 DEBUG_FreeExprMem
(); }
249 | tINFO tQUEUE expr_value tEOL
{ QUEUE_DumpQueue
( $3 );
250 DEBUG_FreeExprMem
(); }
251 | tINFO tREGS tEOL
{ DEBUG_InfoRegisters
(); }
252 | tINFO tSEGMENTS expr_value tEOL
{ LDT_Print
( SELECTOR_TO_ENTRY
($3), 1 );
253 DEBUG_FreeExprMem
(); }
254 | tINFO tSEGMENTS tEOL
{ LDT_Print
( 0, -1 ); }
255 | tINFO tSTACK tEOL
{ DEBUG_InfoStack
(); }
256 | tINFO tWND expr_value tEOL
{ WIN_DumpWindow
( $3 );
257 DEBUG_FreeExprMem
(); }
258 | tINFO tLOCAL tEOL
{ DEBUG_InfoLocals
(); }
259 | tINFO tDISPLAY tEOL
{ DEBUG_InfoDisplay
(); }
262 tWALK tCLASS tEOL
{ CLASS_WalkClasses
(); }
263 | tWALK tMODULE tEOL
{ MODULE_WalkModules
(); }
264 | tWALK tQUEUE tEOL
{ QUEUE_WalkQueues
(); }
265 | tWALK tWND tEOL
{ WIN_WalkWindows
( 0, 0 ); }
266 | tWALK tWND tNUM tEOL
{ WIN_WalkWindows
( $3, 0 ); }
270 '(' type_expr
')' { $$
= $2; }
273 type_expr
'*' { $$
= DEBUG_FindOrMakePointerType
($1); }
274 | tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "int"); }
275 | tCHAR
{ $$
= DEBUG_TypeCast
(BASIC
, "char"); }
276 | tLONG tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "long int"); }
277 | tUNSIGNED tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "unsigned int"); }
278 | tLONG tUNSIGNED tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "long unsigned int"); }
279 | tLONG tLONG tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "long long int"); }
280 | tLONG tLONG tUNSIGNED tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "long long unsigned int"); }
281 | tSHORT tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "short int"); }
282 | tSHORT tUNSIGNED tINT
{ $$
= DEBUG_TypeCast
(BASIC
, "short unsigned int"); }
283 | tSIGNED tCHAR
{ $$
= DEBUG_TypeCast
(BASIC
, "signed char"); }
284 | tUNSIGNED tCHAR
{ $$
= DEBUG_TypeCast
(BASIC
, "unsigned char"); }
285 | tFLOAT
{ $$
= DEBUG_TypeCast
(BASIC
, "float"); }
286 | tDOUBLE
{ $$
= DEBUG_TypeCast
(BASIC
, "double"); }
287 | tLONG tDOUBLE
{ $$
= DEBUG_TypeCast
(BASIC
, "long double"); }
288 | tSTRUCT tIDENTIFIER
{ $$
= DEBUG_TypeCast
(STRUCT
, $2); }
289 | tUNION tIDENTIFIER
{ $$
= DEBUG_TypeCast
(STRUCT
, $2); }
290 | tENUM tIDENTIFIER
{ $$
= DEBUG_TypeCast
(ENUM
, $2); }
293 expr
{ $$
= DEBUG_EvalExpr
($1); }
296 expr
{ DBG_ADDR addr
= DEBUG_EvalExpr
($1);
297 $$
= *(unsigned int *) addr.off
; }
299 * The expr rule builds an expression tree. When we are done, we call
300 * EvalExpr to evaluate the value of the expression. The advantage of
301 * the two-step approach is that it is possible to save expressions for
302 * use in 'display' commands, and in conditional watchpoints.
305 tNUM
{ $$
= DEBUG_ConstExpr
($1); }
306 | tSTRING
{ $$
= DEBUG_StringExpr
($1); }
307 | tREG
{ $$
= DEBUG_RegisterExpr
($1); }
308 | tIDENTIFIER
{ $$
= DEBUG_SymbolExpr
($1); }
309 | expr OP_DRF tIDENTIFIER
{ $$
= DEBUG_StructPExpr
($1, $3); }
310 | expr
'.' tIDENTIFIER
{ $$
= DEBUG_StructExpr
($1, $3); }
311 | tIDENTIFIER
'(' ')' { $$
= DEBUG_CallExpr
($1, 0); }
312 | tIDENTIFIER
'(' expr
')' { $$
= DEBUG_CallExpr
($1, 1, $3); }
313 | tIDENTIFIER
'(' expr
',' expr
')' { $$
= DEBUG_CallExpr
($1, 2, $3,
315 | tIDENTIFIER
'(' expr
',' expr
',' expr
')' { $$
= DEBUG_CallExpr
($1, 3, $3, $5, $7); }
316 | tIDENTIFIER
'(' expr
',' expr
',' expr
',' expr
')' { $$
= DEBUG_CallExpr
($1, 3, $3, $5, $7, $9); }
317 | tIDENTIFIER
'(' expr
',' expr
',' expr
',' expr
',' expr
')' { $$
= DEBUG_CallExpr
($1, 3, $3, $5, $7, $9, $11); }
318 | expr
'[' expr
']' { $$
= DEBUG_BinopExpr
(EXP_OP_ARR
, $1, $3); }
319 | expr
':' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_SEG
, $1, $3); }
320 | expr OP_LOR expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_LOR
, $1, $3); }
321 | expr OP_LAND expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_LAND
, $1, $3); }
322 | expr
'|' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_OR
, $1, $3); }
323 | expr
'&' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_AND
, $1, $3); }
324 | expr
'^' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_XOR
, $1, $3); }
325 | expr OP_EQ expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_EQ
, $1, $3); }
326 | expr
'>' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_GT
, $1, $3); }
327 | expr
'<' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_LT
, $1, $3); }
328 | expr OP_GE expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_GE
, $1, $3); }
329 | expr OP_LE expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_LE
, $1, $3); }
330 | expr OP_NE expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_NE
, $1, $3); }
331 | expr OP_SHL expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_SHL
, $1, $3); }
332 | expr OP_SHR expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_SHR
, $1, $3); }
333 | expr
'+' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_ADD
, $1, $3); }
334 | expr
'-' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_SUB
, $1, $3); }
335 | expr
'*' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_MUL
, $1, $3); }
336 | expr
'/' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_DIV
, $1, $3); }
337 | expr
'%' expr
{ $$
= DEBUG_BinopExpr
(EXP_OP_REM
, $1, $3); }
338 |
'-' expr %prec OP_SIGN
{ $$
= DEBUG_UnopExpr
(EXP_OP_NEG
, $2); }
339 |
'+' expr %prec OP_SIGN
{ $$
= $2; }
340 |
'!' expr
{ $$
= DEBUG_UnopExpr
(EXP_OP_NOT
, $2); }
341 |
'~' expr
{ $$
= DEBUG_UnopExpr
(EXP_OP_LNOT
, $2); }
342 |
'(' expr
')' { $$
= $2; }
343 |
'*' expr %prec OP_DEREF
{ $$
= DEBUG_UnopExpr
(EXP_OP_DEREF
, $2); }
344 |
'&' expr %prec OP_DEREF
{ $$
= DEBUG_UnopExpr
(EXP_OP_ADDR
, $2); }
345 | type_cast expr %prec OP_DEREF
{ $$
= DEBUG_TypeCastExpr
($1, $2); }
348 * The lvalue rule builds an expression tree. This is a limited form
349 * of expression that is suitable to be used as an lvalue.
352 lval
{ $$
= DEBUG_EvalExpr
($1); }
356 |
'*' expr
{ $$
= DEBUG_UnopExpr
(EXP_OP_FORCE_DEREF
, $2); }
359 tNUM
{ $$
= DEBUG_ConstExpr
($1); }
360 | tREG
{ $$
= DEBUG_RegisterExpr
($1); }
361 | tIDENTIFIER
{ $$
= DEBUG_SymbolExpr
($1); }
362 | lvalue OP_DRF tIDENTIFIER
{ $$
= DEBUG_StructPExpr
($1, $3); }
363 | lvalue
'.' tIDENTIFIER
{ $$
= DEBUG_StructExpr
($1, $3); }
364 | lvalue
'[' expr
']' { $$
= DEBUG_BinopExpr
(EXP_OP_ARR
, $1, $3); }
370 #ifdef DONT_USE_READLINE
371 fprintf
(stderr
,"Wine-dbg>");
375 void mode_command
(int newmode
)
377 if
((newmode
== 16) ||
(newmode
== 32)) dbg_mode
= newmode
;
378 else fprintf
(stderr
,"Invalid mode (use 16 or 32)\n");
382 /***********************************************************************
385 * Debugger main loop.
387 static void DEBUG_Main
( int signal
)
389 static int loaded_symbols
= 0;
390 static BOOL32 in_debugger
= FALSE
;
391 char SymbolTableFile
[256];
400 fprintf
( stderr
, "Segmentation fault inside debugger, exiting.\n" );
406 DEBUG_SetBreakpoints
( FALSE
);
413 * Initialize the type handling stuff.
418 * In some cases we can read the stabs information directly
419 * from the executable. If this is the case, we don't need
420 * to bother with trying to read a symbol file, as the stabs
421 * also have line number and local variable information.
422 * As long as gcc is used for the compiler, stabs will
423 * be the default. On SVr4, DWARF could be used, but we
424 * don't grok that yet, and in this case we fall back to using
427 if
( DEBUG_ReadExecutableDbgInfo
() == FALSE
)
429 PROFILE_GetWineIniString
( "wine", "SymbolTableFile", "wine.sym",
430 SymbolTableFile
, sizeof
(SymbolTableFile
));
431 DEBUG_ReadSymbolTable
( SymbolTableFile
);
435 * Read COFF, MSC, etc debug information that we noted when we
436 * started up the executable.
438 DEBUG_ProcessDeferredDebug
();
440 DEBUG_LoadEntryPoints
();
444 fprintf
(stderr
, "Entering debugger PC=%x, mode=%d, count=%d\n",
445 EIP_reg
(&DEBUG_context
),
446 dbg_exec_mode
, dbg_exec_count
);
451 if
((signal
!= SIGTRAP
) ||
!DEBUG_ShouldContinue
( dbg_exec_mode
,
456 addr.seg
= CS_reg
(&DEBUG_context
);
457 addr.off
= EIP_reg
(&DEBUG_context
);
459 DBG_FIX_ADDR_SEG
( &addr
, 0 );
461 /* Put the display in a correct state */
463 XUngrabPointer
( display
, CurrentTime
);
464 XUngrabServer
( display
);
467 if
(!addr.seg
) newmode
= 32;
468 else newmode
= (GET_SEL_FLAGS
(addr.seg
) & LDT_FLAGS_32BIT
) ?
32 : 16;
470 if
(newmode
!= dbg_mode
)
471 fprintf
(stderr
,"In %d bit mode.\n", dbg_mode
= newmode
);
475 if
(signal
!= SIGTRAP
) /* This is a real crash, dump some info */
477 DEBUG_InfoRegisters
();
481 LDT_Print
( SELECTOR_TO_ENTRY
(DS_reg
(&DEBUG_context
)), 1 );
482 if
(ES_reg
(&DEBUG_context
) != DS_reg
(&DEBUG_context
))
483 LDT_Print
( SELECTOR_TO_ENTRY
(ES_reg
(&DEBUG_context
)), 1 );
490 * Do a quiet backtrace so that we have an idea of what the situation
491 * is WRT the source files.
493 DEBUG_SilentBackTrace
();
496 if
( signal
!= SIGTRAP
)
498 /* Show where we crashed */
500 DEBUG_PrintAddress
( &addr
, dbg_mode
, TRUE
);
501 fprintf
(stderr
,": ");
502 if
(DBG_CHECK_READ_PTR
( &addr
, 1 ))
504 DEBUG_Disasm
( &addr
, TRUE
);
505 fprintf
(stderr
,"\n");
515 addr.seg
= CS_reg
(&DEBUG_context
);
516 addr.off
= EIP_reg
(&DEBUG_context
);
517 DBG_FIX_ADDR_SEG
( &addr
, 0 );
518 ret_ok
= DEBUG_ValidateRegisters
();
519 if
(ret_ok
) ret_ok
= DBG_CHECK_READ_PTR
( &addr
, 1 );
523 dbg_exec_mode
= DEBUG_RestartExecution
( dbg_exec_mode
, dbg_exec_count
);
525 * This will have gotten absorbed into the breakpoint info
526 * if it was used. Otherwise it would have been ignored.
527 * In any case, we don't mess with it any more.
529 if
( dbg_exec_mode
== EXEC_CONT
)
538 /***********************************************************************
539 * DebugBreak16 (KERNEL.203)
541 void DebugBreak16
( CONTEXT
*regs
)
543 const char *module
= MODULE_GetModuleName
( GetExePtr
(GetCurrentTask
()) );
544 fprintf
( stderr
, "%s called DebugBreak\n", module ? module
: "???" );
545 DEBUG_context
= *regs
;
546 DEBUG_Main
( SIGTRAP
);
550 void wine_debug
( int signal
, SIGCONTEXT
*regs
)
552 DEBUG_SetSigContext
( regs
);
554 DWORD
*stack
= (DWORD
*)ESP_reg
(&DEBUG_context
);
557 *(--stack
) = EH_NONCONTINUABLE
;
558 *(--stack
) = EXCEPTION_ACCESS_VIOLATION
;
559 *(--stack
) = EIP_reg
(&DEBUG_context
);
560 ESP_reg
(&DEBUG_context
) = (DWORD
)stack
;
561 EIP_reg
(&DEBUG_context
) = GetProcAddress32
( GetModuleHandle
("KERNEL32"),
564 DEBUG_Main
( signal
);
565 DEBUG_GetSigContext
( regs
);
568 int yyerror(char * s
)
570 fprintf
(stderr
,"%s\n", s
);