All of lore.kernel.org
 help / color / mirror / Atom feed
* debugging xen ....
@ 2005-08-23 22:41 Himanshu Raj
  2005-08-24  7:30 ` Tim Newsham
  0 siblings, 1 reply; 5+ messages in thread
From: Himanshu Raj @ 2005-08-23 22:41 UTC (permalink / raw)
  To: xen-devel

Hi Folks,

After looking around for a howto and asking ppl on IRC, I had to come back
to the forum for this - how to debug xen?

Basically, I would love to be able to step through the code using gdb connected
serially to another machine.

Is there some functionality like that in Xen. I also found some emails referencing
a XenDebugger-HowTo, however I couldn't find that file anywhere.

I will highly appreciate if someone can point me to a set of documents that 
describes the process.

Thanks,
Himanshu

-- 
-------------------------------------------------------------------------
Himanshu Raj
PhD Student, GaTech (www.cc.gatech.edu/~rhim)
I prefer to receive attachments in an open, non-proprietary format.
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: debugging xen ....
  2005-08-23 22:41 debugging xen Himanshu Raj
@ 2005-08-24  7:30 ` Tim Newsham
  2005-08-24 11:55   ` Himanshu Raj
  2005-08-29 14:35   ` Michal Ostrowski
  0 siblings, 2 replies; 5+ messages in thread
From: Tim Newsham @ 2005-08-24  7:30 UTC (permalink / raw)
  To: Himanshu Raj; +Cc: xen-devel

> After looking around for a howto and asking ppl on IRC, I had to come back
> to the forum for this - how to debug xen?
>
> Basically, I would love to be able to step through the code using gdb connected
> serially to another machine.
>
> Is there some functionality like that in Xen. I also found some emails referencing
> a XenDebugger-HowTo, however I couldn't find that file anywhere.

Run the build script in xen-unstable.hg/tools/debugger/gdb.
Install the gdbserver and gdb (I put them in /usr/local/bin
   as gdbserver-xen and xengdb).
Build your kernel with debug.  I use the flags
   "verbose=y domu_debug=y debug=y".  although I dont know if these
   are all required.
Start up your domain (I use vm-tools and do all the steps except
   the vm-pause step).
Run gdbserver.  I run "gdbserver-xen 127.0.0.1:9999 --attach $dom"
Run gdb.  I run "xengdb -x remgdb" where remgdb has the command
   "target remote 127.0.0.1:9999" in it.

Tada, you're in a debugger.

I use the following script to automate this tedious process:

--- deb.sh ---
#!/bin/sh

run()
{
         echo "$*"
         $* || (echo 'failed'; exit 1)
}

# vm-create isnt giving us the right answer...
dom=`vm-create`
echo dom is $dom

run vm-memory -m $dom 64m
run vm-memory -i $dom 64m
run vm-build.linux $dom /root/kernel

echo done $dom
gdbserver-xen 127.0.0.1:9999 --attach $dom &
sleep 1
xengdb -x /root/remgdb

run vm-pause -u $dom
--- end deb.sh ---

> Himanshu Raj
> PhD Student, GaTech (www.cc.gatech.edu/~rhim)

Hope this helps,
Tim Newsham
http://www.lava.net/~newsham/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: debugging xen ....
  2005-08-24  7:30 ` Tim Newsham
@ 2005-08-24 11:55   ` Himanshu Raj
  2005-08-29 14:35   ` Michal Ostrowski
  1 sibling, 0 replies; 5+ messages in thread
From: Himanshu Raj @ 2005-08-24 11:55 UTC (permalink / raw)
  To: Tim Newsham; +Cc: xen-devel

Hi Tim,

Thanks for the reply. I will try this out asap. However, just looking at it,
this looks like a solution to debug guests running under xen. I am more interested
in debugging xen itself. Can you shed any light on that?

Thanks,
Himanshu

On Tue, Aug 23, 2005 at 09:30:54PM -1000, Tim Newsham wrote:
> >After looking around for a howto and asking ppl on IRC, I had to come back
> >to the forum for this - how to debug xen?
> >
> >Basically, I would love to be able to step through the code using gdb 
> >connected
> >serially to another machine.
> >
> >Is there some functionality like that in Xen. I also found some emails 
> >referencing
> >a XenDebugger-HowTo, however I couldn't find that file anywhere.
> 
> Run the build script in xen-unstable.hg/tools/debugger/gdb.
> Install the gdbserver and gdb (I put them in /usr/local/bin
>   as gdbserver-xen and xengdb).
> Build your kernel with debug.  I use the flags
>   "verbose=y domu_debug=y debug=y".  although I dont know if these
>   are all required.
> Start up your domain (I use vm-tools and do all the steps except
>   the vm-pause step).
> Run gdbserver.  I run "gdbserver-xen 127.0.0.1:9999 --attach $dom"
> Run gdb.  I run "xengdb -x remgdb" where remgdb has the command
>   "target remote 127.0.0.1:9999" in it.
> 
> Tada, you're in a debugger.
> 
> I use the following script to automate this tedious process:
> 
> --- deb.sh ---
> #!/bin/sh
> 
> run()
> {
>         echo "$*"
>         $* || (echo 'failed'; exit 1)
> }
> 
> # vm-create isnt giving us the right answer...
> dom=`vm-create`
> echo dom is $dom
> 
> run vm-memory -m $dom 64m
> run vm-memory -i $dom 64m
> run vm-build.linux $dom /root/kernel
> 
> echo done $dom
> gdbserver-xen 127.0.0.1:9999 --attach $dom &
> sleep 1
> xengdb -x /root/remgdb
> 
> run vm-pause -u $dom
> --- end deb.sh ---
> 
> >Himanshu Raj
> >PhD Student, GaTech (www.cc.gatech.edu/~rhim)
> 
> Hope this helps,
> Tim Newsham
> http://www.lava.net/~newsham/

-- 
-------------------------------------------------------------------------
Himanshu Raj
PhD Student, GaTech (www.cc.gatech.edu/~rhim)
I prefer to receive attachments in an open, non-proprietary format.
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: debugging xen ....
  2005-08-24  7:30 ` Tim Newsham
  2005-08-24 11:55   ` Himanshu Raj
@ 2005-08-29 14:35   ` Michal Ostrowski
  2005-08-29 17:29     ` Kip Macy
  1 sibling, 1 reply; 5+ messages in thread
From: Michal Ostrowski @ 2005-08-29 14:35 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 2560 bytes --]

I've been trying this approach, trying xend tools and vm-tools.
I actually make the most progress using xend tools.

I'm able to create a domain (paused), set up the gdbserver, connect gdb
and set a breakpoint.   I can then unpause the domain and it runs until
it hits the breakpoint I set (which is in netfront.c).

However, when that breakpoint is hit, the domU kernel oopses, rather
than re-directing the exception to the gdbserver.

Did I miss something?

(And with vm-tools  when I unpause the domain I get one line of console
output and that's all.)

-- 
Michal Ostrowski

On Tue, 23 Aug 2005 21:30:54 -1000 (HST) Tim
Newsham <newsham@lava.net> wrote:

> > After looking around for a howto and asking ppl on IRC, I had to come back
> > to the forum for this - how to debug xen?
> >
> > Basically, I would love to be able to step through the code using gdb connected
> > serially to another machine.
> >
> > Is there some functionality like that in Xen. I also found some emails referencing
> > a XenDebugger-HowTo, however I couldn't find that file anywhere.
> 
> Run the build script in xen-unstable.hg/tools/debugger/gdb.
> Install the gdbserver and gdb (I put them in /usr/local/bin
>    as gdbserver-xen and xengdb).
> Build your kernel with debug.  I use the flags
>    "verbose=y domu_debug=y debug=y".  although I dont know if these
>    are all required.
> Start up your domain (I use vm-tools and do all the steps except
>    the vm-pause step).
> Run gdbserver.  I run "gdbserver-xen 127.0.0.1:9999 --attach $dom"
> Run gdb.  I run "xengdb -x remgdb" where remgdb has the command
>    "target remote 127.0.0.1:9999" in it.
> 
> Tada, you're in a debugger.
> 
> I use the following script to automate this tedious process:
> 
> --- deb.sh ---
> #!/bin/sh
> 
> run()
> {
>          echo "$*"
>          $* || (echo 'failed'; exit 1)
> }
> 
> # vm-create isnt giving us the right answer...
> dom=`vm-create`
> echo dom is $dom
> 
> run vm-memory -m $dom 64m
> run vm-memory -i $dom 64m
> run vm-build.linux $dom /root/kernel
> 
> echo done $dom
> gdbserver-xen 127.0.0.1:9999 --attach $dom &
> sleep 1
> xengdb -x /root/remgdb
> 
> run vm-pause -u $dom
> --- end deb.sh ---
> 
> > Himanshu Raj
> > PhD Student, GaTech (www.cc.gatech.edu/~rhim)
> 
> Hope this helps,
> Tim Newsham
> http://www.lava.net/~newsham/
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel



[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: debugging xen ....
  2005-08-29 14:35   ` Michal Ostrowski
@ 2005-08-29 17:29     ` Kip Macy
  0 siblings, 0 replies; 5+ messages in thread
From: Kip Macy @ 2005-08-29 17:29 UTC (permalink / raw)
  To: Michal Ostrowski; +Cc: xen-devel

You need to have domu_debug enabled in Rules.mk

      -Kip


On 8/29/05, Michal Ostrowski <mostrows@watson.ibm.com> wrote:
> I've been trying this approach, trying xend tools and vm-tools.
> I actually make the most progress using xend tools.
> 
> I'm able to create a domain (paused), set up the gdbserver, connect gdb
> and set a breakpoint.   I can then unpause the domain and it runs until
> it hits the breakpoint I set (which is in netfront.c).
> 
> However, when that breakpoint is hit, the domU kernel oopses, rather
> than re-directing the exception to the gdbserver.
> 
> Did I miss something?
> 
> (And with vm-tools  when I unpause the domain I get one line of console
> output and that's all.)
> 
> --
> Michal Ostrowski
> 
> On Tue, 23 Aug 2005 21:30:54 -1000 (HST) Tim
> Newsham <newsham@lava.net> wrote:
> 
> > > After looking around for a howto and asking ppl on IRC, I had to come back
> > > to the forum for this - how to debug xen?
> > >
> > > Basically, I would love to be able to step through the code using gdb connected
> > > serially to another machine.
> > >
> > > Is there some functionality like that in Xen. I also found some emails referencing
> > > a XenDebugger-HowTo, however I couldn't find that file anywhere.
> >
> > Run the build script in xen-unstable.hg/tools/debugger/gdb.
> > Install the gdbserver and gdb (I put them in /usr/local/bin
> >    as gdbserver-xen and xengdb).
> > Build your kernel with debug.  I use the flags
> >    "verbose=y domu_debug=y debug=y".  although I dont know if these
> >    are all required.
> > Start up your domain (I use vm-tools and do all the steps except
> >    the vm-pause step).
> > Run gdbserver.  I run "gdbserver-xen 127.0.0.1:9999 --attach $dom"
> > Run gdb.  I run "xengdb -x remgdb" where remgdb has the command
> >    "target remote 127.0.0.1:9999" in it.
> >
> > Tada, you're in a debugger.
> >
> > I use the following script to automate this tedious process:
> >
> > --- deb.sh ---
> > #!/bin/sh
> >
> > run()
> > {
> >          echo "$*"
> >          $* || (echo 'failed'; exit 1)
> > }
> >
> > # vm-create isnt giving us the right answer...
> > dom=`vm-create`
> > echo dom is $dom
> >
> > run vm-memory -m $dom 64m
> > run vm-memory -i $dom 64m
> > run vm-build.linux $dom /root/kernel
> >
> > echo done $dom
> > gdbserver-xen 127.0.0.1:9999 --attach $dom &
> > sleep 1
> > xengdb -x /root/remgdb
> >
> > run vm-pause -u $dom
> > --- end deb.sh ---
> >
> > > Himanshu Raj
> > > PhD Student, GaTech (www.cc.gatech.edu/~rhim)
> >
> > Hope this helps,
> > Tim Newsham
> > http://www.lava.net/~newsham/
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
> 
> 
> 
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-29 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-23 22:41 debugging xen Himanshu Raj
2005-08-24  7:30 ` Tim Newsham
2005-08-24 11:55   ` Himanshu Raj
2005-08-29 14:35   ` Michal Ostrowski
2005-08-29 17:29     ` Kip Macy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.