From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24276 invoked by alias); 15 Jan 2002 09:15:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24231 invoked from network); 15 Jan 2002 09:15:37 -0000 Received: from unknown (HELO beta.dmz-eu.st.com) (164.129.1.35) by sources.redhat.com with SMTP; 15 Jan 2002 09:15:37 -0000 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with SMTP id 62B9C4904 for ; Tue, 15 Jan 2002 09:15:35 +0000 (GMT) Received: by zeta.dmz-eu.st.com (STMicroelectronics, from userid 0) id 94D84618B; Tue, 15 Jan 2002 09:16:20 +0000 (GMT) Received: from eux220.sgp.st.com (localhost [127.0.0.1]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 594241848 for ; Tue, 15 Jan 2002 09:16:20 +0000 (GMT) Received: from crx316.cro.st.com (crx316.cro.st.com [164.129.43.128]) by eux220.sgp.st.com (8.9.3 (PHNE_24419)/8.8.6) with ESMTP id KAA07216; Tue, 15 Jan 2002 10:15:34 +0100 (MET) Received: from dais.cro.st.com (crx722.cro.st.com [164.129.44.222]) by crx316.cro.st.com with ESMTP (8.8.6 (PHNE_17190)/8.7.1) id KAA11940; Tue, 15 Jan 2002 10:17:05 +0100 (MET) Received: from st.com (crx1009 [164.129.46.109]) by dais.cro.st.com (8.8.8+Sun/8.8.8) with ESMTP id KAA17518; Tue, 15 Jan 2002 10:17:38 +0100 (MET) Message-ID: <3C43F3B2.1AD4C675@st.com> Date: Tue, 15 Jan 2002 01:15:00 -0000 From: Christophe PLANAT Organization: ST CR&D Crolles X-Mailer: Mozilla 4.77 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: gp@qnx.com Cc: gdb@sources.redhat.com Subject: Re: skipping prologues References: <200201141602.LAA1705201715@node128.ott.qnx.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00152.txt.bz2 gp@qnx.com wrote: > > Hi, all. > > Is there a standard way of skipping prologues? Some *-tdep.c > files try and skip to the first line number when that info is > present, while others always use an ad-hock skip based on > instruction sequences. The first line number is of course > dependent on the compiler knowing this convention. > > Thanks again. > > GP Hello, The best way IMHO consists to use the skipping method provided by the target the debugger is connected on. The skip_prologue() primitive (*-tdep.c) calls an ad-hoc is-in-prologue(PC) target primitive with PC argument, which returns true or false. skip-prologue() increments PC until is-in-prologue() is FALSE. Every is-in-prologue() call, the target find if the PC value is located inside or outside the prologue (the application code must not be optimized otherwise the prologue may be mixed inside the function body). is-in-prologue() is implemented in the target side and better in the debugger's API of the target This method avoid to be aware of target asm code and also avoid to be dependant of asm specifications and evolutions. The other approach consists to analyse (debugger side) the instruction hexadecimal code (in skip-prologue() primitive) and find if PUSH (or other prologue insn or sequence) are the current one meaning we are located inside the prologue. The method is heavy. The debugger developper must also be aware of asm code and prologue specifications. Good luck Christophe -- ---------------------------------------------------------------------- | Christophe PLANAT | Embedded Systems Technology | | Email : Christophe.Planat@st.com | STMicroelectronics | | Phone : +33 04 76 92 68 82 | 850, rue Jean-Monnet | | Fax : +33 04 76 92 50 94 | BP 16 - 38921 Crolles - France | ----------------------------------------------------------------------