X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fp-valprint.c;h=92f820fc2c70d4b24d7a0c7e2ec94bb55c32e734;hb=9b254dd1ce46c19dde1dde5b8d1e22e862dfacce;hp=c2de75f5ea29b02aa4b9c5e293c2fe00f1d95337;hpb=a9762ec78a53fbe9209fe1654db42df0cd328d50;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index c2de75f5ea..92f820fc2c 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -1,6 +1,6 @@ /* Support for printing Pascal values for GDB, the GNU debugger. - Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007 + Copyright (C) 2000, 2001, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of GDB. @@ -85,9 +85,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, print_spaces_filtered (2 + 2 * recurse, stream); } /* For an array of chars, print with string syntax. */ - if (eltlen == 1 && - ((TYPE_CODE (elttype) == TYPE_CODE_INT) - || ((current_language->la_language == language_m2) + if (eltlen == 1 + && ((TYPE_CODE (elttype) == TYPE_CODE_INT) + || ((current_language->la_language == language_pascal) && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) && (format == 0 || format == 's')) { @@ -164,13 +164,14 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, if (addressprint && format != 's') { - deprecated_print_address_numeric (addr, 1, stream); + fputs_filtered (paddress (addr), stream); } /* For a pointer to char or unsigned char, also print the string pointed to, unless pointer is null. */ if (TYPE_LENGTH (elttype) == 1 - && TYPE_CODE (elttype) == TYPE_CODE_INT + && (TYPE_CODE (elttype) == TYPE_CODE_INT + || TYPE_CODE(elttype) == TYPE_CODE_CHAR) && (format == 0 || format == 's') && addr != 0) { @@ -217,7 +218,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, int is_this_fld; if (msymbol != NULL) - wsym = lookup_symbol (DEPRECATED_SYMBOL_NAME (msymbol), block, + wsym = lookup_symbol (SYMBOL_LINKAGE_NAME (msymbol), block, VAR_DOMAIN, &is_this_fld, NULL); if (wsym) @@ -252,11 +253,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { fprintf_filtered (stream, "@"); /* Extract the address, assume that it is unsigned. */ - deprecated_print_address_numeric - (extract_unsigned_integer (valaddr + embedded_offset, - gdbarch_ptr_bit (current_gdbarch) - / HOST_CHAR_BIT), - 1, stream); + fputs_filtered (paddress ( + extract_unsigned_integer (valaddr + embedded_offset, + gdbarch_ptr_bit (current_gdbarch) / HOST_CHAR_BIT)), stream); if (deref_ref) fputs_filtered (": ", stream); } @@ -530,14 +529,14 @@ pascal_value_print (struct value *val, struct ui_file *stream, int format, Object pascal: if it is a member pointer, we will take care of that when we print it. */ - if (TYPE_CODE (type) == TYPE_CODE_PTR || - TYPE_CODE (type) == TYPE_CODE_REF) + if (TYPE_CODE (type) == TYPE_CODE_PTR + || TYPE_CODE (type) == TYPE_CODE_REF) { /* Hack: remove (char *) for char strings. Their type is indicated by the quoted string anyway. */ - if (TYPE_CODE (type) == TYPE_CODE_PTR && - TYPE_NAME (type) == NULL && - TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL + if (TYPE_CODE (type) == TYPE_CODE_PTR + && TYPE_NAME (type) == NULL + && TYPE_NAME (TYPE_TARGET_TYPE (type)) != NULL && strcmp (TYPE_NAME (TYPE_TARGET_TYPE (type)), "char") == 0) { /* Print nothing */