From patchwork Sun Jul 1 21:07:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 28181 Received: (qmail 104864 invoked by alias); 1 Jul 2018 21:07:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 104775 invoked by uid 89); 1 Jul 2018 21:07:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=Frame, organized, fun, conflict X-HELO: mailsec107.isp.belgacom.be Received: from mailsec107.isp.belgacom.be (HELO mailsec107.isp.belgacom.be) (195.238.20.103) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 01 Jul 2018 21:07:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1530479272; x=1562015272; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=UxRIUt0KQ7R+FE0g4c1Gy8TNmtWJVuAJv23xsp/LUkA=; b=XeF62w3y68vmEfJcVMEobGBsvhKnnsSGRD0Jj+cZCaWnKNBTzlLMnXZ9 VBX+0fUAycGx9ULNQhH8sV0yLYXCgA==; Received: from 224.41-64-87.adsl-dyn.isp.belgacom.be (HELO md.home) ([87.64.41.224]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 01 Jul 2018 23:07:40 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFC 4/5] Document changes to info [args|functions|locals|variables] Date: Sun, 1 Jul 2018 23:07:33 +0200 Message-Id: <20180701210734.3793-5-philippe.waroquiers@skynet.be> In-Reply-To: <20180701210734.3793-1-philippe.waroquiers@skynet.be> References: <20180701210734.3793-1-philippe.waroquiers@skynet.be> X-IsSubscribed: yes Document changes to info [args|functions|locals|variables] --- gdb/doc/gdb.texinfo | 98 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 88 insertions(+), 10 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 7fb6ac5636..789d54a3b2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -7705,15 +7705,60 @@ architectures) that you specify in the @code{frame} command. @xref{Selection, ,Selecting a Frame}. @kindex info args -@item info args +@item info args [-q] Print the arguments of the selected frame, each on a separate line. +Flag @code{-q}, which stands for @samp{quiet}, disables printing +header information and messages explaining why no argument have been +printed. + +@item info args [-q] [-t @var{type_regexp}] [@var{regexp}] +Like @kbd{info args}, but only print the arguments +that matches the provided regexp(s). + +If @var{regexp} is provided, prints only the arguments whose names +contain a match for regular expression @var{regexp}. + +If @var{type_regexp} is provided, prints only the arguments whose +types contain a match for regular expression @var{type_regexp}. +The matching is done with the variable type as printed with the +@code{whatis} command. +If @var{type_regexp} contains space(s), it should be enclosed in single +quote characters. + + @item info locals -@kindex info locals +@kindex info locals [-q] Print the local variables of the selected frame, each on a separate line. These are all variables (declared either static or automatic) accessible at the point of execution of the selected frame. +Flag @code{-q}, which stands for @samp{quiet}, disables printing +header information and messages explaining why no local variables have been +printed. + +@item info locals [-q] [-t @var{type_regexp}] [@var{regexp}] +Like @kbd{info locals}, but only print the local variables +that matches the provided regexp(s). + +If @var{regexp} is provided, prints only the local variables whose names +contain a match for regular expression @var{regexp}. + +If @var{type_regexp} is provided, prints only the local variables whose +types contain a match for regular expression @var{type_regexp}. +The matching is done with the local variable type as printed with the +@code{whatis} command. +If @var{type_regexp} contains space(s), it should be enclosed in single +quote characters. + +The command @samp{info locals -q -t @var{type_regexp}} can usefully be +combined with the commands @samp{frame apply} and @samp{thread apply}. +For example, if you have an RAII type @code{lock_something_t}, +you can list all locks in your program by doing +@samp{thread apply all -s frame apply all -s +info locals -q -t lock_something_t}, or the equivalent shorter form +@samp{tfaas i lo -q -t lock_something_t}. + @end table @node Frame Filter Management @@ -17665,32 +17710,65 @@ debugging information, organized into two lists: files whose symbols have already been read, and files whose symbols will be read when needed. @kindex info functions -@item info functions +@item info functions [-q] Print the names and data types of all defined functions. Similarly to @samp{info types}, this command groups its output by source files and annotates each function definition with its source line number. -@item info functions @var{regexp} +Flag @code{-q}, which stands for @samp{quiet}, disables printing +header information and messages explaining why no functions have been +printed. + +@item info functions [-q] [-t @var{type_regexp}] [@var{regexp}] Like @samp{info functions}, but only print the names and data types of -functions whose names contain a match for regular expression -@var{regexp}. Thus, @samp{info fun step} finds all functions whose +the functions that matches the provided regexp(s). + +If @var{regexp} is provided, prints only the functions whose names +contain a match for regular expression @var{regexp}. +Thus, @samp{info fun step} finds all functions whose names include @code{step}; @samp{info fun ^step} finds those whose names start with @code{step}. If a function name contains characters that conflict with the regular expression language (e.g.@: @samp{operator*()}), they may be quoted with a backslash. +If @var{type_regexp} is provided, prints only the functions whose +types contain a match for regular expression @var{type_regexp}. +The matching is done with the function type as printed with the +@code{whatis} command. +If @var{type_regexp} contains space(s), it should be enclosed in single +quote characters. +Thus, @samp{info fun -t '^int ('} finds the functions that return +an integer; @samp{info fun -t '(.*int.*'} finds the functions that +have an argument type containing int; @samp{info fun -t '^int (' ^step} +finds the functions whose names start with @code{step} and that are returning +an int. + + @kindex info variables -@item info variables +@item info variables [-q] Print the names and data types of all variables that are defined outside of functions (i.e.@: excluding local variables). The printed variables are grouped by source files and annotated with their respective source line numbers. -@item info variables @var{regexp} +Flag @code{-q}, which stands for @samp{quiet}, disables printing +header information and messages explaining why no variables have been +printed. + +@item info variables [-q] [-t @var{type_regexp}] [@var{regexp}] Like @kbd{info variables}, but only print the names and data types of -non-local variables whose names contain a match for regular expression -@var{regexp}. +non-local variables that matches the provided regexp(s). + +If @var{regexp} is provided, prints only the variables whose names +contain a match for regular expression @var{regexp}. + +If @var{type_regexp} is provided, prints only the variables whose +types contain a match for regular expression @var{type_regexp}. +The matching is done with the variable type as printed with the +@code{whatis} command. +If @var{type_regexp} contains space(s), it should be enclosed in single +quote characters. @kindex info classes @cindex Objective-C, classes and selectors