From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12627 invoked by alias); 20 Aug 2011 13:33:14 -0000 Received: (qmail 12616 invoked by uid 22791); 20 Aug 2011 13:33:12 -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 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; Sat, 20 Aug 2011 13:32:39 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7KDWcnk024610 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 20 Aug 2011 09:32:38 -0400 Received: from host1.jankratochvil.net (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p7KDWaWE017158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 20 Aug 2011 09:32:38 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p7KDWa5Q016854; Sat, 20 Aug 2011 15:32:36 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p7KDWZgw016851; Sat, 20 Aug 2011 15:32:35 +0200 Date: Sat, 20 Aug 2011 13:33: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: <20110820133235.GA16583@host1.jankratochvil.net> References: <20110819162807.GA27393@host1.jankratochvil.net> <20110819180431.GA6279@host1.jankratochvil.net> <20110820114025.GA8472@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/msg00095.txt.bz2 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. > > line = get_line_number(func_addr); > > next_line = find_next_statement_line_number(line); // take > advantage of debug info > > addr = 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 (neither DWARF nor STABS, no -g). So it is good to implement gdbarch_skip_prologue 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