X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fgo-valprint.c;h=eccf9a818144d7281f40641c636daf8b7dbd1c0f;hb=cbe5657196d0d3acbeca39973f93f333ecedacda;hp=edef92c7b1eab39e0235e7ac57af73b6d5866663;hpb=28e7fd62340426746f9c896cbc40c5d374ec47aa;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/go-valprint.c b/gdb/go-valprint.c index edef92c7b1..eccf9a8181 100644 --- a/gdb/go-valprint.c +++ b/gdb/go-valprint.c @@ -1,6 +1,6 @@ /* Support for printing Go values for GDB, the GNU debugger. - Copyright (C) 2012-2013 Free Software Foundation, Inc. + Copyright (C) 2012-2018 Free Software Foundation, Inc. This file is part of GDB. @@ -36,10 +36,10 @@ gdb_assert (go_classify_struct_type (type) == GO_TYPE_STRING). */ static void -print_go_string (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, +print_go_string (struct type *type, + LONGEST embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, + struct value *val, const struct value_print_options *options) { struct gdbarch *gdbarch = get_type_arch (type); @@ -51,8 +51,8 @@ print_go_string (struct type *type, const gdb_byte *valaddr, unpack_value_field_as_pointer. Do this until we can get unpack_value_field_as_pointer. */ LONGEST addr; + const gdb_byte *valaddr = value_contents_for_printing (val); - gdb_assert (valaddr == value_contents_for_printing_const (val)); if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0, val, &addr)) @@ -86,12 +86,12 @@ print_go_string (struct type *type, const gdb_byte *valaddr, /* Implements the la_val_print routine for language Go. */ void -go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +go_val_print (struct type *type, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, - const struct value *val, + struct value *val, const struct value_print_options *options) { - CHECK_TYPEDEF (type); + type = check_typedef (type); switch (TYPE_CODE (type)) { @@ -104,7 +104,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, case GO_TYPE_STRING: if (! options->raw) { - print_go_string (type, valaddr, embedded_offset, address, + print_go_string (type, embedded_offset, address, stream, recurse, val, options); return; } @@ -116,7 +116,7 @@ go_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, /* Fall through. */ default: - c_val_print (type, valaddr, embedded_offset, address, stream, + c_val_print (type, embedded_offset, address, stream, recurse, val, options); break; }