This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA: complex numbers in c-valprint.c
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 30 Jan 2002 23:31:43 -0500
- Subject: RFA: complex numbers in c-valprint.c
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 <drow@mvista.com>
* 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, "<incomplete type>");
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));
}