delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/24/00:43:36

Date: Tue, 24 Sep 2002 06:39:16 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Dr. Pablo A. Perez-Fernandez" <pperez10 AT nyc DOT rr DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: problems with GDB examining long double variables in C
In-Reply-To: <Guvj9.8474$R8.2779572@twister.nyc.rr.com>
Message-ID: <Pine.SUN.3.91.1020924063609.18101B@is>
MIME-Version: 1.0
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

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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019