PR gdb/18002: Fix reinsert of a permanent breakpoints
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 87b14488b0cf30a52a387da1c6f071f7b97fdd84..cdbed304689cde1444e409fc03a2d8b1d47e6c73 100644 (file)
@@ -1,6 +1,6 @@
 /* Print values for GNU debugger GDB.
 
-   Copyright (C) 1986-2014 Free Software Foundation, Inc.
+   Copyright (C) 1986-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -18,7 +18,6 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include <string.h>
 #include "frame.h"
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "objfiles.h"          /* ditto */
 #include "completer.h"         /* for completion functions */
 #include "ui-out.h"
-#include "gdb_assert.h"
 #include "block.h"
 #include "disasm.h"
 #include "dfp.h"
-#include "exceptions.h"
 #include "observer.h"
 #include "solist.h"
 #include "parser-defs.h"
@@ -1254,8 +1251,11 @@ address_info (char *exp, int from_tty)
                           current_language->la_language, DMGL_ANSI);
   printf_filtered ("\" is ");
   val = SYMBOL_VALUE (sym);
-  section = SYMBOL_OBJ_SECTION (SYMBOL_OBJFILE (sym), sym);
-  gdbarch = get_objfile_arch (SYMBOL_SYMTAB (sym)->objfile);
+  if (SYMBOL_OBJFILE_OWNED (sym))
+    section = SYMBOL_OBJ_SECTION (symbol_objfile (sym), sym);
+  else
+    section = NULL;
+  gdbarch = symbol_arch (sym);
 
   if (SYMBOL_COMPUTED_OPS (sym) != NULL)
     {
@@ -1496,7 +1496,7 @@ display_command (char *arg, int from_tty)
 {
   struct format_data fmt;
   struct expression *expr;
-  struct display *new;
+  struct display *newobj;
   int display_it = 1;
   const char *exp = arg;
 
@@ -1535,20 +1535,20 @@ display_command (char *arg, int from_tty)
       innermost_block = NULL;
       expr = parse_expression (exp);
 
-      new = (struct display *) xmalloc (sizeof (struct display));
+      newobj = (struct display *) xmalloc (sizeof (struct display));
 
-      new->exp_string = xstrdup (exp);
-      new->exp = expr;
-      new->block = innermost_block;
-      new->pspace = current_program_space;
-      new->next = display_chain;
-      new->number = ++display_number;
-      new->format = fmt;
-      new->enabled_p = 1;
-      display_chain = new;
+      newobj->exp_string = xstrdup (exp);
+      newobj->exp = expr;
+      newobj->block = innermost_block;
+      newobj->pspace = current_program_space;
+      newobj->next = display_chain;
+      newobj->number = ++display_number;
+      newobj->format = fmt;
+      newobj->enabled_p = 1;
+      display_chain = newobj;
 
-      if (from_tty && target_has_execution)
-       do_one_display (new);
+      if (from_tty)
+       do_one_display (newobj);
 
       dont_repeat ();
     }
@@ -1618,7 +1618,7 @@ map_display_numbers (char *args,
 
   while (!state.finished)
     {
-      char *p = state.string;
+      const char *p = state.string;
 
       num = get_number_or_range (&state);
       if (num == 0)
This page took 0.025245 seconds and 4 git commands to generate.