From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8062 invoked by alias); 10 Jun 2004 19:39:23 -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 8055 invoked from network); 10 Jun 2004 19:39:22 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 10 Jun 2004 19:39:23 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1BYVOS-00006q-Bq; Thu, 10 Jun 2004 15:39:20 -0400 Date: Thu, 10 Jun 2004 19:39:00 -0000 From: Daniel Jacobowitz To: Peter Jay Salzman Cc: Gdb Mailing List Subject: Re: gdb segfaults when printing long double complex variables Message-ID: <20040610193919.GA32564@nevyn.them.org> Mail-Followup-To: Peter Jay Salzman , Gdb Mailing List References: <20040610192828.GA13125@dirac.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040610192828.GA13125@dirac.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-06/txt/msg00105.txt.bz2 On Thu, Jun 10, 2004 at 12:28:29PM -0700, Peter Jay Salzman wrote: > Bug: GDB segfaults when printing long double complex variables. > > Sample Code: > > 1 #include > 2 #include > 3 > 4 int main(void) > 5 { > 6 complex a; > 7 double complex b; > 8 long double complex c; > 9 > 10 a = 5 + 2I; > 11 printf("%f + %fi\n", __real__ a, __imag__ a); > 12 > 13 b = 5.0 + 2.0I; > 14 printf("%f + %fi\n", __real__ b, __imag__ b); > 15 > 16 c = 5.0L + 2.0LI; > 17 printf("%Lf + %Lfi\n", __real__ c, __imag__ c); > 18 > 19 return 0; > 20 } GDB doesn't really support complex long double. The entire type infrastructure for complex types is hokey and special-cases based on the size of the type; it expects 128-bit long double rather than x86's 96-bit. Look in dwarf2read.c for the code setting TYPE_TARGET_TYPE if you want to work around it. -- Daniel Jacobowitz