+2003-02-20 David Carlton <carlton@math.stanford.edu>
+
+ * symtab.h (SYMBOL_PRINT_NAME): Rename from SYMBOL_SOURCE_NAME;
+ expand comment.
+ * ada-lang.c (user_select_syms, ada_finish_decode_line_1): Replace
+ SYMBOL_PRINT_NAME with SYMBOL_SOURCE_NAME.
+ * 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, decode_compound): Ditto.
+ * maint.c (maintenance_translate_address): Ditto.
+ * objc-lang.c (compare_selectors, compare_classes): Ditto.
+ * printcmd.c (build_address_symbolic, sym_info, print_frame_args):
+ Ditto.
+ * p-valprint.c (pascal_val_print): Ditto.
+ * stabsread.c (define_symbol): Ditto.
+ * stack.c (print_frame, frame_info, print_block_frame_locals)
+ (print_frame_arg_vars, return_command): Ditto.
+ * symfile.c (compare_symbols, compare_psymbols): Ditto.
+ * symmisc.c (print_symbol): Ditto.
+ * symtab.c (lookup_partial_symbol, lookup_block_symbol)
+ (compare_search_syms, print_symbol_info, print_msymbol_info)
+ (rbreak_command): Ditto.
+ * tracepoint.c (tracepoints_info): Ditto.
+ * typeprint.c (typedef_print): Ditto.
+ * valops.c (value_of_variable, hand_function_call): Ditto.
+ * cli/cli-cmds.c (edit_command, list_command): Ditto.
+ * ada-typeprint.c: Update Copyright.
+ * infcmd.c, objc-lang.c, p-valprint.c, symmisc.c: Ditto.
+ * tracepoint.c, cli/cli-cmds.c: Ditto.
+
2003-02-20 Kevin Buettner <kevinb@redhat.com>
* frame.c (generic_unwind_get_saved_register): Make non-static.
/* 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.
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);
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]));
}
}
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);
/* 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.
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);
}
case LOC_TYPEDEF:
error ("Cannot compute value of typedef `%s'.",
- SYMBOL_SOURCE_NAME (var));
+ SYMBOL_PRINT_NAME (var));
break;
case LOC_BLOCK:
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));
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;
}
}
{
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 ");
}
{
complaint (&symfile_complaints,
"block end address less than block start address in %s (patched it)",
- SYMBOL_SOURCE_NAME (symbol));
+ SYMBOL_PRINT_NAME (symbol));
}
else
{
{
complaint (&symfile_complaints,
"inner block not inside outer block in %s",
- SYMBOL_SOURCE_NAME (symbol));
+ SYMBOL_PRINT_NAME (symbol));
}
else
{
(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)
/* 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.
{
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
{
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
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;
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)
&& *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;
&& *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 */
/* 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.
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 */
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);
}
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);
}
}
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));
/* 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.
{
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)");
{
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)");
/* 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.
&& (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)
{
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);
}
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);
}
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))
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 ();
{
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;
{
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;
{
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;
}
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
/* 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);
}
}
}
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
* but that's preferable to diplaying a mangled name.
*/
if (demangled == NULL)
- funname = SYMBOL_SOURCE_NAME (func);
+ funname = SYMBOL_PRINT_NAME (func);
}
}
else
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");
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, " ");
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
{
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 */
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)));
}
/*
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])
/* 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.
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",
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))
{
{
do_linear_search = 1;
}
- if (strcmp (SYMBOL_SOURCE_NAME (*center), name) >= 0)
+ if (strcmp (SYMBOL_PRINT_NAME (*center), name) >= 0)
{
top = center;
}
{
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;
}
{
return sym;
}
- if (SYMBOL_SOURCE_NAME (sym)[0] > name[0])
+ if (SYMBOL_PRINT_NAME (sym)[0] > name[0])
{
break;
}
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
{
type_print (SYMBOL_TYPE (sym),
(SYMBOL_CLASS (sym) == LOC_TYPEDEF
- ? "" : SYMBOL_SOURCE_NAME (sym)),
+ ? "" : SYMBOL_PRINT_NAME (sym)),
gdb_stdout, 0);
printf_filtered (";\n");
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
{
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));
}
}
#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. */
-
-#define SYMBOL_SOURCE_NAME(symbol) \
+/* Macro that returns 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_PRINT_NAME(symbol) \
(demangle && SYMBOL_DEMANGLED_NAME (symbol) != NULL \
? SYMBOL_DEMANGLED_NAME (symbol) \
: SYMBOL_NAME (symbol))
/* 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.
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);
}
type_print (type, "", stream, 0);
if (TYPE_NAME ((SYMBOL_TYPE (new))) == 0
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0)
- fprintf_filtered (stream, " %s", SYMBOL_SOURCE_NAME (new));
+ fprintf_filtered (stream, " %s", SYMBOL_PRINT_NAME (new));
break;
#endif
#ifdef _LANG_m2
fprintf_filtered (stream, "TYPE ");
if (!TYPE_NAME (SYMBOL_TYPE (new))
|| strcmp (TYPE_NAME ((SYMBOL_TYPE (new))), SYMBOL_NAME (new)) != 0)
- 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);
#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
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");
}
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;
}
symbol = find_pc_function (funaddr);
if (symbol)
{
- name = SYMBOL_SOURCE_NAME (symbol);
+ name = SYMBOL_PRINT_NAME (symbol);
}
else
{
if (msymbol)
{
- name = SYMBOL_SOURCE_NAME (msymbol);
+ name = SYMBOL_PRINT_NAME (msymbol);
}
}
if (name == NULL)