Skip to contentSkip to conversation

gdbserver-xen / gdb crashing domU

DISCUSSION Jonathan M. McCune 2 participants 4 messages Sep 27, 2005 – Sep 28, 2005

lore
Share & tools
lore
#0 lore raw

Hello,

I'm trying to use gdb and gdbserver-xen to walk through the instructions executed when starting up a domU kernel. We are using the current xen-unstable (linux-2.6.12-xenU). I have followed the instructions in tools/debugger/gdb/ and I am able to successfully attach to a running domU kernel. I have compiled the domU kernel with debug options as described in tools/debugger/gdb/README. After attaching to the running domU kernel, I observe the following behavior:

Issuing the gdb commands 'step', 'stepi', 'next', and 'nexti' when the domU kernel is initially paused all crash the domU kernel silently (i.e., the state of said domU goes to 'c' if you issue an xm list in dom0). 'continue' causes the domU kernel to boot up correctly.

All the breakpoints I've tried setting so far (setting the breakpoints before issuing the 'continue' in gdb) cause the domU kernel to panic when the function at which the breakpoint is set gets run. Functions I've tried setting breakpoints for include dup_task_struct, queue_work, scheduler_tick, and activate_task.

Is it possible to step through the domU kernel code as it is booted in Xen?

Thanks,
-Jon

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

#1 lore raw

domu_debug must be enabled in xen's Rules.mk <http://Rules.mk>, otherwise the int3 gets passed onto the OS which will cause it to crash as it isn't expecting to see a debug trap in ring 0 (unless of course you have a debugger compiled into the kernel itself).

Just re-compile and then pass -p (pause) to xm create followed by an attach with gdbserver-xen.

-Kip

Quoted 30 lines · Jonathan M. McCune

Hello,

I'm trying to use gdb and gdbserver-xen to walk through the instructions executed when starting up a domU kernel. We are using the current xen-unstable (linux-2.6.12-xenU). I have followed the instructions in tools/debugger/gdb/ and I am able to successfully attach to a running domU kernel. I have compiled the domU kernel with debug options as described in tools/debugger/gdb/README. After attaching to the running domU kernel, I observe the following behavior:

Issuing the gdb commands 'step', 'stepi', 'next', and 'nexti' when the domU kernel is initially paused all crash the domU kernel silently (i.e., the state of said domU goes to 'c' if you issue an xm list in dom0). 'continue' causes the domU kernel to boot up correctly.

All the breakpoints I've tried setting so far (setting the breakpoints before issuing the 'continue' in gdb) cause the domU kernel to panic when the function at which the breakpoint is set gets run. Functions I've tried setting breakpoints for include dup_task_struct, queue_work, scheduler_tick, and activate_task.

Is it possible to step through the domU kernel code as it is booted in Xen?

Thanks,
-Jon

Quoted 8 lines

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

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

#2 lore raw

Hi Kip,

Thanks for your quick response. Unfortunately, in the experiment I described in my first post, I did have domu_debug=y in xen/Rules.mk. I rebuilt and reinstalled xen after a make clean in the xen subdir just to be sure it would have picked up the change.

Any other ideas?

Thanks,
-Jon

Quoted 5 lines · Kip Macy

domu_debug must be enabled in xen's Rules.mk <http://Rules.mk>, otherwise the int3 gets passed onto the OS which will cause it to crash as it isn't expecting to see a debug trap in ring 0 (unless of course you have a debugger compiled into the kernel itself).

Quoted 50 lines

Just re-compile and then pass -p (pause) to xm create followed by an attach with gdbserver-xen.

-Kip

Quoted 39 lines · Jonathan M. McCune

Hello,

I'm trying to use gdb and gdbserver-xen to walk through the instructions executed when starting up a domU kernel. We are using the current xen-unstable (linux-2.6.12-xenU). I have followed the instructions in tools/debugger/gdb/ and I am able to successfully attach to a running domU kernel. I have compiled the domU kernel with debug options as described in tools/debugger/gdb/README. After attaching to the running domU kernel, I observe the following behavior:

Issuing the gdb commands 'step', 'stepi', 'next', and 'nexti' when the domU kernel is initially paused all crash the domU kernel silently (i.e., the state of said domU goes to 'c' if you issue an xm list in dom0). 'continue' causes the domU kernel to boot up correctly.

All the breakpoints I've tried setting so far (setting the breakpoints before issuing the 'continue' in gdb) cause the domU kernel to panic when the function at which the breakpoint is set gets run. Functions I've tried setting breakpoints for include dup_task_struct, queue_work, scheduler_tick, and activate_task.

Is it possible to step through the domU kernel code as it is booted in Xen?

Thanks,
-Jon

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

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

#3 lore raw

I vaguely recall it depending on debug as silly as that sounds. I'll have to go back and take a look - xen clearly isn't pausing the domain when an int3 is hit.
-Kip

Quoted 15 lines · Jonathan M. McCune

Hi Kip,

Thanks for your quick response. Unfortunately, in the experiment I described in my first post, I did have domu_debug=y in xen/Rules.mk. I rebuilt and reinstalled xen after a make clean in the xen subdir just to be sure it would have picked up the change.

Any other ideas?

Thanks,
-Jon

Kip Macy wrote:

Quoted 60 lines
Quoted 1 line

domu_debug must be enabled in xen's Rules.mk <http://Rules.mk> <

http://Rules.mk>, otherwise

Quoted 5 lines

the int3 gets passed onto the OS which will cause it to crash as it isn't expecting to see a debug trap in ring 0 (unless of course you have a debugger compiled into the kernel itself).

Just re-compile and then pass -p (pause) to xm create followed by an

attach

Quoted 49 lines

with gdbserver-xen.

-Kip

Quoted 39 lines · Jonathan M. McCune

Hello,

I'm trying to use gdb and gdbserver-xen to walk through the instructions executed when starting up a domU kernel. We are using the current xen-unstable (linux-2.6.12-xenU). I have followed the instructions in tools/debugger/gdb/ and I am able to successfully attach to a running domU kernel. I have compiled the domU kernel with debug options as described in tools/debugger/gdb/README. After attaching to the running domU kernel, I observe the following behavior:

Issuing the gdb commands 'step', 'stepi', 'next', and 'nexti' when the domU kernel is initially paused all crash the domU kernel silently (i.e., the state of said domU goes to 'c' if you issue an xm list in dom0). 'continue' causes the domU kernel to boot up correctly.

All the breakpoints I've tried setting so far (setting the breakpoints before issuing the 'continue' in gdb) cause the domU kernel to panic when the function at which the breakpoint is set gets run. Functions I've tried setting breakpoints for include dup_task_struct, queue_work, scheduler_tick, and activate_task.

Is it possible to step through the domU kernel code as it is booted in Xen?

Thanks,
-Jon

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

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