/* 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.
supported at this level. */
void
-print_scalar_formatted (const void *valaddr, struct type *type,
+print_scalar_formatted (const gdb_byte *valaddr, struct type *type,
const struct value_print_options *options,
int size, struct ui_file *stream)
{
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);