From: "Lily Huang" Subject: Re: help on debugging kernel module in Xen Date: Fri, 12 Jan 2007 15:35:10 -0500 Message-ID: <4d616cca0701121235p67d08659u1be98a7f4676d4c3@mail.gmail.com> References: <4d616cca0701121041n62b8ad05k7996ffe125c43043@mail.gmail.com> <20070112192049.GA4982@ventoux.cs.ubc.ca> <4d616cca0701121225p1018056ar24541c3a27c57518@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1415988102==" Return-path: In-Reply-To: <4d616cca0701121225p1018056ar24541c3a27c57518@mail.gmail.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: ushuanglily@gmail.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1415988102== Content-Type: multipart/alternative; boundary="----=_Part_46697_12152550.1168634110914" ------=_Part_46697_12152550.1168634110914 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry. I was wrong. I forgot to run the rest of gdb command. Now I did the following commands in gdb: 1. "directory /boot" response: "Source directories searched: /boot:$cdir:$cwd" 2. br filp_open response: "Breakpoint 1 at 0xc0160246: file fs/open.c, line 885." 3. cont 4. But no matter what file I opened in domU, the breakpoint was never encountered. What's wrong? Thanks, lily On 1/12/07, Lily Huang wrote: > > Thanks, Brendan. > > I followed the README instruction and did follows: > > 1. start a domU > 2. in Dom0, run "gdbserver-xen 127.0.0.1:9999 --attach 5", where 5 is the > domain id of the domU > 3. I got the response: > /*******************************/ > Attached; pid = 5 > Listening on port 9999 > /*******************************/ > And then, I lost connection with the domU, I tried both network and > console, neither works for me. > > 4. I run "gdb /boot/vmlinux-syms-2.6.16.33-xenU" in dom0, hoping to > reactivate domU with debug command. > > the response is as follows: > > /*******************************/ > GNU gdb Red Hat Linux (6.3.0.0-1.84rh) > 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 "i386-redhat-linux-gnu"...Using host > libthread_db library "/lib/libthread_db.so.1". > /*******************************/ > > when I typed "cont" command in the gdb, I got "The program is not being > run." > > Am I doing something wrong? Any further help will be highly appreciated. > > lily > > > > On 1/12/07, Brendan Cully wrote: > > > > On Friday, 12 January 2007 at 13:41, Lily Huang wrote: > > > Hi all, > > > > > > I am developing a kernel module running in both Xen0 and XenU. I want > > to > > > debug it but don't know how. Does someone has experience on this? > > > > > > I know printk is an option, but not very convenient. > > > > There's a nice howto for using gdb to debug guest kernels in > > tools/debugger/gdb/README. > > > > ------=_Part_46697_12152550.1168634110914 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry. I was wrong. I forgot to run the rest of gdb command.

Now I did the following commands in gdb:

1. "directory /boot"
response:  "Source directories searched: /boot:$cdir:$cwd"

2. br filp_open
response: "Breakpoint 1 at 0xc0160246: file fs/open.c, line 885."

3.  cont

4. But no matter what file I opened in domU, the breakpoint was never encountered.

What's wrong?

Thanks,
lily


On 1/12/07, Lily Huang <ushuanglily@gmail.com> wrote:
Thanks, Brendan.

I followed the README instruction and did follows:

1. start a domU
2. in Dom0, run "gdbserver-xen 127.0.0.1:9999 --attach 5", where 5 is the domain id of the domU
3. I got the response:
/*******************************/
Attached; pid = 5
Listening on port 9999
/*******************************/
And then, I lost connection with the domU, I tried both network and console, neither works for me.

4. I run "gdb /boot/vmlinux-syms-2.6.16.33-xenU" in dom0, hoping to reactivate domU with debug command.

the response is as follows:

/*******************************/
GNU gdb Red Hat Linux (6.3.0.0-1.84rh)
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 "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
/*******************************/

when I typed "cont" command in the gdb, I got "The program is not being run."

Am I doing something wrong? Any further help will be highly appreciated.

lily




On 1/12/07, Brendan Cully <brendan@cs.ubc.ca> wrote:
On Friday, 12 January 2007 at 13:41, Lily Huang wrote:
> Hi all,
>
> I am developing a kernel module running in both Xen0 and XenU. I want to
> debug it but don't know how. Does someone has experience on this?
>
> I know printk is an option, but not very convenient.

There's a nice howto for using gdb to debug guest kernels in
tools/debugger/gdb/README.


------=_Part_46697_12152550.1168634110914-- --===============1415988102== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1415988102==--