From patchwork Fri Dec 12 16:38:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 4221 Received: (qmail 24890 invoked by alias); 12 Dec 2014 16:38:52 -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 24878 invoked by uid 89); 12 Dec 2014 16:38:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Dec 2014 16:38:50 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1XzTEr-0007ek-8d from Maciej_Rozycki@mentor.com ; Fri, 12 Dec 2014 08:38:45 -0800 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.181.6; Fri, 12 Dec 2014 16:38:43 +0000 Date: Fri, 12 Dec 2014 16:38:39 +0000 From: "Maciej W. Rozycki" To: Joel Brobecker CC: , Rich Fuhler , Richard Sandiford Subject: [committed] MIPS: Define aliases for MSYMBOL_TARGET_FLAG macros In-Reply-To: Message-ID: References: <20120611182043.GA7597@adacore.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 On Mon, 6 Oct 2014, Maciej W. Rozycki wrote: > > Just some minor comments below: > > > > > gdb-mips16-isa-bit.diff > > > Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c > > > =================================================================== > > > --- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c 2012-05-14 16:00:33.000000000 +0100 > > > +++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c 2012-05-14 16:02:02.235560558 +0100 > > > @@ -358,9 +358,15 @@ mips_elf_make_msymbol_special (asymbol * > > > return; > > > > > > if (ELF_ST_IS_MICROMIPS (elfsym->internal_elf_sym.st_other)) > > > - MSYMBOL_TARGET_FLAG_2 (msym) = 1; > > > + { > > > + MSYMBOL_TARGET_FLAG_2 (msym) = 1; > > > + SYMBOL_VALUE_ADDRESS (msym) |= 1; > > > + } > > > else if (ELF_ST_IS_MIPS16 (elfsym->internal_elf_sym.st_other)) > > > - MSYMBOL_TARGET_FLAG_1 (msym) = 1; > > > + { > > > + MSYMBOL_TARGET_FLAG_1 (msym) = 1; > > > + SYMBOL_VALUE_ADDRESS (msym) |= 1; > > > + } > > > > This remark is not to be considered as part of this patch's review, > > since this is already an established practice, but I think we could do > > better than using magic numbers for those flags. I understand they have > > to be that way in the common code, but perhaps mips-tdep could define > > aliases? Something like MSYMBOL_MIPS_TARGET_FLAG_BLAH? > > Good point, I'll push such a change as a followup; I have it ready now. I have committed this change now. 2014-12-12 Maciej W. Rozycki gdb/ * mips-tdep.h (MSYMBOL_TARGET_FLAG_MIPS16): New macro. (MSYMBOL_TARGET_FLAG_MICROMIPS): Likewise. * mips-tdep.c (mips_elf_make_msymbol_special): Use the new macros. (msymbol_is_mips, msymbol_is_mips16, msymbol_is_micromips): Likewise. Maciej gdb-mips-msymbol-target-flag.diff Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c 2014-10-03 14:50:26.398945943 +0100 +++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c 2014-10-03 14:50:26.398945943 +0100 @@ -379,12 +379,12 @@ mips_elf_make_msymbol_special (asymbol * if (ELF_ST_IS_MICROMIPS (st_other)) { - MSYMBOL_TARGET_FLAG_2 (msym) = 1; + MSYMBOL_TARGET_FLAG_MICROMIPS (msym) = 1; SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1); } else if (ELF_ST_IS_MIPS16 (st_other)) { - MSYMBOL_TARGET_FLAG_1 (msym) = 1; + MSYMBOL_TARGET_FLAG_MIPS16 (msym) = 1; SET_MSYMBOL_VALUE_ADDRESS (msym, MSYMBOL_VALUE_RAW_ADDRESS (msym) | 1); } } @@ -394,7 +394,8 @@ mips_elf_make_msymbol_special (asymbol * static int msymbol_is_mips (struct minimal_symbol *msym) { - return !(MSYMBOL_TARGET_FLAG_1 (msym) | MSYMBOL_TARGET_FLAG_2 (msym)); + return !(MSYMBOL_TARGET_FLAG_MIPS16 (msym) + | MSYMBOL_TARGET_FLAG_MICROMIPS (msym)); } /* Return one iff MSYM refers to MIPS16 code. */ @@ -402,7 +403,7 @@ msymbol_is_mips (struct minimal_symbol * static int msymbol_is_mips16 (struct minimal_symbol *msym) { - return MSYMBOL_TARGET_FLAG_1 (msym); + return MSYMBOL_TARGET_FLAG_MIPS16 (msym); } /* Return one iff MSYM refers to microMIPS code. */ @@ -410,7 +411,7 @@ msymbol_is_mips16 (struct minimal_symbol static int msymbol_is_micromips (struct minimal_symbol *msym) { - return MSYMBOL_TARGET_FLAG_2 (msym); + return MSYMBOL_TARGET_FLAG_MICROMIPS (msym); } /* Set the ISA bit in the main symbol too, complementing the corresponding Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.h =================================================================== --- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.h 2014-10-03 14:50:26.398945943 +0100 +++ gdb-fsf-trunk-quilt/gdb/mips-tdep.h 2014-10-03 14:50:26.398945943 +0100 @@ -48,6 +48,10 @@ enum mips_isa ISA_MICROMIPS }; +/* Corresponding MSYMBOL_TARGET_FLAG aliases. */ +#define MSYMBOL_TARGET_FLAG_MIPS16 MSYMBOL_TARGET_FLAG_1 +#define MSYMBOL_TARGET_FLAG_MICROMIPS MSYMBOL_TARGET_FLAG_2 + /* Return the MIPS ISA's register size. Just a short cut to the BFD architecture's word size. */ extern int mips_isa_regsize (struct gdbarch *gdbarch);