From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GhhNh-00070G-Fm for qemu-devel@nongnu.org; Wed, 08 Nov 2006 01:57:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GhhNe-0006x9-EN for qemu-devel@nongnu.org; Wed, 08 Nov 2006 01:57:52 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GhhNe-0006x0-5j for qemu-devel@nongnu.org; Wed, 08 Nov 2006 01:57:50 -0500 Received: from [211.5.2.77] (helo=nm01omta019.dion.ne.jp) by monty-python.gnu.org with smtp (Exim 4.52) id 1GhhNd-0006t1-VJ for qemu-devel@nongnu.org; Wed, 08 Nov 2006 01:57:50 -0500 Message-ID: <000401c70303$391bb1d0$0464a8c0@athlon> From: "Kazu" References: <5d649bdb0611050034q18189a47n8a62827b4397b630@mail.gmail.com> Subject: Re: [Qemu-devel] Compilation error from CVS while turning offoptimization Date: Wed, 8 Nov 2006 15:57:57 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Sent: Tuesday, November 07, 2006 7:27 PM Lauro Moura wrote: > On 11/5/06, Neo Jia 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