From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32398 invoked by alias); 6 Oct 2004 17:24:04 -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 32391 invoked from network); 6 Oct 2004 17:24:02 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 6 Oct 2004 17:24:02 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i96HO2iY026388 for ; Wed, 6 Oct 2004 13:24:02 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i96HNur17346; Wed, 6 Oct 2004 13:24:02 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id F003F28D2; Wed, 6 Oct 2004 13:23:40 -0400 (EDT) Message-ID: <41642A1C.2010603@gnu.org> Date: Wed, 06 Oct 2004 17:24:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040831 MIME-Version: 1.0 To: Kei Sakamoto Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA/m32r] Fix m32r frame analyzer References: <046601c4aac3$eda73740$5169910a@E5A02646> In-Reply-To: <046601c4aac3$eda73740$5169910a@E5A02646> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00118.txt.bz2 } else func_end = pc + DEFAULT_SEARCH_LIMIT; - decode_prologue (pc, func_end, &sal.end); + + /* If pc's location is not readable, just quit. */ + if (!safe_read_memory_integer (pc, 4, &return_value)) + return 0; + + decode_prologue (pc, func_end, &sal.end, NULL); return sal.end; } The save_read_memory will need to be in decode_prologue and applied to every memory read as a fetch of PC+/-4 could equally fail. That means more interface changes to decode_prologue (return success/fail?). On fail, it should also return the old PC and not zero - look at find_function_start_sal for why. If you make those changes, you can commit. Andrew