Wed Mar 13 19:46:50 1996 Alexandre Julliard <julliard@lrc.epfl.ch> * [controls/edit.c] Removed calls to memmove (not portable). * [debugger/dbg.y] [debugger/debug.l] Prefixed all token with 't' to avoid conflicts with type definitions. Added 'walk queue', 'walk class' and 'info class' commands. * [debugger/info.c] Moved queue and window information functions to windows/queue.c and windows/win.c respectively. * [loader/signal.c] Added SIGHUP handling to force entry into built-in debugger. Cleaned up a bit. * [misc/spy.c] General cleanup and performance improvements. * [windows/class.c] Added CLASS_DumpClass() and CLASS_WalkClasses() functions for debugger. * [windows/event.c] Pressing Ctrl-Alt-Return forces an entry into the debugger. Not sure if this key combination is a good choice... * [windows/message.c] [windows/queue.c] (New file) Moved message queue handling functions to windows/queue.c. Tue Mar 12 14:55:16 1996 Onno Hovers <onno@stack.urc.tue.nl> * [if1632/except.S] [include/except.h] [win32/except.c] (New files) Implemented Win32 exception functions: RaiseException(), RtlUnwind(), SetUnhandledExceptionFilter() and UnhandledExceptionFilter(). Mon Mar 11 19:23:29 1996 Albrecht Kleine <kleine@ak.sax.de> * [controls/listbox.c] [include/listbox.h] Special handling for COMBOLBOX styles introduced via extension of HEADLIST structure: lphl->dwStyle. Mon Mar 11 13:31:06 1996 Greg Kreider <kreider@natlab.research.philips.com> * [controls/combo.c] Any mouse movement within a small distance (defined by CBLMM_EDGE) of the top or bottom edge causes the window to scroll. Also moved some assignments so the routine works correctly. * [controls/listbox.c] Changing selection in ListBoxSetCurSel now updates PrevFocused. Added to LBSetFont and CreateListBoxStruct a fake hdc that tests and sets the standard text height. Sun Mar 10 08:39:23 1996 Alex Korobka <alex@phm30.pharm.sunysb.edu> * [windows/dce.c] Fixed memory leak in DCE_ClipWindows().
152 lines
3.9 KiB
C
152 lines
3.9 KiB
C
/*
|
|
* Wine debugger utility routines
|
|
*
|
|
* Copyright 1993 Eric Youngdale
|
|
* Copyright 1995 Alexandre Julliard
|
|
*/
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "debugger.h"
|
|
|
|
/***********************************************************************
|
|
* DEBUG_Print
|
|
*
|
|
* Implementation of the 'print' command.
|
|
*/
|
|
void DEBUG_Print( const DBG_ADDR *addr, int count, char format )
|
|
{
|
|
if (count != 1)
|
|
{
|
|
fprintf( stderr, "Count other than 1 is meaningless in 'print' command\n" );
|
|
return;
|
|
}
|
|
|
|
if (addr->seg && (addr->seg != 0xffffffff))
|
|
{
|
|
switch(format)
|
|
{
|
|
case 'x':
|
|
fprintf( stderr, "0x%04lx:", addr->seg );
|
|
break;
|
|
|
|
case 'd':
|
|
fprintf( stderr, "%ld:", addr->seg );
|
|
break;
|
|
|
|
case 'c':
|
|
break; /* No segment to print */
|
|
|
|
case 'i':
|
|
case 's':
|
|
case 'w':
|
|
case 'b':
|
|
break; /* Meaningless format */
|
|
}
|
|
}
|
|
|
|
switch(format)
|
|
{
|
|
case 'x':
|
|
if (addr->seg) fprintf( stderr, "0x%04lx\n", addr->off );
|
|
else fprintf( stderr, "0x%08lx\n", addr->off );
|
|
break;
|
|
|
|
case 'd':
|
|
fprintf( stderr, "%ld\n", addr->off );
|
|
break;
|
|
|
|
case 'c':
|
|
fprintf( stderr, "%d = '%c'\n",
|
|
(char)(addr->off & 0xff), (char)(addr->off & 0xff) );
|
|
break;
|
|
|
|
case 'i':
|
|
case 's':
|
|
case 'w':
|
|
case 'b':
|
|
fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* DEBUG_PrintAddress
|
|
*
|
|
* Print an 16- or 32-bit address, with the nearest symbol if any.
|
|
*/
|
|
void DEBUG_PrintAddress( const DBG_ADDR *addr, int addrlen )
|
|
{
|
|
const char *name = DEBUG_FindNearestSymbol( addr );
|
|
|
|
if (addr->seg) fprintf( stderr, "0x%04lx:", addr->seg );
|
|
if (addrlen == 16) fprintf( stderr, "0x%04lx", addr->off );
|
|
else fprintf( stderr, "0x%08lx", addr->off );
|
|
if (name) fprintf( stderr, " (%s)", name );
|
|
}
|
|
|
|
|
|
/***********************************************************************
|
|
* DEBUG_Help
|
|
*
|
|
* Implementation of the 'help' command.
|
|
*/
|
|
void DEBUG_Help(void)
|
|
{
|
|
int i = 0;
|
|
static const char * helptext[] =
|
|
{
|
|
"The commands accepted by the Wine debugger are a small subset",
|
|
"of the commands that gdb would accept. The commands currently",
|
|
"are:\n",
|
|
" break [*<addr>] delete break bpnum",
|
|
" disable bpnum enable bpnum",
|
|
" help quit",
|
|
" x <addr> cont",
|
|
" step next",
|
|
" mode [16,32] print <expr>",
|
|
" set <reg> = <expr> set *<addr> = <expr>",
|
|
" walk [wnd] <expr> dump [wnd, queue] <expr>",
|
|
" info [reg,stack,break,segments] bt",
|
|
" symbolfile <filename> define <identifier> <addr>",
|
|
" list <addr> ",
|
|
"",
|
|
"The 'x' command accepts repeat counts and formats (including 'i') in the",
|
|
"same way that gdb does.",
|
|
"",
|
|
" The following are examples of legal expressions:",
|
|
" $eax $eax+0x3 0x1000 ($eip + 256) *$eax *($esp + 3)",
|
|
" Also, a nm format symbol table can be read from a file using the",
|
|
" symbolfile command. Symbols can also be defined individually with",
|
|
" the define command.",
|
|
"",
|
|
NULL
|
|
};
|
|
|
|
while(helptext[i]) fprintf(stderr,"%s\n", helptext[i++]);
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
* DEBUG_List
|
|
*
|
|
* Implementation of the 'list' command.
|
|
*/
|
|
void DEBUG_List( DBG_ADDR *addr, int count )
|
|
{
|
|
static DBG_ADDR lasttime = { 0xffffffff, 0 };
|
|
|
|
if (addr == NULL) addr = &lasttime;
|
|
DBG_FIX_ADDR_SEG( addr, CS_reg(DEBUG_context) );
|
|
while (count-- > 0)
|
|
{
|
|
DEBUG_PrintAddress( addr, dbg_mode );
|
|
fprintf( stderr, ": " );
|
|
if (!DBG_CHECK_READ_PTR( addr, 1 )) return;
|
|
DEBUG_Disasm( addr );
|
|
fprintf (stderr, "\n");
|
|
}
|
|
lasttime = *addr;
|
|
}
|