aboutsummaryrefslogtreecommitdiff
path: root/gdb/ch-valprint.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
committerFred Fish <fnf@specifix.com>1993-01-19 23:00:19 +0000
commitec16f7015b91a7324011b41f6a13dfab0fd5d21a (patch)
treee7f4babdb56207372200a6e11c3f46b4bbcacb97 /gdb/ch-valprint.c
parentfa2b89f1032989451742a5a75bcdec34736f903a (diff)
downloadgdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.zip
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.gz
gdb-ec16f7015b91a7324011b41f6a13dfab0fd5d21a.tar.bz2
* c-exp.y (exp): Add production to support direct creation
of array constants using the obvious syntax. * c-valprint.c (c_val_print): Set printed string length. * dwarfread.c (read_tag_string_type): New prototype and function that handles TAG_string_type DIEs. * dwarfread.c (process_dies): Add case for TAG_string_type that calls new read_tag_string_type function. * expprint.c (print_subexp): Add support for OP_ARRAY. * gdbtypes.c (create_range_type, create_array_type): Inherit objfile from the index type. **** start-sanitize-chill **** * ch-typeprint.c (chill_print_type): Add case for TYPE_CODE_STRING. * ch-valprint.c (chill_val_print): Fix case for TYPE_CODE_STRING. **** end-sanitize-chill ****
Diffstat (limited to 'gdb/ch-valprint.c')
-rw-r--r--gdb/ch-valprint.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/ch-valprint.c b/gdb/ch-valprint.c
index c465fc3..37730b4 100644
--- a/gdb/ch-valprint.c
+++ b/gdb/ch-valprint.c
@@ -52,7 +52,7 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
enum val_prettyprint pretty;
{
LONGEST val;
- unsigned int i;
+ unsigned int i = 0; /* Number of characters printed. */
struct type *elttype;
unsigned eltlen;
CORE_ADDR addr;
@@ -156,7 +156,6 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
/* For a pointer to char or unsigned char, also print the string
pointed to, unless pointer is null. */
- i = 0; /* Number of characters printed. */
if (TYPE_LENGTH (elttype) == 1
&& TYPE_CODE (elttype) == TYPE_CODE_CHAR
&& (format == 0 || format == 's')
@@ -178,15 +177,12 @@ chill_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
print_scalar_formatted (valaddr, type, format, 0, stream);
break;
}
- addr = unpack_pointer (lookup_pointer_type (builtin_type_char), valaddr);
if (addressprint && format != 's')
{
- fprintf_filtered (stream, "0x%x", addr);
- }
- if (addr != 0)
- {
- i = val_print_string (addr, TYPE_LENGTH (type), stream);
+ fprintf_filtered (stream, "0x%x ", addr);
}
+ i = TYPE_LENGTH (type);
+ LA_PRINT_STRING (stream, valaddr, i, 0);
/* Return number of characters printed, plus one for the terminating
null if we have "reached the end". */
return (i + (print_max && i != print_max));