Mark pieces of values as unavailable if the corresponding memory
[deliverable/binutils-gdb.git] / gdb / d-lang.c
index 6db521b6d81ef500afe94999f8fa500fe78d1391..c0599a5aa70bfc8bd849424b4047ec4f35d2034a 100644 (file)
@@ -1,6 +1,7 @@
 /* D language support routines for GDB, the GNU debugger.
 
-   Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006, 2008, 2009, 2010, 2011
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,9 +38,11 @@ extract_identifiers (const char *mangled_str, struct obstack *tempbuf)
 
   while (isdigit (*mangled_str))
     {
-      i = strtol (mangled_str, NULL, 10);
-      mangled_str++;
-      if (i <= 0  && strlen (mangled_str) < i)
+      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);
       mangled_str += i;
@@ -250,7 +253,8 @@ static const struct language_defn d_language_defn =
   c_printstr,                  /* Function to print string constant.  */
   c_emit_char,                 /* Print a single char.  */
   c_print_type,                        /* Print a type using appropriate syntax.  */
-  c_print_typedef,             /* Print a typedef using appropriate syntax.  */
+  c_print_typedef,             /* Print a typedef using appropriate
+                                  syntax.  */
   d_val_print,                 /* Print a value using appropriate syntax.  */
   c_value_print,               /* Print a top-level value.  */
   NULL,                                /* Language specific skip_trampoline.  */
@@ -258,7 +262,8 @@ static const struct language_defn d_language_defn =
   basic_lookup_symbol_nonlocal, 
   basic_lookup_transparent_type,
   d_demangle,                  /* Language specific symbol demangler.  */
-  NULL,                                /* Language specific class_name_from_physname.  */
+  NULL,                                /* Language specific
+                                  class_name_from_physname.  */
   d_op_print_tab,              /* Expression operators for printing.  */
   1,                           /* C-style arrays.  */
   0,                           /* String lower bound.  */
This page took 0.02577 seconds and 4 git commands to generate.