From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3264 invoked by alias); 2 Jun 2017 12:23:29 -0000 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 Received: (qmail 3202 invoked by uid 89); 2 Jun 2017 12:23:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Jun 2017 12:23:26 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7B787E9CA for ; Fri, 2 Jun 2017 12:23:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C7B787E9CA Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C7B787E9CA Received: from cascais.lan (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DB844DA6B for ; Fri, 2 Jun 2017 12:23:21 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 40/40] Document breakpoints / linespec & co improvements (manual + NEWS) Date: Fri, 02 Jun 2017 12:23:00 -0000 Message-Id: <1496406158-12663-41-git-send-email-palves@redhat.com> In-Reply-To: <1496406158-12663-1-git-send-email-palves@redhat.com> References: <1496406158-12663-1-git-send-email-palves@redhat.com> X-SW-Source: 2017-06/txt/msg00024.txt.bz2 * NEWS: Mention breakpoints, linespecs and explicit locations improvements. gdb/doc/ChangeLog: yyyy-mm-dd Pedro Alves * gdb.texinfo (Linespec Locations): Document how "function" is interpreted in C++. (Explicit Locations): Document how "-function" is interpreted in C++. Document -qualified. --- gdb/doc/gdb.texinfo | 26 ++++++++++++++++++++++++++ gdb/NEWS | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9fb70f6..59469e0 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -7845,6 +7845,16 @@ name of @file{/build/trunk/gcc/expr.c}, but not Specifies the line that begins the body of the function @var{function}. For example, in C, this is the line with the open brace. +For C@t{++}, @var{function} is interpreted as specifying all functions +named @var{function} ignoring missing leading specifiers (namespaces +and classes). + +For example, assuming a program with symbols named @code{A::B::func} +and @code{B::func}, both commands @code{break func} and @code{break +B::func} set a breakpoint on both symbols. To override this, you can +use the explicit location option @code{-qualified}. @xref{Explicit +Locations}. + @item @var{function}:@var{label} Specifies the line where @var{label} appears in @var{function}. @@ -7909,6 +7919,22 @@ on function locations unmodified by other options (such as @code{-label} or @code{-line}) refer to the line that begins the body of the function. In C, for example, this is the line with the open brace. +For C@t{++}, @var{function} is interpreted as specifying all functions +named @var{function} ignoring missing leading specifiers (namespaces +and classes). + +For example, assuming a program with symbols named @code{A::B::func} +and @code{B::func}, both commands @code{break -function func} and +@code{break -function B::func} set a breakpoint on both symbols. + +@item -qualified @var{function} +Like @code{-function}, but the value specifies a fully qualified name +of a function. + +For example, assuming a C@t{++} program with symbols named +@code{A::B::func} and @code{B::func}, the @code{break -qualified +B::func} command sets a breakpoint on @code{B::func}, only. + @item -label @var{label} The value specifies the name of a label. When the function name is not specified, the label is searched in the function of the currently diff --git a/gdb/NEWS b/gdb/NEWS index 112aa2f..6f9ade0 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -3,6 +3,42 @@ *** Changes since GDB 8.0 +* Breakpoints / linespecs / explicit locations improvements + + ** Breakpoints on C++ functions change + + By default, breakpoints on functions are now interpreted as + specifying all functions with the given name ignoring missing + leading specifiers (namespaces and classes). + + For example, assuming a C++ program with symbols named: + + A::B::func + B::func + + both commands "break func" and "break B::func" set a breakpoint on + both symbols. The explicit location option "-function" was + changed accordingly. + + To override this, you can specify an explicitly fully qualified + name, usign the new explicit location option "-qualified". For + example, using the same C++ program, the "break -qualified + B::func" command sets a breakpoint on "B::func", only. + + ** GDB now has a much improved linespec and explicit locations TAB + completion support, that better understands what you're + completing and offers better suggestions. + + ** GDB can now complete function parameters in linespecs and + explicit locations, even without quoting. When setting + breakpoints, quoting around functions names to help with + TAB-completion is generally no longer necessary. + + ** GDB can now TAB-complete label symbol names. + + ** GDB can now set breakpoints functions marked with [abi:cxx11] + tags. + *** Changes in GDB 8.0 * GDB now supports access to the PKU register on GNU/Linux. The register is -- 2.5.5