From 1326dacef924696d3969b43f152b39443b728c43 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Mon, 12 Jul 1993 18:00:48 +0000 Subject: [PATCH] * c-valprint.c (c_val_print): Fix thinko with unspecified length arrays. --- gdb/ChangeLog | 3 +++ gdb/c-valprint.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cd7304f80e7..982ce2b144f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ Mon Jul 12 11:29:44 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + * c-valprint.c (c_val_print): Fix thinko with unspecified length + arrays. + * hppa-tdep.c (find_proc_framesize): If there is a frame pointer, use it. diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index dca35f3dd1d..f50432d40be 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -137,8 +137,8 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse, break; } /* Array of unspecified length: treat like pointer to first elt. */ - valaddr = (char *) &address; - /* FALL THROUGH */ + addr = address; + goto print_unpacked_pointer; case TYPE_CODE_PTR: if (format && format != 's') @@ -159,6 +159,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse, else { addr = unpack_pointer (type, valaddr); + print_unpacked_pointer: elttype = TYPE_TARGET_TYPE (type); if (TYPE_CODE (elttype) == TYPE_CODE_FUNC) -- 2.30.2