From: Joel Brobecker <brobecker@adacore.com>
To: Rodrigo Dominguez <roddomi@hotmail.com>
Cc: gdb@sourceware.org
Subject: Re: How to print the current source line number
Date: Fri, 15 May 2009 16:19:00 -0000 [thread overview]
Message-ID: <20090515161942.GD17566@adacore.com> (raw)
In-Reply-To: <BAY109-DS599503F3B9065FC87CBA7B95F0@phx.gbl>
> How can I print the current source line number in gdb? I have tried the
> 'list' command and it shows the lines around the current line. However, this
> command has "memory" and doesn't show the same lines each time it is
> executed. Is there a better way to print the current line number? Or is
> there a way to "reset" the memory of the 'line' command so it will show the
> current line centered around the output?
If it's the contents of the current line that you're interested in,
have a look at "help list". Otherwise, "frame" or "info line" might
be what you're looking for. Hint: "$pc" is a convenience variable that
contains the current PC.
--
Joel
next prev parent reply other threads:[~2009-05-15 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-15 15:59 Rodrigo Dominguez
2009-05-15 16:19 ` Joel Brobecker [this message]
2009-05-15 17:16 ` Eli Zaretskii
2009-05-15 18:09 ` Rodrigo Dominguez
2009-05-17 6:49 ` kamaraju kusumanchi
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=20090515161942.GD17566@adacore.com \
--to=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=roddomi@hotmail.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