From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7qRX-0006su-P0 for qemu-devel@nongnu.org; Fri, 09 Aug 2013 13:25:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7qRT-0006Y1-Rw for qemu-devel@nongnu.org; Fri, 09 Aug 2013 13:25:39 -0400 Received: from mail-oa0-x235.google.com ([2607:f8b0:4003:c02::235]:48838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7qRT-0006Xl-DL for qemu-devel@nongnu.org; Fri, 09 Aug 2013 13:25:35 -0400 Received: by mail-oa0-f53.google.com with SMTP id k18so2478364oag.40 for ; Fri, 09 Aug 2013 10:25:34 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <44F64AFA-B961-41D8-A669-90EC61894689@gmail.com> Date: Fri, 9 Aug 2013 21:25:34 +0400 Message-ID: From: Max Filippov Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] GDB debugging of QEMU. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Yaodong Yang , qemu-devel@nongnu.org On Fri, Aug 9, 2013 at 9:14 PM, Peter Maydell wrote: > On 9 August 2013 18:11, Yaodong Yang wrote: >> 2. how to invoke QEMU with gdb, >> because my previous attempt failed. "gdb sudo >> /usr/local/kvm/bin/qemu-system/x86_64 -s -enable-kvm -hda" > > This won't work because you're running gdb as your own > user and attempting to debug a program running as root. > 'sudo gdb qemu-system-x86_64 ...' will probably work. > > (Also, you almost certainly want to run gdb on the binary > that you just built rather than on the binary in > /usr/local/kvm/bin which is presumably whatever older > version was last installed.) You also need --args when you pass arguments to the application being debugged, so the command line looks like sudo gdb --args /usr/local/kvm/bin/qemu-system/x86_64 -s -enable-kvm -hda -- Thanks. -- Max