proc-events.c: fix compilation on Solaris
[deliverable/binutils-gdb.git] / gdb / psymtab.c
index c87ef25d612c0e9413e652416ab795f173a0dcd1..ac0ee0a5a64c592b2c2807d354b6d06bac012a8b 100644 (file)
@@ -1,6 +1,6 @@
 /* Partial symbol tables.
 
-   Copyright (C) 2009-2017 Free Software Foundation, Inc.
+   Copyright (C) 2009-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -556,7 +556,7 @@ psymbol_name_matches (partial_symbol *psym,
 {
   const language_defn *lang = language_def (SYMBOL_LANGUAGE (psym));
   symbol_name_matcher_ftype *name_match
-    = language_get_symbol_name_matcher (lang, lookup_name);
+    = get_symbol_name_matcher (lang, lookup_name);
   return name_match (SYMBOL_SEARCH_NAME (psym), lookup_name, NULL);
 }
 
@@ -1203,14 +1203,14 @@ psymtab_to_fullname (struct partial_symtab *ps)
      to handle cases like the file being moved.  */
   if (ps->fullname == NULL)
     {
-      int fd = find_and_open_source (ps->filename, ps->dirname, &ps->fullname);
+      gdb::unique_xmalloc_ptr<char> fullname;
+      int fd = find_and_open_source (ps->filename, ps->dirname, &fullname);
+      ps->fullname = fullname.release ();
 
       if (fd >= 0)
        close (fd);
       else
        {
-         gdb::unique_xmalloc_ptr<char> fullname;
-
          /* rewrite_source_path would be applied by find_and_open_source, we
             should report the pathname where GDB tried to find the file.  */
 
@@ -1337,21 +1337,21 @@ recursively_search_psymtabs
     }
 
   partial_symbol **gbound
-    = &objfile->global_psymbols[ps->globals_offset + ps->n_global_syms];
+    = objfile->global_psymbols.data () + ps->globals_offset + ps->n_global_syms;
   partial_symbol **sbound
-    = &objfile->static_psymbols[ps->statics_offset + ps->n_static_syms];
+    = objfile->static_psymbols.data () + ps->statics_offset + ps->n_static_syms;
   partial_symbol **bound = gbound;
 
   /* Go through all of the symbols stored in a partial
      symtab in one loop.  */
-  partial_symbol **psym = &objfile->global_psymbols[ps->globals_offset];
+  partial_symbol **psym = objfile->global_psymbols.data () + ps->globals_offset;
   while (keep_going)
     {
       if (psym >= bound)
        {
          if (bound == gbound && ps->n_static_syms != 0)
            {
-             psym = &objfile->static_psymbols[ps->statics_offset];
+             psym = objfile->static_psymbols.data () + ps->statics_offset;
              bound = sbound;
            }
          else
@@ -2254,7 +2254,8 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
     length = ps->n_static_syms;
     while (length--)
       {
-       sym = block_lookup_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
+       sym = block_lookup_symbol (b, SYMBOL_SEARCH_NAME (*psym),
+                                  symbol_name_match_type::SEARCH_NAME,
                                   SYMBOL_DOMAIN (*psym));
        if (!sym)
          {
@@ -2271,7 +2272,8 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
     length = ps->n_global_syms;
     while (length--)
       {
-       sym = block_lookup_symbol (b, SYMBOL_LINKAGE_NAME (*psym),
+       sym = block_lookup_symbol (b, SYMBOL_SEARCH_NAME (*psym),
+                                  symbol_name_match_type::SEARCH_NAME,
                                   SYMBOL_DOMAIN (*psym));
        if (!sym)
          {
This page took 0.024712 seconds and 4 git commands to generate.