annotate agent/src/os/win32/README.txt @ 2998:775881292ddb

Made Deoptimize instruction into FixedNode instead of Instruction.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Thu, 16 Jun 2011 15:02:20 +0200
parents a61af66fc99e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 This is a "Simple Windows Debug Server" written for the purpose of
a61af66fc99e Initial load
duke
parents:
diff changeset
2 enabling the Serviceability Agent on Win32. It has backends both for
a61af66fc99e Initial load
duke
parents:
diff changeset
3 Windows NT 4.0 (using internal Windows APIs for a few routines) as
a61af66fc99e Initial load
duke
parents:
diff changeset
4 well as for 95/98/ME/2000 via the Tool Help APIs.
a61af66fc99e Initial load
duke
parents:
diff changeset
5
a61af66fc99e Initial load
duke
parents:
diff changeset
6 The reason this debug server is necessary is that the Win32 debug APIs
a61af66fc99e Initial load
duke
parents:
diff changeset
7 by design tear down the target process when the debugger exits (see
a61af66fc99e Initial load
duke
parents:
diff changeset
8 knowledge base article Q164205 on msdn.microsoft.com). On Solaris, one
a61af66fc99e Initial load
duke
parents:
diff changeset
9 can attach to and detach from a process with no effect; this is key to
a61af66fc99e Initial load
duke
parents:
diff changeset
10 allowing dbx and gcore to work.
a61af66fc99e Initial load
duke
parents:
diff changeset
11
a61af66fc99e Initial load
duke
parents:
diff changeset
12 The Simple Windows Debug Server effectively implements attach/detach
a61af66fc99e Initial load
duke
parents:
diff changeset
13 functionality for arbitrary debug clients. This allows the SA to
a61af66fc99e Initial load
duke
parents:
diff changeset
14 attach non-destructively to a process, and will enable gcore for Win32
a61af66fc99e Initial load
duke
parents:
diff changeset
15 to be written shortly. While the debugger (the "client" in all of the
a61af66fc99e Initial load
duke
parents:
diff changeset
16 source code) is attached, the target process is suspended. (Note that
a61af66fc99e Initial load
duke
parents:
diff changeset
17 the debug server could be extended to support resumption of the target
a61af66fc99e Initial load
duke
parents:
diff changeset
18 process and transmission of debug events over to the debugger, but
a61af66fc99e Initial load
duke
parents:
diff changeset
19 this has been left for the future.)
a61af66fc99e Initial load
duke
parents:
diff changeset
20
a61af66fc99e Initial load
duke
parents:
diff changeset
21 The makefile (type "nmake") builds two executables: SwDbgSrv.exe,
a61af66fc99e Initial load
duke
parents:
diff changeset
22 which is the server process, and SwDbgSub.exe, which is forked by the
a61af66fc99e Initial load
duke
parents:
diff changeset
23 server and should not be directly invoked by the user.
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 The intent is that these two executables can be installed into
a61af66fc99e Initial load
duke
parents:
diff changeset
26 C:\WINNT\SYSTEM32 and SwDbgSrv installed to run as a service (on NT),
a61af66fc99e Initial load
duke
parents:
diff changeset
27 for example using ServiceInstaller (http://www.kcmultimedia.com/smaster/).
a61af66fc99e Initial load
duke
parents:
diff changeset
28 However, SwDbgSrv can also be run from the command line. It generates
a61af66fc99e Initial load
duke
parents:
diff changeset
29 no text output unless the source code is changed to enable debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
30 printouts. As long as any processes which have been attached to by the
a61af66fc99e Initial load
duke
parents:
diff changeset
31 SA are alive, the SwDbgSrv and any forked SwDbgSub processes must be
a61af66fc99e Initial load
duke
parents:
diff changeset
32 left running. Terminating them will cause termination of the target
a61af66fc99e Initial load
duke
parents:
diff changeset
33 processes.
a61af66fc99e Initial load
duke
parents:
diff changeset
34
a61af66fc99e Initial load
duke
parents:
diff changeset
35 The debug server opens port 27000 and accepts incoming connections
a61af66fc99e Initial load
duke
parents:
diff changeset
36 from localhost only. The security model assumes that if one can run a
a61af66fc99e Initial load
duke
parents:
diff changeset
37 process on the given machine then one basically has access to most or
a61af66fc99e Initial load
duke
parents:
diff changeset
38 all of the machine's facilities; this seems to be in line with the
a61af66fc99e Initial load
duke
parents:
diff changeset
39 standard Windows security model. The protocol used is text-based, so
a61af66fc99e Initial load
duke
parents:
diff changeset
40 one can debug the debug server using telnet. See README-commands.txt
a61af66fc99e Initial load
duke
parents:
diff changeset
41 for documentation on the supported commands.
a61af66fc99e Initial load
duke
parents:
diff changeset
42
a61af66fc99e Initial load
duke
parents:
diff changeset
43 Testing indicates that the performance impact of attaching to a
a61af66fc99e Initial load
duke
parents:
diff changeset
44 process (and therefore permanently attaching a debugger) is minimal.
a61af66fc99e Initial load
duke
parents:
diff changeset
45 Some serious performance problems had been seen which ultimately
a61af66fc99e Initial load
duke
parents:
diff changeset
46 appeared to be a lack of physical memory on the machine running the
a61af66fc99e Initial load
duke
parents:
diff changeset
47 system.
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 Bugs:
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 This debug server is fundamentally incompatible with the Visual C++
a61af66fc99e Initial load
duke
parents:
diff changeset
52 debugger. Once the debug server is used to attach to a process, the
a61af66fc99e Initial load
duke
parents:
diff changeset
53 Visual C++ IDE will not be able to attach to the same process (even if
a61af66fc99e Initial load
duke
parents:
diff changeset
54 the debug server is "detached" from that process). Note that this
a61af66fc99e Initial load
duke
parents:
diff changeset
55 system is designed to work with the same primitives that C and C++
a61af66fc99e Initial load
duke
parents:
diff changeset
56 debuggers use (like "symbol lookup" and "read from process memory")
a61af66fc99e Initial load
duke
parents:
diff changeset
57 and exposes these primitives to Java, so in the long term we could
a61af66fc99e Initial load
duke
parents:
diff changeset
58 solve this problem by implementing platform-specific debug symbol
a61af66fc99e Initial load
duke
parents:
diff changeset
59 parsing and a platform-independent C++ debugger in Java.
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 Note:
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 The files IOBuf.cpp and IOBuf.hpp are also used in
a61af66fc99e Initial load
duke
parents:
diff changeset
64 building src/os/solaris/agent.