From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16246 invoked by alias); 31 Jan 2002 04:31:38 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16146 invoked from network); 31 Jan 2002 04:31:35 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 31 Jan 2002 04:31:35 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16W8sx-0005aF-00 for ; Wed, 30 Jan 2002 23:31:43 -0500 Date: Wed, 30 Jan 2002 20:31:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: RFA: complex numbers in c-valprint.c Message-ID: <20020130233143.A21333@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.23i X-SW-Source: 2002-01/txt/msg00798.txt.bz2 This patch fixes half of gdb/320. The other half is a bug in GCC 3.x, that I just CC'd gdb@ about. Is this OK to commit? Does anyone have a preference for {0, 0} vs. { re = 0, im = 0}? I used the former. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer 2002-01-30 Daniel Jacobowitz * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. Index: c-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/c-valprint.c,v retrieving revision 1.11 diff -u -r1.11 c-valprint.c --- c-valprint.c 2001/11/10 20:44:37 1.11 +++ c-valprint.c 2002/01/31 04:26:09 @@ -459,6 +459,29 @@ fprintf_filtered (stream, ""); break; + case TYPE_CODE_COMPLEX: + fprintf_filtered (stream, "{"); + if (format) + print_scalar_formatted (valaddr + embedded_offset, + TYPE_TARGET_TYPE (type), + format, 0, stream); + else + print_floating (valaddr + embedded_offset, TYPE_TARGET_TYPE (type), + stream); + fprintf_filtered (stream, ", "); + if (format) + print_scalar_formatted (valaddr + embedded_offset + + TYPE_LENGTH (TYPE_TARGET_TYPE (type)), + TYPE_TARGET_TYPE (type), + format, 0, stream); + else + print_floating (valaddr + embedded_offset + + TYPE_LENGTH (TYPE_TARGET_TYPE (type)), + TYPE_TARGET_TYPE (type), + stream); + fprintf_filtered (stream, "}"); + break; + default: error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type)); }