aboutsummaryrefslogtreecommitdiff
path: root/gdb/gcc.patch
blob: 1317d1baf6a650fb5c56dbf63c3328ff10170a1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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;