Skip to contentSkip to conversation

about gdbserver-xen

DISCUSSION topperxin 2 participants 3 messages Dec 6, 2010 – Dec 7, 2010

lore
Share & tools
lore

topperxin

author
#0 lore raw

hi all
Anybody who have ever use gdbserver-xen debug the domU kernel?

from the guide of the gdbserver-xen, the domU must start at first, then at the dom0 we can do just like this:
gdbserver-xen 127.0.0.1:9999 $dom_id

and then also at dom0:

     gdb vmlinux


     gdb> target romote 127.0.0.1:9999

that's ok.

my question is when I do as above , my domU will crash. another is since the domU must start at first, if I want to debug the start stage of the domU kernel , what should I do? who can give me some advice , thank you very much.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 11 lines · topperxin

hi all
Anybody who have ever use gdbserver-xen debug the domU kernel?

from the guide of the gdbserver-xen, the domU must start at first, then at the dom0 we can do just like this:
gdbserver-xen 127.0.0.1:9999 $dom_id

and then also at dom0:

gdb vmlinux

Quoted 8 lines

gdb> target romote 127.0.0.1:9999

that's ok.

my question is when I do as above , my domU will crash. another is since the domU must start at first, if I want to debug the start stage of the domU kernel , what should I do? who can give me some advice , thank you very much.

Firstly, "gdbsx" is the preferred command for debugging a domain these days ("gdbsx -a <domid> <32|64> <port>").

Secondly, you can start your domain paused ("xl create -p"), attach gdbsx and gdb, set any breakpoints, etc, then start the domain off.

J

author
#2 lore raw

hi Jeremy
Thank you very much.

now, the gdbserver-xen can work a little, I can set breakpoint, such as
-----------------------------------------------------------------

       gdb -s vmlinux 
        ................
        Reading symbols from /root/vmlinux...done.
       (gdb) set architecture i386:x86-64:intel
      The target architecture is assumed to be i386:x86-4:intel
      (gdb) target remote 127.0.0.1:9999
         Remote debugging using 127.0.0.1:9999
         [Switching to Remote target]
         native_safe_halt ()
         at /usr/src/linux-source-2.6.35/linux-source-           2.6.35/arch/x86/include/asm/irqflags.h:50

50/usr/src/linux-source-2.6.35/linux-source-2.6.35/arch/x86/include/asm/irqflags.h: No such file or directory. in /usr/src/linux-source-2.6.35/linux-source-2.6.35/arch/x86/include/asm/irqflags.h
(gdb) br sys_open
Breakpoint 1 at 0xffffffff81144909: file fs/open.c, line 912.
(gdb) c
Continuing.
Breakpoint 1, sys_open (filename=0x12262c0 "/sys/devices/system/cpu", flags=591872, mode=-332603840)

    at fs/open.c:912

912fs/open.c: No such file or directory.
in fs/open.c
---------------------------------------------------------------
perhaps there are two warnings
the first is native_safe_halt, I found the messages on google, someone said just shut down the options in kernel hacking "Detect Soft Lockup" can solve it, I will try.
the second is: when continuing it says:
912fs/open.c: No such file or directory.
in fs/open.c
what'r wrong with this?
------------------------------------------------------------
and another tools you referred gdbsx, I found it under the ./tools/debugger/gdbsx/, when I want to compile it, I received such errors:

         remote: Counting objects: 1857338, done.

remote: Compressing objects: 100% (292566/292566), done. Receiving objects: 100% (1857338/1857338), 368.84 MiB | 53 KiB/s, done.
remote: Total 1857338 (delta 1554805), reused 1849232 (delta 1547905) Resolving deltas: 100% (1554805/1554805), done.
Checking out files: 100% (30571/30571), done.
+ cd linux-2.6-pvops.git.tmp
+ git checkout xen/master
error: pathspec 'xen/master' did not match any file(s) known to git. make[2]: *** [linux-2.6-pvops.git/.valid-src] 错误 1
make[2]: Leaving directory `/home/nlx/nex-4.5.4/xen' make[1]: *** [linux-2.6-pvops-install] 错误 2
make[1]: Leaving directory `/home/nlx/nex-4.5.4/xen'
make: *** [install-kernels] 错误 1

I can't analyse what's wrong with it, can you give me some advice?
thanks a lot.

Quoted 28 lines · At 2010-12-07 02:24:04,"Jeremy Fitzhardinge" <[email protected]> wrote:
Quoted 11 lines · topperxin

hi all
Anybody who have ever use gdbserver-xen debug the domU kernel?

from the guide of the gdbserver-xen, the domU must start at first, then at the dom0 we can do just like this:
gdbserver-xen 127.0.0.1:9999 $dom_id

and then also at dom0:

gdb vmlinux

Quoted 8 lines

gdb> target romote 127.0.0.1:9999

that's ok.

my question is when I do as above , my domU will crash. another is since the domU must start at first, if I want to debug the start stage of the domU kernel , what should I do? who can give me some advice , thank you very much.

Firstly, "gdbsx" is the preferred command for debugging a domain these days ("gdbsx -a <domid> <32|64> <port>").

Secondly, you can start your domain paused ("xl create -p"), attach gdbsx and gdb, set any breakpoints, etc, then start the domain off.

Quoted 6 lines

J

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel