From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6438 invoked by alias); 20 Jul 2003 03:30:02 -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 6430 invoked from network); 20 Jul 2003 03:30:01 -0000 Received: from unknown (199.72.38.5) by sources.redhat.com with QMTP; 20 Jul 2003 03:30:01 -0000 Received: (qmail 21605 invoked from network); 20 Jul 2003 03:30:00 -0000 Received: from cpe-24-221-209-215.co.sprintbbd.net (HELO doc.com) (24.221.209.215) by external1.doc.com with SMTP; 20 Jul 2003 03:30:00 -0000 Message-ID: <3F1A0CB8.3040607@doc.com> Date: Sun, 20 Jul 2003 03:30:00 -0000 From: Adam Fedor User-Agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.1) Gecko/20020905 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com, ezannoni@redhat.com, jimb@redhat.com Subject: Re: RFA symtab: Fix for PR c++/1267 ("next" and shared libraries) References: <20030719181817.GA11670@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg00356.txt.bz2 Daniel Jacobowitz wrote: > This patch fixes c++/1267, a bug where stepping over a function call that > went through the PLT (as happens when a -fPIC function makes a call to a > globally visible symbol) would lose control of the inferior. I'll spare you > the complete debugging session, as it really doesn't make much sense. But > here's the root of the problem: > > When we called frame_pc_unwind on the sentinel frame, we got an address in > the PLT. But when we called frame_func_unwind, we got "_init", in ".init", > which is generally located right before the PLT. Then, we'd run the > new-and-improved prologue unwinder on _init, and get some completely bogus > information, since things weren't actually saved on the stack where it > thought they were. This led to the unwound stack pointer being wrong for > the step_resume breakpoint, so when we hit the step_resume breakpoint we > kept going. > > I fixed this by changing lookup_minimal_symbol_pc_section to be paranoid > about returning a minsym in the same section as the PC. Technically, at > least on ELF targets, that doesn't _have_ to be true. I've never > encountered an exception or a good reason for one, though. Does anyone see > any pitfalls for this change? Symtab maintainers, is this patch OK? > > I believe this patch should also fix shlibs/1237, and may also fix > shlibs/1280. Adam, could you check those? > Yes this fixes both cases (shlibs/1237 and shlibs/1280) for me. Thanks!