aboutsummaryrefslogtreecommitdiff
path: root/gdb/gcc.patch
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>1992-07-10 03:56:17 +0000
committerPer Bothner <per@bothner.com>1992-07-10 03:56:17 +0000
commit5c5b5d4b0e4dd49699a6a88dd58f5816f6c14386 (patch)
tree8b4244fd5d9e6a60472936dc118968d593dcbf70 /gdb/gcc.patch
parent7eec00ed5623bc3231f18d8953cedc22dbd91246 (diff)
downloadgdb-5c5b5d4b0e4dd49699a6a88dd58f5816f6c14386.zip
gdb-5c5b5d4b0e4dd49699a6a88dd58f5816f6c14386.tar.gz
gdb-5c5b5d4b0e4dd49699a6a88dd58f5816f6c14386.tar.bz2
Various fixes to improve C++ debugging. See ChangeLog.
Diffstat (limited to 'gdb/gcc.patch')
-rw-r--r--gdb/gcc.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/gdb/gcc.patch b/gdb/gcc.patch
new file mode 100644
index 0000000..1317d1b
--- /dev/null
+++ b/gdb/gcc.patch
@@ -0,0 +1,63 @@
+Recent versions of gcc have had a bug in how they emit debugging
+information for C++ methods (when using dbx-style stabs).
+This patch should fix the problem. Fix you can't fix gcc,
+you can alternatively define GCC_MANGLE_BUG when compling gdb/symtab.c.
+
+===================================================================
+RCS file: /rel/cvsfiles/devo/gcc/dbxout.c,v
+retrieving revision 1.53
+diff -c -r1.53 dbxout.c
+*** 1.53 1992/07/05 09:50:22
+--- dbxout.c 1992/07/09 07:00:33
+***************
+*** 683,688 ****
+--- 683,689 ----
+ tree type_encoding;
+ register tree fndecl;
+ register tree last;
++ char formatted_type_identifier_length[16];
+ register int type_identifier_length;
+
+ if (methods == NULL_TREE)
+***************
+*** 711,716 ****
+--- 712,719 ----
+
+ type_identifier_length = IDENTIFIER_LENGTH (type_encoding);
+
++ sprintf(formatted_type_identifier_length, "%d", type_identifier_length);
++
+ if (TREE_CODE (methods) == FUNCTION_DECL)
+ fndecl = methods;
+ else if (TREE_VEC_ELT (methods, 0) != NULL_TREE)
+***************
+*** 754,762 ****
+--- 757,769 ----
+ if (debug_name[0] == '_' && debug_name[1] == '_')
+ {
+ char *method_name = debug_name + 2;
++ char *length_ptr = formatted_type_identifier_length;
+ /* Get past const and volatile qualifiers. */
+ while (*method_name == 'C' || *method_name == 'V')
+ method_name++;
++ /* Skip digits for length of type_encoding. */
++ while (*method_name == *length_ptr && *length_ptr)
++ length_ptr++, method_name++;
+ if (! strncmp (method_name,
+ IDENTIFIER_POINTER (type_encoding),
+ type_identifier_length))
+***************
+*** 768,775 ****
+--- 775,786 ----
+ else if (debug_name[0] == '_' && debug_name[1] == '_')
+ {
+ char *ctor_name = debug_name + 2;
++ char *length_ptr = formatted_type_identifier_length;
+ while (*ctor_name == 'C' || *ctor_name == 'V')
+ ctor_name++;
++ /* Skip digits for length of type_encoding. */
++ while (*ctor_name == *length_ptr && *length_ptr)
++ length_ptr++, ctor_name++;
+ if (!strncmp (IDENTIFIER_POINTER (type_encoding), ctor_name,
+ type_identifier_length))
+ debug_name = ctor_name + type_identifier_length;