Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* skipping prologues
@ 2002-01-14  8:02 Graeme Peterson
  2002-01-15  1:15 ` Christophe PLANAT
  0 siblings, 1 reply; 2+ messages in thread
From: Graeme Peterson @ 2002-01-14  8:02 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: skipping prologues
  2002-01-14  8:02 skipping prologues Graeme Peterson
@ 2002-01-15  1:15 ` Christophe PLANAT
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe PLANAT @ 2002-01-15  1:15 UTC (permalink / raw)
  To: gp; +Cc: gdb

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 |
----------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-15  9:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-14  8:02 skipping prologues Graeme Peterson
2002-01-15  1:15 ` Christophe PLANAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox