From: Orjan Friberg <orjan.friberg@axis.com>
To: gdb-patches@sources.redhat.com
Subject: Next over function and breakpoint setting
Date: Tue, 16 Mar 2004 15:42:00 -0000 [thread overview]
Message-ID: <40572066.2020304@axis.com> (raw)
Message-ID: <20040316154200.QxzJm2Ko6OSnrdmLZhdKIme4EdEvkik2nMgH94D-tyA@z> (raw)
Out of curiosity I followed what happens when issuing a next command
over a function call. The reason I got curious was that I noticed
(remote protocol) that GDB sets a breakpoint on the first instruction of
the function being stepped over, and, when stopped there, sets another
breakpoint at that function's return address to accomplish the "next".
Actually, maybe that's a misrepresentation: looking at the code, it
seems GDB does a step, and if it *then* finds it ended up inside a
function (step_into_function -> step_over_function) it decides to step
out of it.
Looking at the code in infcmd.c and infrun.c I'm sure there's a good
reason for not just setting the breakpoint on the address belonging to
the next line of code, but I couldn't find any comment saying what that
reason is. Anyone care to enlighten me?
(I couldn't say if any of this was remote target/CRIS specific;
apologies if it is and I missed it.)
--
Orjan Friberg
Axis Communications
next reply other threads:[~2004-03-16 15:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-19 0:09 Orjan Friberg [this message]
2004-03-16 15:42 ` Orjan Friberg
2004-03-27 5:50 ` Daniel Jacobowitz
2004-03-29 8:48 ` Orjan Friberg
2004-03-29 13:36 ` Andrew Cagney
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=40572066.2020304@axis.com \
--to=orjan.friberg@axis.com \
--cc=gdb-patches@sources.redhat.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