All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] extend qemu-dm.debug to use ddd for device model debugging
@ 2006-01-06  5:12 Andrew D. Ball
  2006-01-06 17:42 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew D. Ball @ 2006-01-06  5:12 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 2143 bytes --]

This patch modifies the qemu-dm.debug shell script to call ddd.  I have tested it with
xm-test against xen-unstable.hg changeset 8497, with no evidence of regression.

Andrew

==================
Andrew D. Ball
aball@us.ibm.com
'Festina lente'


Add support to the qemu-dm.debug script to launch a ddd window running
gdb on the device model for fully virtualized domU's.

Signed-off-by: Chip Blach <chipper@us.ibm.com>
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>

diff -r 9efe7eb108e1 tools/examples/xmexample.vmx
--- a/tools/examples/xmexample.vmx	Wed Jan  4 17:51:38 2006
+++ b/tools/examples/xmexample.vmx	Thu Jan  5 18:10:24 2006
@@ -100,6 +100,15 @@
 
 # New stuff
 device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
+# Use this instead for device model debugging [launches ddd in a new window 
+# for qemu-dm]
+#
+# To get debugging symbols in qemu-dm, you can copy 
+#   tools/ioemu/target-i386-dm/qemu-dm from a built Xen source tree to
+# /usr/lib/xen/bin/qemu-dm or /usr/lib64/xen/bin/qemu-dm , depending
+# on where your qemu-dm sits
+#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm.debug'
+
 
 #-----------------------------------------------------------------------------
 # Disk image for 
diff -r 9efe7eb108e1 tools/ioemu/target-i386-dm/qemu-dm.debug
--- a/tools/ioemu/target-i386-dm/qemu-dm.debug	Wed Jan  4 17:51:38 2006
+++ b/tools/ioemu/target-i386-dm/qemu-dm.debug	Thu Jan  5 18:10:24 2006
@@ -1,5 +1,26 @@
-#!/bin/sh
+#!/bin/bash
+# Subject to GPL version 2 license.
+#
+# Chip Blach <chipper@us.ibm.com>
+# Andrew D. Ball <aball@us.ibm.com>
+ 
+cd ~root # why does ~ mean '/' instead of '/root' here?
 
-echo $* > /tmp/args
-echo $DISPLAY >> /tmp/args
-exec /usr/lib/xen/bin/qemu-dm $*
+if [[ -z "$IOEMU" ]]
+then 
+	# Guess where the device model (qemu-dm) sits, based
+	# on architecture
+	if [[ $(uname -p) == 'x86_64' ]]
+	then
+    		IOEMU=/usr/lib64/xen/bin/qemu-dm
+	else
+    		IOEMU=/usr/lib/xen/bin/qemu-dm
+	fi
+fi
+	
+# set up gdb
+echo "file $IOEMU" > ioemu_debug
+echo "set args $@" >> ioemu_debug
+echo "break main" >> ioemu_debug
+
+nohup ddd --gdb --debugger "gdb -x ioemu_debug" &


[-- Attachment #2: qemu_debug.patch --]
[-- Type: text/x-patch, Size: 1897 bytes --]

Add support to the qemu-dm.debug script to launch a ddd window running
gdb on the device model for fully virtualized domU's.

Signed-off-by: Chip Blach <chipper@us.ibm.com>
Signed-off-by: Andrew D. Ball <aball@us.ibm.com>

diff -r 9efe7eb108e1 tools/examples/xmexample.vmx
--- a/tools/examples/xmexample.vmx	Wed Jan  4 17:51:38 2006
+++ b/tools/examples/xmexample.vmx	Thu Jan  5 18:10:24 2006
@@ -100,6 +100,15 @@
 
 # New stuff
 device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
+# Use this instead for device model debugging [launches ddd in a new window 
+# for qemu-dm]
+#
+# To get debugging symbols in qemu-dm, you can copy 
+#   tools/ioemu/target-i386-dm/qemu-dm from a built Xen source tree to
+# /usr/lib/xen/bin/qemu-dm or /usr/lib64/xen/bin/qemu-dm , depending
+# on where your qemu-dm sits
+#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm.debug'
+
 
 #-----------------------------------------------------------------------------
 # Disk image for 
diff -r 9efe7eb108e1 tools/ioemu/target-i386-dm/qemu-dm.debug
--- a/tools/ioemu/target-i386-dm/qemu-dm.debug	Wed Jan  4 17:51:38 2006
+++ b/tools/ioemu/target-i386-dm/qemu-dm.debug	Thu Jan  5 18:10:24 2006
@@ -1,5 +1,26 @@
-#!/bin/sh
+#!/bin/bash
+# Subject to GPL version 2 license.
+#
+# Chip Blach <chipper@us.ibm.com>
+# Andrew D. Ball <aball@us.ibm.com>
+ 
+cd ~root # why does ~ mean '/' instead of '/root' here?
 
-echo $* > /tmp/args
-echo $DISPLAY >> /tmp/args
-exec /usr/lib/xen/bin/qemu-dm $*
+if [[ -z "$IOEMU" ]]
+then 
+	# Guess where the device model (qemu-dm) sits, based
+	# on architecture
+	if [[ $(uname -p) == 'x86_64' ]]
+	then
+    		IOEMU=/usr/lib64/xen/bin/qemu-dm
+	else
+    		IOEMU=/usr/lib/xen/bin/qemu-dm
+	fi
+fi
+	
+# set up gdb
+echo "file $IOEMU" > ioemu_debug
+echo "set args $@" >> ioemu_debug
+echo "break main" >> ioemu_debug
+
+nohup ddd --gdb --debugger "gdb -x ioemu_debug" &

[-- Attachment #3: 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] 2+ messages in thread

* Re: [PATCH] extend qemu-dm.debug to use ddd for device model debugging
  2006-01-06  5:12 [PATCH] extend qemu-dm.debug to use ddd for device model debugging Andrew D. Ball
@ 2006-01-06 17:42 ` Anthony Liguori
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2006-01-06 17:42 UTC (permalink / raw)
  To: aball; +Cc: xen-devel

Andrew D. Ball wrote:

>This patch modifies the qemu-dm.debug shell script to call ddd.  I have tested it with
>xm-test against xen-unstable.hg changeset 8497, with no evidence of regression.
>
>Andrew
>
>==================
>Andrew D. Ball
>aball@us.ibm.com
>'Festina lente'
>
>
>Add support to the qemu-dm.debug script to launch a ddd window running
>gdb on the device model for fully virtualized domU's.
>
>Signed-off-by: Chip Blach <chipper@us.ibm.com>
>Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
>
>diff -r 9efe7eb108e1 tools/examples/xmexample.vmx
>--- a/tools/examples/xmexample.vmx	Wed Jan  4 17:51:38 2006
>+++ b/tools/examples/xmexample.vmx	Thu Jan  5 18:10:24 2006
>@@ -100,6 +100,15 @@
> 
> # New stuff
> device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
>+# Use this instead for device model debugging [launches ddd in a new window 
>+# for qemu-dm]
>+#
>+# To get debugging symbols in qemu-dm, you can copy 
>+#   tools/ioemu/target-i386-dm/qemu-dm from a built Xen source tree to
>+# /usr/lib/xen/bin/qemu-dm or /usr/lib64/xen/bin/qemu-dm , depending
>+# on where your qemu-dm sits
>+#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm.debug'
>+
> 
> #-----------------------------------------------------------------------------
> # Disk image for 
>diff -r 9efe7eb108e1 tools/ioemu/target-i386-dm/qemu-dm.debug
>--- a/tools/ioemu/target-i386-dm/qemu-dm.debug	Wed Jan  4 17:51:38 2006
>+++ b/tools/ioemu/target-i386-dm/qemu-dm.debug	Thu Jan  5 18:10:24 2006
>@@ -1,5 +1,26 @@
>-#!/bin/sh
>+#!/bin/bash
>+# Subject to GPL version 2 license.
>+#
>+# Chip Blach <chipper@us.ibm.com>
>+# Andrew D. Ball <aball@us.ibm.com>
>+ 
>+cd ~root # why does ~ mean '/' instead of '/root' here?
>
~/ expands to the current users home directory.

~word expands to user word's home directory.

You may want to check for ddd and just invoke gdb if ddd is not available.

Regards,

Anthony Liguori

> 
>-echo $* > /tmp/args
>-echo $DISPLAY >> /tmp/args
>-exec /usr/lib/xen/bin/qemu-dm $*
>+if [[ -z "$IOEMU" ]]
>+then 
>+	# Guess where the device model (qemu-dm) sits, based
>+	# on architecture
>+	if [[ $(uname -p) == 'x86_64' ]]
>+	then
>+    		IOEMU=/usr/lib64/xen/bin/qemu-dm
>+	else
>+    		IOEMU=/usr/lib/xen/bin/qemu-dm
>+	fi
>+fi
>+	
>+# set up gdb
>+echo "file $IOEMU" > ioemu_debug
>+echo "set args $@" >> ioemu_debug
>+echo "break main" >> ioemu_debug
>+
>+nohup ddd --gdb --debugger "gdb -x ioemu_debug" &
>
>  
>
>------------------------------------------------------------------------
>
>Add support to the qemu-dm.debug script to launch a ddd window running
>gdb on the device model for fully virtualized domU's.
>
>Signed-off-by: Chip Blach <chipper@us.ibm.com>
>Signed-off-by: Andrew D. Ball <aball@us.ibm.com>
>
>diff -r 9efe7eb108e1 tools/examples/xmexample.vmx
>--- a/tools/examples/xmexample.vmx	Wed Jan  4 17:51:38 2006
>+++ b/tools/examples/xmexample.vmx	Thu Jan  5 18:10:24 2006
>@@ -100,6 +100,15 @@
> 
> # New stuff
> device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
>+# Use this instead for device model debugging [launches ddd in a new window 
>+# for qemu-dm]
>+#
>+# To get debugging symbols in qemu-dm, you can copy 
>+#   tools/ioemu/target-i386-dm/qemu-dm from a built Xen source tree to
>+# /usr/lib/xen/bin/qemu-dm or /usr/lib64/xen/bin/qemu-dm , depending
>+# on where your qemu-dm sits
>+#device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm.debug'
>+
> 
> #-----------------------------------------------------------------------------
> # Disk image for 
>diff -r 9efe7eb108e1 tools/ioemu/target-i386-dm/qemu-dm.debug
>--- a/tools/ioemu/target-i386-dm/qemu-dm.debug	Wed Jan  4 17:51:38 2006
>+++ b/tools/ioemu/target-i386-dm/qemu-dm.debug	Thu Jan  5 18:10:24 2006
>@@ -1,5 +1,26 @@
>-#!/bin/sh
>+#!/bin/bash
>+# Subject to GPL version 2 license.
>+#
>+# Chip Blach <chipper@us.ibm.com>
>+# Andrew D. Ball <aball@us.ibm.com>
>+ 
>+cd ~root # why does ~ mean '/' instead of '/root' here?
> 
>-echo $* > /tmp/args
>-echo $DISPLAY >> /tmp/args
>-exec /usr/lib/xen/bin/qemu-dm $*
>+if [[ -z "$IOEMU" ]]
>+then 
>+	# Guess where the device model (qemu-dm) sits, based
>+	# on architecture
>+	if [[ $(uname -p) == 'x86_64' ]]
>+	then
>+    		IOEMU=/usr/lib64/xen/bin/qemu-dm
>+	else
>+    		IOEMU=/usr/lib/xen/bin/qemu-dm
>+	fi
>+fi
>+	
>+# set up gdb
>+echo "file $IOEMU" > ioemu_debug
>+echo "set args $@" >> ioemu_debug
>+echo "break main" >> ioemu_debug
>+
>+nohup ddd --gdb --debugger "gdb -x ioemu_debug" &
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Xen-devel mailing list
>Xen-devel@lists.xensource.com
>http://lists.xensource.com/xen-devel
>  
>

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

end of thread, other threads:[~2006-01-06 17:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-06  5:12 [PATCH] extend qemu-dm.debug to use ddd for device model debugging Andrew D. Ball
2006-01-06 17:42 ` Anthony Liguori

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.