From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5099 invoked by alias); 24 Jan 2011 20:20:52 -0000 Received: (qmail 5051 invoked by uid 22791); 24 Jan 2011 20:20:51 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Jan 2011 20:20:44 +0000 Received: (qmail 3750 invoked from network); 24 Jan 2011 20:20:40 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Jan 2011 20:20:40 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [Ada] Make sure we pass the correct struct value to val_print & co. Date: Mon, 24 Jan 2011 20:36:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.1; x86_64; ; ) Cc: Joel Brobecker MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201101242020.37882.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00467.txt.bz2 Another patch touching Ada bits. This makes sure that we pass in the the correct struct value to val_print & co, because val_print functions need to consult the value for meta-data about the value contents, such the value_bits_valid calls, and with later changes, a function that checks whether contents at a given offset are "available". This fixes a few cases in the Ada val_print routines I had caught by inspection. No regressions on gdb.ada/, FWIW. Okay to apply? -- Pedro Alves 2011-01-24 Pedro Alves * ada-valprint.c (val_print_packed_array_elements): Pass the correct struct value to val_print. (ada_val_print_1): Ditto. --- gdb/ada-valprint.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) Index: src/gdb/ada-valprint.c =================================================================== --- src.orig/gdb/ada-valprint.c 2011-01-24 18:44:19.000000000 +0000 +++ src/gdb/ada-valprint.c 2011-01-24 20:13:07.677639998 +0000 @@ -211,7 +211,7 @@ val_print_packed_array_elements (struct opts.deref_ref = 0; val_print (elttype, value_contents_for_printing (v0), value_embedded_offset (v0), 0, stream, - recurse + 1, val, &opts, current_language); + recurse + 1, v0, &opts, current_language); annotate_elt_rep (i - i0); fprintf_filtered (stream, _(" "), i - i0); annotate_elt_rep_end (); @@ -242,7 +242,7 @@ val_print_packed_array_elements (struct } val_print (elttype, value_contents_for_printing (v0), value_embedded_offset (v0), 0, stream, - recurse + 1, val, &opts, current_language); + recurse + 1, v0, &opts, current_language); annotate_elt (); } } @@ -708,7 +708,7 @@ ada_val_print_1 (struct type *type, cons value_contents_for_printing (val), value_embedded_offset (val), value_address (val), stream, recurse, - NULL, options); + val, options); value_free_to_mark (mark); return retn; } @@ -770,7 +770,7 @@ ada_val_print_1 (struct type *type, cons return ada_val_print_1 (target_type, value_contents_for_printing (v), value_embedded_offset (v), 0, - stream, recurse + 1, NULL, options); + stream, recurse + 1, v, options); } else return ada_val_print_1 (TYPE_TARGET_TYPE (type), @@ -915,7 +915,7 @@ ada_val_print_1 (struct type *type, cons value_contents_for_printing (deref_val), value_embedded_offset (deref_val), value_address (deref_val), stream, recurse + 1, - original_value, options, current_language); + deref_val, options, current_language); } else fputs_filtered ("(null)", stream);