DO_DEMANGLE controls whether to print a symbol in its native "raw" form,
or to interpret it as a possible C++ name and convert it back to source
form. However note that DO_DEMANGLE can be overridden by the specific
- settings of the demangle and asm_demangle variables. */
+ settings of the demangle and asm_demangle variables. Returns
+ non-zero if anything was printed; zero otherwise. */
-void
+int
print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
struct ui_file *stream,
int do_demangle, char *leadin)
&filename, &line, &unmapped))
{
do_cleanups (cleanup_chain);
- return;
+ return 0;
}
fputs_filtered (leadin, stream);
fputs_filtered (">", stream);
do_cleanups (cleanup_chain);
+ return 1;
}
/* Given an address ADDR return all the elements needed to print the
struct symbol *symbol;
CORE_ADDR name_location = 0;
struct obj_section *section = NULL;
- char *name_temp = "";
+ const char *name_temp = "";
/* Let's say it is mapped (not unmapped). */
*unmapped = 0;
name_temp = SYMBOL_LINKAGE_NAME (symbol);
}
+ if (msymbol != NULL
+ && MSYMBOL_SIZE (msymbol) == 0
+ && MSYMBOL_TYPE (msymbol) != mst_text
+ && MSYMBOL_TYPE (msymbol) != mst_text_gnu_ifunc
+ && MSYMBOL_TYPE (msymbol) != mst_file_text)
+ msymbol = NULL;
+
if (msymbol != NULL)
{
if (SYMBOL_VALUE_ADDRESS (msymbol) > name_location || symbol == NULL)
/* Print address ADDR symbolically on STREAM. Parameter DEMANGLE
controls whether to print the symbolic name "raw" or demangled.
- Global setting "addressprint" controls whether to print hex address
- or not. */
+ Return non-zero if anything was printed; zero otherwise. */
-void
-print_address_demangle (struct gdbarch *gdbarch, CORE_ADDR addr,
+int
+print_address_demangle (const struct value_print_options *opts,
+ struct gdbarch *gdbarch, CORE_ADDR addr,
struct ui_file *stream, int do_demangle)
{
- struct value_print_options opts;
-
- get_user_print_options (&opts);
- if (addr == 0)
- {
- fprintf_filtered (stream, "0");
- }
- else if (opts.addressprint)
+ if (opts->addressprint)
{
fputs_filtered (paddress (gdbarch, addr), stream);
print_address_symbolic (gdbarch, addr, stream, do_demangle, " ");
}
else
{
- print_address_symbolic (gdbarch, addr, stream, do_demangle, "");
+ return print_address_symbolic (gdbarch, addr, stream, do_demangle, "");
}
+ return 1;
}
\f
struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
+ if (expr->nelts >= 1)
+ switch (expr->elts[0].opcode)
+ {
+ case UNOP_PREINCREMENT:
+ case UNOP_POSTINCREMENT:
+ case UNOP_PREDECREMENT:
+ case UNOP_POSTDECREMENT:
+ case BINOP_ASSIGN:
+ case BINOP_ASSIGN_MODIFY:
+ case BINOP_COMMA:
+ break;
+ default:
+ warning
+ (_("Expression is not an assignment (and might have no effect)"));
+ }
+
evaluate_expression (expr);
do_cleanups (old_chain);
}
void *data)
{
struct get_number_or_range_state state;
- struct display *b, *tmp;
int num;
if (args == NULL)
static void
undisplay_command (char *args, int from_tty)
{
- int num;
- struct get_number_or_range_state state;
-
if (args == NULL)
{
if (query (_("Delete all auto-display expressions? ")))