From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32248 invoked by alias); 24 Sep 2002 14:16:48 -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 32240 invoked from network); 24 Sep 2002 14:16:46 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 24 Sep 2002 14:16:46 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 8888C3C64 for ; Tue, 24 Sep 2002 10:16:44 -0400 (EDT) Message-ID: <3D9073CC.4010201@redhat.com> Date: Tue, 24 Sep 2002 07:16:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [rfa/ppc] Return the dummy frame's saved pc Content-Type: multipart/mixed; boundary="------------060706090605060708010005" X-SW-Source: 2002-09/txt/msg00576.txt.bz2 This is a multi-part message in MIME format. --------------060706090605060708010005 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 652 Hello, The attached patch modifies rs6000_frame_saved_pc() so that when: - a frame didn't save the PC (i.e., link register) - the next inner most frame is a dummy the dummy frame's link register is returned. On a GNU/Linux PPC system (not sure which flavour but gcc is ``2.95.3'' :-), it fixes the following failures: gdb.base/callfuncs.exp: backtrace after finish from nested call level 3 gdb.base/callfuncs.exp: backtrace after finish from nested call level 4 gdb.base/callfuncs.exp: backtrace at nested call level 2 gdb.base/callfuncs.exp: backtrace at nested call level 3 gdb.base/callfuncs.exp: backtrace at nested call level 4 Ok? Andrew --------------060706090605060708010005 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1132 2002-09-24 Andrew Cagney * rs6000-tdep.c (rs6000_frame_saved_pc): If the link register wasn't saved, and the next innermost frame is a dummy, return the dummy frame's link register. Index: rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.82 diff -u -r1.82 rs6000-tdep.c --- rs6000-tdep.c 17 Sep 2002 20:42:01 -0000 1.82 +++ rs6000-tdep.c 24 Sep 2002 14:06:50 -0000 @@ -1527,6 +1527,16 @@ if (fi->next->signal_handler_caller) return read_memory_addr (fi->next->frame + SIG_FRAME_LR_OFFSET, wordsize); + else if (PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0)) + /* The link register wasn't saved by this frame and the next + (inner, newer) frame is a dummy. Get the link register + value by unwinding it from that [dummy] frame. */ + { + ULONGEST lr; + frame_unwind_unsigned_register (get_next_frame (fi), + tdep->ppc_lr_regnum, &lr); + return lr; + } else return read_memory_addr (FRAME_CHAIN (fi) + tdep->lr_frame_offset, wordsize); --------------060706090605060708010005--