From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16317 invoked by alias); 20 Jul 2007 16:49:28 -0000 Received: (qmail 16309 invoked by uid 22791); 20 Jul 2007 16:49:26 -0000 X-Spam-Check-By: sourceware.org Received: from dmz.mips-uk.com (HELO dmz.mips-uk.com) (194.74.144.194) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 20 Jul 2007 16:49:21 +0000 Received: from internal-mx1 ([192.168.192.240] helo=ukservices1.mips.com) by dmz.mips-uk.com with esmtp (Exim 3.35 #1 (Debian)) id 1IBvfK-0002Di-00; Fri, 20 Jul 2007 17:49:18 +0100 Received: from perivale.mips.com ([192.168.192.200]) by ukservices1.mips.com with esmtp (Exim 3.36 #1 (Debian)) id 1IBvfF-0005hs-00; Fri, 20 Jul 2007 17:49:13 +0100 Received: from macro (helo=localhost) by perivale.mips.com with local-esmtp (Exim 4.63) (envelope-from ) id 1IBvfF-0003xE-TY; Fri, 20 Jul 2007 17:49:13 +0100 Date: Fri, 20 Jul 2007 17:18:00 -0000 From: "Maciej W. Rozycki" To: gdb-patches@sourceware.org cc: Chris Dearman , "Maciej W. Rozycki" Subject: mips-tdep.c (heuristic_proc_start): Recognise MIPS16 "save" Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MIPS-Technologies-UK-MailScanner: Found to be clean X-MIPS-Technologies-UK-MailScanner-From: macro@mips.com 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: 2007-07/txt/msg00237.txt.bz2 Hello, The MIPS16e ASE adds "save" to the list of MIPS16 instructions, which is typically used in a function's prologue. It is therefore useful to have it recognised by our heuristic analyser. Tested for mipsisa32-sde-elf, with the mips-sim-sde32/-mips16/-EB and mips-sim-sde32/-mips16/-EL target boards with no regressions. 2004-07-20 Chris Dearman * mips-tdep.c (heuristic_proc_start): Add more MIPS16 function prologue instructions. OK to apply? Maciej 12271-6.diff Index: binutils-quilt/src/gdb/mips-tdep.c =================================================================== --- binutils-quilt.orig/src/gdb/mips-tdep.c 2007-05-22 19:11:41.000000000 +0100 +++ binutils-quilt/src/gdb/mips-tdep.c 2007-05-22 19:11:51.000000000 +0100 @@ -2363,15 +2363,28 @@ /* On MIPS16, any one of the following is likely to be the start of a function: + extend save + save entry addiu sp,-n daddiu sp,-n extend -n followed by 'addiu sp,+n' or 'daddiu sp,+n' */ inst = mips_fetch_instruction (start_pc); - if (((inst & 0xf81f) == 0xe809 && (inst & 0x700) != 0x700) /* entry */ - || (inst & 0xff80) == 0x6380 /* addiu sp,-n */ - || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */ - || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */ + if ((inst & 0xff80) == 0x6480) /* save */ + { + if (start_pc - instlen >= fence) + { + inst = mips_fetch_instruction (start_pc - instlen); + if ((inst & 0xf800) == 0xf000) /* extend */ + start_pc -= instlen; + } + break; + } + else if (((inst & 0xf81f) == 0xe809 + && (inst & 0x700) != 0x700) /* entry */ + || (inst & 0xff80) == 0x6380 /* addiu sp,-n */ + || (inst & 0xff80) == 0xfb80 /* daddiu sp,-n */ + || ((inst & 0xf810) == 0xf010 && seen_adjsp)) /* extend -n */ break; else if ((inst & 0xff00) == 0x6300 /* addiu sp */ || (inst & 0xff00) == 0xfb00) /* daddiu sp */