From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19319 invoked by alias); 26 Jul 2004 03:55:30 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19312 invoked from network); 26 Jul 2004 03:55:29 -0000 Received: from unknown (HELO aragorn.inter.net.il) (192.114.186.23) by sourceware.org with SMTP; 26 Jul 2004 03:55:29 -0000 Received: from zaretski (pns03-200-205.inter.net.il [80.230.200.205]) by aragorn.inter.net.il (MOS 3.4.6-GR) with ESMTP id DXO63472; Mon, 26 Jul 2004 06:55:14 +0300 (IDT) Date: Mon, 26 Jul 2004 05:47:00 -0000 From: "Eli Zaretskii" To: Baurjan Ismagulov Message-Id: <2914-Mon26Jul2004065339+0300-eliz@gnu.org> CC: gdb@sources.redhat.com In-reply-to: <20040725223832.GB8947@ata.cs.hun.edu.tr> (message from Baurjan Ismagulov on Mon, 26 Jul 2004 00:38:33 +0200) Subject: Re: bug disappears if compiled with -O0 Reply-to: Eli Zaretskii References: <20040725223832.GB8947@ata.cs.hun.edu.tr> X-SW-Source: 2004-07/txt/msg00316.txt.bz2 > Date: Mon, 26 Jul 2004 00:38:33 +0200 > From: Baurjan Ismagulov > > I'm trying to track down a problem in a dynamic library. However, the > bug doesn't show up if the code is compiled with -O0 (it is normally > compiled with -O2). Any pointers or tips on how to proceed (except > printf)? Just debug as usual, GDB can debug optimized code. In fact, I suggest to do that always, since if you debug a program compiled without optimizations, then ship a binary compiled with -O2, you in effect debugged and tested a similar, but quite different code.