From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20271 invoked by alias); 3 Mar 2006 00:08:47 -0000 Received: (qmail 20254 invoked by uid 22791); 3 Mar 2006 00:08:44 -0000 X-Spam-Check-By: sourceware.org Received: from ip127.bb146.pacific.net.hk (HELO mailhub.stlglobal.com) (202.64.146.127) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Mar 2006 00:08:42 +0000 Received: from localhost ([127.0.0.1]) by mailhub.stlglobal.com with esmtp (Exim 4.50) id 1FExqT-0007Aj-D2 for gdb-patches@sources.redhat.com; Fri, 03 Mar 2006 08:08:33 +0800 Message-ID: <44078901.2060609@tausq.org> Date: Fri, 03 Mar 2006 01:26:00 -0000 From: Randolph Chung User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [RFA/hppa] Unwinding from noreturn functions References: <44070B97.2050707@tausq.org> <20060302151526.GA7033@nevyn.them.org> In-Reply-To: <20060302151526.GA7033@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------060904080400050105020804" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00067.txt.bz2 This is a multi-part message in MIME format. --------------060904080400050105020804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 123 Thanks to Dan's hint about frame_unwind_address_in_block, the following fixes the unwinding problem I saw. OK? randolph --------------060904080400050105020804 Content-Type: text/x-patch; name="noret.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="noret.diff" Content-length: 1937 2006-03-03 Randolph Chung * hppa-tdep.c (hppa_find_unwind_entry_in_block): New. (hppa_frame_cache): Use new function to find unwind entry. (hppa_frame_this_id): Likewise. (hppa_frame_unwind_sniffer): Likewise. Index: hppa-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/hppa-tdep.c,v retrieving revision 1.221 diff -u -p -r1.221 hppa-tdep.c --- hppa-tdep.c 1 Mar 2006 05:43:03 -0000 1.221 +++ hppa-tdep.c 3 Mar 2006 00:04:27 -0000 @@ -1782,6 +1782,17 @@ hppa_skip_prologue (CORE_ADDR pc) return (skip_prologue_hard_way (pc, 1)); } +/* Return an unwind entry that falls within the frame's code block. */ +static struct unwind_table_entry * +hppa_find_unwind_entry_in_block (struct frame_info *f) +{ + CORE_ADDR pc; + + pc = frame_unwind_address_in_block (f); + pc = gdbarch_addr_bits_remove (get_frame_arch (f), pc); + return find_unwind_entry (pc); +} + struct hppa_frame_cache { CORE_ADDR base; @@ -1817,7 +1828,7 @@ hppa_frame_cache (struct frame_info *nex cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); /* Yow! */ - u = find_unwind_entry (frame_pc_unwind (next_frame)); + u = hppa_find_unwind_entry_in_block (next_frame); if (!u) { if (hppa_debug) @@ -2197,7 +2208,7 @@ hppa_frame_this_id (struct frame_info *n struct unwind_table_entry *u; info = hppa_frame_cache (next_frame, this_cache); - u = find_unwind_entry (pc); + u = hppa_find_unwind_entry_in_block (next_frame); (*this_id) = frame_id_build (info->base, u->region_start); } @@ -2224,9 +2235,7 @@ static const struct frame_unwind hppa_fr static const struct frame_unwind * hppa_frame_unwind_sniffer (struct frame_info *next_frame) { - CORE_ADDR pc = frame_pc_unwind (next_frame); - - if (find_unwind_entry (pc)) + if (hppa_find_unwind_entry_in_block (next_frame)) return &hppa_frame_unwind; return NULL; --------------060904080400050105020804--