All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Yaodong Yang <yaodong.yangy@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] GDB debugging of QEMU.
Date: Fri, 9 Aug 2013 18:14:09 +0100	[thread overview]
Message-ID: <CAFEAcA_8jETHnJqoQdsd9NPCAgMgA8cdTq+Ve8sE9dvMgOMsXQ@mail.gmail.com> (raw)
In-Reply-To: <44F64AFA-B961-41D8-A669-90EC61894689@gmail.com>

On 9 August 2013 18:11, Yaodong Yang <yaodong.yangy@gmail.com> wrote:
> I think I did not make my question clear. I do not know
> 1. how to add "-g" flag when compile QEMU, in order to use gdb

This is what passing --enable-debug to configure does.

> 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.)

-- PMM

  reply	other threads:[~2013-08-09 17:14 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 [this message]
2013-08-09 17:25       ` Max Filippov
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=CAFEAcA_8jETHnJqoQdsd9NPCAgMgA8cdTq+Ve8sE9dvMgOMsXQ@mail.gmail.com \
    --to=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.