]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2002-12-20 David Carlton <carlton@math.stanford.edu>
authorDavid Carlton <carlton@bactrian.org>
Sat, 21 Dec 2002 00:17:45 +0000 (00:17 +0000)
committerDavid Carlton <carlton@bactrian.org>
Sat, 21 Dec 2002 00:17:45 +0000 (00:17 +0000)
* symtab.c (lookup_symbol_aux_minsyms): Don't call
lookup_symbol_aux from within this.
* values.c (value_static_field): lookup_symbol_linkage.
(value_fn_field): lookup_symbol_linkage.
* valops.c (value_struct_elt_for_reference): lookup_symbol_linkage.
* blockframe.c (inside_main_func): lookup_symbol_linkage.
* source.c (select_source_symtab): lookup_symbol_linkage.
* nlmread.c (nlm_symfile_read): Call lookup_symbol_linkage.
* nindy-tdep.c (nindy_frame_chain_valid): Call
lookup_symbol_linkage.
* linespec.c (count_methods): Call lookup_symbol_linkage.
(add_matching_methods): Ditto.
(add_constructors): Ditto.
* hppa-tdep.c (find_stub_with_shl_get): Call
lookup_symbol_linkage.  Delete symbol2.
(initialize_hp_cxx_exception_support): Call lookup_symbol_linkage.
* cli/cli-cmds.c (edit_command): SYMBOL_PRINT_NAME.
(list_command): SYMBOL_PRINT_NAME.
* valops.c (value_of_variable): SYMBOL_PRINT_NAME
(hand_function_call): SYMBOL_PRINT_NAME.
* typeprint.c (typedef_print): SYMBOL_PRINT_NAME.
* tracepoint.c (tracepoints_info): SYMBOL_PRINT_NAME.
* symtab.c (lookup_partial_symbol): SYMBOL_BEST_NAME.
(compare_search_syms): SYMBOL_BEST_NAME.
(print_symbol_info): SYMBOL_PRINT_NAME.
(print_msymbol_info): SYMBOL_PRINT_NAME.
(rbreak_command): SYMBOL_PRINT_NAME.
* symmisc.c (print_symbol): SYMBOL_PRINT_NAME.
* stack.c (print_frame): SYMBOL_PRINT_NAME.
(frame_info): SYMBOL_PRINT_NAME.
(print_block_frame_locals): SYMBOL_PRINT_NAME.
(print_block_frame_labels): SYMBOL_PRINT_NAME.
(print_frame_arg_vars): SYMBOL_PRINT_NAME.
(return_command): SYMBOL_PRINT_NAME.
* stabsread.c (define_symbol): SYMBOL_PRINT_NAME.
* p-valprint.c (pascal_val_print): SYMBOL_PRINT_NAME.
* printcmd.c (build_address_symbolic): SYMBOL_PRINT_NAME.
(sym_info): SYMBOL_PRINT_NAME.
(print_frame_args): SYMBOL_PRINT_NAME.
* objc-lang.c (compare_selectors): SYMBOL_BEST_NAME.
(compare_classes): SYMBOL_BEST_NAME.
* maint.c (maintenance_translate_address): SYMBOL_PRINT_NAME.
* linespec.c (find_method): SYMBOL_PRINT_NAME.
(select_symbols): SYMBOL_PRINT_NAME.
* infcmd.c (jump_command): SYMBOL_PRINT_NAME.
* findvar.c (locate_var_value): SYMBOL_PRINT_NAME.
* expprint.c (print_subexp): SYMBOL_PRINT_NAME.
* c-valprint.c (c_val_print): SYMBOL_PRINT_NAME.
* buildsym.c (finish_block): SYMBOL_PRINT_NAME.
* breakpoint.c (print_one_breakpoint): SYMBOL_PRINT_NAME.
* ax-gdb.c (gen_var_ref): SYMBOL_PRINT_NAME.
* ada-typeprint.c (ada_typedef_print): SYMBOL_PRINT_NAME.
* ada-lang.c (user_select_syms): Use SYMBOL_PRINT_NAME instead of
SYMBOL_SOURCE_NAME.
(user_select_syms):
(ada_finish_decode_line_1): Use SYMBOL_BEST_NAME instead of
SYMBOL_SOURCE_NAME.
* symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME.
* symfile.c (compare_symbols): Use SYMBOL_BEST_NAME, not
SYMBOL_SOURCE_NAME.
(compare_psymbols): Ditto.
* symtab.c (lookup_symbol_linkage): New function.
* symtab.h: Declare lookup_symbol_linkage.
* c-valprint.c (c_val_print): Call lookup_symbol_minsym.
* symtab.c (lookup_symbol_aux_minsyms): Call minsym_static.
* minsyms.c (minsym_static): New function.
* symtab.h: Declare minsym_static.
* symtab.c (lookup_symbol_minsym): New function.
(search_symbols): Call lookup_symbol_minsym instead of
lookup_symbol.
(lookup_symbol_namespace): Don't take apart NAME.
* symtab.h: Declare lookup_symbol_minsym.
* printcmd.c (build_address_symbolic): Don't use old version of
SYMBOL_LINKAGE_NAME.
* symtab.c (lookup_block_symbol): Change mangled names to linkage
name, and use SYMBOL_LINKAGE_NAME as appropriate.
* symtab.h (SYMBOL_LINKAGE_NAME): New macro, with a different
meaning from the old macro of the same name.  Also, add comments
about proper uses of names.

37 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/ada-typeprint.c
gdb/alpha-tdep.c
gdb/ax-gdb.c
gdb/blockframe.c
gdb/breakpoint.c
gdb/buildsym.c
gdb/c-valprint.c
gdb/cli/cli-cmds.c
gdb/expprint.c
gdb/findvar.c
gdb/hppa-tdep.c
gdb/infcmd.c
gdb/linespec.c
gdb/maint.c
gdb/mdebugread.c
gdb/minsyms.c
gdb/nindy-tdep.c
gdb/nlmread.c
gdb/objc-lang.c
gdb/p-valprint.c
gdb/parse.c
gdb/printcmd.c
gdb/source.c
gdb/stabsread.c
gdb/stack.c
gdb/symfile.c
gdb/symmisc.c
gdb/symtab.c
gdb/symtab.h
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.c++/namespace.exp
gdb/tracepoint.c
gdb/typeprint.c
gdb/valops.c
gdb/values.c

index a880e44278f6d86166fa50e1a756e1980c8ef484..a6b11ee2a92b8aa9bdb64266368808060b70a9e3 100644 (file)
@@ -1,3 +1,85 @@
+2002-12-20  David Carlton  <carlton@math.stanford.edu>
+
+       * symtab.c (lookup_symbol_aux_minsyms): Don't call
+       lookup_symbol_aux from within this.
+       * values.c (value_static_field): lookup_symbol_linkage.
+       (value_fn_field): lookup_symbol_linkage.
+       * valops.c (value_struct_elt_for_reference): lookup_symbol_linkage.
+       * blockframe.c (inside_main_func): lookup_symbol_linkage.
+       * source.c (select_source_symtab): lookup_symbol_linkage.
+       * nlmread.c (nlm_symfile_read): Call lookup_symbol_linkage.
+       * nindy-tdep.c (nindy_frame_chain_valid): Call
+       lookup_symbol_linkage.
+       * linespec.c (count_methods): Call lookup_symbol_linkage.
+       (add_matching_methods): Ditto.
+       (add_constructors): Ditto.
+       * hppa-tdep.c (find_stub_with_shl_get): Call
+       lookup_symbol_linkage.  Delete symbol2.
+       (initialize_hp_cxx_exception_support): Call lookup_symbol_linkage.
+       * cli/cli-cmds.c (edit_command): SYMBOL_PRINT_NAME.
+       (list_command): SYMBOL_PRINT_NAME.
+       * valops.c (value_of_variable): SYMBOL_PRINT_NAME
+       (hand_function_call): SYMBOL_PRINT_NAME.
+       * typeprint.c (typedef_print): SYMBOL_PRINT_NAME.
+       * tracepoint.c (tracepoints_info): SYMBOL_PRINT_NAME.
+       * symtab.c (lookup_partial_symbol): SYMBOL_BEST_NAME.
+       (compare_search_syms): SYMBOL_BEST_NAME.
+       (print_symbol_info): SYMBOL_PRINT_NAME.
+       (print_msymbol_info): SYMBOL_PRINT_NAME.
+       (rbreak_command): SYMBOL_PRINT_NAME.
+       * symmisc.c (print_symbol): SYMBOL_PRINT_NAME.
+       * stack.c (print_frame): SYMBOL_PRINT_NAME.
+       (frame_info): SYMBOL_PRINT_NAME.
+       (print_block_frame_locals): SYMBOL_PRINT_NAME.
+       (print_block_frame_labels): SYMBOL_PRINT_NAME.
+       (print_frame_arg_vars): SYMBOL_PRINT_NAME.
+       (return_command): SYMBOL_PRINT_NAME.
+       * stabsread.c (define_symbol): SYMBOL_PRINT_NAME.
+       * p-valprint.c (pascal_val_print): SYMBOL_PRINT_NAME.
+       * printcmd.c (build_address_symbolic): SYMBOL_PRINT_NAME.
+       (sym_info): SYMBOL_PRINT_NAME.
+       (print_frame_args): SYMBOL_PRINT_NAME.
+       * objc-lang.c (compare_selectors): SYMBOL_BEST_NAME.
+       (compare_classes): SYMBOL_BEST_NAME.
+       * maint.c (maintenance_translate_address): SYMBOL_PRINT_NAME.
+       * linespec.c (find_method): SYMBOL_PRINT_NAME.
+       (select_symbols): SYMBOL_PRINT_NAME.
+       * infcmd.c (jump_command): SYMBOL_PRINT_NAME.
+       * findvar.c (locate_var_value): SYMBOL_PRINT_NAME.
+       * expprint.c (print_subexp): SYMBOL_PRINT_NAME.
+       * c-valprint.c (c_val_print): SYMBOL_PRINT_NAME.
+       * buildsym.c (finish_block): SYMBOL_PRINT_NAME.
+       * breakpoint.c (print_one_breakpoint): SYMBOL_PRINT_NAME.
+       * ax-gdb.c (gen_var_ref): SYMBOL_PRINT_NAME.
+       * ada-typeprint.c (ada_typedef_print): SYMBOL_PRINT_NAME.
+       * ada-lang.c (user_select_syms): Use SYMBOL_PRINT_NAME instead of
+       SYMBOL_SOURCE_NAME.
+       (user_select_syms): 
+       (ada_finish_decode_line_1): Use SYMBOL_BEST_NAME instead of
+       SYMBOL_SOURCE_NAME.
+       * symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME.
+       * symfile.c (compare_symbols): Use SYMBOL_BEST_NAME, not
+       SYMBOL_SOURCE_NAME.
+       (compare_psymbols): Ditto.
+       * symtab.c (lookup_symbol_linkage): New function.
+       * symtab.h: Declare lookup_symbol_linkage.
+       * c-valprint.c (c_val_print): Call lookup_symbol_minsym.
+       * symtab.c (lookup_symbol_aux_minsyms): Call minsym_static.
+       * minsyms.c (minsym_static): New function.
+       * symtab.h: Declare minsym_static.
+       * symtab.c (lookup_symbol_minsym): New function.
+       (search_symbols): Call lookup_symbol_minsym instead of
+       lookup_symbol.
+       (lookup_symbol_namespace): Don't take apart NAME.
+       * symtab.h: Declare lookup_symbol_minsym.
+       * printcmd.c (build_address_symbolic): Don't use old version of
+       SYMBOL_LINKAGE_NAME.
+       * symtab.c (lookup_block_symbol): Change mangled names to linkage
+       name, and use SYMBOL_LINKAGE_NAME as appropriate.
+       * symtab.h (SYMBOL_LINKAGE_NAME): New macro, with a different
+       meaning from the old macro of the same name.  Also, add comments
+       about proper uses of names.
+
 2002-12-18  David Carlton  <carlton@math.stanford.edu>
 
        * symtab.c (lookup_symbol_aux_file): Call
index 2d46699a3b1744c21375abcfd3c3ecdd2af112e0..99abad6c0dda361b5ccdbb3d37473ba0c82d21b5 100644 (file)
@@ -2616,7 +2616,7 @@ user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms,
          struct symtab_and_line sal = find_function_start_sal (syms[i], 1);
          printf_unfiltered ("[%d] %s at %s:%d\n",
                             i + first_choice,
-                            SYMBOL_SOURCE_NAME (syms[i]),
+                            SYMBOL_PRINT_NAME (syms[i]),
                             sal.symtab == NULL
                             ? "<no source file available>"
                             : sal.symtab->filename, sal.line);
@@ -2633,28 +2633,28 @@ user_select_syms (struct symbol *syms[], struct block *blocks[], int nsyms,
          if (SYMBOL_LINE (syms[i]) != 0 && symtab != NULL)
            printf_unfiltered ("[%d] %s at %s:%d\n",
                               i + first_choice,
-                              SYMBOL_SOURCE_NAME (syms[i]),
+                              SYMBOL_PRINT_NAME (syms[i]),
                               symtab->filename, SYMBOL_LINE (syms[i]));
          else if (is_enumeral && TYPE_NAME (SYMBOL_TYPE (syms[i])) != NULL)
            {
              printf_unfiltered ("[%d] ", i + first_choice);
              ada_print_type (SYMBOL_TYPE (syms[i]), NULL, gdb_stdout, -1, 0);
              printf_unfiltered ("'(%s) (enumeral)\n",
-                                SYMBOL_SOURCE_NAME (syms[i]));
+                                SYMBOL_PRINT_NAME (syms[i]));
            }
          else if (symtab != NULL)
            printf_unfiltered (is_enumeral
                               ? "[%d] %s in %s (enumeral)\n"
                               : "[%d] %s at %s:?\n",
                               i + first_choice,
-                              SYMBOL_SOURCE_NAME (syms[i]),
+                              SYMBOL_PRINT_NAME (syms[i]),
                               symtab->filename);
          else
            printf_unfiltered (is_enumeral
                               ? "[%d] %s (enumeral)\n"
                               : "[%d] %s at ?\n",
                               i + first_choice,
-                              SYMBOL_SOURCE_NAME (syms[i]));
+                              SYMBOL_PRINT_NAME (syms[i]));
        }
     }
 
@@ -4416,7 +4416,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
       for (i = 0; i < selected.nelts; i += 1)
        (*canonical)[i] =
          extended_canonical_line_spec (selected.sals[i],
-                                       SYMBOL_SOURCE_NAME (symbols[i]));
+                                       SYMBOL_BEST_NAME (symbols[i]));
     }
 
   discard_cleanups (old_chain);
index c18aa85b3974b0a53e342d44fc09534084926f6f..f6c92d93f97c79e9936477d4d1b2abb92702f43e 100644 (file)
@@ -124,8 +124,8 @@ ada_typedef_print (struct type *type, struct symbol *new,
                   struct ui_file *stream)
 {
   fprintf_filtered (stream, "type %.*s is ",
-                   ada_name_prefix_len (SYMBOL_SOURCE_NAME (new)),
-                   SYMBOL_SOURCE_NAME (new));
+                   ada_name_prefix_len (SYMBOL_PRINT_NAME (new)),
+                   SYMBOL_PRINT_NAME (new));
   type_print (type, "", stream, 1);
 }
 
index 277b5ca821b51e03ad2b69e721876246c9c9a4fa..5ff21f0989ae11388491d332494651c7056bcceb 100644 (file)
@@ -856,6 +856,7 @@ find_proc_desc (CORE_ADDR pc, struct frame_info *next_frame)
           symbol reading.  */
        sym = NULL;
       else
+
        sym = lookup_symbol (MIPS_EFI_SYMBOL_NAME, b, LABEL_NAMESPACE,
                             0, NULL);
     }
index fda84362a3ab4668872918995af4fcb39e12ee4e..dc2adef2b43446d94ca7104a911fe4b4406b76d1 100644 (file)
@@ -577,7 +577,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
 
     case LOC_TYPEDEF:
       error ("Cannot compute value of typedef `%s'.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
 
     case LOC_BLOCK:
@@ -608,7 +608,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
        struct minimal_symbol *msym
        = lookup_minimal_symbol (SYMBOL_NAME (var), NULL, NULL);
        if (!msym)
-         error ("Couldn't resolve symbol `%s'.", SYMBOL_SOURCE_NAME (var));
+         error ("Couldn't resolve symbol `%s'.", SYMBOL_PRINT_NAME (var));
 
        /* Push the address of the variable.  */
        ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
@@ -618,12 +618,12 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
 
     case LOC_OPTIMIZED_OUT:
       error ("The variable `%s' has been optimized out.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
 
     default:
       error ("Cannot find value of botched symbol `%s'.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
     }
 }
index 1bc439540d2fece8e3f6f25ca5cc563bad274814..7b920442709800179ec66ec8204e1c29458c97c5 100644 (file)
@@ -125,7 +125,7 @@ inside_main_func (CORE_ADDR pc)
     {
       struct symbol *mainsym;
 
-      mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
+      mainsym = lookup_symbol_linkage (main_name ());
       if (mainsym && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
        {
          symfile_objfile->ei.main_func_lowpc =
index df74c3db19c54f462a670d72e0c98af377357d35..80f31c28bf67fcff25ad27f31b4963ec3dab5eb2 100644 (file)
@@ -3390,7 +3390,7 @@ print_one_breakpoint (struct breakpoint *b,
            {
              ui_out_text (uiout, "in ");
              ui_out_field_string (uiout, "func",
-                                  SYMBOL_SOURCE_NAME (sym));
+                                  SYMBOL_PRINT_NAME (sym));
              ui_out_wrap_hint (uiout, wrap_indent);
              ui_out_text (uiout, " at ");
            }
index 6d0fd5f00d7ea78f01a55c80561ad6aed5ef3837..8583942fadacb248b14513e8c826fb7aa15fc35d 100644 (file)
@@ -508,7 +508,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
     {
       if (symbol)
        {
-         complain (&block_end_complaint, SYMBOL_SOURCE_NAME (symbol));
+         complain (&block_end_complaint, SYMBOL_PRINT_NAME (symbol));
        }
       else
        {
@@ -539,7 +539,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
              if (symbol)
                {
                  complain (&innerblock_complaint,
-                           SYMBOL_SOURCE_NAME (symbol));
+                           SYMBOL_PRINT_NAME (symbol));
                }
              else
                {
index 1098cab585dd95c2431e08462fbf16792c150d65..ed1dfee81d739cbf93ba78bfc36e32730441d4c6 100644 (file)
@@ -205,7 +205,7 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
                  (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
                {
                  fputs_filtered (" <", stream);
-                 fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
+                 fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream);
                  fputs_filtered (">", stream);
                }
              if (vt_address && vtblprint)
@@ -213,12 +213,9 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
                  struct value *vt_val;
                  struct symbol *wsym = (struct symbol *) NULL;
                  struct type *wtype;
-                 struct block *block = (struct block *) NULL;
-                 int is_this_fld;
 
                  if (msymbol != NULL)
-                   wsym = lookup_symbol (SYMBOL_NAME (msymbol), block,
-                                         VAR_NAMESPACE, &is_this_fld, NULL);
+                   wsym = lookup_symbol_minsym (msymbol);
 
                  if (wsym)
                    {
index 9d5829177093f6e1e0fb647cdb3f7bb84d9b7053..fb7c2374c2899d3250dab0ba4bc0ad143d034d1f 100644 (file)
@@ -604,7 +604,7 @@ edit_command (char *arg, int from_tty)
            {
              print_address_numeric (sal.pc, 1, gdb_stdout);
              printf_filtered (" is in ");
-             fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
+             fputs_filtered (SYMBOL_PRINT_NAME (sym), gdb_stdout);
              printf_filtered (" (%s:%d).\n", sal.symtab->filename, sal.line);
            }
           else
@@ -771,7 +771,7 @@ list_command (char *arg, int from_tty)
        {
          print_address_numeric (sal.pc, 1, gdb_stdout);
          printf_filtered (" is in ");
-         fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
+         fputs_filtered (SYMBOL_PRINT_NAME (sym), gdb_stdout);
          printf_filtered (" (%s:%d).\n", sal.symtab->filename, sal.line);
        }
       else
index 23c6eb46ff325b15dd9a2a414f3dee118f74abde..edaa6f95afe6ca8a1d79ec81366b6aa54ab1209c 100644 (file)
@@ -105,12 +105,12 @@ print_subexp (register struct expression *exp, register int *pos,
        b = exp->elts[pc + 1].block;
        if (b != NULL
            && BLOCK_FUNCTION (b) != NULL
-           && SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)) != NULL)
+           && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)) != NULL)
          {
-           fputs_filtered (SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)), stream);
+           fputs_filtered (SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)), stream);
            fputs_filtered ("::", stream);
          }
-       fputs_filtered (SYMBOL_SOURCE_NAME (exp->elts[pc + 2].symbol), stream);
+       fputs_filtered (SYMBOL_PRINT_NAME (exp->elts[pc + 2].symbol), stream);
       }
       return;
 
index 99b9485f8cc68eec4599f8f1a4d00d083c4d494a..6f38b6faff43dea8f432f45e53a5118ae93b24f9 100644 (file)
@@ -875,7 +875,7 @@ locate_var_value (register struct symbol *var, struct frame_info *frame)
 
   lazy_value = read_var_value (var, frame);
   if (lazy_value == 0)
-    error ("Address of \"%s\" is unknown.", SYMBOL_SOURCE_NAME (var));
+    error ("Address of \"%s\" is unknown.", SYMBOL_PRINT_NAME (var));
 
   if (VALUE_LAZY (lazy_value)
       || TYPE_CODE (type) == TYPE_CODE_FUNC)
@@ -896,7 +896,7 @@ locate_var_value (register struct symbol *var, struct frame_info *frame)
                    && *REGISTER_NAME (VALUE_REGNO (lazy_value)) != '\0');
       error("Address requested for identifier "
            "\"%s\" which is in register $%s",
-            SYMBOL_SOURCE_NAME (var), 
+            SYMBOL_PRINT_NAME (var), 
            REGISTER_NAME (VALUE_REGNO (lazy_value)));
       break;
 
@@ -905,13 +905,13 @@ locate_var_value (register struct symbol *var, struct frame_info *frame)
                    && *REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)) != '\0');
       error("Address requested for identifier "
            "\"%s\" which is in frame register $%s",
-            SYMBOL_SOURCE_NAME (var), 
+            SYMBOL_PRINT_NAME (var), 
            REGISTER_NAME (VALUE_FRAME_REGNUM (lazy_value)));
       break;
 
     default:
       error ("Can't take address of \"%s\" which isn't an lvalue.",
-            SYMBOL_SOURCE_NAME (var));
+            SYMBOL_PRINT_NAME (var));
       break;
     }
   return 0;                    /* For lint -- never reached */
index a3f95610d51d1fe6a52941ab69e9429b58963192..e0f7d9ece60d06eda4cadd7ef2def285fdb20b5c 100644 (file)
@@ -1938,7 +1938,7 @@ hppa_value_returned_from_stack (register struct type *valtype, CORE_ADDR addr)
 CORE_ADDR
 find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
 {
-  struct symbol *get_sym, *symbol2;
+  struct symbol *get_sym;
   struct minimal_symbol *buff_minsym, *msymbol;
   struct type *ftype;
   struct value **args;
@@ -1952,10 +1952,9 @@ find_stub_with_shl_get (struct minimal_symbol *function, CORE_ADDR handle)
 
   args = alloca (sizeof (struct value *) * 8);         /* 6 for the arguments and one null one??? */
   funcval = find_function_in_inferior ("__d_shl_get");
-  get_sym = lookup_symbol ("__d_shl_get", NULL, VAR_NAMESPACE, NULL, NULL);
+  get_sym = lookup_symbol_linkage ("__d_shl_get");
   buff_minsym = lookup_minimal_symbol ("__buffer", NULL, NULL);
   msymbol = lookup_minimal_symbol ("__shldp", NULL, NULL);
-  symbol2 = lookup_symbol ("__shldp", NULL, VAR_NAMESPACE, NULL, NULL);
   endo_buff_addr = SYMBOL_VALUE_ADDRESS (buff_minsym);
   namelen = strlen (SYMBOL_NAME (function));
   value_return_addr = endo_buff_addr + namelen;
@@ -4308,8 +4307,7 @@ initialize_hp_cxx_exception_support (void)
     }
 
   /* Next look for the catch enable flag provided in end.o */
-  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-                      VAR_NAMESPACE, 0, (struct symtab **) NULL);
+  sym = lookup_symbol_linkage (HP_ACC_EH_catch_catch);
   if (sym)                     /* sometimes present in debug info */
     {
       eh_catch_catch_addr = SYMBOL_VALUE_ADDRESS (sym);
@@ -4334,8 +4332,7 @@ initialize_hp_cxx_exception_support (void)
     }
 
   /* Next look for the catch enable flag provided end.o */
-  sym = lookup_symbol (HP_ACC_EH_catch_catch, (struct block *) NULL,
-                      VAR_NAMESPACE, 0, (struct symtab **) NULL);
+  sym = lookup_symbol (HP_ACC_EH_catch_catch);
   if (sym)                     /* sometimes present in debug info */
     {
       eh_catch_throw_addr = SYMBOL_VALUE_ADDRESS (sym);
index 01d45b3410c7864fde0a4755722de6ba39fe9e0d..9988f629f493d28e8cb54ece2df1b222ebdcb4bc 100644 (file)
@@ -846,7 +846,7 @@ jump_command (char *arg, int from_tty)
   if (fn != NULL && sfn != fn)
     {
       if (!query ("Line %d is not in `%s'.  Jump anyway? ", sal.line,
-                 SYMBOL_SOURCE_NAME (fn)))
+                 SYMBOL_PRINT_NAME (fn)))
        {
          error ("Not confirmed.");
          /* NOTREACHED */
index 952d51d2c231f2cf293ae1c5e786176b4462f43b..1db423b5dd462966c87ca0ded0eee95ae64830a7 100644 (file)
@@ -846,11 +846,11 @@ find_method (int funfirstline, char ***canonical, char *saved_arg,
       if (tmp[0] == '~')
        cplusplus_error (saved_arg,
                         "the class `%s' does not have destructor defined\n",
-                        SYMBOL_SOURCE_NAME (class_sym));
+                        SYMBOL_PRINT_NAME (class_sym));
       else
        cplusplus_error (saved_arg,
                         "the class %s does not have any method named %s\n",
-                        SYMBOL_SOURCE_NAME (class_sym), tmp);
+                        SYMBOL_PRINT_NAME (class_sym), tmp);
     }
 
   return values;
@@ -876,8 +876,7 @@ count_methods (struct type *class_type, char *method,
          struct fn_field *f = TYPE_FN_FIELDLIST1 (class_type, m_index);
          
          sym_arr[count] =
-           lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, f_index),
-                          NULL, VAR_NAMESPACE, NULL, NULL);
+           lookup_symbol_linkage (TYPE_FN_FIELD_PHYSNAME (f, f_index));
          if (sym_arr[count])
            count++;
        }
@@ -1016,8 +1015,7 @@ add_matching_methods (int method_counter, struct type *class_type,
       if (is_destructor_name (phys_name) != 0)
        continue;
 
-      sym_arr[count] = lookup_symbol (phys_name, NULL, VAR_NAMESPACE,
-                                     NULL, NULL);
+      sym_arr[count] = lookup_symbol_linkage (phys_name);
       if (sym_arr[count])
        count++;
       else
@@ -1071,8 +1069,7 @@ add_constructors (int method_counter, struct type *class_type,
 
       /* If this method is actually defined, include it in the
         list.  */
-      sym_arr[count] = lookup_symbol (phys_name, NULL, VAR_NAMESPACE,
-                                     NULL, NULL);
+      sym_arr[count] = lookup_symbol_linkage (phys_name);
       if (sym_arr[count])
        count++;
     }
@@ -1117,7 +1114,7 @@ select_symbols (struct symbol **sym_arr, int nelts, int funfirstline,
          values.sals[i] = find_function_start_sal (sym_arr[i], funfirstline);
          printf_unfiltered ("[%d] %s at %s:%d\n",
                             (i + 2),
-                            SYMBOL_SOURCE_NAME (sym_arr[i]),
+                            SYMBOL_PRINT_NAME (sym_arr[i]),
                             values.sals[i].symtab->filename,
                             values.sals[i].line);
        }
index 6a849f9c8710f5b374eb6fc63926e2ce34553eed..e45d54d3a988e1b7c82673b1965208f4c4e5e975 100644 (file)
@@ -484,7 +484,7 @@ maintenance_translate_address (char *arg, int from_tty)
 
   if (sym)
     printf_filtered ("%s+%s\n",
-                    SYMBOL_SOURCE_NAME (sym),
+                    SYMBOL_PRINT_NAME (sym),
                     paddr_u (address - SYMBOL_VALUE_ADDRESS (sym)));
   else if (sect)
     printf_filtered ("no symbol at %s:0x%s\n", sect->name, paddr (address));
index e4aa86b61879eb701b14a0ad91cccdb4168b3d34..77a6aa142005f94b832436ed40252c0eb01edfe8 100644 (file)
@@ -4742,16 +4742,16 @@ fixup_sigtramp (void)
   /* We have to handle the following cases here:
      a) The Mips library has a sigtramp label within sigvec.
      b) Irix has a _sigtramp which we want to use, but it also has sigvec.  */
-  s = lookup_symbol ("sigvec", 0, VAR_NAMESPACE, 0, NULL);
+  s = lookup_symbol_linkage ("sigvec");
   if (s != 0)
     {
       b0 = SYMBOL_BLOCK_VALUE (s);
-      s = lookup_symbol ("sigtramp", b0, VAR_NAMESPACE, 0, NULL);
+      s = lookup_symbol_linkage ("sigtramp");
     }
   if (s == 0)
     {
       /* No sigvec or no sigtramp inside sigvec, try _sigtramp.  */
-      s = lookup_symbol ("_sigtramp", 0, VAR_NAMESPACE, 0, NULL);
+      s = lookup_symbol_linkage ("_sigtramp");
     }
 
   /* But maybe this program uses its own version of sigvec */
index b1ef28ffa5feae4140a01a55fed1f713eaa5fede..080c5bc33cc9ec8445c575f7e975ada2cfc7e72b 100644 (file)
@@ -985,3 +985,19 @@ find_solib_trampoline_target (CORE_ADDR pc)
     }
   return 0;
 }
+
+/* Test whether or not MINSYM corresponnds to a static symbol (i.e. is
+   file-local) or not.  */
+int
+minsym_static (const struct minimal_symbol *minsym)
+{
+  switch (MSYMBOL_TYPE (minsym))
+    {
+    case mst_file_text:
+    case mst_file_data:
+    case mst_file_bss:
+      return 1;
+    default:
+      return 0;
+    }
+}
index 1f35062e2bd2fe6230e2f6af13ef6ad8e1a7ce13..8e058c97c86d0c533d4a439edee1e65f113f58f4 100644 (file)
@@ -60,8 +60,7 @@ nindy_frame_chain_valid (CORE_ADDR chain, struct frame_info *curframe)
       return 0;
     }
 
-  sym = lookup_symbol (sf, 0, VAR_NAMESPACE, (int *) NULL,
-                      (struct symtab **) NULL);
+  sym = lookup_symbol_linkage (sf);
   if (sym != 0)
     {
       a = SYMBOL_VALUE (sym);
index 9d692ddd906926e89e1c08800b2653717dcf4ae8..1ad4a029513b35eb2ccc7db4c79c772904fe5f1b 100644 (file)
@@ -194,7 +194,7 @@ nlm_symfile_read (struct objfile *objfile, int mainline)
   stabsect_build_psymtabs (objfile, mainline, ".stab",
                           ".stabstr", ".text");
 
-  mainsym = lookup_symbol (main_name (), NULL, VAR_NAMESPACE, NULL, NULL);
+  mainsym = lookup_symbol_linkage (main_name ());
 
   if (mainsym
       && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
index 21453d0c28cd6bca36d1418dd010b95039fd0f77..924c79c63d5a6deb4352561057eae1816803291f 100644 (file)
@@ -808,8 +808,8 @@ compare_selectors (void *a, void *b)
 {
   char *aname, *bname;
 
-  aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
-  bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
+  aname = SYMBOL_BEST_NAME (*(struct symbol **) a);
+  bname = SYMBOL_BEST_NAME (*(struct symbol **) b);
   if (aname == NULL || bname == NULL)
     error ("internal: compare_selectors(1)");
 
@@ -966,8 +966,8 @@ compare_classes (void *a, void *b)
 {
   char *aname, *bname;
 
-  aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
-  bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
+  aname = SYMBOL_BEST_NAME (*(struct symbol **) a);
+  bname = SYMBOL_BEST_NAME (*(struct symbol **) b);
   if (aname == NULL || bname == NULL)
     error ("internal: compare_classes(1)");
 
index 1a145f99b68cf74c6127f3c86515f359b0c00a70..4e092302464ca82c69b6ca9abfbf178290e22fff 100644 (file)
@@ -213,7 +213,7 @@ pascal_val_print (struct type *type, char *valaddr, int embedded_offset,
                  && (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
                {
                  fputs_filtered (" <", stream);
-                 fputs_filtered (SYMBOL_SOURCE_NAME (msymbol), stream);
+                 fputs_filtered (SYMBOL_PRINT_NAME (msymbol), stream);
                  fputs_filtered (">", stream);
                }
              if (vt_address && vtblprint)
index 3180bd1abf142ceb995bac97acbf1b7a0ace5603..f44bcec843441c39260ee8ae5e99ab59e364f4a4 100644 (file)
@@ -471,8 +471,7 @@ write_dollar_variable (struct stoken str)
       /* This code is not enabled on non HP-UX systems, since worst case 
         symbol table lookup performance is awful, to put it mildly. */
 
-      sym = lookup_symbol (copy_name (str), (struct block *) NULL,
-                          VAR_NAMESPACE, (int *) NULL, (struct symtab **) NULL);
+      sym = lookup_symbol_linkage (copy_name (str));
       if (sym)
        {
          write_exp_elt_opcode (OP_VAR_VALUE);
index e7f4cf971fc386ae864a8f2dcc216e102959a7b2..4cab35081581e668a1b164307de840a3a13cdc97 100644 (file)
@@ -652,8 +652,8 @@ build_address_symbolic (CORE_ADDR addr,  /* IN */
   if (symbol)
     {
       name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol));
-      if (do_demangle)
-       name_temp = SYMBOL_SOURCE_NAME (symbol);
+      if (do_demangle || asm_demangle)
+       name_temp = SYMBOL_PRINT_NAME (symbol);
       else
        name_temp = SYMBOL_LINKAGE_NAME (symbol);
     }
@@ -667,8 +667,8 @@ build_address_symbolic (CORE_ADDR addr,  /* IN */
          symbol = 0;
          symtab = 0;
          name_location = SYMBOL_VALUE_ADDRESS (msymbol);
-         if (do_demangle)
-           name_temp = SYMBOL_SOURCE_NAME (msymbol);
+         if (do_demangle || asm_demangle)
+           name_temp = SYMBOL_PRINT_NAME (msymbol);
          else
            name_temp = SYMBOL_LINKAGE_NAME (msymbol);
        }
@@ -1064,10 +1064,10 @@ sym_info (char *arg, int from_tty)
        offset = sect_addr - SYMBOL_VALUE_ADDRESS (msymbol);
        if (offset)
          printf_filtered ("%s + %u in ",
-                          SYMBOL_SOURCE_NAME (msymbol), offset);
+                          SYMBOL_PRINT_NAME (msymbol), offset);
        else
          printf_filtered ("%s in ",
-                          SYMBOL_SOURCE_NAME (msymbol));
+                          SYMBOL_PRINT_NAME (msymbol));
        if (pc_in_unmapped_range (addr, sect))
          printf_filtered ("load address range of ");
        if (section_is_overlay (sect))
@@ -1903,7 +1903,7 @@ print_frame_args (struct symbol *func, struct frame_info *fi, int num,
          annotate_arg_begin ();
 
          list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, NULL);
-         fprintf_symbol_filtered (stb->stream, SYMBOL_SOURCE_NAME (sym),
+         fprintf_symbol_filtered (stb->stream, SYMBOL_PRINT_NAME (sym),
                                   SYMBOL_LANGUAGE (sym), DMGL_PARAMS | DMGL_ANSI);
          ui_out_field_stream (uiout, "name", stb);
          annotate_arg_name_end ();
index 0107bfa2355a62e27ae37150bf39e4dd48e45849..293913e0e7fdf032bd9a1af5913e7dd4560932dc 100644 (file)
@@ -238,7 +238,7 @@ select_source_symtab (register struct symtab *s)
 
   /* Make the default place to list be the function `main'
      if one exists.  */
-  if (lookup_symbol (main_name (), 0, VAR_NAMESPACE, 0, NULL))
+  if (lookup_symbol_linkage (main_name ()))
     {
       sals = decode_line_spec (main_name (), 1);
       sal = sals.sals[0];
index 7c09d769370282f658a0852ed0bf533764598655..a4807e3561f956cbb81f5425f65b9a59c226960c 100644 (file)
@@ -1815,7 +1815,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym),
                    NUM_REGS + NUM_PSEUDO_REGS,
-                   SYMBOL_SOURCE_NAME (sym));
+                   SYMBOL_PRINT_NAME (sym));
          SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -1831,7 +1831,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym),
                    NUM_REGS + NUM_PSEUDO_REGS,
-                   SYMBOL_SOURCE_NAME (sym));
+                   SYMBOL_PRINT_NAME (sym));
          SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
@@ -2085,7 +2085,7 @@ define_symbol (CORE_ADDR valu, char *string, int desc, int type,
        {
          complain (&reg_value_complaint, SYMBOL_VALUE (sym),
                    NUM_REGS + NUM_PSEUDO_REGS,
-                   SYMBOL_SOURCE_NAME (sym));
+                   SYMBOL_PRINT_NAME (sym));
          SYMBOL_VALUE (sym) = SP_REGNUM;       /* Known safe, though useless */
        }
       SYMBOL_NAMESPACE (sym) = VAR_NAMESPACE;
index 5aa362114a7a384203030ced16e286d35f21207e..734132d32484e1c34ca4c9d401f62dd166081e01 100644 (file)
@@ -514,7 +514,7 @@ print_frame (struct frame_info *fi,
        }
       else
        {
-         /* I'd like to use SYMBOL_SOURCE_NAME() here, to display the
+         /* I'd like to use SYMBOL_PRINT_NAME() here, to display the
             demangled name that we already have stored in the symbol
             table, but we stored a version with DMGL_PARAMS turned
             on, and here we don't want to display parameters. So call
@@ -535,7 +535,7 @@ print_frame (struct frame_info *fi,
                /* If the demangler fails, try the demangled name from
                   the symbol table. This'll have parameters, but
                   that's preferable to diplaying a mangled name. */
-               funname = SYMBOL_SOURCE_NAME (func);
+               funname = SYMBOL_PRINT_NAME (func);
            }
        }
     }
@@ -801,7 +801,7 @@ frame_info (char *addr_exp, int from_tty)
   s = find_pc_symtab (fi->pc);
   if (func)
     {
-      /* I'd like to use SYMBOL_SOURCE_NAME() here, to display
+      /* I'd like to use SYMBOL_PRINT_NAME() here, to display
        * the demangled name that we already have stored in
        * the symbol table, but we stored a version with
        * DMGL_PARAMS turned on, and here we don't want
@@ -825,7 +825,7 @@ frame_info (char *addr_exp, int from_tty)
           * but that's preferable to diplaying a mangled name.
           */
          if (demangled == NULL)
-           funname = SYMBOL_SOURCE_NAME (func);
+           funname = SYMBOL_PRINT_NAME (func);
        }
     }
   else
@@ -1245,7 +1245,7 @@ print_block_frame_locals (struct block *b, register struct frame_info *fi,
          values_printed = 1;
          for (j = 0; j < num_tabs; j++)
            fputs_filtered ("\t", stream);
-         fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
+         fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
          fputs_filtered (" = ", stream);
          print_variable_value (sym, fi, stream);
          fprintf_filtered (stream, "\n");
@@ -1282,7 +1282,7 @@ print_block_frame_labels (struct block *b, int *have_default,
          struct symtab_and_line sal;
          sal = find_pc_line (SYMBOL_VALUE_ADDRESS (sym), 0);
          values_printed = 1;
-         fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
+         fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
          if (addressprint)
            {
              fprintf_filtered (stream, " ");
@@ -1469,7 +1469,7 @@ print_frame_arg_vars (register struct frame_info *fi,
        case LOC_REGPARM_ADDR:
        case LOC_BASEREG_ARG:
          values_printed = 1;
-         fputs_filtered (SYMBOL_SOURCE_NAME (sym), stream);
+         fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
          fputs_filtered (" = ", stream);
 
          /* We have to look up the symbol because arguments can have
@@ -1804,7 +1804,7 @@ return_command (char *retval_exp, int from_tty)
     {
       if (thisfun != 0)
        {
-         if (!query ("Make %s return now? ", SYMBOL_SOURCE_NAME (thisfun)))
+         if (!query ("Make %s return now? ", SYMBOL_PRINT_NAME (thisfun)))
            {
              error ("Not confirmed.");
              /* NOTREACHED */
index cd87b1d1b58371819463b8b799832c60f08a9cff..b3d3afa46df6d6ff3cab2c39faece83856a29d80 100644 (file)
@@ -204,7 +204,7 @@ compare_symbols (const void *s1p, const void *s2p)
 
   s1 = (struct symbol **) s1p;
   s2 = (struct symbol **) s2p;
-  return (strcmp (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2)));
+  return (strcmp (SYMBOL_BEST_NAME (*s1), SYMBOL_BEST_NAME (*s2)));
 }
 
 /*
@@ -237,8 +237,8 @@ compare_psymbols (const void *s1p, const void *s2p)
 
   s1 = (struct partial_symbol **) s1p;
   s2 = (struct partial_symbol **) s2p;
-  st1 = SYMBOL_SOURCE_NAME (*s1);
-  st2 = SYMBOL_SOURCE_NAME (*s2);
+  st1 = SYMBOL_BEST_NAME (*s1);
+  st2 = SYMBOL_BEST_NAME (*s2);
 
 
   if ((st1[0] - st2[0]) || !st1[0])
index 42b27e347f405e651a1f0566b3beaefd2cc8865c..86ba9d9028a59f98856516f159636d925f58b084 100644 (file)
@@ -591,7 +591,7 @@ print_symbol (PTR args)
   print_spaces (depth, outfile);
   if (SYMBOL_NAMESPACE (symbol) == LABEL_NAMESPACE)
     {
-      fprintf_filtered (outfile, "label %s at ", SYMBOL_SOURCE_NAME (symbol));
+      fprintf_filtered (outfile, "label %s at ", SYMBOL_PRINT_NAME (symbol));
       print_address_numeric (SYMBOL_VALUE_ADDRESS (symbol), 1, outfile);
       if (SYMBOL_BFD_SECTION (symbol))
        fprintf_filtered (outfile, " section %s\n",
@@ -626,14 +626,14 @@ print_symbol (PTR args)
       if (SYMBOL_TYPE (symbol))
        {
          /* Print details of types, except for enums where it's clutter.  */
-         LA_PRINT_TYPE (SYMBOL_TYPE (symbol), SYMBOL_SOURCE_NAME (symbol),
+         LA_PRINT_TYPE (SYMBOL_TYPE (symbol), SYMBOL_PRINT_NAME (symbol),
                         outfile,
                         TYPE_CODE (SYMBOL_TYPE (symbol)) != TYPE_CODE_ENUM,
                         depth);
          fprintf_filtered (outfile, "; ");
        }
       else
-       fprintf_filtered (outfile, "%s ", SYMBOL_SOURCE_NAME (symbol));
+       fprintf_filtered (outfile, "%s ", SYMBOL_PRINT_NAME (symbol));
 
       switch (SYMBOL_CLASS (symbol))
        {
index fdf269cd85ec50fcbb0b9d380db77aa2851c400b..951991d656f4aa293527681a9479be48ca7b1219 100644 (file)
@@ -1275,19 +1275,9 @@ symbol *lookup_symbol_aux_using_loop (const char *name,
 
 /* This tries to look up NAME in the namespace given by the initial
    substring of NAMESPACE_NAME of length NAMESPACE_LEN.  It applies
-   the using directives that are active in BLOCK.
-
-   For example, assume that we have using directives adding A to the
-   global namespace, adding A::inner to namespace A, and adding B to
-   the global namespace.  Then, when looking up a symbol "foo", we
-   want to recurse by looking up stuff in A::foo and seeing which
-   using directives still apply.  The only one that still applies
-   converts that to A::inner::foo: we _don't_ want to then look at
-   B::A::foo (let alone A::A::foo!).  So we end up just looking at
-   A::foo, A::inner::foo, and B::foo.  (Though if the original caller
-   to lookup_symbol had specified A::foo, we would want to look up
-   stuff in A::A::foo, A::inner::A::foo, A::inner::foo, and
-   B::A::foo).  */
+   the using directives that are active in BLOCK.  It doesn't look
+   into NAME at all, so if NAME happens to contain some namespaces, it
+   won't apply using directives to those namespaces.  */
 
 /* FIXME: carlton/2002-11-27: Currently, there's no way to specify
    that additional using directives are active.  When we get around to
@@ -1310,53 +1300,32 @@ lookup_symbol_namespace (const char *namespace_name,
   const struct using_direct *current;
   struct symbol *sym;
 
+  /* First, go through the using directives.  If any of them add new
+     names to the namespace we're searching in, see if we can find a
+     match by applying them.  */
+
   for (current = block_using_iterator_first (block, &iter);
        current != NULL;
        current = block_using_iterator_next (&iter))
     {
-      /* First, see if the namespace matches the start of this using
-        directive.  */
-      if (namespace_len <= current->outer_length
+      if (namespace_len == current->outer_length
          && strncmp (namespace_name, current->name, namespace_len) == 0)
        {
-         /* Great, it matches: now does the rest of the using
-            directive match the rest of the name?  */
-         
-         const char *rest_of_outer = current->name + namespace_len;
-         int rest_of_outer_len
-           = current->outer_length - namespace_len;
-         /* Should we skip some colons?  Should be true unless
-            NAMESPACE_LEN is zero (and hence we're in the global
-            namespace) or we've finished all of outer.  */
-         if (rest_of_outer_len != 0 && *rest_of_outer == ':')
-           {
-             rest_of_outer += 2;
-             rest_of_outer_len -= 2;
-           }
-         if (strncmp (rest_of_outer, name, rest_of_outer_len) == 0)
-           {
-             /* Everything matches!  Yippee!  So apply the using
-                directive and recurse.  */
-             const char *new_name = name + rest_of_outer_len;
-             if (*new_name == ':')
-               new_name += 2;
-
-             sym = lookup_symbol_namespace (current->name,
-                                            current->inner_length,
-                                            new_name,
-                                            mangled_name,
-                                            block,
-                                            name_space,
-                                            symtab);
-             if (sym != NULL)
-               return sym;
-           }
+         sym = lookup_symbol_namespace (current->name,
+                                        current->inner_length,
+                                        name,
+                                        mangled_name,
+                                        block,
+                                        name_space,
+                                        symtab);
+         if (sym != NULL)
+           return sym;
        }
     }
 
   /* We didn't find anything by applying any of the using directives
      that are still applicable; so let's see if we've got a match
-     using the current name.  */
+     using the current namespace.  */
   
   if (namespace_len == 0)
     {
@@ -1378,10 +1347,8 @@ lookup_symbol_namespace (const char *namespace_name,
     }
 }
 
-/* Check for the possibility of the symbol being a function or a
-   mangled variable that is stored in one of the minimal symbol
-   tables.  Eventually, all global symbols might be resolved in this
-   way.  */
+/* Check for the possibility of the symbol being a function that is
+   stored in one of the minimal symbol tables.  */
 
 static struct symbol *
 lookup_symbol_aux_minsyms (int block_index, const char *name,
@@ -1421,14 +1388,13 @@ lookup_symbol_aux_minsyms (int block_index, const char *name,
             that's okay: this is only called with block_index equal
             to STATIC_BLOCK if a global search has failed.  */
 
-         switch (MSYMBOL_TYPE (msymbol))
+         if (minsym_static (msymbol))
            {
-           case mst_file_text:
-           case mst_file_data:
-           case mst_file_bss:
              if (block_index == GLOBAL_BLOCK)
                return NULL;
-           default:
+           }
+         else
+           {
              if (block_index == STATIC_BLOCK)
                return NULL;
            }
@@ -1453,16 +1419,6 @@ lookup_symbol_aux_minsyms (int block_index, const char *name,
              sym =
                lookup_block_symbol (block, name, mangled_name, namespace);
 
-             /* FIXME: carlton/2002-10-28: this next comment dates
-                from when this code was part of lookup_symbol_aux, so
-                this return could return NULL from lookup_symbol_aux.
-                Are there really situations where we want a minimal
-                symbol lookup to be able to force a NULL return from
-                lookup_symbol?  If so, maybe the thing to do would be
-                to have lookup_symbol_aux_minsym to set a
-                minsym_found flag, and to have lookup_symbol_aux only
-                do the psymtab search if that flag is zero.  */
-
              /* sym == 0 if symbol was found in the minimal symbol table
                 but not in the symtab.
                 Return 0 to use the msymbol definition of "foo_".
@@ -1480,24 +1436,76 @@ lookup_symbol_aux_minsyms (int block_index, const char *name,
                *symtab = s;
              return fixup_symbol_section (sym, s->objfile);
            }
-         else if (MSYMBOL_TYPE (msymbol) != mst_text
-                  && MSYMBOL_TYPE (msymbol) != mst_file_text
-                  && strcmp (name, SYMBOL_NAME (msymbol)) != 0)
-           {
-             /* This is a mangled variable, look it up by its
-                mangled name.  */
-             return lookup_symbol_aux_nonlocal (block_index,
-                                                SYMBOL_NAME (msymbol),
-                                                mangled_name,
-                                                namespace,
-                                                symtab);
-           }
        }
     }
 
   return NULL;
 }
 
+/* Lookup the symbol associated to a minimal symbol, if there is one.  */
+
+/* FIXME: carlton/2002-12-20: This is now implemented in a way that
+   doesn't work very well and that may, in fact return the wrong
+   symbol.  For now, we're in a transition period where I want to
+   replace some calls to lookup_symbol by calls to
+   lookup_symbol_minsym, so it's okay for lookup_symbol_minsym to get
+   the answer wrong in circumstances where lookup_symbol would have
+   screwed it up, too; later, I'll fix lookup_symbol_minsym to get it
+   right as quickly and easily as possible.  */
+
+struct symbol *
+lookup_symbol_minsym (const struct minimal_symbol *minsym)
+{
+  int block_index = minsym_static (minsym) ? STATIC_BLOCK : GLOBAL_BLOCK;
+
+  return lookup_symbol_aux_nonlocal (block_index,
+                                    SYMBOL_BEST_NAME (minsym),
+                                    SYMBOL_LINKAGE_NAME (minsym),
+                                    VAR_NAMESPACE,
+                                    NULL);
+}
+
+/* Lookup the symbol with a given linkage name.  */
+
+struct symbol *
+lookup_symbol_linkage (const char *linkage_name)
+{
+  const char *name;
+  char *demangled_name = NULL;
+  struct symbol *sym;
+
+  name = linkage_name;
+
+  /* If we are using C++, then the linkage name might be a mangled C++
+     name; lookup_symbol_aux_nonlocal expects the name to be
+     demangled.  */
+
+  if (current_language->la_language == language_cplus)
+    {
+      demangled_name = cplus_demangle (name, DMGL_ANSI | DMGL_PARAMS);
+      if (demangled_name != NULL)
+       {
+         name = demangled_name;
+       }
+    }
+
+  sym = lookup_symbol_aux_nonlocal (GLOBAL_BLOCK, name, linkage_name,
+                                   VAR_NAMESPACE, NULL);
+
+  if (sym != NULL)
+    {
+      xfree (demangled_name);
+      return sym;
+    }
+
+  sym = lookup_symbol_aux_nonlocal (STATIC_BLOCK, name, linkage_name,
+                                   VAR_NAMESPACE, NULL);
+
+  xfree (demangled_name);
+  return sym;
+}
+
+
 /* Look up a type named NESTED_NAME that is nested inside the C++
    class or namespace given by PARENT_TYPE, from within the context
    given by BLOCK.  */
@@ -1588,7 +1596,7 @@ lookup_partial_symbol (struct partial_symtab *pst, const char *name,
            {
              do_linear_search = 1;
            }
-         if (strcmp (SYMBOL_SOURCE_NAME (*center), name) >= 0)
+         if (strcmp (SYMBOL_BEST_NAME (*center), name) >= 0)
            {
              top = center;
            }
@@ -1786,8 +1794,8 @@ find_main_psymtab (void)
    symbol (language_cplus set) has both the encoded and non-encoded names
    tested for a match.
 
-   If MANGLED_NAME is non-NULL, verify that any symbol we find has this
-   particular mangled name.
+   If LINKAGE_NAME is non-NULL, verify that any symbol we find has
+   this particular linkage name.
 */
 
 /* FIXME: carlton/2002-09-26: I've slightly changed the semantics: I
@@ -1803,7 +1811,7 @@ find_main_psymtab (void)
 
 struct symbol *
 lookup_block_symbol (register const struct block *block, const char *name,
-                    const char *mangled_name, const namespace_enum namespace)
+                    const char *linkage_name, const namespace_enum namespace)
 {
   struct dict_iterator iter;
   struct symbol *sym;
@@ -1814,8 +1822,8 @@ lookup_block_symbol (register const struct block *block, const char *name,
           sym; sym = dict_iter_name_next (name, &iter))
        {
          if (SYMBOL_NAMESPACE (sym) == namespace
-             && (mangled_name
-                 ? strcmp (SYMBOL_NAME (sym), mangled_name) == 0 : 1))
+             && (linkage_name
+                 ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1))
            return sym;
        }
       return NULL;
@@ -1834,8 +1842,8 @@ lookup_block_symbol (register const struct block *block, const char *name,
           sym; sym = dict_iter_name_next (name, &iter))
        {
          if (SYMBOL_NAMESPACE (sym) == namespace
-             && (mangled_name
-                 ? strcmp (SYMBOL_NAME (sym), mangled_name) == 0 : 1))
+             && (linkage_name
+                 ? strcmp (SYMBOL_LINKAGE_NAME (sym), linkage_name) == 0 : 1))
            {
              /* If SYM has aliases, then use any alias that is active
                 at the current PC.  If no alias is active at the current
@@ -2860,8 +2868,8 @@ compare_search_syms (const void *sa, const void *sb)
   struct symbol_search **sym_a = (struct symbol_search **) sa;
   struct symbol_search **sym_b = (struct symbol_search **) sb;
 
-  return strcmp (SYMBOL_SOURCE_NAME ((*sym_a)->symbol),
-                SYMBOL_SOURCE_NAME ((*sym_b)->symbol));
+  return strcmp (SYMBOL_BEST_NAME ((*sym_a)->symbol),
+                SYMBOL_BEST_NAME ((*sym_b)->symbol));
 }
 
 /* Sort the ``nfound'' symbols in the list after prevtail.  Leave
@@ -3063,7 +3071,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
      The symbol will then be found during the scan of symtabs below.
 
      For functions, find_pc_symtab should succeed if we have debug info
-     for the function, for variables we have to call lookup_symbol
+     for the function, for variables we have to call lookup_symbol_minsym
      to determine if the variable has debug info.
      If the lookup fails, set found_misc so that we will rescan to print
      any matching symbols without debug info.
@@ -3084,10 +3092,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
                if (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol)))
                  {
                    if (kind == FUNCTIONS_NAMESPACE
-                       || lookup_symbol (SYMBOL_NAME (msymbol),
-                                         (struct block *) NULL,
-                                         VAR_NAMESPACE,
-                                         0, (struct symtab **) NULL) == NULL)
+                       || lookup_symbol_minsym (msymbol) == NULL)
                      found_misc = 1;
                  }
              }
@@ -3181,9 +3186,7 @@ search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
                    (0 == find_pc_symtab (SYMBOL_VALUE_ADDRESS (msymbol))))
                  {
                    /* Variables/Absolutes:  Look up by name */
-                   if (lookup_symbol (SYMBOL_NAME (msymbol),
-                                      (struct block *) NULL, VAR_NAMESPACE,
-                                      0, (struct symtab **) NULL) == NULL)
+                   if (lookup_symbol_minsym (msymbol) == NULL)
                      {
                        /* match */
                        psr =
@@ -3242,7 +3245,7 @@ print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
     {
       type_print (SYMBOL_TYPE (sym),
                  (SYMBOL_CLASS (sym) == LOC_TYPEDEF
-                  ? "" : SYMBOL_SOURCE_NAME (sym)), gdb_stdout, 0);
+                  ? "" : SYMBOL_PRINT_NAME (sym)), gdb_stdout, 0);
 
       printf_filtered (";\n");
     }
@@ -3261,7 +3264,7 @@ print_msymbol_info (struct minimal_symbol *msymbol)
                                   & (CORE_ADDR) 0xffffffff, "08l");
   else
     tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol), "016l");
-  printf_filtered ("%s  %s\n", tmp, SYMBOL_SOURCE_NAME (msymbol));
+  printf_filtered ("%s  %s\n", tmp, SYMBOL_PRINT_NAME (msymbol));
 }
 
 /* This is the guts of the commands "info functions", "info types", and
@@ -3369,7 +3372,7 @@ rbreak_command (char *regexp, int from_tty)
        {
          break_command (SYMBOL_NAME (p->msymbol), from_tty);
          printf_filtered ("<function, no debug info> %s;\n",
-                          SYMBOL_SOURCE_NAME (p->msymbol));
+                          SYMBOL_PRINT_NAME (p->msymbol));
        }
     }
 
index d96c0c6812b524657e8f5ff80c6bb61fd3501be5..b558e813279d88e2ef96eab2ad028619826d490c 100644 (file)
@@ -138,7 +138,6 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
    functions, unless the callers are changed to pass in the ginfo
    field only, instead of the SYMBOL parameter.  */
 
-#define SYMBOL_NAME(symbol)            (symbol)->ginfo.name
 #define SYMBOL_VALUE(symbol)           (symbol)->ginfo.value.ivalue
 #define SYMBOL_VALUE_ADDRESS(symbol)   (symbol)->ginfo.value.address
 #define SYMBOL_VALUE_BYTES(symbol)     (symbol)->ginfo.value.bytes
@@ -148,6 +147,14 @@ extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, asection *);
 #define SYMBOL_SECTION(symbol)         (symbol)->ginfo.section
 #define SYMBOL_BFD_SECTION(symbol)     (symbol)->ginfo.bfd_section
 
+/* FIXME: carlton/2002-12-20: The situation with all of these names is
+   a mess.  As a first step, try to avoid using SYMBOL_NAME to access
+   the name of a symbol: use SYMBOL_BEST_NAME or SYMBOL_LINKAGE_NAME
+   instead, depending on which one you want.  I'll try to add some
+   initialization functions later, too.  */
+
+#define SYMBOL_NAME(symbol)            (symbol)->ginfo.name
+
 #define SYMBOL_CPLUS_DEMANGLED_NAME(symbol)    \
   (symbol)->ginfo.language_specific.cplus_specific.demangled_name
 
@@ -171,45 +178,36 @@ extern const char *symbol_demangled_name (const struct general_symbol_info
                                          *symbol);
 
 /* Macro that returns the demangled name of the symbol if if possible
-   and the symbol name if not possible.  This is like
-   SYMBOL_SOURCE_NAME except that it doesn't depend on the value of
-   'demangle' (and is hence more suitable for internal usage).  The
-   result should never be NULL.  */
-
-/* FIXME: carlton/2002-09-26: Probably the situation with this and
-   SYMBOL_SOURCE_NAME should be rethought.  */
+   and the symbol name if not possible.  The result should never be
+   NULL.  */
 
 #define SYMBOL_BEST_NAME(symbol)                                       \
   (SYMBOL_DEMANGLED_NAME (symbol) != NULL                              \
    ? SYMBOL_DEMANGLED_NAME (symbol)                                    \
    : SYMBOL_NAME (symbol))
 
+/* Use this if you want to get at the linkage name of a symbol (which
+   might be mangled).  */
+
+#define SYMBOL_LINKAGE_NAME(symbol)    SYMBOL_NAME (symbol)
+
 /* OBSOLETE #define SYMBOL_CHILL_DEMANGLED_NAME(symbol) */
 /* OBSOLETE (symbol)->ginfo.language_specific.chill_specific.demangled_name */
 
 #define SYMBOL_OBJC_DEMANGLED_NAME(symbol)                             \
    (symbol)->ginfo.language_specific.objc_specific.demangled_name
 
-/* Macro that returns the "natural source name" of a symbol.  In C++ this is
-   the "demangled" form of the name if demangle is on and the "mangled" form
-   of the name if demangle is off.  In other languages this is just the
-   symbol name.  The result should never be NULL. */
+/* Macro that returns the name of a name of a symbol that we want to
+   print.  In C++ this is the "demangled" form of the name if demangle
+   is on and the "mangled" form of the name if demangle is off.  In
+   other languages this is just the symbol name.  The result should
+   never be NULL. */
 
 /* NOTE: carlton/2002-09-26: For external use only; in many
    situations, SYMBOL_BEST_NAME is more appropriate.  */
 
-#define SYMBOL_SOURCE_NAME(symbol)                                     \
-  (demangle ? SYMBOL_BEST_NAME (symbol) : SYMBOL_NAME (symbol))
-
-/* Macro that returns the "natural assembly name" of a symbol.  In C++ this is
-   the "mangled" form of the name if demangle is off, or if demangle is on and
-   asm_demangle is off.  Otherwise if asm_demangle is on it is the "demangled"
-   form.  In other languages this is just the symbol name.  The result should
-   never be NULL. */
-
-#define SYMBOL_LINKAGE_NAME(symbol)                                    \
-  (demangle && asm_demangle ? SYMBOL_BEST_NAME (symbol)                        \
-   : SYMBOL_NAME (symbol))
+#define SYMBOL_PRINT_NAME(symbol)                                      \
+  (demangle ? SYMBOL_BEST_NAME (symbol) : SYMBOL_LINKAGE_NAME (symbol))
 
 /* Macro that tests a symbol for a match against a specified name string.
    First test the unencoded name, then looks for and test a C++ encoded
@@ -953,6 +951,15 @@ extern struct symbol *lookup_symbol_namespace (const char *namespace_name,
                                               namespace_enum name_space,
                                               struct symtab **symtab);
 
+/* Lookup the symbol associated to a minimal symbol.  */
+
+extern struct symbol *lookup_symbol_minsym (const struct minimal_symbol
+                                           *minsym);
+
+/* Lookup the symbol with a given linkage name.  */
+
+extern struct symbol *lookup_symbol_linkage (const char *linkage_name);
+
 /* Lookup a type within a class or a namespace.  */
 
 extern struct type *lookup_nested_type (struct type *parent_type,
@@ -1097,6 +1104,8 @@ extern void install_minimal_symbols (struct objfile *);
 
 extern void msymbols_sort (struct objfile *objfile);
 
+int minsym_static (const struct minimal_symbol *minsym);
+
 struct symtab_and_line
 {
   struct symtab *symtab;
index 977114b29a2d06fb3dd41fd44a63e109d921ce2c..1f699e460d0acb0b84192407f05d495afa82b61a 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-20  David Carlton  <carlton@math.stanford.edu>
+
+       * gdb.c++/namespace.exp: Delete tests that try to apply using
+       directives to quoted namespaces.
+
 2002-12-17  David Carlton  <carlton@math.stanford.edu>
 
        * gdb.c++/m-data.cc: Whitespace cleanup, to match mainline patch.
index 1f0d7e1b1246346c768716519dd797328531b022..78775b185717dae6722a838a8cd3dcb796b2b585 100644 (file)
@@ -269,12 +269,10 @@ gdb_test "ptype C::OtherFileClass" "No symbol \"Class\" in namespace \"C::C\"."
 gdb_test "print cX" "\\$\[0-9\].* = 6"
 gdb_test "print 'F::cXf'" "\\$\[0-9\].* = 7"
 gdb_test "print F::cXf" "\\$\[0-9\].* = 7"
-gdb_test "print 'F::cXfX'" "\\$\[0-9\].* = 8"
 gdb_test "print F::cXfX" "\\$\[0-9\].* = 8"
 gdb_test "print X" "\\$\[0-9\].* = 9"
 gdb_test "print 'G::Xg'" "\\$\[0-9\].* = 10"
 gdb_test "print G::Xg" "\\$\[0-9\].* = 10"
-gdb_test "print 'G::XgX'" "\\$\[0-9\].* = 11"
 gdb_test "print G::XgX" "\\$\[0-9\].* = 11"
 
 # Test namespace renaming.
index da10242be8c0dedb07e827b2156d0c3b17a147dd..67cd6b56e34de5b0de5e99a46744c4a2599e4db0 100644 (file)
@@ -516,7 +516,7 @@ tracepoints_info (char *tpnum_exp, int from_tty)
          if (sym)
            {
              fputs_filtered ("in ", gdb_stdout);
-             fputs_filtered (SYMBOL_SOURCE_NAME (sym), gdb_stdout);
+             fputs_filtered (SYMBOL_PRINT_NAME (sym), gdb_stdout);
              wrap_here (wrap_indent);
              fputs_filtered (" at ", gdb_stdout);
            }
index 58c66412ab6646037993b66f679f144462ec3156..194e48098edc45ba7212b737d10a53a15fe9bed7 100644 (file)
@@ -67,7 +67,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
       type_print (type, "", stream, 0);
       if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
          || !STREQ (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)))
-       fprintf_filtered (stream, " %s", SYMBOL_SOURCE_NAME (new));
+       fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new));
       break;
 #endif
 #ifdef _LANG_m2
@@ -75,7 +75,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
       fprintf_filtered (stream, "TYPE ");
       if (!TYPE_NAME (SYMBOL_TYPE (new)) ||
          !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new)))
-       fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
+       fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new));
       else
        fprintf_filtered (stream, "<builtin> = ");
       type_print (type, "", stream, 0);
@@ -84,7 +84,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
 #ifdef _LANG_pascal
     case language_pascal:
       fprintf_filtered (stream, "type ");
-      fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new));
+      fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new));
       type_print (type, "", stream, 0);
       break;
 #endif
@@ -93,7 +93,7 @@ typedef_print (struct type *type, struct symbol *new, struct ui_file *stream)
       /* OBSOLETE   fprintf_filtered (stream, "SYNMODE "); */
       /* OBSOLETE   if (!TYPE_NAME (SYMBOL_TYPE (new)) || */
       /* OBSOLETE       !STREQ (TYPE_NAME (SYMBOL_TYPE (new)), SYMBOL_NAME (new))) */
-      /* OBSOLETE     fprintf_filtered (stream, "%s = ", SYMBOL_SOURCE_NAME (new)); */
+      /* OBSOLETE     fprintf_filtered (stream, "%s = ", SYMBOL_PRINT_NAME (new)); */
       /* OBSOLETE   else */
       /* OBSOLETE     fprintf_filtered (stream, "<builtin> = "); */
       /* OBSOLETE   type_print (type, "", stream, 0); */
index 209e50423d2662fa8dde0b124b08c24bd6fc064b..129332e71b5ac1b2709e4a61b77f5f212a7549a3 100644 (file)
@@ -856,9 +856,9 @@ value_of_variable (const struct symbol *var, const struct block *b)
       if (!frame)
        {
          if (BLOCK_FUNCTION (b)
-             && SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)))
+             && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)))
            error ("No frame is currently executing in block %s.",
-                  SYMBOL_SOURCE_NAME (BLOCK_FUNCTION (b)));
+                  SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b)));
          else
            error ("No frame is currently executing in specified block");
        }
@@ -866,7 +866,7 @@ value_of_variable (const struct symbol *var, const struct block *b)
 
   val = read_var_value (var, frame);
   if (!val)
-    error ("Address of symbol \"%s\" is unknown.", SYMBOL_SOURCE_NAME (var));
+    error ("Address of symbol \"%s\" is unknown.", SYMBOL_PRINT_NAME (var));
 
   return val;
 }
@@ -1757,7 +1757,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
     symbol = find_pc_function (funaddr);
     if (symbol)
       {
-       name = SYMBOL_SOURCE_NAME (symbol);
+       name = SYMBOL_PRINT_NAME (symbol);
       }
     else
       {
@@ -1766,7 +1766,7 @@ You must use a pointer to function type variable. Command ignored.", arg_name);
 
        if (msymbol)
          {
-           name = SYMBOL_SOURCE_NAME (msymbol);
+           name = SYMBOL_PRINT_NAME (msymbol);
          }
       }
     if (name == NULL)
@@ -3229,8 +3229,8 @@ value_struct_elt_for_reference (struct type *domain, int offset,
            }
          else
            {
-             struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j),
-                                               0, VAR_NAMESPACE, 0, NULL);
+             struct symbol *s
+               = lookup_symbol_linkage (TYPE_FN_FIELD_PHYSNAME (f, j));
              if (s == NULL)
                {
                  v = 0;
index 5226aea3b4a28e8068a0f5067e29a1d558203f0b..e78ad89ba8ff19e53d7c78b14b8f459496d482c1 100644 (file)
@@ -812,7 +812,7 @@ value_static_field (struct type *type, int fieldno)
   else
     {
       char *phys_name = TYPE_FIELD_STATIC_PHYSNAME (type, fieldno);
-      struct symbol *sym = lookup_symbol (phys_name, 0, VAR_NAMESPACE, 0, NULL);
+      struct symbol *sym = lookup_symbol_linkage (phys_name);
       if (sym == NULL)
        {
          /* With some compilers, e.g. HP aCC, static data members are reported
@@ -986,7 +986,7 @@ value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *ty
   struct symbol *sym;
   struct minimal_symbol *msym;
 
-  sym = lookup_symbol (physname, 0, VAR_NAMESPACE, 0, NULL);
+  sym = lookup_symbol_linkage (physname);
   if (sym != NULL)
     {
       msym = NULL;