This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
RE: How to print the current source line number
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?