All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Yaodong Yang <yaodong.yangy@gmail.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] GDB debugging of QEMU.
Date: Fri, 9 Aug 2013 21:25:34 +0400	[thread overview]
Message-ID: <CAMo8BfLuHrbEs_1Jv8dDWA6T3cxpqFvFMHQrvwYChV56Fw+Wfg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_8jETHnJqoQdsd9NPCAgMgA8cdTq+Ve8sE9dvMgOMsXQ@mail.gmail.com>

On Fri, Aug 9, 2013 at 9:14 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 9 August 2013 18:11, Yaodong Yang <yaodong.yangy@gmail.com> 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

  reply	other threads:[~2013-08-09 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 16:45 [Qemu-devel] GDB debugging of QEMU Yaodong Yang
2013-08-09 16:56 ` Peter Maydell
2013-08-09 17:11   ` Yaodong Yang
2013-08-09 17:14     ` Peter Maydell
2013-08-09 17:25       ` Max Filippov [this message]
2013-08-09 18:45         ` Yaodong Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMo8BfLuHrbEs_1Jv8dDWA6T3cxpqFvFMHQrvwYChV56Fw+Wfg@mail.gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=yaodong.yangy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.