From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2009 invoked by alias); 10 Dec 2001 03:08:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 1972 invoked from network); 10 Dec 2001 03:08:10 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 10 Dec 2001 03:08:10 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 490445E9D8; Sun, 9 Dec 2001 22:09:28 -0500 (EST) To: fnf@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: "maint print type" should print all the flag bits References: <200112091907.fB9J7tM06223@fishpond.ninemoons.com> From: Jim Blandy Date: Sun, 09 Dec 2001 19:08:00 -0000 In-Reply-To: Fred Fish's message of Sun, 9 Dec 2001 12:07:55 -0700 (MST) Message-ID: X-Mailer: Gnus v5.3/Emacs 19.34 X-SW-Source: 2001-12/txt/msg00263.txt.bz2 Approved. Fred Fish writes: > > The "maint print type" command does not print all the flag > bits. It also should to use the defined macros to test for > the bits. > > -Fred > > 2001-12-09 Fred Fish > > * gdbtypes.c (TYPE_FLAG_UNSIGNED, TYPE_FLAG_STUB): Use > TYPE_UNSIGNED and TYPE_NOSIGN to determine when to print these > rather than testing the bits directly. > (TYPE_FLAG_NOSIGN, TYPE_FLAG_TARGET_STUB, TYPE_FLAG_STATIC, > TYPE_FLAG_CONST, TYPE_FLAG_VOLATILE, TYPE_FLAG_PROTOTYPED, > TYPE_FLAG_INCOMPLETE, TYPE_FLAG_CODE_SPACE, TYPE_FLAG_DATA_SPACE, > TYPE_FLAG_VARARGS): Test for and print these bits as well. > > Index: gdbtypes.c > =================================================================== > RCS file: /cvs/src/src/gdb/gdbtypes.c,v > retrieving revision 1.29 > diff -u -p -r1.29 gdbtypes.c > --- gdbtypes.c 2001/12/07 22:11:51 1.29 > +++ gdbtypes.c 2001/12/09 19:08:25 > @@ -2846,14 +2844,54 @@ recursive_dump_type (struct type *type, > gdb_print_host_address (TYPE_REFERENCE_TYPE (type), gdb_stdout); > printf_filtered ("\n"); > printfi_filtered (spaces, "flags 0x%x", TYPE_FLAGS (type)); > - if (TYPE_FLAGS (type) & TYPE_FLAG_UNSIGNED) > + if (TYPE_UNSIGNED (type)) > { > puts_filtered (" TYPE_FLAG_UNSIGNED"); > } > - if (TYPE_FLAGS (type) & TYPE_FLAG_STUB) > + if (TYPE_NOSIGN (type)) > { > + puts_filtered (" TYPE_FLAG_NOSIGN"); > + } > + if (TYPE_STUB (type)) > + { > puts_filtered (" TYPE_FLAG_STUB"); > } > + if (TYPE_TARGET_STUB (type)) > + { > + puts_filtered (" TYPE_FLAG_TARGET_STUB"); > + } > + if (TYPE_STATIC (type)) > + { > + puts_filtered (" TYPE_FLAG_STATIC"); > + } > + if (TYPE_CONST (type)) > + { > + puts_filtered (" TYPE_FLAG_CONST"); > + } > + if (TYPE_VOLATILE (type)) > + { > + puts_filtered (" TYPE_FLAG_VOLATILE"); > + } > + if (TYPE_PROTOTYPED (type)) > + { > + puts_filtered (" TYPE_FLAG_PROTOTYPED"); > + } > + if (TYPE_INCOMPLETE (type)) > + { > + puts_filtered (" TYPE_FLAG_INCOMPLETE"); > + } > + if (TYPE_CODE_SPACE (type)) > + { > + puts_filtered (" TYPE_FLAG_CODE_SPACE"); > + } > + if (TYPE_DATA_SPACE (type)) > + { > + puts_filtered (" TYPE_FLAG_DATA_SPACE"); > + } > + if (TYPE_VARARGS (type)) > + { > + puts_filtered (" TYPE_FLAG_VARARGS"); > + } > puts_filtered ("\n"); > printfi_filtered (spaces, "nfields %d ", TYPE_NFIELDS (type)); > gdb_print_host_address (TYPE_FIELDS (type), gdb_stdout); >