From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26324 invoked by alias); 20 Aug 2011 13:07:00 -0000 Received: (qmail 26313 invoked by uid 22791); 20 Aug 2011 13:06:59 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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 13:06:45 +0000 Received: by gwaa20 with SMTP id a20so2333460gwa.0 for ; Sat, 20 Aug 2011 06:06:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.80.5 with SMTP id h5mr465510yal.5.1313845605074; Sat, 20 Aug 2011 06:06:45 -0700 (PDT) Received: by 10.147.32.14 with HTTP; Sat, 20 Aug 2011 06:06:44 -0700 (PDT) In-Reply-To: <20110820114025.GA8472@host1.jankratochvil.net> References: <20110819162807.GA27393@host1.jankratochvil.net> <20110819180431.GA6279@host1.jankratochvil.net> <20110820114025.GA8472@host1.jankratochvil.net> Date: Sat, 20 Aug 2011 13:07: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 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/msg00094.txt.bz2 2011/8/20 Jan Kratochvil : > On Sat, 20 Aug 2011 05:45:01 +0200, Triple Yang wrote: >> 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? > > It is already implemented, if you just want to write a new GDB arch backend. > This code in GDB is arch-independent. > > It would be better to give a reproducer or I do not understand the problem. > > > Regards, > Jan > Sorry. 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.) 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. Best regards. -- Yang Yong-Yong