Fix PR threads/19422 - show which thread caused stop
[deliverable/binutils-gdb.git] / gdb / printcmd.c
index 1744abd432485b0658abffeed88c95247c05f78a..8acf44131735c9702ee42a4998e7cee9d8bef96d 100644 (file)
@@ -1,6 +1,6 @@
 /* Print values for GNU debugger GDB.
 
-   Copyright (C) 1986-2015 Free Software Foundation, Inc.
+   Copyright (C) 1986-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -1543,11 +1543,21 @@ display_command (char *arg, int from_tty)
   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;
+  newobj->next = NULL;
+
+  if (display_chain == NULL)
+    display_chain = newobj;
+  else
+    {
+      struct display *last;
+
+      for (last = display_chain; last->next != NULL; last = last->next)
+       ;
+      last->next = newobj;
+    }
 
   if (from_tty)
     do_one_display (newobj);
This page took 0.024 seconds and 4 git commands to generate.