From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11237 invoked by alias); 27 Jul 2012 03:50:16 -0000 Received: (qmail 11213 invoked by uid 22791); 27 Jul 2012 03:50:15 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_FD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Jul 2012 03:50:01 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6R3o114028271 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 26 Jul 2012 23:50:01 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6R3nxf9020398 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 26 Jul 2012 23:50:00 -0400 Message-ID: <50120FE7.8060100@redhat.com> Date: Fri, 27 Jul 2012 03:50:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: [RFA 5/5] Explicit linespecs - documentation Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-07/txt/msg00664.txt.bz2 Hi, The patch below adds documentation for explicit linespecs for both MI and "Locations" chapters of the manual. Questions/comments/concerns? Keith ChangeLog 2012-07-26 Keith Seitz * NEWS: Mention new explicit linespec feature. doc/ChangeLog 2012-07-26 Keith Seitz * gdb.texinfo (Specifying a Location): Describe explicit linespecs. (GDB/MI Breakpoint Commands): Likewise for -break-insert. diff --git a/gdb/NEWS b/gdb/NEWS index a590bee..09c2403 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -19,6 +19,9 @@ maint info bfds *** Changes in GDB 7.5 +* GDB now allows users to specify explicit locations, bypassing + the linespec parser. Feature also accessible from GDB/MI. + * GDB now supports x32 ABI. Visit for more x32 ABI info. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index facca8f..e0c3792 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -6760,7 +6760,16 @@ of your program's code. Since @value{GDBN} is a source-level debugger, a location usually specifies some line in the source code; for that reason, locations are also known as @dfn{linespecs}. -Here are all the different ways of specifying a code location that +Linespecs may be specified implicitly or explicitly. Implicit linespecs +are parsed by the linespec parser and converted into a location. +This often involves multiple searches through the program's symbol +table. For large programs, this may be extremely time-consuming. + +Explicit linespecs avoid a lot of this searching by allowing the direct +specification of file name, function, and/or other source location +attributes. + +Here are all the different ways of specifying an implicit code location that @value{GDBN} understands: @table @code @@ -6858,6 +6867,32 @@ each one of those probes. @end table +Explicit linespecs maybe be specified using the generalized form +@samp{-option value}. The list of valid options is summarized in the +following table: + +@table @code +@item @var{-source} +The value specifies the source filename for the location. This option +requires the use of at least one other explicit linespec option. + +@item @var{-function} +The value specifies the name of a function for the location. + +@item @var{-label} +The value specifies the name of a label for the location. + +@item @var{-offset} +The value specifies an offset for the location. This option may either be +an absolute (@var{-offset 3}) or relative (@var{-offset +3}) offset. + +@item @var{-address} +The value specifies any valid code address in the program. This option +may not be used with any other option. +@end table + +Explicit linespec options may be abbreviated by omitting any non-unique +trailing characters from the option name, e.g., @code{break -func main -o 3}. @node Edit @section Editing Source Files @@ -28088,7 +28123,8 @@ N.A. @smallexample -break-insert [ -t ] [ -h ] [ -f ] [ -d ] [ -a ] [ -c @var{condition} ] [ -i @var{ignore-count} ] - [ -p @var{thread-id} ] [ @var{location} ] + [ -p @var{thread-id} ] [ @var{location} | @var{explicit_location}] + @end smallexample @noindent @@ -28104,6 +28140,28 @@ If specified, @var{location}, can be one of: @item *address @end itemize +@noindent +An @var{explicit_location} may be used instead of a @var{location} +by supplying at least one of the following options: + +@table @samp +@item -s @var{filename} +The source file name of the location. This option requires the use +of at least one other explicit linespec option. + +@item -m @var{function} +The name of a function. + +@item -l @var{label} +The name of a label. + +@item -o @var{offset} +An absolute or relative offset from the start of the location. + +@item -e @var{address} +A code address of the program. +@end table + The possible optional parameters of this command are: @table @samp