* elf64-mips.c (elf_backend_got_header_size): Correct definition.
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index bee8a85090439e9738d78e5db98a49cac24e6d17..030a4f2536efa08c41f6fe4f7d10a304bbe45107 100644 (file)
@@ -568,9 +568,10 @@ set_next_address (struct gdbarch *gdbarch, CORE_ADDR addr)
    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)
@@ -589,7 +590,7 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
                              &filename, &line, &unmapped))
     {
       do_cleanups (cleanup_chain);
-      return;
+      return 0;
     }
 
   fputs_filtered (leadin, stream);
@@ -616,6 +617,7 @@ print_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR addr,
     fputs_filtered (">", stream);
 
   do_cleanups (cleanup_chain);
+  return 1;
 }
 
 /* Given an address ADDR return all the elements needed to print the
@@ -638,7 +640,7 @@ build_address_symbolic (struct gdbarch *gdbarch,
   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;
@@ -683,6 +685,13 @@ build_address_symbolic (struct gdbarch *gdbarch,
        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)
@@ -763,29 +772,23 @@ pc_prefix (CORE_ADDR addr)
 
 /* 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
 
@@ -1080,6 +1083,22 @@ set_command (char *exp, int from_tty)
   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);
 }
@@ -1594,7 +1613,6 @@ map_display_numbers (char *args,
                     void *data)
 {
   struct get_number_or_range_state state;
-  struct display *b, *tmp;
   int num;
 
   if (args == NULL)
@@ -1637,9 +1655,6 @@ do_delete_display (struct display *d, void *data)
 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? ")))
This page took 0.024895 seconds and 4 git commands to generate.