From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11534 invoked by alias); 20 Aug 2011 14:49:05 -0000 Received: (qmail 11526 invoked by uid 22791); 20 Aug 2011 14:49:04 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-gw0-f41.google.com (HELO mail-gw0-f41.google.com) (74.125.83.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 20 Aug 2011 14:48:50 +0000 Received: by gwaa20 with SMTP id a20so2363421gwa.0 for ; Sat, 20 Aug 2011 07:48:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.9.38 with SMTP id 26mr3346874yhs.13.1313851730181; Sat, 20 Aug 2011 07:48:50 -0700 (PDT) Received: by 10.147.32.14 with HTTP; Sat, 20 Aug 2011 07:48:49 -0700 (PDT) In-Reply-To: <20110820133235.GA16583@host1.jankratochvil.net> References: <20110819162807.GA27393@host1.jankratochvil.net> <20110819180431.GA6279@host1.jankratochvil.net> <20110820114025.GA8472@host1.jankratochvil.net> <20110820133235.GA16583@host1.jankratochvil.net> Date: Sat, 20 Aug 2011 14:49: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/msg00096.txt.bz2 Thanks a lot. I will check skip_prologue_sal to find out what it does and returns. Best regards. 2011/8/20 Jan Kratochvil : > On Sat, 20 Aug 2011 15:06:44 +0200, Triple Yang wrote: >> I will give a C-like pseudocode to describe what I plan to do in >> function XXX_skip_prologue(), here XXX represents my architecture >> name. >> >> =A0 =A0 line =3D get_line_number(func_addr); >> >> =A0 =A0 next_line =3D find_next_statement_line_number(line); // take >> advantage of debug info >> >> =A0 =A0 addr =3D get_addr(nexe_line); >> >> Here, if func_addr is the start address of a function, we actually >> skip the function prologue. (But I am not sure this idea is proper.) > > Yes, it is rought what GDB already does for all the arches. > > gdbarch_skip_prologue is there for the case you have no debug info (neith= er > DWARF nor STABS, no -g). =A0So it is good to implement gdbarch_skip_prolo= gue but > it should be only based on instructions decoding in such case. > > >> And I guess gdb does the similar thing to step a source code line, >> which is of course arch-independent. But I don't know where those >> codes are placed. GDBing a gdb to locate them is time-consuming and >> tiring. I will be very grateful if you or someone else point it out. > > I already stated here the GDB function is skip_prologue_sal. > > > Thanks, > Jan > --=20 Yang Yong-Yong