From: "Eli Zaretskii" <eliz@gnu.org>
To: Jason Luo <jasonl@turbolinux.com.cn>
Cc: drow@false.org, gdb@sources.redhat.com
Subject: Re: What make the directive run twice?
Date: Fri, 04 Jun 2004 12:11:00 -0000 [thread overview]
Message-ID: <6654-Fri04Jun2004145336+0300-eliz@gnu.org> (raw)
In-Reply-To: <40BFDEC8.3070602@turbolinux.com.cn> (message from Jason Luo on Fri, 04 Jun 2004 10:30:32 +0800)
> Date: Fri, 04 Jun 2004 10:30:32 +0800
> From: Jason Luo <jasonl@turbolinux.com.cn>
>
> > It wasn't run twice; it appears in the step output twice. This is
> > common when debugging optimized code; part of the function call occurs
> > before the previous line and part after.
>
> I disassemble the call function init_device_map,and the function
> check_device,I didn't find that you says.
>
> init_device_map call check_deivce,then the control jump to the function
> check_device,then process continue.The process flow is correct like the
> c source file's.
That's not the right way to analyze this.
When you type "next" in GDB, GDB needs to know how machine
instructions to run to land at the next source line. So what you need
to do is to use a tool such as objdump to see what is the
correspondence between program code addresses and source lines. That
is the information used by GDB during stepping.
My experience is consistent with what Daniel says: stepping through
optimized code quite often jumps between source lines like you saw.
prev parent reply other threads:[~2004-06-04 12:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-03 7:10 Jason Luo
2004-06-03 20:44 ` Daniel Jacobowitz
2004-06-04 2:34 ` Jason Luo
2004-06-04 12:11 ` 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=6654-Fri04Jun2004145336+0300-eliz@gnu.org \
--to=eliz@gnu.org \
--cc=drow@false.org \
--cc=gdb@sources.redhat.com \
--cc=jasonl@turbolinux.com.cn \
/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