qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Compilation error from CVS while turning offoptimization
Date: Wed, 8 Nov 2006 15:57:57 +0900	[thread overview]
Message-ID: <000401c70303$391bb1d0$0464a8c0@athlon> (raw)
In-Reply-To: fad892760611070227h2ec66e2ej7df157945a16b895@mail.gmail.com

Sent: Tuesday, November 07, 2006 7:27 PM Lauro Moura wrote:


> On 11/5/06, Neo Jia <neojia@gmail.com> wrote:
>> hi,
>>
>> I am still trying to debug qemu with gdb so I would like to turn off the
>> optimization. But the build failed. I put the build output in this
>> attachment, please check. I really appreciate if you can share the way
you
>> used to debug qemu.
>>
>
> I didn't find any build error on that log, but the -O2 flag is still
> there. I believe it'd be useful if you post your build configuration
> or the changes you made.
>
> I'm trying to make it work with gdb too. Tried the guide on qemu-win
> site [1] but without success. GDB keeps showing "no symbols found".
>
> [1] http://www.h7.dion.ne.jp/~qemu-win/DebuggingTips-en.html
>

I don't know why "no symbols found".

This patch turns off optimization for current CVS and to disable
SIGUSR2 and AIO use SIGALRM. Because gdb can't ignore SIGUSR2 signal. It
also disable timer interrupt because it is not good for debugging.
After AIO is introduced, SIGALRM and SIGUSR2 are used on Linux host. They
have effect on gdb.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-linux.patch

On Windows host, these signal handling are not used so that debugging is
easier.
http://www.h7.dion.ne.jp/~qemu-win/download/qemu-20061108-debug-on-windows.patch

This is my debugging method on Linux host.

(1)Apply patch to current CVS and make.
$ cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu co qemu

$ cd qemu
qemu$ patch -p0 <../qemu-20061108-debug-on-linux.patch
qemu$ ./configure --target-list=i386-softmmu --cc=gcc32
qemu$ make

(2) Change directory to i386-softmmu and edit .gdbinit file.
qemu$ cd i386-softmmu
i386-softmmu$ vi .gdbinit

This  is .gdbinit file.
----------------------
file qemu
set args -L ../pc-bios -hda ../../linux.img
b main

define hook-stop
handle SIGALRM nopass
end

define hook-run
handle SIGALRM pass
end

defilen hook-continue
handle SIGALRM pass
end

run
-----------------

AIO used SIGALRM in the patch and set gdb ingore it.

(3) Start gdb.

i386-softmmu$ gdb

Then the program stops at main routine.

Regards,
Kazu

      reply	other threads:[~2006-11-08  6:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-05  8:34 [Qemu-devel] Compilation error from CVS while turning off optimization Neo Jia
2006-11-07 10:27 ` Lauro Moura
2006-11-08  6:57   ` Kazu [this message]

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='000401c70303$391bb1d0$0464a8c0@athlon' \
    --to=kazoo@r3.dion.ne.jp \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).