aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@redhat.com>2002-12-13 01:24:52 +0000
committerJim Wilson <wilson@gcc.gnu.org>2002-12-12 17:24:52 -0800
commit24aacafbfc3bae66cb43bdfadaa3411cd9383ae4 (patch)
treeaa3334d83c30777077594e33900e57114100da1a /gcc
parent09da15320b1856ba010101ca5a1c2766d493c1b4 (diff)
downloadgcc-24aacafbfc3bae66cb43bdfadaa3411cd9383ae4.zip
gcc-24aacafbfc3bae66cb43bdfadaa3411cd9383ae4.tar.gz
gcc-24aacafbfc3bae66cb43bdfadaa3411cd9383ae4.tar.bz2
re PR debug/1621 (Debugging with complex numbers)
Fix for PR 1621. * dbxout.c (dbxout_fptype_value): New. (dbxout_type, case COMPLEX_TYPE): Call it. Use 'R' instead of 'r'. From-SVN: r60087
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/dbxout.c60
2 files changed, 63 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 36c3f94..bad7c43 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-12-12 Jim Wilson <wilson@redhat.com>
+
+ * dbxout.c (dbxout_fptype_value): New.
+ (dbxout_type, case COMPLEX_TYPE): Call it. Use 'R' instead of 'r'.
+
2002-12-12 Kazu Hirata <kazu@cs.umass.edu>
* c-decl.c: Fix a comment typo.
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index 932e076..60ca664 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -294,6 +294,7 @@ static void dbxout_finish PARAMS ((const char *));
static void dbxout_start_source_file PARAMS ((unsigned, const char *));
static void dbxout_end_source_file PARAMS ((unsigned));
static void dbxout_typedefs PARAMS ((tree));
+static void dbxout_fptype_value PARAMS ((tree));
static void dbxout_type_index PARAMS ((tree));
#if DBX_CONTIN_LENGTH > 0
static void dbxout_continue PARAMS ((void));
@@ -689,6 +690,61 @@ dbxout_finish (filename)
#endif /* DBX_OUTPUT_MAIN_SOURCE_FILE_END */
}
+/* Output floating point type values used by the 'R' stab letter.
+ These numbers come from include/aout/stab_gnu.h in binutils/gdb.
+
+ There are only 3 real/complex types defined, and we need 7/6.
+ We use NF_SINGLE as a generic float type, and NF_COMPLEX as a generic
+ complex type. Since we have the type size anyways, we don't really need
+ to distinguish between different FP types, we only need to distinguish
+ between float and complex. This works fine with gdb.
+
+ We only use this for complex types, to avoid breaking backwards
+ compatibility for real types. complex types aren't in ISO C90, so it is
+ OK if old debuggers don't understand the debug info we emit for them. */
+
+/* ??? These are supposed to be IEEE types, but we don't check for that.
+ We could perhaps add additional numbers for non-IEEE types if we need
+ them. */
+
+static void
+dbxout_fptype_value (type)
+ tree type;
+{
+ char value = '0';
+ enum machine_mode mode = TYPE_MODE (type);
+
+ if (TREE_CODE (type) == REAL_TYPE)
+ {
+ if (mode == SFmode)
+ value = '1';
+ else if (mode == DFmode)
+ value = '2';
+ else if (mode == TFmode || mode == XFmode)
+ value = '6';
+ else
+ /* Use NF_SINGLE as a generic real type for other sizes. */
+ value = '1';
+ }
+ else if (TREE_CODE (type) == COMPLEX_TYPE)
+ {
+ if (mode == SCmode)
+ value = '3';
+ else if (mode == DCmode)
+ value = '4';
+ else if (mode == TCmode || mode == XCmode)
+ value = '5';
+ else
+ /* Use NF_COMPLEX as a generic complex type for other sizes. */
+ value = '3';
+ }
+ else
+ abort ();
+
+ putc (value, asmfile);
+ CHARS (1);
+}
+
/* Output the index of a type. */
static void
@@ -1362,9 +1418,9 @@ dbxout_type (type, full)
if (TREE_CODE (TREE_TYPE (type)) == REAL_TYPE)
{
- fprintf (asmfile, "r");
+ putc ('R', asmfile);
CHARS (1);
- dbxout_type_index (type);
+ dbxout_fptype_value (type);
putc (';', asmfile);
CHARS (1);
print_wide_int (2 * int_size_in_bytes (TREE_TYPE (type)));