From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32499 invoked by alias); 21 Aug 2003 22:50:03 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32482 invoked from network); 21 Aug 2003 22:50:02 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 21 Aug 2003 22:50:02 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6EFE42B7F; Thu, 21 Aug 2003 18:49:49 -0400 (EDT) Message-ID: <3F454C8D.3060704@redhat.com> Date: Thu, 21 Aug 2003 22:50:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Elizabeth Chastain Cc: gdb@sources.redhat.com Subject: Re: msym->info is wack References: <200308202328.h7KNS3cY014321@duracef.shout.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00247.txt.bz2 > Here are some notes on msym->info. I am going to submit a couple > of patches based on these notes. Thanks for the reminder. > === ARM-TDEP.C, M68HC11-TDEP.C, MIPS-TDEP.C, SH-TDEP.C > > These *-tdep.c files use msym->info as a place to store flag bits. > So, first, they are converting 'void *' to 'long' and back again. Begs the question, is the field needed -> can bfd provide the info directly? Arm, MIPS, SH, use it to determine the functions CPU mode. Thing is, libopcodes (in the disassembler) must duplicate that exact same heuristic as otherwize the 'objdum -d' won't work. That leaves m68hc11. Perhaphs a more lazy approach and a symbol aux can be used? > The straightforward solution is to provide msym->tdep_flags as > an explicit place for tdep files to store flag bits. Then they > can store their bits without nasty casting. Notice that arm defines/uses: #define MSYMBOL_SET_SPECIAL(msym) \ MSYMBOL_INFO (msym) = (char *) (((long) MSYMBOL_INFO (msym)) \ | 0x80000000) #define MSYMBOL_IS_SPECIAL(msym) \ (((long) MSYMBOL_INFO (msym) & 0x80000000) != 0) #define MSYMBOL_SIZE(msym) \ ((long) MSYMBOL_INFO (msym) & 0x7fffffff) i.e., it is doing masking, while dbxread.c defines/uses: #define MSYMBOL_SIZE(msym) ((long) MSYMBOL_INFO (msym)) i.e., there is no masking. If Arm sets that top bit, dbxread.c would discover a very large size. Guess that never happens. Andrew