From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23240 invoked by alias); 20 Aug 2011 03:45:19 -0000 Received: (qmail 23225 invoked by uid 22791); 20 Aug 2011 03:45:18 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_FRT_PROFILE2 X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 20 Aug 2011 03:45:01 +0000 Received: by gxk23 with SMTP id 23so2829442gxk.0 for ; Fri, 19 Aug 2011 20:45:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.9.38 with SMTP id 26mr559345yhs.13.1313811901084; Fri, 19 Aug 2011 20:45:01 -0700 (PDT) Received: by 10.147.32.14 with HTTP; Fri, 19 Aug 2011 20:45:01 -0700 (PDT) In-Reply-To: <20110819180431.GA6279@host1.jankratochvil.net> References: <20110819162807.GA27393@host1.jankratochvil.net> <20110819180431.GA6279@host1.jankratochvil.net> Date: Sat, 20 Aug 2011 03:45:00 -0000 Message-ID: Subject: Re: How to skip function prologues with stabs debug infomation? From: Triple Yang To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-08/txt/msg00092.txt.bz2 2011/8/20 Jan Kratochvil : > On Fri, 19 Aug 2011 19:56:44 +0200, Triple Yang wrote: >> It seems not that easy for a rescheduled prologue, because prologues >> generated with compiler optimization on make things complicated. > > With gcc -O2 -g gdb already no longer skips prologues, see > symtab->locations_valid (a recent change by me). =A0If DW_AT_location is = valid > for every PC of a function you do not need to skip prologues. =A0I would = find > best to comply with it in your compiler and do not depend on the fragile > prologue skipping. > > >> It's well-known that people can take advantage of SAL info when to >> skip prologue with dwarf info. I wonder whether we can do the same >> thing with stabs. > > I am not proficient with STABS but when gcc can produce the line number i= nfo > for both STABS and DWARF you should be also able to do so. > I agree with that. Since we can get line number from binary file's section offset, and vice versa, we can skip prologue using line number. The practical problem is that, I don't know how to implement it, i.e. what functions should be called. Any suggestions? > >> As for your examples, we sometimes need to skip prologue first before >> we can insert breakpoints. Skipping prologue is a lower-level >> function. > > I have not checked what skip_prologue_sal returns but I have checked using > readelf -wl the breakpoint address is aligned with the line number info. > > > You may have reasons for STABS but I do not see why not to produce only D= WARF. > > > Thanks, > Jan > --=20 Yang Yong-Yong