From fca9e6033a164bf34a58031cb59b276bf5412289 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Tue, 5 Feb 2002 21:41:29 +0000 Subject: [PATCH] 2002-02-05 Daniel Jacobowitz * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. --- gdb/ChangeLog | 4 ++++ gdb/c-valprint.c | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ebe28865455..efae7374a1c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2002-02-05 Daniel Jacobowitz + + * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX. + 2002-02-05 Daniel Jacobowitz * gdbserver/linux-low.c: Remove unused include files. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index c094a17ad88..9361067ceaa 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -463,6 +463,28 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset, fprintf_filtered (stream, ""); break; + case TYPE_CODE_COMPLEX: + 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, " * I"); + break; + default: error ("Invalid C/C++ type code %d in symbol table.", TYPE_CODE (type)); } -- 2.30.2