ada_print_floating rewrites a floating-point string representation to
conform to Ada syntax. However, if you managed to get a floating
point error, you might see:
(gdb) print whatever
$2 = <invalid float valu.0e>
What's happening here is that ada_print_floating doesn't recognize
this error case, and proceeds to modify the error text.
This patch fixes this problem.
std::string s = tmp_stream.release ();
size_t skip_count = 0;
+ /* Don't try to modify a result representing an error. */
+ if (s[0] == '<')
+ {
+ fputs_filtered (s.c_str (), stream);
+ return;
+ }
+
/* Modify for Ada rules. */
size_t pos = s.find ("inf");
" = 5.0e\\+25"
gdb_test "print val_long_double" " = 5.0e\\+25" \
"print val_long_double after assignment"
+
+gdb_test "print 16llf#a56fa5b99019a5c800007ffff7ff4054#" \
+ " = <invalid float value>"