From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14371 invoked by alias); 15 May 2009 16:19:52 -0000 Received: (qmail 14361 invoked by uid 22791); 15 May 2009 16:19:51 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 May 2009 16:19:46 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id D23412BACEB; Fri, 15 May 2009 12:19:44 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QyJGROva4Tje; Fri, 15 May 2009 12:19:44 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A549C2BAB19; Fri, 15 May 2009 12:19:44 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 5AF57F5962; Fri, 15 May 2009 18:19:42 +0200 (CEST) Date: Fri, 15 May 2009 16:19:00 -0000 From: Joel Brobecker To: Rodrigo Dominguez Cc: gdb@sourceware.org Subject: Re: How to print the current source line number Message-ID: <20090515161942.GD17566@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00087.txt.bz2 > 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