Emit 8 NULs for target section name instead of dumping core when the target
[deliverable/binutils-gdb.git] / gdb / symtab.c
index e43afd41cfd84ccef1d63ca5855ef8b53c9c76ce..4068fd0e5122ff23dc7625cab46bfbd3cddd3703 100644 (file)
@@ -81,10 +81,6 @@ static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
                                                     const char *, int,
                                                     namespace_enum);
 
-static struct partial_symbol *fixup_psymbol_section (struct
-                                                    partial_symbol *,
-                                                    struct objfile *);
-
 static struct symtab *lookup_symtab_1 (char *);
 
 static void cplusplus_hint (char *);
@@ -520,7 +516,10 @@ fixup_section (struct general_symbol_info *ginfo, struct objfile *objfile)
   msym = lookup_minimal_symbol (ginfo->name, NULL, objfile);
 
   if (msym)
-    ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
+    {
+      ginfo->bfd_section = SYMBOL_BFD_SECTION (msym);
+      ginfo->section = SYMBOL_SECTION (msym);
+    }
 }
 
 struct symbol *
@@ -537,7 +536,7 @@ fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
   return sym;
 }
 
-static struct partial_symbol *
+struct partial_symbol *
 fixup_psymbol_section (struct partial_symbol *psym, struct objfile *objfile)
 {
   if (!psym)
@@ -585,6 +584,19 @@ lookup_symbol (const char *name, register const struct block *block,
   register struct block *b;
   register struct minimal_symbol *msymbol;
 
+  if (case_sensitivity == case_sensitive_off)
+    {
+      char *copy;
+      int len, i;
+
+      len = strlen (name);
+      copy = (char *) alloca (len + 1);
+      for (i= 0; i < len; i++)
+        copy[i] = tolower (name[i]);
+      copy[len] = 0;
+      name = copy;
+    }
+
   /* Search specified block and its superiors.  */
 
   while (block != 0)
@@ -2630,7 +2642,8 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
          /* First check for "global" namespace specification,
             of the form "::foo". If found, skip over the colons
             and jump to normal symbol processing */
-         if ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t'))
+         if (p[0] == ':' 
+             && ((*argptr == p) || (p[-1] == ' ') || (p[-1] == '\t')))
            saved_arg2 += 2;
 
          /* We have what looks like a class or namespace
@@ -3561,10 +3574,10 @@ search_symbols (regexp, kind, nfiles, files, matches)
   if (kind < LABEL_NAMESPACE)
     error ("must search on specific namespace");
 
-  ourtype = types[(int) (kind - LABEL_NAMESPACE)];
-  ourtype2 = types2[(int) (kind - LABEL_NAMESPACE)];
-  ourtype3 = types3[(int) (kind - LABEL_NAMESPACE)];
-  ourtype4 = types4[(int) (kind - LABEL_NAMESPACE)];
+  ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
+  ourtype2 = types2[(int) (kind - VARIABLES_NAMESPACE)];
+  ourtype3 = types3[(int) (kind - VARIABLES_NAMESPACE)];
+  ourtype4 = types4[(int) (kind - VARIABLES_NAMESPACE)];
 
   sr = *matches = NULL;
   tail = NULL;
@@ -3817,7 +3830,7 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
   /* Typedef that is not a C++ class */
   if (kind == TYPES_NAMESPACE
       && SYMBOL_NAMESPACE (sym) != STRUCT_NAMESPACE)
-    c_typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
+    typedef_print (SYMBOL_TYPE (sym), sym, gdb_stdout);
   /* variable, func, or typedef-that-is-c++-class */
   else if (kind < TYPES_NAMESPACE ||
           (kind == TYPES_NAMESPACE &&
@@ -3891,7 +3904,7 @@ symtab_symbol_info (char *regexp, namespace_enum kind, int from_tty)
   printf_filtered (regexp
                   ? "All %ss matching regular expression \"%s\":\n"
                   : "All defined %ss:\n",
-                  classnames[(int) (kind - LABEL_NAMESPACE - 1)], regexp);
+                  classnames[(int) (kind - VARIABLES_NAMESPACE)], regexp);
 
   for (p = symbols; p != NULL; p = p->next)
     {
This page took 0.025839 seconds and 4 git commands to generate.