ia64/xen-unstable

view tools/debugger/pdb/readme @ 6538:84ee014ebd41

Merge xen-vtx-unstable.hg
author adsharma@los-vmm.sc.intel.com
date Wed Aug 17 12:34:38 2005 -0800 (2005-08-17)
parents 23979fb12c49 60d20acf8928
children 99914b54f7bf
line source
2 PDB 0.3.3
3 http://www.cl.cam.ac.uk/netos/pdb
5 Alex Ho
6 August 2005
9 This is the latest incarnation of the pervasive debugger.
10 PDB is a remote stub for GDB. Running as a user-space
11 application in domain 0, it can debug any other domain.
14 +------+ tcp/ip +-------+
15 | GDB |--------------| PDB |
16 +------+ +-------+ +-------+
17 | Dom 0 | | Dom U |
18 +-------+---+-------+
19 | Xen |
20 +-------------------+
22 Installation
24 - Install OCaml 3.08 in domain 0.
25 http://caml.inria.fr/download.en.html is a good place to start.
27 - Build Xen with debugger support
28 make domu_debug=y xen
30 - (optional)
31 Build the target domains with debugging symbols.
32 make CONFIG_DEBUG_INFO=true CONFIG_FRAME_POINTER=false linux-2.6-xenU-build
34 You can also change linux-2.6.12-xenU/Makefile
35 CONFIG_CC_OPTIMIZE_FOR_SIZE from -O2 to -O
37 - Build PDB
38 (cd tools/debugger/libxendebug; make install)
39 (cd tools/debugger/pdb; make)
41 Usage
43 - PDB does not currently support SMP. Please boot xen with "maxcpus=1"
45 - Run PDB
46 domain-0.xeno# ./pdb <port>
48 - Run GDB
49 hostname% gdb <xeno.bk>/dist/install/boot/vmlinux-syms-2.6.12-xenU
51 (gdb) target remote domain-0.xeno:<port>
53 At this point, you'll get an error message such as:
54 Remote debugging using domain-0.xeno:5000
55 0x00000000 in ?? ()
56 warning: shared library handler failed to enable breakpoint
57 Although GDB is connected to PDB, PDB doesn't know which domain
58 you'd like to debug, so it's just feeding GDB a bunch of zeros.
60 (gdb) maint packet x context = domain <domid> <vcpu>
62 This tells PDB that we'd like to debug a particular domain & vcpu.
63 However, since we're sending the command directly to PDB, GDB doesn't
64 know that we now have a proper target. We can force GDB to invalidate
65 its register cache. This is optional; the next time the program
66 stops GDB will query for the registers automatically.
68 (gdb) flushreg
71 the following gdb commands should work :)
73 break
74 step, stepi
75 next, nexti
76 continue
77 print
79 Process
81 PDB can also debug a process running in a Linux 2.6 domain.
82 You will need to patch the Linux 2.6 domain U tree to export some
83 additional symbols for the pdb module
85 % make -C linux-2.6-patches
87 After running PDB in domain 0, insert the pdb module in dom u:
89 % insmod linux-2.6-module/pdb.ko
91 Load GDB with the appropriate symbols, and attach with
93 (gdb) maint packet x context = process <domid> <pid>
95 Read, write, and access watchpoint should also work for processes,
96 use the "rwatch", "watch" and "awatch" gdb commands respectively.
98 If you are having trouble with GDB 5.3 (i386-redhat-linux-gnu),
99 try GDB 6.3 (configured with --target=i386-linux-gnu).
102 To Do
104 - watchpoints for domains
105 - support for SMP