All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yaodong Yang <yaodong.yangy@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 12:11:13 -0500	[thread overview]
Message-ID: <44F64AFA-B961-41D8-A669-90EC61894689@gmail.com> (raw)
In-Reply-To: <CAFEAcA_Zu6PxwKDWB07Ah75vhdfywTEbZUqGhpcTjVhrOZvRFQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

Hello Peter,


Best,
Yaodong
----------------------------------------------
Yaodong Yang
Ph.D. Student
Department of Computer Science & Engineering
University of Nebraska-Lincoln 
Email: yaodong.yangy@gmail.com OR yyang@cse.unl.edu




On Aug 9, 2013, at 11:56 AM, Peter Maydell <peter.maydell@linaro.org> wrote:

> On 9 August 2013 17:45, Yaodong Yang <yaodong.yangy@gmail.com> wrote:
>> I tried the following commands.
>> 
>> ./configure --enable-debug --disable-werror --enable-kvm
>> --prefix=/usr/local/kvm
> 
> --disable-werror is usually not a good idea for developers.
I see, I will get rid of it in my development.
> 
>> make -j4
>> 
>> sudo make install
>> 
>> gdb sudo /usr/local/kvm/bin/qemu-system/x86_64 -s -enable-kvm -hda
>> ubuntu.img -m 1024.
> 
> Why are you running qemu as root here? (ie why 'sudo'?)
In my implementation, I need to read and write to other raw disks, so I think I need the root permission to run this program. 
> 
>> Could someone give me some guidance on how to use gdb in QEMU.
>> I know the basic usage of gdb for simple .c file, but I really
>> do not know how to use it in QEMU.
> 
> There is no particular difference. QEMU is a bigger program
> but has no particular gotchas for being debugged.

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 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"

by the way, when I add storagemanager.c and storagemanager.h to the root directory, in order to compile and link them, I add storagemanger.o in Makefile.objs, as "block-obj-y += nbd.o  block.o  storagemanager.o" in line 10. 

Thanks a lot!
> 
> -- PMM


[-- Attachment #2: Type: text/html, Size: 5110 bytes --]

  reply	other threads:[~2013-08-09 17:11 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 [this message]
2013-08-09 17:14     ` Peter Maydell
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=44F64AFA-B961-41D8-A669-90EC61894689@gmail.com \
    --to=yaodong.yangy@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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.