From: Eli Zaretskii <eliz@delorie.com>
To: fnasser@redhat.com
Cc: gdb@sources.redhat.com
Subject: Re: "next" single-steps all the way
Date: Wed, 11 Apr 2001 08:37:00 -0000 [thread overview]
Message-ID: <200104111537.LAA30385@delorie.com> (raw)
In-Reply-To: <3AD453C2.469326AF@redhat.com>
> Date: Wed, 11 Apr 2001 08:53:22 -0400
> From: Fernando Nasser <fnasser@redhat.com>
>
> The core of the problem is that GDB is not recognizing car7() as a
> function (method). Maybe it has been inlined?
It is definitely inlined.
> To prevent this cases, we could add a new GDB setting: max_single_steps
> that would cause a confirmation message to be asked to the user (after
> printing where it is currently).
Seems like a good idea. I will try to find a way to do that, thanks
for the hint.
> Anyway, your problem seem to be related to prologue-less functions. The
> in_prologue() test is not firing.
No, in_prologue is not even called in this case.
The actual reason for single-stepping seems to be that COFF debug info
used by DJGPP doesn't handle inlining well enough. This part of the
program:
int main()
{
count = 0;
Paths::car7();
together with the inlined car7 code, is seen by gdb as only one long
line. Observe:
(gdb) list
17 int main()
18 {
19 count = 0;
20 Paths::car7();
21 count += 2;
22 return count;
23 }
(gdb) info line 19
Line 19 of "car.cc" starts at address 0x1570 <main>
and ends at 0x15c6 <main+86>.
(gdb) info line 20
Line 20 of "car.cc" is at address 0x15c6 <main+86> but contains no code.
So GDB thinks that line 19 starts at 0x1570, the beginning of `main',
and ends at 0x15c6. Disassembly shows that this range includes the
entire inlined code of car7(). So this code in handle_inferior_event:
/* If stepping through a line, keep going if still within it.
Note that step_range_end is the address of the first instruction
beyond the step range, and NOT the address of the last instruction
within it! */
if (stop_pc >= step_range_start
&& stop_pc < step_range_end)
{
/* We might be doing a BPSTAT_WHAT_SINGLE and getting a signal.
So definately need to check for sigtramp here. */
check_sigtramp2 (ecs);
keep_going (ecs);
return;
}
keeps single-stepping all the way.
Thanks for the feedback.
prev parent reply other threads:[~2001-04-11 8:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-11 5:16 Eli Zaretskii
2001-04-11 5:57 ` Fernando Nasser
2001-04-11 8:37 ` Eli Zaretskii [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=200104111537.LAA30385@delorie.com \
--to=eliz@delorie.com \
--cc=fnasser@redhat.com \
--cc=gdb@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