From patchwork Wed Nov 5 06:14:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 3585 Received: (qmail 7686 invoked by alias); 5 Nov 2014 06:14:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7676 invoked by uid 89); 5 Nov 2014 06:14:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f174.google.com Received: from mail-pd0-f174.google.com (HELO mail-pd0-f174.google.com) (209.85.192.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Nov 2014 06:14:22 +0000 Received: by mail-pd0-f174.google.com with SMTP id p10so101882pdj.33 for ; Tue, 04 Nov 2014 22:14:20 -0800 (PST) X-Received: by 10.68.143.226 with SMTP id sh2mr55181201pbb.62.1415168060461; Tue, 04 Nov 2014 22:14:20 -0800 (PST) Received: from bubble.grove.modra.org (CPE-58-160-155-134.oycza5.sa.bigpond.net.au. [58.160.155.134]) by mx.google.com with ESMTPSA id ft2sm2105936pbb.15.2014.11.04.22.14.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Nov 2014 22:14:19 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id B07AFEA5E3D; Wed, 5 Nov 2014 16:44:12 +1030 (ACDT) Date: Wed, 5 Nov 2014 16:44:12 +1030 From: Alan Modra To: gdb-patches@sourceware.org Subject: Make dont_print_vb of cp_print_value_fields an int Message-ID: <20141105061412.GC30857@bubble.grove.modra.org> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) dont_print_vb is currently a pointer to an array, but it is only used as a flag. So make it an int. OK to apply? * cp-valprint.c (cp_print_value_fields): Make dont_print_vb param an int. Update function comment. (cp_print_value_fields_rtti): Make dont_print_vb param an int. (cp_print_value): Likewise. * c-lang.h (cp_print_value_fields): Update prototype. (cp_print_value_fields_rtti): Likewise. * c-valprint.c (c_val_print): Update cp_print_value_fields_rtti call. * m2-valprint.c (m2_val_print): Update cp_print_value_fields call. diff --git a/gdb/c-lang.h b/gdb/c-lang.h index 76bd426..524c3d9 100644 --- a/gdb/c-lang.h +++ b/gdb/c-lang.h @@ -124,14 +124,14 @@ extern void cp_print_value_fields (struct type *, struct type *, struct ui_file *, int, const struct value *, const struct value_print_options *, - struct type **, int); + int, int); extern void cp_print_value_fields_rtti (struct type *, const gdb_byte *, int, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, - struct type **, int); + int, int); extern int cp_is_vtbl_ptr_type (struct type *); diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 17963f0..bdb6b53 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -394,7 +394,7 @@ c_val_print (struct type *type, const gdb_byte *valaddr, embedded_offset, address, stream, recurse, original_value, options, - NULL, 0); + 0, 0); break; case TYPE_CODE_INT: diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c index 8f456bf..eaf7cfd 100644 --- a/gdb/cp-valprint.c +++ b/gdb/cp-valprint.c @@ -84,7 +84,7 @@ static void cp_print_value (struct type *, struct type *, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, - struct type **); + int); /* GCC versions after 2.4.5 use this. */ @@ -149,8 +149,13 @@ cp_is_vtbl_member (struct type *type) 2nd argument REAL_TYPE is used to carry over the type of the derived class across the recursion to base classes. - DONT_PRINT is an array of baseclass types that we should not print, - or zero if called from top level. */ + DONT_PRINT_VB is set if we have been called from cp_print_value + while printing virtual baseclasses. DONT_PRINT_VB_OBSTACK contains + an array of types that we should not print in that case. + + DONT_PRINT_STATMEM is set when called from cp_print_static_field + while printing static members. DONT_PRINT_STATMEM_OBSTACK contains + an array of types that we should not print in that case. */ void cp_print_value_fields (struct type *type, struct type *real_type, @@ -158,7 +163,7 @@ cp_print_value_fields (struct type *type, struct type *real_type, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, - struct type **dont_print_vb, + int dont_print_vb, int dont_print_statmem) { int i, len, n_baseclasses; @@ -419,7 +424,7 @@ cp_print_value_fields_rtti (struct type *type, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, - struct type **dont_print_vb, + int dont_print_vb, int dont_print_statmem) { struct type *real_type = NULL; @@ -460,7 +465,7 @@ cp_print_value (struct type *type, struct type *real_type, CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, - struct type **dont_print_vb) + int dont_print_vb) { struct type **last_dont_print = (struct type **) obstack_next_free (&dont_print_vb_obstack); @@ -595,9 +600,7 @@ cp_print_value (struct type *type, struct type *real_type, thisoffset + boffset, value_address (base_val), stream, recurse, base_val, options, - ((struct type **) - obstack_base (&dont_print_vb_obstack)), - 0); + 1, 0); } fputs_filtered (", ", stream); @@ -669,7 +672,7 @@ cp_print_static_field (struct type *type, value_contents_for_printing (val), value_embedded_offset (val), addr, stream, recurse, val, - options, NULL, 1); + options, 0, 1); return; } diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index f8ac141..beeb1f5 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -401,7 +401,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, else cp_print_value_fields (type, type, valaddr, embedded_offset, address, stream, recurse, original_value, - options, NULL, 0); + options, 0, 0); break; case TYPE_CODE_SET: