[gdb/testsuite] Accept new complex print style in mixed-lang-stack.exp
[deliverable/binutils-gdb.git] / gdb / value.c
index 781808016cde43778c4446b1ae4f0ff02f17b20d..f722c272d8b0a8dc6ea27d6ead7e5bf12dc999a2 100644 (file)
@@ -1,6 +1,6 @@
 /* Low level packing and unpacking of values for GDB, the GNU Debugger.
 
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -3962,7 +3962,7 @@ creal_internal_fn (struct gdbarch *gdbarch,
   type *ctype = check_typedef (value_type (cval));
   if (TYPE_CODE (ctype) != TYPE_CODE_COMPLEX)
     error (_("expected a complex number"));
-  return value_from_component (cval, TYPE_TARGET_TYPE (ctype), 0);
+  return value_real_part (cval);
 }
 
 /* Implementation of the convenience function $_cimag.  Extracts the
@@ -3981,8 +3981,7 @@ cimag_internal_fn (struct gdbarch *gdbarch,
   type *ctype = check_typedef (value_type (cval));
   if (TYPE_CODE (ctype) != TYPE_CODE_COMPLEX)
     error (_("expected a complex number"));
-  return value_from_component (cval, TYPE_TARGET_TYPE (ctype),
-                              TYPE_LENGTH (TYPE_TARGET_TYPE (ctype)));
+  return value_imaginary_part (cval);
 }
 
 #if GDB_SELF_TEST
@@ -4127,8 +4126,9 @@ test_insert_into_bit_range_vector ()
 } /* namespace selftests */
 #endif /* GDB_SELF_TEST */
 
+void _initialize_values ();
 void
-_initialize_values (void)
+_initialize_values ()
 {
   add_cmd ("convenience", no_class, show_convenience, _("\
 Debugger convenience (\"$foo\") variables and functions.\n\
This page took 0.024315 seconds and 4 git commands to generate.