From: Christophe PLANAT <christophe.planat@st.com>
To: gp@qnx.com
Cc: gdb@sources.redhat.com
Subject: Re: skipping prologues
Date: Tue, 15 Jan 2002 01:15:00 -0000 [thread overview]
Message-ID: <3C43F3B2.1AD4C675@st.com> (raw)
In-Reply-To: <200201141602.LAA1705201715@node128.ott.qnx.com>
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 |
----------------------------------------------------------------------
prev parent reply other threads:[~2002-01-15 9:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-14 8:02 Graeme Peterson
2002-01-15 1:15 ` Christophe PLANAT [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C43F3B2.1AD4C675@st.com \
--to=christophe.planat@st.com \
--cc=gdb@sources.redhat.com \
--cc=gp@qnx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox