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

> On 11/5/06, Neo Jia <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]:/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



_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel

Reply via email to