/* 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)
{
/* String printing should go through val_print_scalar_formatted. */
gdb_assert (options->format != 's');
- if (len > sizeof(LONGEST) &&
- (TYPE_CODE (type) == TYPE_CODE_INT
- || TYPE_CODE (type) == TYPE_CODE_ENUM))
+ if (len > sizeof(LONGEST)
+ && (TYPE_CODE (type) == TYPE_CODE_INT
+ || TYPE_CODE (type) == TYPE_CODE_ENUM))
{
switch (options->format)
{
else
{
section = MSYMBOL_OBJ_SECTION (msym.objfile, msym.minsym);
- load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
- printf_filtered (_("a thread-local variable at offset %s "
- "in the thread-local storage for `%s'"),
- paddress (gdbarch, load_addr),
- objfile_name (section->objfile));
+ {
+ load_addr = MSYMBOL_VALUE_RAW_ADDRESS (msym.minsym);
+ printf_filtered (_("a thread-local variable at offset %s "
+ "in the thread-local storage for `%s'"),
+ paddress (gdbarch, load_addr),
+ objfile_name (section->objfile));
+ }
else
{
+ load_addr = BMSYMBOL_VALUE_ADDRESS (msym);
printf_filtered (_("static storage at address "));
fputs_filtered (paddress (gdbarch, load_addr), gdb_stdout);
if (section_is_overlay (section))
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);
struct type *wctype = lookup_typename (current_language, gdbarch,
"wchar_t", NULL, 0);
int wcwidth = TYPE_LENGTH (wctype);
- gdb_byte *buf = alloca (wcwidth);
+ gdb_byte *buf = (gdb_byte *) alloca (wcwidth);
struct obstack output;
struct cleanup *inner_cleanup;
long val = value_as_long (value);
#endif
- fmt = alloca (strlen (format) + 5);
+ fmt = (char *) alloca (strlen (format) + 5);
/* Copy up to the leading %. */
p = format;