From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17878 invoked by alias); 13 Nov 2003 14:29:43 -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 17746 invoked from network); 13 Nov 2003 14:29:40 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 13 Nov 2003 14:29:40 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hADETcM18094; Thu, 13 Nov 2003 09:29:38 -0500 Received: from pobox.surrey.redhat.com (pobox.surrey.redhat.com [172.16.10.17]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hADETa624012; Thu, 13 Nov 2003 09:29:37 -0500 Received: from localhost.localdomain.redhat.com (vpn50-20.rdu.redhat.com [172.16.50.20]) by pobox.surrey.redhat.com (8.12.8/8.12.8) with ESMTP id hADETRGN015253; Thu, 13 Nov 2003 14:29:30 GMT To: gdb-patches@sources.redhat.com Cc: binutils@sources.redhat.com Subject: RFA: Skip ARM ELF Mapping symbols when showing disassembly From: Nick Clifton Date: Thu, 13 Nov 2003 14:29:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-11/txt/msg00253.txt.bz2 Hi Guys, I have recently committed a patch to the arm-elf port of GAS which causes it to generate special mapping symbols as required by the ARM ELF spec. Unfortunately this now means that when GDB shows a disassembly it can select one of the mapping symbols instead of the proper function name symbol. The patch below is a fix for this problem. It is not elegant, but it does have the advantage of being entirely arm specific. A cleaner patch would require changes to generic code, which I did not feel comfortable doing. May I apply this patch ? Cheers Nick 2003-11-13 Nick Clifton * arm-tdep.c (arm_elf_make_msymbol_special): Intercept arm-elf mapping symbols and artificially alter their value so that they are not used for disassembly displays. Index: gdb/arm-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/arm-tdep.c,v retrieving revision 1.155 diff -c -3 -p -r1.155 arm-tdep.c *** gdb/arm-tdep.c 11 Nov 2003 20:04:52 -0000 1.155 --- gdb/arm-tdep.c 13 Nov 2003 14:27:49 -0000 *************** coff_sym_is_thumb (int val) *** 2675,2680 **** --- 2675,2692 ---- static void arm_elf_make_msymbol_special(asymbol *sym, struct minimal_symbol *msym) { + /* FIXME: We want gdb to ignore the ARM ELF mapping symbols when + displaying disassembly so we use this horrible hack here to + artifically set their address to the highest possible value. + This is wrong of course, and it prevents the symbols from being + used for their intended purpose - to distinguish between ARM + and THUMB code. So we ought to find a better way to do this. */ + if (bfd_asymbol_name (sym) + && bfd_asymbol_name (sym)[0] == '$' + && bfd_asymbol_name (sym)[1] != 0 + && bfd_asymbol_name (sym)[2] == 0) + SYMBOL_VALUE_ADDRESS(msym) = (CORE_ADDR) 0x7ffffffc; + /* Thumb symbols are of type STT_LOPROC, (synonymous with STT_ARM_TFUNC). */ if (ELF_ST_TYPE (((elf_symbol_type *)sym)->internal_elf_sym.st_info)