Release 961222 Sun Dec 22 13:30:18 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [graphics/metafiledrv/init.c] [graphisc/metafiledrv/mapping.c] Added mapping functions. * [if1632/gdi.spec] [objects/*.c] [include/windows.h] Added a lot of Win32 functions. * [memory/heap.c] Added HEAP_strdupAtoW and HEAP_strdupWtoA. * [misc/lstr.c] [memory/string.c] Moved OEM<->Ansi conversion to string.c. Fixed a couple of bugs. * [object/font.c] Avoid uppercasing font names. * [windows/hook.c] Set ds = ss before calling hook procedure. Sat Dec 21 21:44:17 1996 Alex Korobka <alex@trantor.pharm.sunysb.edu> * [objects/color.c] Use colors allocated by other clients. * [windows/caret.c] Set default blink time to 500. * [windows/win.c] [windows/event.c] Delete X context before XDestroyWindow(). * [windows/keyboard.c] Fixed GetKeyState() once more. Fri Dec 20 08:26:33 1996 Eric Youngdale <eric@sub2304.jic.com> * [debugger/*.c] Lots of built-in debugger improvements: parse Win32 EXEs debug information, display local variables, source files and line numbers, get symbols directly from the Wine executable, etc. Tue Dec 17 22:39:42 1996 Philippe De Muyter <phdm@info.ucl.ac.be> * [misc/winsock_async.c] Extern declaration added for h_errno. Tue Dec 17 21:29:34 1996 Albrecht Kleine <kleine@ak.sax.de> * [windows/message.c] Added two more CBT hook calls: HCBT_CLICKSKIPPED/HCBT_KEYSKIPPED.
diff --git a/include/debugger.h b/include/debugger.h index ebdefc4..306cb18 100644 --- a/include/debugger.h +++ b/include/debugger.h
@@ -10,6 +10,8 @@ #include "ldt.h" #include "registers.h" +#include "pe_image.h" + #define STEP_FLAG 0x100 /* single step flag */ typedef struct @@ -18,6 +20,45 @@ DWORD off; } DBG_ADDR; +struct wine_lines { + unsigned long line_number; + DBG_ADDR pc_offset; +}; + +typedef struct wine_lines WineLineNo; + +/* + * This structure holds information about stack variables, function + * parameters, and register variables, which are all local to this + * function. + */ +struct wine_locals { + unsigned int regno:8; /* For register symbols */ + unsigned int offset:24; /* offset from esp/ebp to symbol */ + unsigned int pc_start; /* For RBRAC/LBRAC */ + unsigned int pc_end; /* For RBRAC/LBRAC */ + char * name; /* Name of symbol */ +}; + +typedef struct wine_locals WineLocals; + +struct name_hash +{ + struct name_hash * next; + char * name; + char * sourcefile; + + int n_locals; + int locals_alloc; + WineLocals * local_vars; + + int n_lines; + int lines_alloc; + WineLineNo * linetab; + + DBG_ADDR addr; +}; + #define DBG_FIX_ADDR_SEG(addr,default) \ { if ((addr)->seg == 0xffffffff) (addr)->seg = (default); \ if (((addr)->seg == WINE_CODE_SELECTOR) || \ @@ -30,13 +71,13 @@ #define DBG_CHECK_READ_PTR(addr,len) \ (!DEBUG_IsBadReadPtr((addr),(len)) || \ (fprintf(stderr,"*** Invalid address "), \ - DEBUG_PrintAddress((addr),dbg_mode), \ + DEBUG_PrintAddress((addr),dbg_mode, FALSE), \ fprintf(stderr,"\n"),0)) #define DBG_CHECK_WRITE_PTR(addr,len) \ (!DEBUG_IsBadWritePtr((addr),(len)) || \ (fprintf(stderr,"*** Invalid address "), \ - DEBUG_PrintAddress(addr,dbg_mode), \ + DEBUG_PrintAddress(addr,dbg_mode, FALSE), \ fprintf(stderr,"\n"),0)) #ifdef REG_SP /* Some Sun includes define this */ @@ -79,18 +120,36 @@ extern void DEBUG_Disasm( DBG_ADDR *addr ); /* debugger/hash.c */ -extern void DEBUG_AddSymbol( const char *name, const DBG_ADDR *addr ); -extern BOOL32 DEBUG_GetSymbolValue( const char * name, DBG_ADDR *addr ); +extern struct name_hash * DEBUG_AddSymbol( const char *name, + const DBG_ADDR *addr, + const char * sourcefile); +extern BOOL32 DEBUG_GetSymbolValue( const char * name, const int lineno, + DBG_ADDR *addr ); extern BOOL32 DEBUG_SetSymbolValue( const char * name, const DBG_ADDR *addr ); -extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr ); +extern const char * DEBUG_FindNearestSymbol( const DBG_ADDR *addr, int flag, + struct name_hash ** rtn, + unsigned int ebp); extern void DEBUG_ReadSymbolTable( const char * filename ); extern void DEBUG_LoadEntryPoints(void); +extern void DEBUG_AddLineNumber( struct name_hash * func, int line_num, + unsigned long offset ); +extern void DEBUG_AddLocal( struct name_hash * func, int regno, + int offset, + int pc_start, + int pc_end, + char * name); + /* debugger/info.c */ extern void DEBUG_Print( const DBG_ADDR *addr, int count, char format ); -extern void DEBUG_PrintAddress( const DBG_ADDR *addr, int addrlen ); +extern struct name_hash * DEBUG_PrintAddress( const DBG_ADDR *addr, + int addrlen, int flag ); extern void DEBUG_Help(void); extern void DEBUG_List( DBG_ADDR *addr, int count ); +extern struct name_hash * DEBUG_PrintAddressAndArgs( const DBG_ADDR *addr, + int addrlen, + unsigned int ebp, + int flag ); /* debugger/memory.c */ extern BOOL32 DEBUG_IsBadReadPtr( const DBG_ADDR *address, int size ); @@ -108,6 +167,17 @@ /* debugger/stack.c */ extern void DEBUG_InfoStack(void); extern void DEBUG_BackTrace(void); +extern BOOL32 DEBUG_GetStackSymbolValue( const char * name, DBG_ADDR *addr ); +extern int DEBUG_InfoLocals(void); +extern int DEBUG_SetFrame(int newframe); + + /* debugger/stabs.c */ +extern int DEBUG_ReadExecutableDbgInfo(void); + + /* debugger/msc.c */ +extern int DEBUG_RegisterDebugInfo(int, struct pe_data *pe, + int, unsigned long, unsigned long); +extern int DEBUG_ProcessDeferredDebug(void); /* debugger/dbg.y */ extern void DEBUG_EnterDebugger(void);