From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14722 invoked by alias); 2 Jun 2004 21:50:47 -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 14685 invoked from network); 2 Jun 2004 21:50:46 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 2 Jun 2004 21:50:46 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i52Loki5027225 for ; Wed, 2 Jun 2004 17:50:46 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i52Loj014313 for ; Wed, 2 Jun 2004 17:50:45 -0400 Received: from free.redhat.lsd.ic.unicamp.br (vpn50-73.rdu.redhat.com [172.16.50.73]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i52LoiGA023453 for ; Wed, 2 Jun 2004 17:50:45 -0400 Received: from free.redhat.lsd.ic.unicamp.br (free.redhat.lsd.ic.unicamp.br [127.0.0.1]) by free.redhat.lsd.ic.unicamp.br (8.12.11/8.12.11) with ESMTP id i52Lohg4000369 for ; Wed, 2 Jun 2004 18:50:43 -0300 Received: (from aoliva@localhost) by free.redhat.lsd.ic.unicamp.br (8.12.11/8.12.11/Submit) id i52LohoS000366; Wed, 2 Jun 2004 18:50:43 -0300 To: gdb-patches@sources.redhat.com Subject: mn10300: skip movm checks if PC is on movm From: Alexandre Oliva Organization: Red Hat Global Engineering Services Compiler Team Date: Wed, 02 Jun 2004 21:50:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SW-Source: 2004-06/txt/msg00035.txt.bz2 --=-=-= Content-length: 284 When we attempt to set up a frame while PC is on the initial movm instruction of a function, and then read the saved PC from it, we get the wrong value, because we fail to disregard the offsets introduced by movm, that hasn't run yet. This patch fixes this problem. Ok to install? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=mn10300-gdb-pc-on-movm.patch Content-length: 783 Index: gdb/ChangeLog from Alexandre Oliva * mn10300-tdep.c (mn10300_analyze_prologue): Don't compute saved regs if PC is on movm. Index: gdb/mn10300-tdep.c =================================================================== RCS file: /cvs/uberbaum/gdb/mn10300-tdep.c,v retrieving revision 1.105 diff -u -p -r1.105 mn10300-tdep.c --- gdb/mn10300-tdep.c 8 May 2004 22:19:30 -0000 1.105 +++ gdb/mn10300-tdep.c 2 Jun 2004 21:46:41 -0000 @@ -457,8 +457,8 @@ mn10300_analyze_prologue (struct frame_i addr = func_addr; /* Suck in two bytes. */ - status = read_memory_nobpt (addr, buf, 2); - if (status != 0) + if (addr + 2 >= stop + || (status = read_memory_nobpt (addr, buf, 2)) != 0) { fix_frame_pointer (fi, 0); return addr; --=-=-= Content-length: 188 -- Alexandre Oliva http://www.ic.unicamp.br/~oliva/ Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org} Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org} --=-=-=--