aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2022-09-22 18:03:16 +0200
committerAldy Hernandez <aldyh@redhat.com>2022-09-23 10:52:20 +0200
commit76dbbfe62c0d7f4548cb12e757f67a1b1f84c3df (patch)
treef31cd16e1e6cd782e897ea643308e6304955d954 /gcc
parent0706262498bc5d206330c08414df0c780a0c3141 (diff)
downloadgcc-76dbbfe62c0d7f4548cb12e757f67a1b1f84c3df.zip
gcc-76dbbfe62c0d7f4548cb12e757f67a1b1f84c3df.tar.gz
gcc-76dbbfe62c0d7f4548cb12e757f67a1b1f84c3df.tar.bz2
Add debug functions for REAL_VALUE_TYPE.
We currently have no way of dumping REAL_VALUE_TYPEs when debugging. Tested on a gdb session examining the real value 10.0: (gdb) p min $9 = {cl = 1, decimal = 0, sign = 0, signalling = 0, canonical = 0, uexp = 4, sig = {0, 0, 11529215046068469760}} (gdb) p debug (min) 0x0.ap+4 gcc/ChangeLog: * real.cc (debug): New.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/real.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/real.cc b/gcc/real.cc
index 73bbac6..aae7c33 100644
--- a/gcc/real.cc
+++ b/gcc/real.cc
@@ -1900,6 +1900,14 @@ real_to_decimal (char *str, const REAL_VALUE_TYPE *r_orig, size_t buf_size,
digits, crop_trailing_zeros, VOIDmode);
}
+DEBUG_FUNCTION void
+debug (const REAL_VALUE_TYPE &r)
+{
+ char s[60];
+ real_to_hexadecimal (s, &r, sizeof (s), 0, 1);
+ fprintf (stderr, "%s\n", s);
+}
+
/* Render R as a hexadecimal floating point constant. Emit DIGITS
significant digits in the result, bounded by BUF_SIZE. If DIGITS is 0,
choose the maximum for the representation. If CROP_TRAILING_ZEROS,