From: Martin Lucina Date: Thu, 8 Jan 2015 11:25:39 +0000 (+0100) Subject: Add -D option to attach gdbsx to domU X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=51d8515578ea0c88cc8fc1a057903675cf1fc16c;p=rumpuser-xen.git Add -D option to attach gdbsx to domU Signed-off-by: Martin Lucina --- diff --git a/app-tools/rumprun b/app-tools/rumprun index b15b4d0..3579a30 100755 --- a/app-tools/rumprun +++ b/app-tools/rumprun @@ -35,7 +35,7 @@ err() { usage() { cat </dev/null 2>&1; then + err "'gdbsx' is required for -D, please install it." + fi + opt_debug=${OPTARG} + opt_pause=1 + ;; *) usage ;; @@ -226,6 +236,15 @@ EOM xenstore-write ${prefix}/${line} done rm ${xenstore} + # Attach debugger if requested. + if [ -n "$opt_debug" ]; then + if objdump -f ${app} | grep -q elf64; then + bits=64 + else + bits=32 + fi + gdbsx -a ${domid} ${bits} ${opt_debug} & + fi # Go go go! [ -z "$opt_pause" ] && xl unpause ${domid} if [ -n "$opt_interactive" ]; then