WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

[Xen-users] gdb ignoring breakpoints when used with hvmloader

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-users] gdb ignoring breakpoints when used with hvmloader
From: Franklin Webber <franklin@xxxxxxxxxxxxxx>
Date: Mon, 20 Apr 2009 19:13:17 -0400
Delivery-date: Mon, 20 Apr 2009 16:14:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
Hello,

I am trying to use gdb to debug a kernel that must run
fully virtualized under Xen.  The kernel crashes soon
after it is started; I want to step through the execution
before it crashes. Unfortunately, gdb does not behave
as expected in this situation and so far has been
unusable for this task.

I am wondering: has any reader of this mailing list
succeeded in using gdb in the way I describe below?
Or is there a better way?

If I start the kernel running, it will crash
before I have time to attach gdbserver and
connect with gdb.  Therefore, I am trying to start
the kernel in a paused state, set up gdb,
then continue from the beginning until a breakpoint
is reached:

>xm create -p Kernel.conf

>gdbserver-xen 127.0.0.1:9999 --attach ###
domain currently paused
...

>gdb Kernel.bin

(gdb) directory Kernel.dir
Source directories searched: Kernel.dir:....

(gdb) target remote 127.0.0.1:9999
Remote debugging using 127.0.0.1:9999
[New Thread 0]
[Switching to Thread 0]
0x00000000 in loader ()
warning: shared library handler failed to enable breakpoint

(gdb) break interesting_function
Breakpoint 1 at 0x####: file ....

(gdb) continue
Continuing.

From here, gdb proceeds to the crash point without breaking.
I believe it is ignoring the breakpoints because:
-- If I use a simpler kernel that does not crash
  but instead loops forever, I can see output from
  the kernel generated after the breakpoints.
-- If I inspect the state of the domU using the
  XenCntrl functions, I can see the EIP of the breakpoints
  being reached.

Some other observations:
-- If I run the simpler kernel _paravirtualized_,
  gdb works as expected.  So am I seeing a bug
  in gdb that only appears with full virtualization?

-- If I try to step through the execution from the
  beginning, fully virtualized, I execute a few dozen
  instructions from the "hvmloader" executable.
  When the first x86 "out" instruction is executed,
  however, gdb proceeds as though I had told it to
  "continue", i.e., it never breaks.

-- When stepping through the execution,
  gdbserver-xen routinely announces:
  "unsupported xc_ptrace request PTRACE_SETFPXREGS".
  Is this a related symptom?

Any help you can give me would be greatly appreciated.

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-users] gdb ignoring breakpoints when used with hvmloader, Franklin Webber <=