gdb bugs/patches

Brad Roberts braddr at puremagic.com
Sun Aug 1 02:01:23 PDT 2010


Who was it that has the appropriate paperwork on file to get patches into gdb?

I've got a small diff that fixes a critical problem with it's demangler:

diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index 6db521b..f17431b 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -37,8 +37,9 @@ extract_identifiers (const char *mangled_str, struct obstack
*tempbuf)

   while (isdigit (*mangled_str))
     {
-      i = strtol (mangled_str, NULL, 10);
-      mangled_str++;
+      char * end_ptr;
+      i = strtol (mangled_str, &end_ptr, 10);
+      mangled_str = end_ptr;
       if (i <= 0  && strlen (mangled_str) < i)
         return 0;
       obstack_grow (tempbuf, mangled_str, i);

Before this change, symbols with strings over 9 bytes long gets into a bad state
and might end up crashing.  Certainly ends up with a bad string.

And example that crashes for me:
    20src/core/atomic.d.9215__unittest_failFiZv

Thanks,
Brad


More information about the Digitalmars-d mailing list