From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10310 invoked by alias); 31 Jan 2008 22:03:39 -0000 Received: (qmail 10302 invoked by uid 22791); 31 Jan 2008 22:03:38 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 31 Jan 2008 22:03:19 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1FF6298218; Thu, 31 Jan 2008 22:03:17 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id F2CA598214; Thu, 31 Jan 2008 22:03:16 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1JKhV5-0001by-TV; Thu, 31 Jan 2008 17:03:15 -0500 Date: Thu, 31 Jan 2008 22:08:00 -0000 From: Daniel Jacobowitz To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: MIPS: Handle manual calls of MIPS16 functions with a call stub Message-ID: <20080131220315.GC5085@caradoc.them.org> Mail-Followup-To: "Maciej W. Rozycki" , gdb-patches@sourceware.org, "Maciej W. Rozycki" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-01/txt/msg00874.txt.bz2 On Thu, Jan 31, 2008 at 05:57:57PM +0000, Maciej W. Rozycki wrote: > Hello, > > There is a problem with GDB calling some of MIPS16 functions manually. > It happens when such a function has a call stub (which is needed due to an > ABI difference when passing floating-point arguments when called from > standard MIPS code) and DWARF-2 information is available for the function. > In this case the stub, which is prepended to the function itself, is made > a part of the function's DWARF-2 subprogram block. The PC range of the > block is determined by two labels that are put at the beginning and the > end of the block each. GDB applies the least significant bit (LSB) of the > start address of a DWARF-2 block to its internal block structure > associated with a function and uses it to determine whether the function > is MIPS16 code (when set) or standard MIPS code (if clear). > > The bit in the start address is set in the DWARF-2 record by BFD at the > link time based on the STO_MIPS16 annotation of the symbol at the same > address in the ELF symbol table. If the start address is the same as the > regular entry point of the function, which is the case when no call stub > has been generated for the function in question, then the DWARF-2 record > gets updated accordingly and the bit is correctly set. However, when the > call stub indeed is there, the function's entry point is at a different > location, and the stub's entry point point is standard MIPS code and > therefore bearing no STO_MIPS16 annotation. In this case the bit in the > DWARF-2 record remains clear. Does this mean the DWARF block describes the MIPS16 parts, but the function's minimal symbol points to the call stub, which is elsewhere)? Maybe mips_write_pc should use mips_pc_is_mips16; that's how Thumb works, by always consulting the minimal symbol table to find out whether an address should be called as MIPS16 or MIPS32. -- Daniel Jacobowitz CodeSourcery