+2020-04-01 Tom Tromey <tom@tromey.com>
+
+ * c-valprint.c (c_decorations): Change complex suffix to "i".
+
2020-04-01 Tom Tromey <tom@tromey.com>
* valprint.c (generic_value_print_complex): Use accessors.
{
"",
" + ",
- " * I",
+ "i",
"true",
"false",
"void",
+2020-04-01 Tom Tromey <tom@tromey.com>
+
+ * gdb.compile/compile.exp: Update.
+ * gdb.compile/compile-cplus.exp: Update.
+ * gdb.base/varargs.exp: Update.
+ * gdb.base/floatn.exp: Update.
+ * gdb.base/endianity.exp: Update.
+ * gdb.base/callfuncs.exp (do_function_calls): Update.
+ * gdb.base/funcargs.exp (complex_args, complex_integral_args)
+ (complex_float_integral_args): Update.
+ * gdb.base/complex.exp: Update.
+ * gdb.base/complex-parts.exp: Update.
+
2020-04-01 Tom Tromey <tromey@adacore.com>
* gdb.rust/union.rs: New file.
if [support_complex_tests] {
- gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3 \\* I" \
+ gdb_test "p t_structs_fc(struct_val1)" ".*= 3 \\+ 3i" \
"call inferior func with struct - returns float _Complex"
- gdb_test "p t_structs_dc(struct_val1)" ".*= 4 \\+ 4 \\* I" \
+ gdb_test "p t_structs_dc(struct_val1)" ".*= 4 \\+ 4i" \
"call inferior func with struct - returns double _Complex"
- gdb_test "p t_structs_ldc(struct_val1)" "= 5 \\+ 5 \\* I" \
+ gdb_test "p t_structs_ldc(struct_val1)" "= 5 \\+ 5i" \
"call inferior func with struct - returns long double _Complex"
}
gdb_breakpoint [gdb_get_line_number "Break Here"]
gdb_continue_to_breakpoint "breakpt" ".* Break Here\\. .*"
-gdb_test "p z1" " = 1.5 \\+ 4.5 \\* I"
-gdb_test "p z2" " = 2.5 \\+ -5.5 \\* I"
-gdb_test "p z3" " = 3.5 \\+ 6.5 \\* I"
+gdb_test "p z1" " = 1.5 \\+ 4.5i"
+gdb_test "p z2" " = 2.5 \\+ -5.5i"
+gdb_test "p z3" " = 3.5 \\+ 6.5i"
gdb_test "ptype z1" " = complex double"
gdb_test "ptype z2" " = complex float"
if { [test_compiler_info gcc-2-*] && [test_debug_format "DWARF 2"] } then {
setup_xfail "*-*-*"
}
- gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0 \\* I\}" \
+ gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex packed value in C"
}
if [runto f4] then {
- gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0 \\* I\}" \
+ gdb_test "p *y" "\\\$\[0-9\]* = \{c = 42 '\\*', f = 1 \\+ 0i\}" \
"print complex value in C"
}
return -1
}
-gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25 \\* I, d = 75}" \
+gdb_test "print o" "= {v = 3, w = 2, x = 7, f = 23.5, cplx = 1.25 \\+ 7.25i, d = 75}" \
"print o before assignment"
gdb_test "print o.v = 4" "= 4"
gdb_test "x/x &o.v" "0x04000000"
gdb_test "x/xh &o.w" "0x0300"
-gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25 \\* I, d = -23.125}" \
+gdb_test "print o" "= {v = 4, w = 3, x = 2, f = 1.5, cplx = 1.25 \\+ 7.25i, d = -23.125}" \
"print o after assignment"
gdb_test "print f64x" ".* = 200\\.25.*" "the value of f64x is changed to 200.25"
# Print the original values of c32, c64, c128, c32x, c64x.
-gdb_test "print c32" ".* = 1\\.5 \\+ 1 \\* I.*" "the original value of c32 is 1.5 + 1 * I"
-gdb_test "print c64" ".* = 2\\.25 \\+ 1 \\* I.*" "the original value of c64 is 2.25 + 1 * I"
-gdb_test "print c128" ".* = 3\\.375 \\+ 1 \\* I.*" "the original value of c128 is 3.375 + 1 * I"
-gdb_test "print c32x" ".* = 10\\.5 \\+ 1 \\* I.*" "the original value of c32x is 10.5 + 1 * I"
-gdb_test "print c64x" ".* = 20\\.25 \\+ 1 \\* I.*" "the original value of c64x is 20.25 + 1 * I"
-
-# FIXME: GDB cannot parse non-trivial complex constants yet.
-
+gdb_test "print c32" ".* = 1\\.5 \\+ 1i.*" "the original value of c32 is 1.5 + 1i"
+gdb_test "print c64" ".* = 2\\.25 \\+ 1i.*" "the original value of c64 is 2.25 + 1i"
+gdb_test "print c128" ".* = 3\\.375 \\+ 1i.*" "the original value of c128 is 3.375 + 1i"
+gdb_test "print c32x" ".* = 10\\.5 \\+ 1i.*" "the original value of c32x is 10.5 + 1i"
+gdb_test "print c64x" ".* = 20\\.25 \\+ 1i.*" "the original value of c64x is 20.25 + 1i"
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_test "" " callca \\(f1=1 \\+ 2 \\* I, f2=1 \\+ 2 \\* I, f3=1 \\+ 2 \\* I\\) .*" "run to call2a"
+ gdb_test "" " callca \\(f1=1 \\+ 2i, f2=1 \\+ 2i, f3=1 \\+ 2i\\) .*" "run to call2a"
- gdb_test "cont" ".* callcb \\(d1=3 \\+ 4 \\* I, d2=3 \\+ 4 \\* I, d3=3 \\+ 4 \\* I\\) .*" "continue to callcb"
- gdb_test "cont" ".* callcc \\(ld1=5 \\+ 6 \\* I, ld2=5 \\+ 6 \\* I, ld3=5 \\+ 6 \\* I\\) .*" "continue to callcc"
- gdb_test "cont" ".* callcd \\(fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "continue to callcd"
- gdb_test "cont" ".* callce \\(dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I, fc1=1 \\+ 2 \\* I\\) .*" "continue to callce"
- gdb_test "cont" ".* callcf \\(ldc1=5 \\+ 6 \\* I, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I\\) .*" "continue to callcf"
+ gdb_test "cont" ".* callcb \\(d1=3 \\+ 4i, d2=3 \\+ 4i, d3=3 \\+ 4i\\) .*" "continue to callcb"
+ gdb_test "cont" ".* callcc \\(ld1=5 \\+ 6i, ld2=5 \\+ 6i, ld3=5 \\+ 6i\\) .*" "continue to callcc"
+ gdb_test "cont" ".* callcd \\(fc1=1 \\+ 2i, dc1=3 \\+ 4i, ldc1=5 \\+ 6i\\) .*" "continue to callcd"
+ gdb_test "cont" ".* callce \\(dc1=3 \\+ 4i, ldc1=5 \\+ 6i, fc1=1 \\+ 2i\\) .*" "continue to callce"
+ gdb_test "cont" ".* callcf \\(ldc1=5 \\+ 6i, fc1=1 \\+ 2i, dc1=3 \\+ 4i\\) .*" "continue to callcf"
}
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_test "" " callc1a \\(c=97 'a', s=1, i=2, ui=7, l=3, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "run to callc1a"
+ gdb_test "" " callc1a \\(c=97 'a', s=1, i=2, ui=7, l=3, fc1=1 \\+ 2i, dc1=3 \\+ 4i, ldc1=5 \\+ 6i\\) .*" "run to callc1a"
- gdb_test "cont" ".* callc1b \\(ldc1=5 \\+ 6 \\* I\\, c=97 'a', s=1, i=2, fc1=1 \\+ 2 \\* I, ui=7, l=3, dc1=3 \\+ 4 \\* I\\) .*" "continue to callc1b"
+ gdb_test "cont" ".* callc1b \\(ldc1=5 \\+ 6i\\, c=97 'a', s=1, i=2, fc1=1 \\+ 2i, ui=7, l=3, dc1=3 \\+ 4i\\) .*" "continue to callc1b"
}
#
# Run; should stop at call1a and print actual arguments.
gdb_run_cmd
- gdb_test "" " callc2a \\(c=97 'a', s=1, i=2, ui=7, l=3, f=4, d=5, fc1=1 \\+ 2 \\* I, dc1=3 \\+ 4 \\* I, ldc1=5 \\+ 6 \\* I\\) .*" "run to callc2a"
+ gdb_test "" " callc2a \\(c=97 'a', s=1, i=2, ui=7, l=3, f=4, d=5, fc1=1 \\+ 2i, dc1=3 \\+ 4i, ldc1=5 \\+ 6i\\) .*" "run to callc2a"
- gdb_test "cont" ".* callc2b \\(fc1=1 \\+ 2 \\* I, c=97 'a', s=1, i=2, ui=7, ldc1=5 \\+ 6 \\* I\\, l=3, f=4, d=5, dc1=3 \\+ 4 \\* I\\) .*" "continue to callc2b"
+ gdb_test "cont" ".* callc2b \\(fc1=1 \\+ 2i, c=97 'a', s=1, i=2, ui=7, ldc1=5 \\+ 6i\\, l=3, f=4, d=5, dc1=3 \\+ 4i\\) .*" "continue to callc2b"
}
#
global gdb_prompt
set test "print find_max_float_real(4, fc1, fc2, fc3, fc4)"
- gdb_test $test ".*= 4 \\+ 4 \\* I"
+ gdb_test $test ".*= 4 \\+ 4i"
set test "print find_max_double_real(4, dc1, dc2, dc3, dc4)"
- gdb_test $test ".*= 4 \\+ 4 \\* I"
+ gdb_test $test ".*= 4 \\+ 4i"
set test "print find_max_long_double_real(4, ldc1, ldc2, ldc3, ldc4)"
- gdb_test $test ".*= 4 \\+ 4 \\* I"
+ gdb_test $test ".*= 4 \\+ 4i"
}
" = \\{0, 0, 7, 0, 0\\}"
gdb_test_no_output "compile code struct_object.complexfield = 7 + 5i"
-gdb_test "print struct_object.complexfield" " = 7 \\+ 5 \\* I"
+gdb_test "print struct_object.complexfield" " = 7 \\+ 5i"
gdb_test_no_output "compile code struct_object.boolfield = 1"
gdb_test "print struct_object.boolfield" " = true"
" = \\{0, 0, 7, 0, 0\\}"
gdb_test_no_output "compile code struct_object.complexfield = 7 + 5i"
- gdb_test "print struct_object.complexfield" " = 7 \\+ 5 \\* I"
+ gdb_test "print struct_object.complexfield" " = 7 \\+ 5i"
gdb_test_no_output "compile code struct_object.boolfield = 1"
gdb_test "print struct_object.boolfield" " = true"