From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29432 invoked by alias); 23 Nov 2010 00:34:23 -0000 Received: (qmail 29222 invoked by uid 22791); 23 Nov 2010 00:34:21 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Nov 2010 00:34:16 +0000 Received: from hpaq5.eem.corp.google.com (hpaq5.eem.corp.google.com [172.25.149.5]) by smtp-out.google.com with ESMTP id oAN0YEUY002603 for ; Mon, 22 Nov 2010 16:34:14 -0800 Received: from ywa6 (ywa6.prod.google.com [10.192.1.6]) by hpaq5.eem.corp.google.com with ESMTP id oAN0XUgt006236 for ; Mon, 22 Nov 2010 16:34:13 -0800 Received: by ywa6 with SMTP id 6so2432711ywa.12 for ; Mon, 22 Nov 2010 16:34:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.90.2.35 with SMTP id 35mr6766134agb.90.1290472452438; Mon, 22 Nov 2010 16:34:12 -0800 (PST) Received: by 10.90.81.2 with HTTP; Mon, 22 Nov 2010 16:34:12 -0800 (PST) In-Reply-To: <20101123001325.GA11983@host0.dyn.jankratochvil.net> References: <20101123001325.GA11983@host0.dyn.jankratochvil.net> Date: Tue, 23 Nov 2010 00:34:00 -0000 Message-ID: Subject: Re: [patch] Support -fsplit-stack (previous frame inner to this frame) From: Doug Evans To: Jan Kratochvil Cc: gdb-patches@sourceware.org, Ian Lance Taylor Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00319.txt.bz2 On Mon, Nov 22, 2010 at 4:13 PM, Jan Kratochvil wrote: > Hi, > > currently on a code with gcc -fsplit-stack `backtrace' does not work (aft= er > the stack gets split): > > (gdb) bt > #0 =A0down (i=3D499) at split.c:36 > #1 =A00x0000000000400e74 in __morestack () at ../../../gcchead/libgcc/con= fig/i386/morestack.S:374 > Backtrace stopped: previous frame inner to this frame (corrupt stack?) > > There were some intentions to remove frame_id_inner at all but then many > corrupt stacks would backtrace indefinitely. =A0Moreover as the current s= top > PC=3D=3D0 should be removed one day for corrupted backtraces unwinding (P= R by me > backtrace/12237). > > I had an idea to instead create non-NORMAL_FRAME by a separate sniffer li= ke > currently present in inline-frame.c. =A0The problem is unwinders currently > cannot easily chain for a single frame. =A0And this unwinder specific for= the > __morestack function needs to do standard DWARF frame unwinding. =A0Chain= ing > directly to dwarf2_frame_prev_register&co. is also not right as the code = can > be compiled for example with STABS instead. > > Maybe a proper unwinders chaining gets implemented one day (hacked in one= for > archer-jankratochvil-entryval) but for now I find this hack acceptable my= self. > Do you? > > No regressions on {x86_64,x86_64-m32,i686}-fedora14-linux-gnu. =A0But the > testcase works for me only for GCC HEAD on Fedora 14 (+not on Fedora 13), > tested it there on x86_64 and x86_64-m32. > > > Thanks, > Jan > > > gdb/ > 2010-11-23 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0* frame.c (morestack_start, morestack_end, frame_new_objfi= le): New. > =A0 =A0 =A0 =A0(frame_id_inner): Check l.code_addr against them. > =A0 =A0 =A0 =A0(_initialize_frame): Install frame_new_objfile). Nit: Do we have the framework for recording these globals per process? [or some such - e.g. if/when gdb can debug multiple different programs]