2002-02-05 Daniel Jacobowitz <drow@mvista.com>
authorDaniel Jacobowitz <drow@false.org>
Tue, 5 Feb 2002 21:41:29 +0000 (21:41 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 5 Feb 2002 21:41:29 +0000 (21:41 +0000)
        * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX.

gdb/ChangeLog
gdb/c-valprint.c

index ebe288654559aa5298b67ffd69cb93189194861f..efae7374a1c07ad28a059337b5f52657c6bc0863 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-05  Daniel Jacobowitz  <drow@mvista.com>
+
+        * c-valprint.c (c_val_print): Handle TYPE_CODE_COMPLEX.
+
 2002-02-05  Daniel Jacobowitz  <drow@mvista.com>
 
        * gdbserver/linux-low.c: Remove unused include files.
index c094a17ad886c19739edb20cd3198fd77a241a54..9361067ceaac55e93e7e59a61d5f237a1b846933 100644 (file)
@@ -463,6 +463,28 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
       fprintf_filtered (stream, "<incomplete type>");
       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));
     }