4 * Copyright 1995 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_DEBUGGER_H
22 #define __WINE_DEBUGGER_H
24 #include <sys/types.h> /* u_long ... */
28 #include "wine/exception.h"
31 #define STEP_FLAG 0x00000100 /* single step flag */
32 #define V86_FLAG 0x00020000
39 #define SYM_INVALID 0x8
40 #define SYM_TRAMPOLINE 0x10
41 #define SYM_STEP_THROUGH 0x20
43 enum debug_type
{DT_BASIC
, DT_POINTER
, DT_ARRAY
, DT_STRUCT
, DT_ENUM
,
44 DT_FUNC
, DT_BITFIELD
};
46 enum debug_type_basic
{DT_BASIC_INT
= 1, DT_BASIC_CHAR
, DT_BASIC_LONGINT
, DT_BASIC_UINT
,
47 DT_BASIC_ULONGINT
, DT_BASIC_LONGLONGINT
, DT_BASIC_ULONGLONGINT
,
48 DT_BASIC_SHORTINT
, DT_BASIC_USHORTINT
, DT_BASIC_SCHAR
, DT_BASIC_UCHAR
,
49 DT_BASIC_FLOAT
, DT_BASIC_LONGDOUBLE
, DT_BASIC_DOUBLE
,
50 DT_BASIC_CMPLX_INT
, DT_BASIC_CMPLX_FLOAT
, DT_BASIC_CMPLX_DOUBLE
,
51 DT_BASIC_CMPLX_LONGDOUBLE
, DT_BASIC_VOID
,
52 /* modifier on size isn't possible on current types definitions
53 * so we need to add more types... */
54 DT_BASIC_BOOL1
, DT_BASIC_BOOL2
, DT_BASIC_BOOL4
,
55 /* this is not really a basic type... */
57 /* this is for historical reasons... should take care of it RSN */
59 /* not so basic, but handy */
61 /* to be kept as last... sentinel entry... do not use */
65 * Return values for DEBUG_CheckLinenoStatus. Used to determine
66 * what to do when the 'step' command is given.
68 #define FUNC_HAS_NO_LINES (0)
69 #define NOT_ON_LINENUMBER (1)
70 #define AT_LINENUMBER (2)
71 #define FUNC_IS_TRAMPOLINE (3)
75 DWORD seg
; /* 0xffffffff means current default segment (cs or ds) */
81 struct datatype
* type
;
82 int cookie
; /* DV_??? */
83 /* DV_TARGET references an address in debugger's address space, whereas DV_HOST
84 * references the debuggee address space
86 # define DV_TARGET 0xF00D
87 # define DV_HOST 0x50DA
88 # define DV_INVALID 0x0000
100 unsigned long line_number
;
106 struct name_hash
* sym
;
110 typedef struct wine_lines WineLineNo
;
113 * This structure holds information about stack variables, function
114 * parameters, and register variables, which are all local to this
118 unsigned int regno
:8; /* For register symbols */
119 signed int offset
:24; /* offset from esp/ebp to symbol */
120 unsigned int pc_start
; /* For RBRAC/LBRAC */
121 unsigned int pc_end
; /* For RBRAC/LBRAC */
122 char * name
; /* Name of symbol */
123 struct datatype
* type
; /* Datatype of symbol */
126 typedef struct wine_locals WineLocals
;
130 EXEC_CONT
, /* Continuous execution */
131 EXEC_STEP_OVER
, /* Stepping over a call to next source line */
132 EXEC_STEP_INSTR
, /* Step to next source line, stepping in if needed */
133 EXEC_STEPI_OVER
, /* Stepping over a call */
134 EXEC_STEPI_INSTR
, /* Single-stepping an instruction */
135 EXEC_FINISH
, /* Step until we exit current frame */
136 EXEC_STEP_OVER_TRAMPOLINE
, /* Step over trampoline. Requires that
137 * we dig the real return value off the stack
138 * and set breakpoint there - not at the
139 * instr just after the call.
145 MODE_INVALID
, MODE_16
, MODE_32
, MODE_VM86
148 enum exit_mode
/* of exception handling */
150 EXIT_CONTINUE
, /* continue execution */
151 EXIT_PASS
, /* pass exception back to app (1st chance) */
152 EXIT_DETACH
, /* detach debugger */
153 EXIT_QUIT
, /* exit debugger and kill debuggee */
179 struct expr
* condition
;
182 /* Wine extension; Windows doesn't have a name for this code. This is an
183 undocumented exception understood by MS VC debugger, allowing the program
184 to name a particular thread. Search google.com or deja.com for "0x406d1388"
186 #define EXCEPTION_NAME_THREAD 0x406D1388
188 /* Helper structure */
189 typedef struct tagTHREADNAME_INFO
191 DWORD dwType
; /* Must be 0x1000 */
192 LPCTSTR szName
; /* Pointer to name - limited to 9 bytes (8 characters + terminator) */
193 DWORD dwThreadID
; /* Thread ID (-1 = caller thread) */
194 DWORD dwFlags
; /* Reserved for future use. Must be zero. */
197 typedef struct tagDBG_THREAD
{
198 struct tagDBG_PROCESS
* process
;
203 int wait_for_first_exception
;
204 enum exec_mode exec_mode
; /* mode the thread is run (step/run...) */
205 int exec_count
; /* count of mode operations */
206 enum dbg_mode dbg_mode
; /* mode (VM86, 32bit, 16bit) */
207 DBG_BREAKPOINT stepOverBP
;
209 struct tagDBG_THREAD
* next
;
210 struct tagDBG_THREAD
* prev
;
213 typedef struct tagDBG_DELAYED_BP
{
224 typedef struct tagDBG_PROCESS
{
227 const char* imageName
;
230 unsigned continue_on_first_exception
;
231 struct tagDBG_MODULE
** modules
;
233 unsigned long dbg_hdr_addr
;
234 DBG_DELAYED_BP
* delayed_bp
;
237 * This is an index we use to keep track of the debug information
238 * when we have multiple sources. We use the same database to also
239 * allow us to do an 'info shared' type of deal, and we use the index
240 * to eliminate duplicates.
243 struct tagDBG_PROCESS
* next
;
244 struct tagDBG_PROCESS
* prev
;
247 extern DBG_PROCESS
* DEBUG_CurrProcess
;
248 extern DBG_THREAD
* DEBUG_CurrThread
;
249 extern DWORD DEBUG_CurrTid
;
250 extern DWORD DEBUG_CurrPid
;
251 extern CONTEXT DEBUG_context
;
252 extern BOOL DEBUG_InteractiveP
;
253 extern enum exit_mode DEBUG_ExitMode
;
254 extern HANDLE DEBUG_hParserInput
;
255 extern HANDLE DEBUG_hParserOutput
;
257 #define DEBUG_READ_MEM(addr, buf, len) \
258 (ReadProcessMemory(DEBUG_CurrProcess->handle, (addr), (buf), (len), NULL))
260 #define DEBUG_WRITE_MEM(addr, buf, len) \
261 (WriteProcessMemory(DEBUG_CurrProcess->handle, (addr), (buf), (len), NULL))
263 #define DEBUG_READ_MEM_VERBOSE(addr, buf, len) \
264 (DEBUG_READ_MEM((addr), (buf), (len)) || (DEBUG_InvalLinAddr( addr ),0))
266 #define DEBUG_WRITE_MEM_VERBOSE(addr, buf, len) \
267 (DEBUG_WRITE_MEM((addr), (buf), (len)) || (DEBUG_InvalLinAddr( addr ),0))
269 enum DbgInfoLoad
{DIL_DEFERRED
, DIL_LOADED
, DIL_NOINFO
, DIL_ERROR
};
270 enum DbgModuleType
{DMT_UNKNOWN
, DMT_ELF
, DMT_NE
, DMT_PE
};
272 typedef struct tagDBG_MODULE
{
276 enum DbgInfoLoad dil
;
277 enum DbgModuleType type
;
278 unsigned short main
: 1;
281 struct tagMSC_DBG_INFO
* msc_info
;
282 struct tagELF_DBG_INFO
* elf_info
;
289 struct datatype
* type
;
292 #define OFFSET_OF(__c,__f) ((int)(((char*)&(((__c*)0)->__f))-((char*)0)))
294 /* from winelib.so */
295 extern void DEBUG_ExternalDebugger(void);
297 /* debugger/break.c */
298 extern void DEBUG_SetBreakpoints( BOOL set
);
299 extern BOOL
DEBUG_AddBreakpoint( const DBG_VALUE
*addr
, BOOL (*func
)(void), BOOL verbose
);
300 extern BOOL
DEBUG_AddBreakpointFromValue( const DBG_VALUE
*addr
);
301 extern void DEBUG_AddBreakpointFromId( const char *name
, int lineno
);
302 extern void DEBUG_AddBreakpointFromLineno( int lineno
);
303 extern void DEBUG_AddWatchpoint( const DBG_VALUE
*addr
, int is_write
);
304 extern void DEBUG_AddWatchpointFromId( const char *name
);
305 extern void DEBUG_CheckDelayedBP( void );
306 extern void DEBUG_DelBreakpoint( int num
);
307 extern void DEBUG_EnableBreakpoint( int num
, BOOL enable
);
308 extern void DEBUG_InfoBreakpoints(void);
309 extern BOOL
DEBUG_HandleTrap(void);
310 extern BOOL
DEBUG_ShouldContinue( DBG_ADDR
* addr
, DWORD code
, int* count
);
311 extern void DEBUG_SuspendExecution( void );
312 extern void DEBUG_RestartExecution( int count
);
313 extern BOOL
DEBUG_IsFctReturn(void);
314 extern int DEBUG_AddBPCondition(int bpnum
, struct expr
* exp
);
316 /* debugger/db_disasm.c */
317 extern void DEBUG_Disasm( DBG_ADDR
*addr
, int display
);
320 extern void DEBUG_Parser(LPCSTR
);
321 extern void DEBUG_Exit(DWORD
);
323 /* debugger/debug.l */
324 extern void DEBUG_FlushSymbols(void);
325 extern char*DEBUG_MakeSymbol(const char*);
326 extern int DEBUG_ReadLine(const char* pfx
, char* buffer
, int size
);
328 /* debugger/display.c */
329 extern int DEBUG_DoDisplay(void);
330 extern int DEBUG_AddDisplay(struct expr
* exp
, int count
, char format
);
331 extern int DEBUG_DoDisplay(void);
332 extern int DEBUG_DelDisplay(int displaynum
);
333 extern int DEBUG_InfoDisplay(void);
335 /* debugger/expr.c */
336 extern void DEBUG_FreeExprMem(void);
337 struct expr
* DEBUG_IntVarExpr(const char* name
);
338 struct expr
* DEBUG_SymbolExpr(const char * name
);
339 struct expr
* DEBUG_ConstExpr(int val
);
340 struct expr
* DEBUG_StringExpr(const char * str
);
341 struct expr
* DEBUG_SegAddr(struct expr
*, struct expr
*);
342 struct expr
* DEBUG_USConstExpr(unsigned int val
);
343 struct expr
* DEBUG_BinopExpr(int oper
, struct expr
*, struct expr
*);
344 struct expr
* DEBUG_UnopExpr(int oper
, struct expr
*);
345 struct expr
* DEBUG_StructPExpr(struct expr
*, const char * element
);
346 struct expr
* DEBUG_StructExpr(struct expr
*, const char * element
);
347 struct expr
* DEBUG_ArrayExpr(struct expr
*, struct expr
* index
);
348 struct expr
* DEBUG_CallExpr(const char *, int nargs
, ...);
349 struct expr
* DEBUG_TypeCastExpr(struct datatype
*, struct expr
*);
350 extern DBG_VALUE
DEBUG_EvalExpr(struct expr
*);
351 extern int DEBUG_DelDisplay(int displaynum
);
352 extern struct expr
* DEBUG_CloneExpr(const struct expr
* exp
);
353 extern int DEBUG_FreeExpr(struct expr
* exp
);
354 extern int DEBUG_DisplayExpr(const struct expr
* exp
);
356 /* debugger/hash.c */
357 extern struct name_hash
* DEBUG_AddSymbol( const char *name
,
358 const DBG_VALUE
*addr
,
359 const char *sourcefile
,
361 extern int DEBUG_GetSymbolValue( const char * name
, const int lineno
,
362 DBG_VALUE
*addr
, int );
363 extern BOOL
DEBUG_SetSymbolValue( const char * name
, const DBG_VALUE
*addr
);
364 extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR
*addr
, int flag
,
365 struct name_hash
** rtn
,
367 struct list_id
* source
);
368 extern void DEBUG_ReadSymbolTable( const char * filename
, unsigned long offset
);
369 extern void DEBUG_AddLineNumber( struct name_hash
* func
, int line_num
,
370 unsigned long offset
);
371 extern struct wine_locals
*
372 DEBUG_AddLocal( struct name_hash
* func
, int regno
,
377 extern int DEBUG_CheckLinenoStatus(const DBG_ADDR
*addr
);
378 extern void DEBUG_GetFuncInfo(struct list_id
* ret
, const char * file
,
380 extern int DEBUG_SetSymbolSize(struct name_hash
* sym
, unsigned int len
);
381 extern int DEBUG_SetSymbolBPOff(struct name_hash
* sym
, unsigned int len
);
382 extern int DEBUG_GetSymbolAddr(struct name_hash
* sym
, DBG_ADDR
* addr
);
383 extern int DEBUG_cmp_sym(const void * p1
, const void * p2
);
384 extern BOOL
DEBUG_GetLineNumberAddr( const struct name_hash
*, const int lineno
,
385 DBG_ADDR
*addr
, int bp_flag
);
387 extern int DEBUG_SetLocalSymbolType(struct wine_locals
* sym
,
388 struct datatype
* type
);
389 extern BOOL
DEBUG_Normalize(struct name_hash
* nh
);
391 /* debugger/info.c */
392 extern void DEBUG_PrintBasic( const DBG_VALUE
* value
, int count
, char format
);
393 extern struct symbol_info
DEBUG_PrintAddress( const DBG_ADDR
*addr
,
394 enum dbg_mode mode
, int flag
);
395 extern void DEBUG_Help(void);
396 extern void DEBUG_HelpInfo(void);
397 extern struct symbol_info
DEBUG_PrintAddressAndArgs( const DBG_ADDR
*addr
,
401 extern void DEBUG_InfoClass(const char* clsName
);
402 extern void DEBUG_WalkClasses(void);
403 extern void DEBUG_WalkModref(DWORD p
);
404 extern void DEBUG_DumpModule(DWORD mod
);
405 extern void DEBUG_WalkModules(void);
406 extern void DEBUG_WalkProcess(void);
407 extern void DEBUG_WalkThreads(void);
408 extern void DEBUG_DumpQueue(DWORD q
);
409 extern void DEBUG_WalkQueues(void);
410 extern void DEBUG_InfoSegments(DWORD s
, int v
);
411 extern void DEBUG_InfoVirtual(void);
412 extern void DEBUG_InfoWindow(HWND hWnd
);
413 extern void DEBUG_WalkWindows(HWND hWnd
, int indent
);
414 extern void DEBUG_DbgChannel(BOOL add
, const char* chnl
, const char* name
);
416 /* debugger/memory.c */
417 extern int DEBUG_ReadMemory( const DBG_VALUE
* value
);
418 extern void DEBUG_WriteMemory( const DBG_VALUE
* val
, int value
);
419 extern void DEBUG_ExamineMemory( const DBG_VALUE
*addr
, int count
, char format
);
420 extern void DEBUG_InvalAddr( const DBG_ADDR
* addr
);
421 extern void DEBUG_InvalLinAddr( void* addr
);
422 extern DWORD
DEBUG_ToLinear( const DBG_ADDR
*address
);
423 extern void DEBUG_GetCurrentAddress( DBG_ADDR
* );
424 extern BOOL
DEBUG_GrabAddress( DBG_VALUE
* value
, BOOL fromCode
);
425 extern enum dbg_mode
DEBUG_GetSelectorType( WORD sel
);
427 extern void DEBUG_FixAddress( DBG_ADDR
*address
, DWORD def
);
428 extern int DEBUG_IsSelectorSystem( WORD sel
);
430 extern int DEBUG_PrintStringA( int chnl
, const DBG_ADDR
* address
, int len
);
431 extern int DEBUG_PrintStringW( int chnl
, const DBG_ADDR
* address
, int len
);
433 /* debugger/module.c */
434 extern int DEBUG_LoadEntryPoints( const char * prefix
);
435 extern void DEBUG_LoadModule32( const char* name
, HANDLE hFile
, DWORD base
);
436 extern DBG_MODULE
* DEBUG_AddModule(const char* name
, enum DbgModuleType type
,
437 void* mod_addr
, u_long size
, HMODULE hmod
);
438 extern DBG_MODULE
* DEBUG_FindModuleByName(const char* name
, enum DbgModuleType type
);
439 extern DBG_MODULE
* DEBUG_FindModuleByHandle(HANDLE handle
, enum DbgModuleType type
);
440 extern DBG_MODULE
* DEBUG_FindModuleByAddr(void* addr
, enum DbgModuleType type
);
441 extern DBG_MODULE
* DEBUG_GetProcessMainModule(DBG_PROCESS
* process
);
442 extern DBG_MODULE
* DEBUG_RegisterPEModule(HMODULE
, u_long load_addr
, u_long size
,
444 extern DBG_MODULE
* DEBUG_RegisterELFModule(u_long load_addr
, u_long size
,
446 extern enum DbgInfoLoad
DEBUG_RegisterPEDebugInfo(DBG_MODULE
* wmod
, HANDLE hFile
,
447 void* _nth
, unsigned long nth_ofs
);
448 extern void DEBUG_ReportDIL(enum DbgInfoLoad dil
, const char* pfx
,
449 const char* filename
, DWORD load_addr
);
450 extern void DEBUG_InfoShare(void);
453 extern enum DbgInfoLoad
DEBUG_RegisterMSCDebugInfo(DBG_MODULE
* module
, HANDLE hFile
,
454 void* nth
, unsigned long nth_ofs
);
455 extern enum DbgInfoLoad
DEBUG_RegisterStabsDebugInfo(DBG_MODULE
* module
,
456 HANDLE hFile
, void* nth
,
457 unsigned long nth_ofs
);
458 extern void DEBUG_InitCVDataTypes(void);
460 /* debugger/registers.c */
461 extern void DEBUG_InfoRegisters(const CONTEXT
* ctx
);
462 extern BOOL
DEBUG_ValidateRegisters(void);
464 /* debugger/source.c */
465 extern void DEBUG_ShowDir(void);
466 extern void DEBUG_AddPath(const char * path
);
467 extern void DEBUG_List(struct list_id
* line1
, struct list_id
* line2
,
469 extern void DEBUG_NukePath(void);
470 extern void DEBUG_Disassemble(const DBG_VALUE
*, const DBG_VALUE
*, int offset
);
471 extern BOOL
DEBUG_DisassembleInstruction(DBG_ADDR
*addr
);
473 /* debugger/stack.c */
474 extern void DEBUG_InfoStack(void);
475 extern void DEBUG_BackTrace(DWORD threadID
, BOOL noisy
);
476 extern int DEBUG_InfoLocals(void);
477 extern int DEBUG_SetFrame(int newframe
);
478 extern int DEBUG_GetCurrentFrame(struct name_hash
** name
,
482 /* debugger/stabs.c */
483 extern enum DbgInfoLoad
DEBUG_ReadExecutableDbgInfo(const char* exe_name
);
484 extern enum DbgInfoLoad
DEBUG_ParseStabs(char * addr
, unsigned int load_offset
,
485 unsigned int staboff
, int stablen
,
486 unsigned int strtaboff
, int strtablen
);
488 /* debugger/types.c */
489 extern int DEBUG_nchar
;
490 extern void DEBUG_InitTypes(void);
491 extern struct datatype
* DEBUG_NewDataType(enum debug_type xtype
,
492 const char * typename
);
493 extern unsigned int DEBUG_TypeDerefPointer(const DBG_VALUE
*value
,
494 struct datatype
** newtype
);
495 extern int DEBUG_AddStructElement(struct datatype
* dt
,
496 char * name
, struct datatype
* type
,
497 int offset
, int size
);
498 extern int DEBUG_SetStructSize(struct datatype
* dt
, int size
);
499 extern int DEBUG_SetPointerType(struct datatype
* dt
, struct datatype
* dt2
);
500 extern int DEBUG_SetArrayParams(struct datatype
* dt
, int min
, int max
,
501 struct datatype
* dt2
);
502 extern void DEBUG_Print( const DBG_VALUE
*addr
, int count
, char format
, int level
);
503 extern unsigned int DEBUG_FindStructElement(DBG_VALUE
* addr
,
504 const char * ele_name
, int * tmpbuf
);
505 extern struct datatype
* DEBUG_GetPointerType(struct datatype
* dt
);
506 extern int DEBUG_GetObjectSize(struct datatype
* dt
);
507 extern unsigned int DEBUG_ArrayIndex(const DBG_VALUE
* addr
, DBG_VALUE
* result
,
509 extern struct datatype
* DEBUG_FindOrMakePointerType(struct datatype
* reftype
);
510 extern long long int DEBUG_GetExprValue(const DBG_VALUE
* addr
, char ** format
);
511 extern int DEBUG_SetBitfieldParams(struct datatype
* dt
, int offset
,
512 int nbits
, struct datatype
* dt2
);
513 extern int DEBUG_CopyFieldlist(struct datatype
* dt
, struct datatype
* dt2
);
514 extern enum debug_type
DEBUG_GetType(struct datatype
* dt
);
515 extern struct datatype
* DEBUG_TypeCast(enum debug_type
, const char *);
516 extern int DEBUG_PrintTypeCast(const struct datatype
*);
517 extern int DEBUG_PrintType( const DBG_VALUE
* addr
);
518 extern struct datatype
* DEBUG_GetBasicType(enum debug_type_basic
);
520 /* debugger/winedbg.c */
521 #define DBG_CHN_MESG 1
522 #define DBG_CHN_ERR 2
523 #define DBG_CHN_WARN 4
524 #define DBG_CHN_FIXME 8
525 #define DBG_CHN_TRACE 16
526 extern void DEBUG_OutputA(int chn
, const char* buffer
, int len
);
527 extern void DEBUG_OutputW(int chn
, const WCHAR
* buffer
, int len
);
529 extern int DEBUG_Printf(int chn
, const char* format
, ...) __attribute__((format (printf
,2,3)));
531 extern int DEBUG_Printf(int chn
, const char* format
, ...);
533 extern DBG_INTVAR
* DEBUG_GetIntVar(const char*);
534 extern BOOL
DEBUG_Attach(DWORD pid
, BOOL cofe
);
535 extern BOOL
DEBUG_Detach(void);
536 extern void DEBUG_Run(const char* args
);
537 extern DBG_PROCESS
* DEBUG_AddProcess(DWORD pid
, HANDLE h
, const char* imageName
);
538 extern DBG_PROCESS
* DEBUG_GetProcess(DWORD pid
);
539 extern void DEBUG_DelProcess(DBG_PROCESS
* p
);
540 extern DBG_THREAD
* DEBUG_AddThread(DBG_PROCESS
* p
, DWORD tid
, HANDLE h
, LPVOID start
, LPVOID teb
);
541 extern DBG_THREAD
* DEBUG_GetThread(DBG_PROCESS
* p
, DWORD tid
);
542 extern void DEBUG_DelThread(DBG_THREAD
* t
);
543 extern BOOL
DEBUG_ProcessGetString(char* buffer
, int size
, HANDLE hp
, LPSTR addr
);
544 extern BOOL
DEBUG_ProcessGetStringIndirect(char* buffer
, int size
, HANDLE hp
, LPVOID addr
);
545 extern void DEBUG_WaitNextException(DWORD cont
, int count
, int mode
);
546 extern int curr_frame
;
549 extern BOOL
DEBUG_GdbRemote(unsigned int);
551 /* Choose your allocator! */
553 /* this one is libc's fast one */
554 extern void* DEBUG_XMalloc(size_t size
);
555 extern void* DEBUG_XReAlloc(void *ptr
, size_t size
);
556 extern char* DEBUG_XStrDup(const char *str
);
558 #define DBG_alloc(x) DEBUG_XMalloc(x)
559 #define DBG_realloc(x,y) DEBUG_XReAlloc(x,y)
560 #define DBG_free(x) free(x)
561 #define DBG_strdup(x) DEBUG_XStrDup(x)
563 /* this one is slow (takes 5 minutes to load the debugger on my machine),
564 if someone could make optimized routines so it wouldn't
565 take so long to load, it could be made default) */
566 #define DBG_alloc(x) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,x)
567 #define DBG_realloc(x,y) HeapReAlloc(GetProcessHeap(),0,x,y)
568 #define DBG_free(x) HeapFree(GetProcessHeap(),0,x)
569 inline static LPSTR
DBG_strdup( LPCSTR str
)
571 INT len
= strlen(str
) + 1;
572 LPSTR p
= DBG_alloc( len
);
573 if (p
) memcpy( p
, str
, len
);
578 #define DEBUG_STATUS_OFFSET 0x80003000
579 #define DEBUG_STATUS_INTERNAL_ERROR (DEBUG_STATUS_OFFSET+0)
580 #define DEBUG_STATUS_NO_SYMBOL (DEBUG_STATUS_OFFSET+1)
581 #define DEBUG_STATUS_DIV_BY_ZERO (DEBUG_STATUS_OFFSET+2)
582 #define DEBUG_STATUS_BAD_TYPE (DEBUG_STATUS_OFFSET+3)
583 #define DEBUG_STATUS_NO_FIELD (DEBUG_STATUS_OFFSET+4)
585 extern DBG_INTVAR DEBUG_IntVars
[];
587 #define DBG_IVARNAME(_var) DEBUG_IV_##_var
588 #define DBG_IVARSTRUCT(_var) DEBUG_IntVars[DBG_IVARNAME(_var)]
589 #define DBG_IVAR(_var) (*(DBG_IVARSTRUCT(_var).pval))
590 #define INTERNAL_VAR(_var,_val,_ref,_typ) DBG_IVARNAME(_var),
597 #endif /* __WINE_DEBUGGER_H */