* How to print the current source line number
@ 2009-05-15 15:59 Rodrigo Dominguez
2009-05-15 16:19 ` Joel Brobecker
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Rodrigo Dominguez @ 2009-05-15 15:59 UTC (permalink / raw)
To: gdb
Hi,
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?
Thank you,
Rodrigo Dominguez
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: How to print the current source line number
2009-05-15 15:59 How to print the current source line number Rodrigo Dominguez
@ 2009-05-15 16:19 ` Joel Brobecker
2009-05-15 17:16 ` Eli Zaretskii
2009-05-17 6:49 ` kamaraju kusumanchi
2 siblings, 0 replies; 5+ messages in thread
From: Joel Brobecker @ 2009-05-15 16:19 UTC (permalink / raw)
To: Rodrigo Dominguez; +Cc: gdb
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to print the current source line number
2009-05-15 15:59 How to print the current source line number Rodrigo Dominguez
2009-05-15 16:19 ` Joel Brobecker
@ 2009-05-15 17:16 ` Eli Zaretskii
2009-05-15 18:09 ` Rodrigo Dominguez
2009-05-17 6:49 ` kamaraju kusumanchi
2 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2009-05-15 17:16 UTC (permalink / raw)
To: Rodrigo Dominguez; +Cc: gdb
> From: "Rodrigo Dominguez" <roddomi@hotmail.com>
> Date: Fri, 15 May 2009 11:59:11 -0400
>
> 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?
Does
list *$pc
do what you want?
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: How to print the current source line number
2009-05-15 17:16 ` Eli Zaretskii
@ 2009-05-15 18:09 ` Rodrigo Dominguez
0 siblings, 0 replies; 5+ messages in thread
From: Rodrigo Dominguez @ 2009-05-15 18:09 UTC (permalink / raw)
To: 'Eli Zaretskii'; +Cc: gdb
Either 'frame' or 'list *$pc' work. Thank you!
> -----Original Message-----
> From: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] On
> Behalf Of Eli Zaretskii
> Sent: Friday, May 15, 2009 1:16 PM
> To: Rodrigo Dominguez
> Cc: gdb@sourceware.org
> Subject: Re: How to print the current source line number
>
> > From: "Rodrigo Dominguez" <roddomi@hotmail.com>
> > Date: Fri, 15 May 2009 11:59:11 -0400
> >
> > 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?
>
> Does
>
> list *$pc
>
> do what you want?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: How to print the current source line number
2009-05-15 15:59 How to print the current source line number Rodrigo Dominguez
2009-05-15 16:19 ` Joel Brobecker
2009-05-15 17:16 ` Eli Zaretskii
@ 2009-05-17 6:49 ` kamaraju kusumanchi
2 siblings, 0 replies; 5+ messages in thread
From: kamaraju kusumanchi @ 2009-05-17 6:49 UTC (permalink / raw)
To: Rodrigo Dominguez; +Cc: gdb
On Fri, May 15, 2009 at 11:59 AM, Rodrigo Dominguez <roddomi@hotmail.com> wrote:
> Hi,
>
> 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?
>
> Thank you,
>
> Rodrigo Dominguez
>
>
Is
info program
what you are looking for?
raju
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-05-17 6:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-15 15:59 How to print the current source line number Rodrigo Dominguez
2009-05-15 16:19 ` Joel Brobecker
2009-05-15 17:16 ` Eli Zaretskii
2009-05-15 18:09 ` Rodrigo Dominguez
2009-05-17 6:49 ` kamaraju kusumanchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox