home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / gnu / gdb / bug / 1360 < prev    next >
Encoding:
Text File  |  1993-01-10  |  5.0 KB  |  228 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cse.ucsc.EDU!dlong
  3. From: dlong@cse.ucsc.EDU (Dean R. E. Long)
  4. Subject: gdb-4.7 patches
  5. Message-ID: <199301100951.AA22739@oak.ucsc.edu>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Sat, 9 Jan 1993 17:51:05 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 215
  12.  
  13. These patches fix a number of demangling bugs related to templates.
  14.  
  15. dl
  16.  
  17. -------------
  18. *** gdb/symtab.c.orig    Fri Oct  9 09:44:31 1992
  19. --- gdb/symtab.c    Fri Jan  8 22:48:48 1993
  20. ***************
  21. *** 2490,2501 ****
  22.     int newsize;
  23.     int i;
  24.   
  25. -   /* clip symbols that cannot match */
  26. -   if (!cplus_match (symname, text, text_len)) {
  27. -     return;
  28. -   }
  29.     /* matches mangled, may match unmangled.  now clip any symbol names
  30.        that we've already considered.  (This is a time optimization)  */
  31.   
  32. --- 2490,2495 ----
  33. ***************
  34. *** 2516,2521 ****
  35. --- 2510,2521 ----
  36.   
  37.         symname = demangled;
  38.       } else {
  39. +       /* clip symbols that cannot match */
  40. +       if (!cplus_match (symname, text, text_len)) {
  41. +     return;
  42. +       }
  43.         symname = savestring (symname, strlen (symname));
  44.       }
  45.   
  46. *** libiberty/cplus-dem.c.orig    Mon Oct  5 17:42:45 1992
  47. --- libiberty/cplus-dem.c    Sun Jan 10 01:42:17 1993
  48. ***************
  49. *** 276,285 ****
  50.   static void
  51.   forget_types PARAMS ((struct work_stuff *));
  52.   
  53. - #if 0
  54.   static void
  55.   string_prepends PARAMS ((string *, string *));
  56. - #endif
  57.   
  58.   /*  Translate count to integer, consuming tokens in the process.
  59.       Conversion terminates on the first non-digit character. */
  60. --- 276,283 ----
  61. ***************
  62. *** 669,675 ****
  63.       }
  64.     string_appendn (&tname, *mangled, r);
  65.     string_appendn (&trawname, *mangled, r);
  66. -   string_appendn (&trawname, "", 1);
  67.     *mangled += r;
  68.     string_append (&tname, "<");
  69.     /* get size of template parameter list */
  70. --- 667,672 ----
  71. ***************
  72. *** 688,697 ****
  73.       {
  74.         (*mangled)++;
  75.         success = do_type (work, mangled, &temp);
  76. -       string_appendn (&temp, "", 1);
  77.         if (success)
  78.           {
  79. !           string_append (&tname, temp.b);
  80.           }
  81.         string_delete(&temp);
  82.         if (!success)
  83. --- 685,693 ----
  84.       {
  85.         (*mangled)++;
  86.         success = do_type (work, mangled, &temp);
  87.         if (success)
  88.           {
  89. !           string_appends (&tname, temp);
  90.           }
  91.         string_delete(&temp);
  92.         if (!success)
  93. ***************
  94. *** 708,717 ****
  95.         is_integral = 0;
  96.         done = 0;
  97.         success = do_type (work, mangled, &temp);
  98. -       string_appendn (&temp, "", 1);
  99.         if (success)
  100.           {
  101. !           string_append (&tname, temp.b);
  102.           }
  103.         string_delete(&temp);
  104.         if (!success)
  105. --- 704,712 ----
  106.         is_integral = 0;
  107.         done = 0;
  108.         success = do_type (work, mangled, &temp);
  109.         if (success)
  110.           {
  111. !           string_appends (&tname, temp);
  112.           }
  113.         string_delete(&temp);
  114.         if (!success)
  115. ***************
  116. *** 825,832 ****
  117.       }
  118.     if (work -> constructor || work -> destructor)
  119.       {
  120. !       string_append (&tname, trawname.b);
  121.       }
  122.     string_delete(&trawname);
  123.     
  124.     if (!success)
  125. --- 820,833 ----
  126.       }
  127.     if (work -> constructor || work -> destructor)
  128.       {
  129. !       string_appends (&tname, trawname);
  130.       }
  131. +   {
  132. +     char buf[16];
  133. +     sprintf(buf, "%d", trawname.p - trawname.b);
  134. +     string_prepend(&trawname, buf);
  135. +     remember_type(work, trawname.b, trawname.p - trawname.b);
  136. +   }
  137.     string_delete(&trawname);
  138.     
  139.     if (!success)
  140. ***************
  141. *** 835,841 ****
  142.       }
  143.     else
  144.       {
  145. !       string_prepend (declp, tname.b);
  146.         string_delete (&tname);
  147.         
  148.         if (work -> static_type)
  149. --- 836,842 ----
  150.       }
  151.     else
  152.       {
  153. !       string_prepends (declp, tname);
  154.         string_delete (&tname);
  155.         
  156.         if (work -> static_type)
  157. ***************
  158. *** 842,853 ****
  159.       {
  160.         string_append (declp, *mangled + 1);
  161.         *mangled += strlen (*mangled);
  162. -       success = 1;
  163.       }
  164. !       else
  165. !     {
  166. !       success = demangle_args (work, mangled, declp);
  167. !     }
  168.       }
  169.     return (success);
  170.   }
  171. --- 843,850 ----
  172.       {
  173.         string_append (declp, *mangled + 1);
  174.         *mangled += strlen (*mangled);
  175.       }
  176. !       success = 1;
  177.       }
  178.     return (success);
  179.   }
  180. ***************
  181. *** 993,1001 ****
  182.         success = 0;
  183.       }
  184.       }
  185. !   else if ((scan == *mangled) && (isdigit (scan[2]) || (scan[2] == 'Q')))
  186.       {
  187. !       /* A GNU style constructor starts with "__<digit>" or "__Q". */
  188.         work -> constructor = 1;
  189.         *mangled = scan + 2;
  190.       }
  191. --- 990,998 ----
  192.         success = 0;
  193.       }
  194.       }
  195. !   else if ((scan == *mangled) && (isdigit (scan[2]) || (scan[2] == 't')))
  196.       {
  197. !       /* A GNU style constructor starts with "__<digit>" or "__t". */
  198.         work -> constructor = 1;
  199.         *mangled = scan + 2;
  200.       }
  201. ***************
  202. *** 2164,2171 ****
  203.       }
  204.   }
  205.   
  206. - #if 0
  207.   static void
  208.   string_prepends (p, s)
  209.        string *p, *s;
  210. --- 2161,2166 ----
  211. ***************
  212. *** 2175,2182 ****
  213.         string_prependn (p, s->b, s->p - s->b);
  214.       }
  215.   }
  216. - #endif
  217.   
  218.   static void
  219.   string_prependn (p, s, n)
  220. --- 2170,2175 ----
  221.  
  222.