qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Compilation error from CVS while turning offoptimizatio


From: Kazu
Subject: Re: [Qemu-devel] Compilation error from CVS while turning offoptimization
Date: Wed, 8 Nov 2006 15:57:57 +0900

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


> On 11/5/06, Neo Jia <address@hidden> 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:address@hidden:/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 via email to

[Prev in Thread] Current Thread [Next in Thread]