From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7673 invoked by alias); 19 Aug 2011 18:04:56 -0000 Received: (qmail 7656 invoked by uid 22791); 19 Aug 2011 18:04:54 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,T_FRT_PROFILE2 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 19 Aug 2011 18:04:35 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7JI4ZCc009902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 19 Aug 2011 14:04:35 -0400 Received: from host1.jankratochvil.net (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7JI4WBA022158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 19 Aug 2011 14:04:34 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p7JI4VVc006758; Fri, 19 Aug 2011 20:04:31 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p7JI4V6A006757; Fri, 19 Aug 2011 20:04:31 +0200 Date: Fri, 19 Aug 2011 18:04:00 -0000 From: Jan Kratochvil To: Triple Yang Cc: gdb@sourceware.org Subject: Re: How to skip function prologues with stabs debug infomation? Message-ID: <20110819180431.GA6279@host1.jankratochvil.net> References: <20110819162807.GA27393@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00089.txt.bz2 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). If DW_AT_location is valid for every PC of a function you do not need to skip prologues. I 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 info for both STABS and DWARF you should be also able to do so. > 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 DWARF. Thanks, Jan