Date: Tue, 24 Sep 2002 06:39:16 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Dr. Pablo A. Perez-Fernandez" cc: djgpp AT delorie DOT com Subject: Re: problems with GDB examining long double variables in C In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 23 Sep 2002, Dr. Pablo A. Perez-Fernandez wrote: > Below follows a short transcript of a session. Note how the printf prints > the right value and "p EBIT" screws up in GDB. Any ideas as to why this is > happening. Most probably because you compiled the program with -g, which in GCC 3.1 gets you COFF debugging info IIRC. Try "ptype EBIT" and see what it prints. If it doesn't say "long double", that's your problem. The reason for the failure is that some debug info formats don't support the long double type. So GDB cannot format the variable's value correctly when you ask it to print it. Compiling with "-gstabs+" or with "-gdwarf-2 -g3" instead of "-g" should fix the problem.