|
|
|
|
|
|
|
|
|
|
xen-users
[Xen-users] gdb ignoring breakpoints when used with hvmloader
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 <=
|
|
|
|
|