This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [rfa] replace SYMBOL_SOURCE_NAME by SYMBOL_PRINT_NAME
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: David Carlton <carlton at math dot stanford dot edu>
- Cc: gdb-patches at sources dot redhat dot com, Elena Zannoni <ezannoni at redhat dot com>
- Date: Wed, 19 Feb 2003 23:25:08 -0500
- Subject: Re: [rfa] replace SYMBOL_SOURCE_NAME by SYMBOL_PRINT_NAME
- References: <ro1isvz1o71.fsf@jackfruit.Stanford.EDU>
David Carlton writes:
> Right now, GDB has a macro called SYMBOL_SOURCE_NAME that gives you
> the demangled name of a symbol if 'demangle' is true, and the mangled
> name if 'demangle' is false.
>
> It's mostly used in output routines; its use there is entirely
> appropriate. It's sometimes used for internal purposes instead; its
> use there is not nearly as appropriate. (E.g. what if you sort or
> hash a table when demangle is false and then look up something in a
> table when demangle is true?) The internal uses should all be
> replaced by a different macro (to appear in a future use) which
> doesn't depend on the value of demangle.
>
> Here's a patch to begin dealing with the issue. It renames
> SYMBOL_SOURCE_NAME to SYMBOL_PRINT_NAME and adds a comment making it
> clear that it's only suitable for output. It changes all occurrences
> of the macro in a completely mechanical way; in a later patch, I'll go
> through all the occurrences to see if they look appropriate or not.
>
> The only part of the patch worth looking at is the symtab.h part,
> which I've listed first; the rest should (I hope!) be purely
> mechanical.
>
> Tested on i686-pc-linux-gnu/GCC3.1/DWARF-2, and should be obviously
> correct if you accept the underlying idea (and if I didn't screw up
> with my keyboard macros in Emacs). OK to commit?
>
Yes. Can you collapse the Changelog entries? Ie:
* ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
there is a typo in the comment.
elena
> David Carlton
> carlton at math dot stanford dot edu
>
> 2003-02-04 David Carlton <carlton at math dot stanford dot edu>
>
> * symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
> expand comment.
> * ada-lang.c (user_select_syms): Replace SYMBOL_PRINT_NAME with
> SYMBOL_SOURCE_NAME.
> (ada_finish_decode_line_1): Ditto.
> * ada-typeprint.c (ada_typedef_print): Ditto.
> * ax-gdb.c (gen_var_ref): Ditto.
> * breakpoint.c (print_one_breakpoint): Ditto.
> * buildsym.c (finish_block): Ditto.
> * c-valprint.c (c_val_print): Ditto.
> * expprint.c (print_subexp): Ditto.
> * findvar.c (locate_var_value): Ditto.
> * infcmd.c (jump_command): Ditto.
> * linespec.c (decode_line_2): Ditto.
> (decode_compound): Ditto.
> * maint.c (maintenance_translate_address): Ditto.
> * objc-lang.c (compare_selectors): Ditto.
> (compare_classes): Ditto.
> * printcmd.c (build_address_symbolic): Ditto.
> (sym_info): Ditto.
> (print_frame_args): Ditto.
> * p-valprint.c (pascal_val_print): Ditto.
> * stabsread.c (define_symbol): Ditto.
> * stack.c (print_frame): Ditto.
> (frame_info): Ditto.
> (print_block_frame_locals): Ditto.
> (print_frame_arg_vars): Ditto.
> (return_command): Ditto.
> * symfile.c (compare_symbols): Ditto.
> (compare_psymbols): Ditto.
> * symmisc.c (print_symbol): Ditto.
> * symtab.c (lookup_partial_symbol): Ditto.
> (lookup_block_symbol): Ditto.
> (compare_search_syms): Ditto.
> (print_symbol_info): Ditto.
> (print_msymbol_info): Ditto.
> (rbreak_command): Ditto.
> * tracepoint.c (tracepoints_info): Ditto.
> * typeprint.c (typedef_print): Ditto.
> * valops.c (value_of_variable): Ditto.
> (hand_function_call): Ditto.
> * cli/cli-cmds.c (edit_command): Ditto.
> (list_command): Ditto.
> * ada-typeprint.c: Update Copyright.
> * infcmd.c: Ditto.
> * objc-lang.c: Ditto.
> * p-valprint.c: Ditto.
> * symmisc.c: Ditto.
> * tracepoint.c: Ditto.
> * cli/cli-cmds.c: Ditto.
>
> Index: symtab.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/symtab.h,v
> retrieving revision 1.57
> diff -u -p -r1.57 symtab.h
> --- symtab.h 4 Feb 2003 21:37:03 -0000 1.57
> +++ symtab.h 5 Feb 2003 01:49:14 -0000
> @@ -168,12 +168,15 @@ extern char *symbol_demangled_name (stru
> #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 a version of the name of a symbol that is
^^^^^
> + suitable for output. 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. Don't use this for internal
> + purposes (e.g. storing in a hashtable): it's only suitable for
> + output. */
>
> -#define SYMBOL_SOURCE_NAME(symbol) \
> +#define SYMBOL_PRINT_NAME(symbol) \
> (demangle && SYMBOL_DEMANGLED_NAME (symbol) != NULL \
> ? SYMBOL_DEMANGLED_NAME (symbol) \
> : SYMBOL_NAME (symbol))
> Index: ada-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ada-lang.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 ada-lang.c
> --- ada-lang.c 2 Jan 2003 20:29:15 -0000 1.17
> +++ ada-lang.c 5 Feb 2003 01:49:13 -0000
> @@ -1,5 +1,6 @@
> /* Ada language support routines for GDB, the GNU debugger. Copyright
> - 1992, 1993, 1994, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
> + 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2003
> + Free Software Foundation, Inc.
>
> This file is part of GDB.
>
> @@ -2612,7 +2613,7 @@ user_select_syms (struct symbol *syms[],
> 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);
> @@ -2629,28 +2630,28 @@ user_select_syms (struct symbol *syms[],
> 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]));
> }
> }
>
> @@ -4472,7 +4473,7 @@ ada_finish_decode_line_1 (char **spec, s
> for (i = 0; i < selected.nelts; i += 1)
> (*canonical)[i] =
> extended_canonical_line_spec (selected.sals[i],
> - SYMBOL_SOURCE_NAME (symbols[i]));
> + SYMBOL_PRINT_NAME (symbols[i]));
> }
>
> discard_cleanups (old_chain);
> Index: ada-typeprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ada-typeprint.c,v
> retrieving revision 1.5
> diff -u -p -r1.5 ada-typeprint.c
> --- ada-typeprint.c 18 Aug 2002 18:23:47 -0000 1.5
> +++ ada-typeprint.c 5 Feb 2003 01:49:13 -0000
> @@ -1,5 +1,6 @@
> /* Support for printing Ada types for GDB, the GNU debugger.
> - Copyright 1986, 1988, 1989, 1991, 1997 Free Software Foundation, Inc.
> + Copyright 1986, 1988, 1989, 1991, 1997, 2003 Free Software
> + Foundation, Inc.
>
> This file is part of GDB.
>
> @@ -124,8 +125,8 @@ ada_typedef_print (struct type *type, st
> 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: ax-gdb.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/ax-gdb.c,v
> retrieving revision 1.17
> diff -u -p -r1.17 ax-gdb.c
> --- ax-gdb.c 14 Jan 2003 00:49:03 -0000 1.17
> +++ ax-gdb.c 5 Feb 2003 01:49:13 -0000
> @@ -578,7 +578,7 @@ gen_var_ref (struct agent_expr *ax, stru
>
> case LOC_TYPEDEF:
> error ("Cannot compute value of typedef `%s'.",
> - SYMBOL_SOURCE_NAME (var));
> + SYMBOL_PRINT_NAME (var));
> break;
>
> case LOC_BLOCK:
> @@ -609,7 +609,7 @@ gen_var_ref (struct agent_expr *ax, stru
> 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));
> @@ -619,12 +619,12 @@ gen_var_ref (struct agent_expr *ax, stru
>
> 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: breakpoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/breakpoint.c,v
> retrieving revision 1.109
> diff -u -p -r1.109 breakpoint.c
> --- breakpoint.c 4 Feb 2003 22:49:19 -0000 1.109
> +++ breakpoint.c 5 Feb 2003 01:49:13 -0000
> @@ -3386,7 +3386,7 @@ print_one_breakpoint (struct breakpoint
> {
> 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: buildsym.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/buildsym.c,v
> retrieving revision 1.27
> diff -u -p -r1.27 buildsym.c
> --- buildsym.c 14 Jan 2003 00:15:05 -0000 1.27
> +++ buildsym.c 5 Feb 2003 01:49:13 -0000
> @@ -394,7 +394,7 @@ finish_block (struct symbol *symbol, str
> {
> complaint (&symfile_complaints,
> "block end address less than block start address in %s (patched it)",
> - SYMBOL_SOURCE_NAME (symbol));
> + SYMBOL_PRINT_NAME (symbol));
> }
> else
> {
> @@ -428,7 +428,7 @@ finish_block (struct symbol *symbol, str
> {
> complaint (&symfile_complaints,
> "inner block not inside outer block in %s",
> - SYMBOL_SOURCE_NAME (symbol));
> + SYMBOL_PRINT_NAME (symbol));
> }
> else
> {
> Index: c-valprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/c-valprint.c,v
> retrieving revision 1.16
> diff -u -p -r1.16 c-valprint.c
> --- c-valprint.c 14 Jan 2003 00:49:03 -0000 1.16
> +++ c-valprint.c 5 Feb 2003 01:49:13 -0000
> @@ -205,7 +205,7 @@ c_val_print (struct type *type, char *va
> (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: expprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/expprint.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 expprint.c
> --- expprint.c 14 Jan 2003 00:49:03 -0000 1.13
> +++ expprint.c 5 Feb 2003 01:49:13 -0000
> @@ -107,12 +107,12 @@ print_subexp (register struct expression
> 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: findvar.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/findvar.c,v
> retrieving revision 1.45
> diff -u -p -r1.45 findvar.c
> --- findvar.c 4 Feb 2003 22:04:08 -0000 1.45
> +++ findvar.c 5 Feb 2003 01:49:13 -0000
> @@ -879,7 +879,7 @@ locate_var_value (register struct symbol
>
> 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)
> @@ -900,7 +900,7 @@ locate_var_value (register struct symbol
> && *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;
>
> @@ -909,13 +909,13 @@ locate_var_value (register struct symbol
> && *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: infcmd.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/infcmd.c,v
> retrieving revision 1.72
> diff -u -p -r1.72 infcmd.c
> --- infcmd.c 1 Feb 2003 17:28:40 -0000 1.72
> +++ infcmd.c 5 Feb 2003 01:49:13 -0000
> @@ -1,6 +1,6 @@
> /* Memory-access and commands for "inferior" process, for GDB.
> Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
> - 1996, 1997, 1998, 1999, 2000, 2001, 2002
> + 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> @@ -854,7 +854,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: linespec.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/linespec.c,v
> retrieving revision 1.39
> diff -u -p -r1.39 linespec.c
> --- linespec.c 4 Feb 2003 21:24:21 -0000 1.39
> +++ linespec.c 5 Feb 2003 01:49:13 -0000
> @@ -429,7 +429,7 @@ decode_line_2 (struct symbol *sym_arr[],
> 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);
> }
> @@ -1099,11 +1099,11 @@ decode_compound (char **argptr, int funf
> if (tmp[0] == '~')
> cplusplus_error (saved_arg,
> "the class `%s' does not have destructor defined\n",
> - SYMBOL_SOURCE_NAME (sym_class));
> + SYMBOL_PRINT_NAME (sym_class));
> else
> cplusplus_error (saved_arg,
> "the class %s does not have any method named %s\n",
> - SYMBOL_SOURCE_NAME (sym_class), tmp);
> + SYMBOL_PRINT_NAME (sym_class), tmp);
> }
> }
>
> Index: maint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/maint.c,v
> retrieving revision 1.33
> diff -u -p -r1.33 maint.c
> --- maint.c 27 Jan 2003 20:25:35 -0000 1.33
> +++ maint.c 5 Feb 2003 01:49:13 -0000
> @@ -494,7 +494,7 @@ maintenance_translate_address (char *arg
>
> 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: objc-lang.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/objc-lang.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 objc-lang.c
> --- objc-lang.c 24 Dec 2002 03:42:36 -0000 1.9
> +++ objc-lang.c 5 Feb 2003 01:49:13 -0000
> @@ -1,6 +1,6 @@
> /* Objective-C language support routines for GDB, the GNU debugger.
>
> - Copyright 2002 Free Software Foundation, Inc.
> + Copyright 2002, 2003 Free Software Foundation, Inc.
>
> Contributed by Apple Computer, Inc.
> Written by Michael Snyder.
> @@ -798,8 +798,8 @@ compare_selectors (const void *a, const
> {
> char *aname, *bname;
>
> - aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
> - bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
> + aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
> + bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
> if (aname == NULL || bname == NULL)
> error ("internal: compare_selectors(1)");
>
> @@ -956,8 +956,8 @@ compare_classes (const void *a, const vo
> {
> char *aname, *bname;
>
> - aname = SYMBOL_SOURCE_NAME (*(struct symbol **) a);
> - bname = SYMBOL_SOURCE_NAME (*(struct symbol **) b);
> + aname = SYMBOL_PRINT_NAME (*(struct symbol **) a);
> + bname = SYMBOL_PRINT_NAME (*(struct symbol **) b);
> if (aname == NULL || bname == NULL)
> error ("internal: compare_classes(1)");
>
> Index: p-valprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/p-valprint.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 p-valprint.c
> --- p-valprint.c 14 Sep 2002 02:09:39 -0000 1.14
> +++ p-valprint.c 5 Feb 2003 01:49:14 -0000
> @@ -1,5 +1,5 @@
> /* Support for printing Pascal values for GDB, the GNU debugger.
> - Copyright 2000, 2001
> + Copyright 2000, 2001, 2003
> Free Software Foundation, Inc.
>
> This file is part of GDB.
> @@ -213,7 +213,7 @@ pascal_val_print (struct type *type, cha
> && (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: printcmd.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/printcmd.c,v
> retrieving revision 1.51
> diff -u -p -r1.51 printcmd.c
> --- printcmd.c 4 Feb 2003 21:37:03 -0000 1.51
> +++ printcmd.c 5 Feb 2003 01:49:14 -0000
> @@ -640,7 +640,7 @@ build_address_symbolic (CORE_ADDR addr,
> {
> name_location = BLOCK_START (SYMBOL_BLOCK_VALUE (symbol));
> if (do_demangle || asm_demangle)
> - name_temp = SYMBOL_SOURCE_NAME (symbol);
> + name_temp = SYMBOL_PRINT_NAME (symbol);
> else
> name_temp = SYMBOL_NAME (symbol);
> }
> @@ -655,7 +655,7 @@ build_address_symbolic (CORE_ADDR addr,
> symtab = 0;
> name_location = SYMBOL_VALUE_ADDRESS (msymbol);
> if (do_demangle || asm_demangle)
> - name_temp = SYMBOL_SOURCE_NAME (msymbol);
> + name_temp = SYMBOL_PRINT_NAME (msymbol);
> else
> name_temp = SYMBOL_NAME (msymbol);
> }
> @@ -1043,10 +1043,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))
> @@ -1879,7 +1879,7 @@ print_frame_args (struct symbol *func, s
> 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: stabsread.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/stabsread.c,v
> retrieving revision 1.55
> diff -u -p -r1.55 stabsread.c
> --- stabsread.c 4 Feb 2003 18:07:01 -0000 1.55
> +++ stabsread.c 5 Feb 2003 01:49:14 -0000
> @@ -1722,7 +1722,7 @@ define_symbol (CORE_ADDR valu, char *str
> {
> 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;
> @@ -1738,7 +1738,7 @@ define_symbol (CORE_ADDR valu, char *str
> {
> 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;
> @@ -1989,7 +1989,7 @@ define_symbol (CORE_ADDR valu, char *str
> {
> 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: stack.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/stack.c,v
> retrieving revision 1.65
> diff -u -p -r1.65 stack.c
> --- stack.c 2 Feb 2003 18:30:56 -0000 1.65
> +++ stack.c 5 Feb 2003 01:49:14 -0000
> @@ -360,7 +360,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
> @@ -381,7 +381,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);
> }
> }
> }
> @@ -638,7 +638,7 @@ frame_info (char *addr_exp, int from_tty
> s = find_pc_symtab (get_frame_pc (fi));
> 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
> @@ -662,7 +662,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
> @@ -1085,7 +1085,7 @@ print_block_frame_locals (struct block *
> 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");
> @@ -1122,7 +1122,7 @@ print_block_frame_labels (struct block *
> 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, " ");
> @@ -1309,7 +1309,7 @@ print_frame_arg_vars (register struct fr
> 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
> @@ -1621,7 +1621,7 @@ return_command (char *retval_exp, int fr
> {
> 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: symfile.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symfile.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 symfile.c
> --- symfile.c 4 Feb 2003 18:07:01 -0000 1.87
> +++ symfile.c 5 Feb 2003 01:49:14 -0000
> @@ -209,7 +209,7 @@ compare_symbols (const void *s1p, const
>
> s1 = (struct symbol **) s1p;
> s2 = (struct symbol **) s2p;
> - return (strcmp (SYMBOL_SOURCE_NAME (*s1), SYMBOL_SOURCE_NAME (*s2)));
> + return (strcmp (SYMBOL_PRINT_NAME (*s1), SYMBOL_PRINT_NAME (*s2)));
> }
>
> /*
> @@ -242,8 +242,8 @@ compare_psymbols (const void *s1p, const
>
> s1 = (struct partial_symbol **) s1p;
> s2 = (struct partial_symbol **) s2p;
> - st1 = SYMBOL_SOURCE_NAME (*s1);
> - st2 = SYMBOL_SOURCE_NAME (*s2);
> + st1 = SYMBOL_PRINT_NAME (*s1);
> + st2 = SYMBOL_PRINT_NAME (*s2);
>
>
> if ((st1[0] - st2[0]) || !st1[0])
> Index: symmisc.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symmisc.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 symmisc.c
> --- symmisc.c 18 Jan 2003 15:55:53 -0000 1.14
> +++ symmisc.c 5 Feb 2003 01:49:14 -0000
> @@ -1,8 +1,8 @@
> /* Do various things to symbol tables (other than lookup), for GDB.
>
> Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
> - 1995, 1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation,
> - Inc.
> + 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software
> + Foundation, Inc.
>
> This file is part of GDB.
>
> @@ -574,7 +574,7 @@ print_symbol (void *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",
> @@ -609,14 +609,14 @@ print_symbol (void *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: symtab.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/symtab.c,v
> retrieving revision 1.87
> diff -u -p -r1.87 symtab.c
> --- symtab.c 4 Feb 2003 18:07:01 -0000 1.87
> +++ symtab.c 5 Feb 2003 01:49:14 -0000
> @@ -1395,7 +1395,7 @@ lookup_partial_symbol (struct partial_sy
> {
> do_linear_search = 1;
> }
> - if (strcmp (SYMBOL_SOURCE_NAME (*center), name) >= 0)
> + if (strcmp (SYMBOL_PRINT_NAME (*center), name) >= 0)
> {
> top = center;
> }
> @@ -1641,15 +1641,15 @@ lookup_block_symbol (register const stru
> {
> do_linear_search = 1;
> }
> - if (SYMBOL_SOURCE_NAME (sym)[0] < name[0])
> + if (SYMBOL_PRINT_NAME (sym)[0] < name[0])
> {
> bot = inc;
> }
> - else if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
> + else if (SYMBOL_PRINT_NAME (sym)[0] > name[0])
> {
> top = inc;
> }
> - else if (strcmp (SYMBOL_SOURCE_NAME (sym), name) < 0)
> + else if (strcmp (SYMBOL_PRINT_NAME (sym), name) < 0)
> {
> bot = inc;
> }
> @@ -1681,7 +1681,7 @@ lookup_block_symbol (register const stru
> {
> return sym;
> }
> - if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
> + if (SYMBOL_PRINT_NAME (sym)[0] > name[0])
> {
> break;
> }
> @@ -2748,8 +2748,8 @@ compare_search_syms (const void *sa, con
> 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_PRINT_NAME ((*sym_a)->symbol),
> + SYMBOL_PRINT_NAME ((*sym_b)->symbol));
> }
>
> /* Sort the ``nfound'' symbols in the list after prevtail. Leave
> @@ -3137,7 +3137,7 @@ print_symbol_info (namespace_enum kind,
> {
> type_print (SYMBOL_TYPE (sym),
> (SYMBOL_CLASS (sym) == LOC_TYPEDEF
> - ? "" : SYMBOL_SOURCE_NAME (sym)),
> + ? "" : SYMBOL_PRINT_NAME (sym)),
> gdb_stdout, 0);
>
> printf_filtered (";\n");
> @@ -3160,7 +3160,7 @@ print_msymbol_info (struct minimal_symbo
> tmp = local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol),
> "016l");
> printf_filtered ("%s %s\n",
> - tmp, SYMBOL_SOURCE_NAME (msymbol));
> + tmp, SYMBOL_PRINT_NAME (msymbol));
> }
>
> /* This is the guts of the commands "info functions", "info types", and
> @@ -3275,7 +3275,7 @@ rbreak_command (char *regexp, int from_t
> {
> 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: tracepoint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/tracepoint.c,v
> retrieving revision 1.46
> diff -u -p -r1.46 tracepoint.c
> --- tracepoint.c 28 Dec 2002 23:22:21 -0000 1.46
> +++ tracepoint.c 5 Feb 2003 01:49:15 -0000
> @@ -1,6 +1,6 @@
> /* Tracing functionality for remote targets in custom GDB protocol
>
> - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software
> + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
> Foundation, Inc.
>
> This file is part of GDB.
> @@ -508,7 +508,7 @@ tracepoints_info (char *tpnum_exp, int f
> 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: typeprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/typeprint.c,v
> retrieving revision 1.14
> diff -u -p -r1.14 typeprint.c
> --- typeprint.c 14 Jan 2003 00:49:04 -0000 1.14
> +++ typeprint.c 5 Feb 2003 01:49:15 -0000
> @@ -68,7 +68,7 @@ typedef_print (struct type *type, struct
> 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
> @@ -76,7 +76,7 @@ typedef_print (struct type *type, struct
> 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);
> @@ -85,7 +85,7 @@ typedef_print (struct type *type, struct
> #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
> Index: valops.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/valops.c,v
> retrieving revision 1.89
> diff -u -p -r1.89 valops.c
> --- valops.c 30 Jan 2003 16:44:20 -0000 1.89
> +++ valops.c 5 Feb 2003 01:49:15 -0000
> @@ -834,9 +834,9 @@ value_of_variable (struct symbol *var, s
> 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");
> }
> @@ -844,7 +844,7 @@ value_of_variable (struct symbol *var, s
>
> 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;
> }
> @@ -1657,7 +1657,7 @@ You must use a pointer to function type
> symbol = find_pc_function (funaddr);
> if (symbol)
> {
> - name = SYMBOL_SOURCE_NAME (symbol);
> + name = SYMBOL_PRINT_NAME (symbol);
> }
> else
> {
> @@ -1666,7 +1666,7 @@ You must use a pointer to function type
>
> if (msymbol)
> {
> - name = SYMBOL_SOURCE_NAME (msymbol);
> + name = SYMBOL_PRINT_NAME (msymbol);
> }
> }
> if (name == NULL)
> Index: cli/cli-cmds.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/cli/cli-cmds.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 cli-cmds.c
> --- cli/cli-cmds.c 10 Dec 2002 00:30:43 -0000 1.26
> +++ cli/cli-cmds.c 5 Feb 2003 01:49:15 -0000
> @@ -1,6 +1,6 @@
> /* GDB CLI commands.
>
> - Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
> + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
>
> This file is part of GDB.
>
> @@ -605,7 +605,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
> @@ -772,7 +772,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