From patchwork Sun Apr 28 15:18:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Waroquiers X-Patchwork-Id: 32442 Received: (qmail 20664 invoked by alias); 28 Apr 2019 15:18:34 -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 20593 invoked by uid 89); 28 Apr 2019 15:18:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 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.1 spammy=FreeBSD, Printing, freebsd X-HELO: mailsec108.isp.belgacom.be Received: from mailsec108.isp.belgacom.be (HELO mailsec108.isp.belgacom.be) (195.238.20.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 28 Apr 2019 15:18:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1556464712; x=1588000712; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v+kAtRH7bfjn3oczbczXwzKC6UAzYdVOmiX1TgqswSY=; b=EZKeEClmz/uRyWPVGuMyypY/s8lYgiQwHs4QUmrrtv2t9LIo4wsI6KB8 evcbIqfoIxJ7z62wV9c8rtJZL2eL7g==; Received: from 59.151-129-109.adsl-dyn.isp.belgacom.be (HELO md.home) ([109.129.151.59]) by relay.skynet.be with ESMTP/TLS/DHE-RSA-AES128-GCM-SHA256; 28 Apr 2019 17:18:23 +0200 From: Philippe Waroquiers To: gdb-patches@sourceware.org Cc: Philippe Waroquiers Subject: [RFA 3/3] NEWS and documentation for $_gdb_setting and $_gdb_int_setting. Date: Sun, 28 Apr 2019 17:18:16 +0200 Message-Id: <20190428151816.31598-4-philippe.waroquiers@skynet.be> In-Reply-To: <20190428151816.31598-1-philippe.waroquiers@skynet.be> References: <20190428151816.31598-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 X-IsSubscribed: yes --- gdb/ChangeLog | 3 +++ gdb/NEWS | 5 +++++ gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4835c6fae5..4f37db24fd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -6022,6 +6022,9 @@ fill-column: 74 version-control: never coding: utf-8 End: +2019-04-28 Philippe Waroquiers + + * NEWS: Mention $_gdb_setting and $_gdb_int_setting. 2019-04-28 Philippe Waroquiers diff --git a/gdb/NEWS b/gdb/NEWS index 42b04e952a..a84509d1c5 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -9,6 +9,11 @@ scripts that should work error-free with many different versions, such as in system-wide init files. +* New built-in convenience functions $_gdb_setting and $_gdb_int_setting + provide access to the value of the GDB settings. They are handy + for changing the logic of user defined commands depending on the + current GDB settings. + * GDB now supports Thread Local Storage (TLS) variables on several FreeBSD architectures (amd64, i386, powerpc, riscv). Other architectures require kernel changes. TLS is not yet supported for diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 3efed670fa..a5a559e2b8 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -12811,3 +12811,8 @@ fill-column: 74 version-control: never coding: utf-8 End: +2019-04-27 Philippe Waroquiers + + * gdb.texinfo (Convenience Funs): Document the new + $_gdb_setting and $_gdb_int_setting convenience functions. + diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index cf8333d86b..688613ce07 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -11307,6 +11307,38 @@ $3 = void $4 = 1 @end smallexample +@item $_gdb_setting (@var{setting}) +@findex $_gdb_setting@r{, convenience function} +Return the value of the @value{GDBN} @var{setting} as a string value. +@var{setting} argument is the suffix to use in the @code{show} command +to examine this setting in the @value{GDBN} command line interface. + +@smallexample +(@value{GDBP}) show print frame-arguments +Printing of non-scalar frame arguments is "scalars". +(@value{GDBP}) p $_gdb_setting("print frame-arguments") +$2 = "scalars" +(@value{GDBP}) p $_gdb_setting("height") +$3 = "30" +((@value{GDBP}) +@end smallexample + +@item $_gdb_int_setting (@var{setting}) +@findex $_gdb_int_setting@r{, convenience function} +Return the value of the @value{GDBN} @var{setting} as an integer value. +This only works for boolean, auto boolean and integer settings. +The boolean values @code{false} and @code{true} are converted to +the integer values @code{0} and @code{1}. The value @code{auto} is +converted to the value @code{2}. + +@smallexample +(@value{GDBP}) p $_gdb_setting("height") +$3 = "30" +(@value{GDBP}) p $_gdb_int_setting("height") +$4 = 30 +((@value{GDBP}) +@end smallexample + @end table These functions require @value{GDBN} to be configured with