From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26907 invoked by alias); 20 Aug 2011 03:18:36 -0000 Received: (qmail 26895 invoked by uid 22791); 20 Aug 2011 03:18:35 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_GD 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:18:12 +0000 Received: by gxk23 with SMTP id 23so2823548gxk.0 for ; Fri, 19 Aug 2011 20:18:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.189.65 with SMTP id b41mr402055yhn.64.1313810291390; Fri, 19 Aug 2011 20:18:11 -0700 (PDT) Received: by 10.147.32.14 with HTTP; Fri, 19 Aug 2011 20:18:09 -0700 (PDT) In-Reply-To: References: <20110819162807.GA27393@host1.jankratochvil.net> Date: Sat, 20 Aug 2011 03:18:00 -0000 Message-ID: Subject: Re: How to skip function prologues with stabs debug infomation? From: Triple Yang To: Sterling Augustine 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/msg00091.txt.bz2 2011/8/20 Sterling Augustine : > The Xtensa port uses prologue analysis (and some heuristics) to > determine its end without debug info. It's prologues are somewhat more > complex than others. Take a look at xtensa-tdep.c starting around line > 1151. > > It's only a heuristic, but for unoptimized code it works pretty well. > For optimized code, the prologue can be sufficiently mixed with real > code and that makes it hard to declare a single point "the end of the > prologue" anyway. > OK, I'll take it as an example. Actually I've written a skip prologue subroutine using heuristics, which works sometimes. I am thinking to make use of SAL to do better. > Sterling > > On Fri, Aug 19, 2011 at 10:56 AM, Triple Yang wro= te: >> Thank you. Of course GDB supports SATBS debug info. >> >> well, my question is mostly on HOW to support SATBS debug info >> (specifically, to skip prologue) when I have to write a new gdb >> backend, i.e. to port gdb to a new architecture whose function >> prologue instructions are not that orderly. >> >> I have checked several backend implementations such as or32 and i386, >> but their prologues are tidy and clean to make the analysis much >> easier. So we don't even need debug info to skip the prologue. It >> seems not that easy for a rescheduled prologue, because prologues >> generated with compiler optimization on make things complicated. >> >> 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. >> >> As for your examples, we sometimes need to skip prologue first before >> we can insert breakpoints. Skipping prologue is a lower-level >> function. >> >> Best regards. >> >> 2011/8/20 Jan Kratochvil : >>> On Fri, 19 Aug 2011 18:08:54 +0200, Triple Yang wrote: >>>> is there any chance that we use symbol and line (sal) to skip function >>>> prologues with stabs debug infomation? >>>> And if not, why? >>> >>> GDB does, why not? =A0The prologue skipping processes already decoded d= ebug >>> info, no matter if it is DWARF or STABS. >>> >>> gcc -Wall >>> Breakpoint 1 at 0x400478 >>> gcc -gstabs >>> Temporary breakpoint 1 at 0x40047c: file 24.c, line 3. >>> (gdb) p/x $pc >>> $1 =3D 0x40047c >>> gcc -gdwarf-3 >>> Temporary breakpoint 1 at 0x40047c: file 24.c, line 3. >>> >>> Sure STABS is discouraged. >>> >>> >>> Regards, >>> Jan >>> >> >> >> >> -- >> Yang Yong-Yong >> > --=20 Yang Yong-Yong