From: Simon Kagstrom Subject: Patch to fix GDB building Date: Mon, 5 Sep 2005 14:17:43 +0200 Message-ID: <20050905121743.GC640@ipdska.ipd.bth.se> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3lcZGd9BuhuYXNfi" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, The attached patch against Xen-unstable corrects building of GDB for Xen domains (it tried to link against the xc library which seems to be renamed to xenctrl). I also added a README file in tools/debugger/gdb which describes how to get GDB working for debugging Xen domains (based on a mail by Tim Newsham). // Simon --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gdb-xen.patch" diff -r cd6f1a4e9a39 tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure --- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure Sun Sep 4 23:51:39 2005 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure Mon Sep 5 14:08:32 2005 @@ -3475,7 +3475,7 @@ GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc" +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxenctrl" diff -r cd6f1a4e9a39 tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in --- a/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in Sun Sep 4 23:51:39 2005 +++ b/tools/debugger/gdb/gdb-6.2.1-xen-sparse/gdb/gdbserver/configure.in Mon Sep 5 14:08:32 2005 @@ -107,7 +107,7 @@ GDBSERVER_DEPFILES="$srv_regobj $srv_tgtobj $srv_thread_depfiles" -GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxc" +GDBSERVER_LIBS="$srv_libs -L../../../../../libxc/ -lxenctrl" AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) diff -r cd6f1a4e9a39 tools/debugger/gdb/README --- /dev/null Sun Sep 4 23:51:39 2005 +++ b/tools/debugger/gdb/README Mon Sep 5 14:08:32 2005 @@ -0,0 +1,41 @@ +1. Build Xen with domu_debug enabled, to do this build Xen with + + $ make verbose=y domu_debug=y debug=y world + +2. Enter tools/debugger/gdb and run ./gdbbuild to compile GDB and the + GDB server + +3. Install the gdbserver and gdb (as root): + + $ cp gdb-6.2.1-linux-i386-xen/gdb/gdbserver/gdbserver-xen /usr/local/bin/ + $ cp gdb-6.2.1-linux-i386-xen/gdb/gdb /usr/local/bin/gdb-xen + + +The rest of this file assumes that you debug the mini-OS in +extras/mini-os (build it by running make first) + +4. Create a new domain (paused in this case) + + $ xm create -p domain_config + +5. Start gdbserver with the domain id (use xm list to get the id) + + $ gdbserver-xen localhost:9999 --attach DOMAIN_ID & + +6. Start gdb-xen with the OS binary and attach to the gdbserver + + $ gdb-xen mini-os.elf + + GNU gdb 6.2.1 + ... + (gdb) target remote localhost:9999 + Remote debugging using localhost:9999 + Remote debugging from host 127.0.0.1 + _start () at x86_32.S:12 + ... + + +This document is written by Simon Kagstrom and is based +the following mail by Tim Newsham to the xen-devel mailing list: + +http://lists.xensource.com/archives/html/xen-devel/2005-08/msg00981.html --3lcZGd9BuhuYXNfi Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --3lcZGd9BuhuYXNfi--