2 * Wine debugger utility routines
4 * Copyright 1993 Eric Youngdale
5 * Copyright 1995 Alexandre Julliard
13 /***********************************************************************
16 * Implementation of the 'print' command.
18 void DEBUG_Print( const DBG_ADDR *addr, int count, char format )
22 fprintf( stderr, "Count other than 1 is meaningless in 'print' command\n" );
26 if (addr->seg && (addr->seg != 0xffffffff))
31 fprintf( stderr, "0x%04lx:", addr->seg );
35 fprintf( stderr, "%ld:", addr->seg );
39 break; /* No segment to print */
45 break; /* Meaningless format */
52 if (addr->seg) fprintf( stderr, "0x%04lx\n", addr->off );
53 else fprintf( stderr, "0x%08lx\n", addr->off );
57 fprintf( stderr, "%ld\n", addr->off );
61 fprintf( stderr, "%d = '%c'\n",
62 (char)(addr->off & 0xff), (char)(addr->off & 0xff) );
69 fprintf( stderr, "Format specifier '%c' is meaningless in 'print' command\n", format );
75 /***********************************************************************
78 * Print an 16- or 32-bit address, with the nearest symbol if any.
80 void DEBUG_PrintAddress( const DBG_ADDR *addr, int addrlen )
82 const char *name = DEBUG_FindNearestSymbol( addr );
84 if (addr->seg) fprintf( stderr, "0x%04lx:", addr->seg );
85 if (addrlen == 16) fprintf( stderr, "0x%04lx", addr->off );
86 else fprintf( stderr, "0x%08lx", addr->off );
87 if (name) fprintf( stderr, " (%s)", name );
91 /***********************************************************************
94 * Implementation of the 'help' command.
99 static const char * helptext[] =
101 "The commands accepted by the Wine debugger are a small subset",
102 "of the commands that gdb would accept. The commands currently",
104 " break [*<addr>] delete break bpnum",
105 " disable bpnum enable bpnum",
109 " mode [16,32] print <expr>",
110 " set <reg> = <expr> set *<addr> = <expr>",
111 " info [reg,stack,break,segments] bt",
112 " symbolfile <filename> define <identifier> <addr>",
114 "The 'x' command accepts repeat counts and formats (including 'i') in the",
115 "same way that gdb does.",
117 " The following are examples of legal expressions:",
118 " $eax $eax+0x3 0x1000 ($eip + 256) *$eax *($esp + 3)",
119 " Also, a nm format symbol table can be read from a file using the",
120 " symbolfile command. Symbols can also be defined individually with",
121 " the define command.",
126 while(helptext[i]) fprintf(stderr,"%s\n", helptext[i++]);