?? rhl58.htm
字號:
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
define
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Equates a symbol to a value. For example: define myproc 0x000001c6.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
disable
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Disable a specific breakpoint. Breakpoints defined by the break command are stored by breakpoint numbers. To disable a breakpoint, you need to find the breakpoint number with the info command. To disable breakpoint number 1, simply type disable 1.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
enable
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Enables a breakpoint number, the opposite of disable. To enable the previously disabled breakpoint number 1, simply type enable 1.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
help
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Prints a help text of the available commands.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
info
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Provides information on the following:
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
reg registers information.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
stack dumps the current stack.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
break shows the current breakpoints and if they are enabled.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
segments shows information about memory segments in use.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
mode
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Switches between 16- and 32-bit modes.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
print
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Prints out values of expressions given.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
quit
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Exits debugger and ends any MS Windows program in progress.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
set
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Enables depositing of values in registers and memory.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
symbolfile
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Loads a symbol file containing symbolic values. The file wine.sym is created as part of the Wine build.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
x
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
Examines memory values in several different formats. The format of x is x / format address, where format can be one of the following:
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
x
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
longword hexadecimal (32-bit integer)</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
d
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
longword decimal</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
w
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
word hexadecimal</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
b
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
byte</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
c
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
single character</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
s
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
null-terminated ASCII string</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
I
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
i386 instruction</FONT>
<TR>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080>
A number can be specified before the format to indicate a repeating group. For example, listing 10 instructions after a given address would be x / 10 I 0x000001cd.
</FONT>
<TD VALIGN=top BGCOLOR=#80FFFF ><FONT COLOR=#000080><BR></FONT>
</TABLE><P>In order to benefit from using the Wine debugger, an understanding of debugging i386 assembly is essential. If you are serious about debugging Wine, an assembly language output from GCC is essential.
<BR>
<BR>
<A NAME="E68E450"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>How Wine Works</B></FONT></CENTER></H3>
<BR>
<P>Wine is composed of a MS Windows program loader and a library of MS Windows functions.
<BR>
<BR>
<A NAME="E69E583"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>How Wine Loads Programs</B></FONT></CENTER></H4>
<BR>
<P>Wine's first duty is to load an MS Windows executable image into memory. This also includes any DLL files and other resources that the application needs. MS Windows uses a different executable image type than does DOS that is called NE, or new
executable. DLLs and font files also use this NE format, which makes Wine's job easier.
<BR>
<P>Individual segments of the NE image must be load into memory, and references to other DLL and Windows calls need to be resolved. Calls to functions outside an image are referred to by the module name and function number. A call to Ellipse is actually
stored as GDI.24.
<BR>
<P>After an executable image is loaded into memory, Wine simply jumps to the WinMain() function defined in the image. A call to MS Windows graphics function Ellipse is stored as GDI.24. GDI is the name of the MS Windows graphics library, and 24 is the
position in that DLL where Ellipse starts. Wine does not need to do any instruction emulation because both Linux and MS Windows use the i386 instruction set. When an MS Windows primitive function is called, Wine intercepts that call and passes it to a
matching library routine.
<BR>
<BR>
<A NAME="E69E584"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>The Wine Library</B></FONT></CENTER></H4>
<BR>
<P>Wine converts the MS Windows API to the matching X or UNIX API calls. A call to the MS Windows Ellipse function to draw an ellipse in a window has the following format:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">Ellipse (hdc, xLeft, yTop, xRight, yBottom);</FONT></PRE>
<P>The definitions are of xLeft, yTop, xRight, and yBottom are a bounding box for an ellipse as shown in Figure 58.2.
<BR>
<P><B> <A HREF="58rhl02.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/58rhl02.gif">Figure 58.2. MS Windows ellipse coordinates.</A></B>
<BR>
<P>The same ellipse is drawn under the X API XDrawArc function:
<BR>
<BR>
<PRE>
<FONT COLOR="#000080">XDrawArc(display, d, gc, x, y, width, height, angle1, angle2);</FONT></PRE>
<P>The definitions of x, y, width, height, angle1, and angle2 are shown in Figure 58.3.
<BR>
<P><B> <A HREF="58rhl03.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/58rhl03.gif">Figure 58.3. </B><B>XDrawArc</B><B> coordinates.</A></B>
<BR>
<P>Wine needs to do a little math to convert the coordinates from an Ellipse call to that of an XDrawArc call. Other parameters of the XDrawArc call are a bit easier to map. The d refers to a drawable area, which is typically a handle to a window. Under MS
Windows, this is contained in the hdc structure. The gc is a graphics context and is analogous in functionality to the hdc under MS Windows. As X is capable of displaying on different machines over a network, the display parameter describes which display
to use. The display parameter remains constant over the life of a Wine session. The last thing Wine has to consider is that an MS Windows Ellipse call can also specify a filled ellipse. Wine checks the hdc, and possibly uses XFillArc instead.
<BR>
<P>There are nearly 300 graphics primitives available under MS Windows that need to undergo similar translations. While this might seem to be a bit of work, the graphics conversions are among the simpler things to emulate under MS Windows.
<BR>
<BR>
<A NAME="E68E451"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Where Does Wine End and MS Windows Begin?</B></FONT></CENTER></H3>
<BR>
<P>As Wine currently requires parts of MS Windows to operate, it is a bit confusing to know where Wine ends and MS Windows begins. Wine currently provides API calls for the following parts of a typical MS Windows installation:
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -