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-devel

[Xen-devel] [PATCH] extend qemu-dm.debug to use ddd for device model deb

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] extend qemu-dm.debug to use ddd for device model debugging
From: "Andrew D. Ball" <aball@xxxxxxxxxx>
Date: Fri, 06 Jan 2006 00:12:24 -0500
Delivery-date: Fri, 06 Jan 2006 05:18:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: aball@xxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxx
'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@xxxxxxxxxx>
Signed-off-by: Andrew D. Ball <aball@xxxxxxxxxx>

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@xxxxxxxxxx>
+# Andrew D. Ball <aball@xxxxxxxxxx>
+ 
+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: qemu_debug.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>