[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] user-space GDB stub



I've added a ptrace interface for domains to libxc and modified the
ptrace client portion of gdbserver to use this "xc_ptrace". This allows
one to debug a VM without impacting anything else running on the machine
at the time. It makes debugging an OS look very much like debugging a
user-space program.

I'm wondering if there are others who would benefit from this?


                                -Kip


I start my domain:
kmacy@shemp sh ~/xentmp/xenargs.shemp
Using config file "/u/kmacy/xentmp/freebsd.shemp".
Started domain xen-vm2.lab.netapp.com, console on port 9604
************ REMOTE CONSOLE: CTRL-] TO QUIT ********

I attach to it:
kmacy@shemp r ./gdbserver shemp:2345 --attach 4
Attached; pid = 4
Listening on port 2345


I start gdb with the symbols:
kmacy@siml3 ./gdb
/t/niners/users/xen/bsd/sys/i386-xeno/compile/XENCONF/kernel.debug
GNU gdb 6.2.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for
details.
This GDB was configured as "i686-pc-linux-gnu"...
warning: A handler for the OS ABI "FreeBSD ELF" is not built into this
configuration
of GDB.  Attempting to continue with the default i386 settings.

(gdb) target remote shemp:2345
Remote debugging using shemp:2345
init386 () at ../../../i386-xeno/i386-xeno/machdep.c:1489
1489                __asm__("int $0x3;");
warning: no shared library support for this OS / ABI
(gdb) bt
#0  init386 () at ../../../i386-xeno/i386-xeno/machdep.c:1489
During symbol reading, Incomplete CFI data; unspecified registers at
0xc01b249c.
#1  0xc0027dbc in btext () at {standard input}:101
(gdb) p $eip
$1 = (void *) 0xc01b258b
(gdb) bt
#0  init386 () at ../../../i386-xeno/i386-xeno/machdep.c:1489
#1  0xc0027dbc in btext () at {standard input}:101
(gdb) f 0
#0  init386 () at ../../../i386-xeno/i386-xeno/machdep.c:1489
1489                __asm__("int $0x3;");
Current language:  auto; currently c
(gdb) list
1484                    kern_envp =
xen_setbootenv((caddr_t)start_info->cmd_line);
1485
1486            boothowto |= xen_boothowto(kern_envp);
1487
1488            if (boothowto & RB_GDB_PAUSE)
1489                __asm__("int $0x3;");
1490
1491            /* Init basic tunables, hz etc */
1492            init_param1();
1493            /*
(gdb) p $eip
$2 = (void *) 0xc01b258b
(gdb) x/i $2
0xc01b258b <init386+251>:       int3
(gdb) set *(char *)$2=0x90
(gdb) x/i $2
0xc01b258b <init386+251>:       nop
(gdb) s

Program received signal SIGSTOP, Stopped (signal).
init386 () at ../../../i386-xeno/i386-xeno/machdep.c:1492
1492            init_param1();
(gdb) s

Program received signal SIGSTOP, Stopped (signal).
init_param1 () at ../../../kern/subr_param.c:101
101     {
(gdb) bt
#0  init_param1 () at ../../../kern/subr_param.c:101
#1  0xc01b2591 in init386 () at
../../../i386-xeno/i386-xeno/machdep.c:1492
#2  0xc0027dbc in btext () at {standard input}:101
(gdb) b mi_startup
Breakpoint 1 at 0xc0053b38: file ../../../kern/init_main.c, line 175.
(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
mi_startup () at ../../../kern/init_main.c:175
175             if (sysinit == NULL) {
(gdb) b start_init
Breakpoint 2 at 0xc0054199: file ../../../kern/init_main.c, line 533.
(gdb) c
Continuing.

Program received signal SIGSTOP, Stopped (signal).
start_init (dummy=0x0) at ../../../kern/init_main.c:533
533             int init_does_devfs = 0;
(gdb)



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.