From c45f11dab9229c1686dc62f77f2f1651dfd32052 Mon Sep 17 00:00:00 2001 From: Pierre Muller Date: Wed, 26 Sep 2007 12:25:16 +0000 Subject: [PATCH] 2007-09-26 Pierre Muller * Fix PR pascal/2283 p-valprint.c (pascal_val_print): correct current language check. Also print array of char as strings. --- gdb/ChangeLog | 7 +++++++ gdb/p-valprint.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6db546a42ad..50c6b354e42 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2007-09-26 Pierre Muller + + * Fix PR pascal/2283 + p-valprint.c (pascal_val_print): correct current language check. + Also print array of char as strings. + + 2007-09-26 David Ung Maciej W. Rozycki diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 0f40d6d2157..2ebbaf8a389 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -87,7 +87,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, /* For an array of chars, print with string syntax. */ if (eltlen == 1 && ((TYPE_CODE (elttype) == TYPE_CODE_INT) - || ((current_language->la_language == language_m2) + || ((current_language->la_language == language_pascal) && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) && (format == 0 || format == 's')) { @@ -170,7 +170,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, /* 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) { -- 2.30.2