From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from AUS01-ME3-obe.outbound.protection.outlook.com (mail-me3aus01olkn2168.outbound.protection.outlook.com [40.92.63.168]) by sourceware.org (Postfix) with ESMTPS id 6B6363857C4E for ; Sat, 16 Apr 2022 18:17:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6B6363857C4E ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=By3WQow9d3jlNg1EGbbYzSdnbq111JMB4+8jc87scihEYkeOIGuTvWv5kFFRXMPhhd0NsV7ZbfG+bfTC/JUR1uASNeTI+lrBMyoo9TzshFO27pinJfKgPEWJ82FGmChyTg6swV0jo8csOQY3Hct5Vrkl3/nX2+LqTQ8E7q5d2UlZUBmUQJ9xpAf+49CC+AXoeRATrUQ8/Eui2Gzz+XNntfd2eymG+PAjW6hLMMyn2UwHMcRK9FP4feErimW2JAyw70I8beFXqcyxjvNVUUPDW4bdpBAUp34i1ByHAktMDqK6A6swLxjOvobga0/7LKqTd62bsYKWJcTMRoXFh0F1nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=47P5jvDu35WUB/DCxoccMbZhlgbHiliuSetyskKlqxY=; b=hhBT99SeqprUXEAthOal9yvAZCFOtxNjhyIiKudGB+m0u2QLzSeMuPlb+Rf5EvYVW/wB0D6rqBK4iw15KZ4r8Wp0Am2bYSKCE/L7qRBw9/OY7Due9H6JU8rJXFM237tRmaV9FwBMrOYkyNWjnhBGcetZenkglZLF/K2PWzhLXpAuq3PRU5R2ZO4zZmDS9OJQlneRuQL23s/LAvnv3PLkHO/nL2RLsHD935ZCDFjEiWZRNemVmFs1wm9W8oR9R4l1zl3l3698BRG5YdTJs2icjaY6B5i9XEFt8+MvZmvKQ2PxMc7H1TnJJw7Q6x9WXCiafFdgqxvgFNEycy2L+QIgpA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) by SY6P282MB3316.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:173::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5164.18; Sat, 16 Apr 2022 18:17:43 +0000 Received: from MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::5804:c2bb:bc94:3cec]) by MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM ([fe80::5804:c2bb:bc94:3cec%6]) with mapi id 15.20.5164.020; Sat, 16 Apr 2022 18:17:43 +0000 From: Enze Li To: tom@tromey.com, pedro@palves.net Cc: gdb-patches@sourceware.org Subject: [PATCH v8 2/3] gdb/doc: Documentation for the new print command Date: Sun, 17 Apr 2022 02:17:24 +0800 Message-ID: X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220416181725.7176-1-lienze2010@hotmail.com> References: <20220416175963.3211-1-lienze2010@hotmail.com> <20220416181725.7176-1-lienze2010@hotmail.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [DxkXkckf7u+CaAIC/Hb0vYKvudKT2mWg] X-ClientProxiedBy: HK2PR03CA0052.apcprd03.prod.outlook.com (2603:1096:202:17::22) To MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM (2603:10c6:220:71::10) X-Microsoft-Original-Message-ID: <20220416181725.7176-3-lienze2010@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd2f0a74-6797-4fcb-792c-08da1fd5663f X-MS-TrafficTypeDiagnostic: SY6P282MB3316:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a2arBhu7p96w1oFZUBQsVa6Z8QYZcuxLPtsGgXu0iaN2hd33XdbqrXnTYfFgaTQ41pbkXTZK3YzrzPOryFlE1zz9xn4JPw99WsSPMS/nDdDp+WIoyhDpV5Fk9TPhQuM16SWwl6C6uRvzF4Kn5DtxOC8cVva++FVmB2ZeHIOmioEMe0wfPpOMrnWlm4h/O3eYzJBfV9kx4lvx6EsN29wHLRsYmJH+7nOnlzGfWiEMUM6PnMzawG9NS54mURlGea/op2gYgLyMq0FFuQRxqOKsjk+xt0XQAvEz1bqeAPLxPwLwpIEVB6C8rWQJcy9lMLCggMdgNYfyCSz4CHDMIeYpmuJn7hBvgtiYAy0NbdEeGisgGe2iMghpoYvwo3c/dOFw+MuHnpRTOBKDHrHizJc7MqMyFjBrmRv1vTWVt5uzq/5toXuuMxXl6innwErb7LDzX0ua803/DGOLSKcpkZZYN6yQr2wBEK/LTIyn3D0O/wQiJgSn0eSFOr9L6icTW9QOcMRH3zhm1oZ3YGz5WErc3K8VPpmi4IYhoS6jMZfx/dDpSRodo4d8mrfQzVN35KIm73X3wb1RC4aAGJUCj9xPXA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6VoeoI4k8YelVbOLQwCvy0s5FuDdOgZx8bNmBRokVcHs53Eaav6WeE/g6KAX?= =?us-ascii?Q?GWLoJpEPGNVbqqSqsSxwl5BBBr+Dvdg4DKr+5Li2Pxa11h7qNalpyEjB3Rgz?= =?us-ascii?Q?j+YFMLMuaTrrNm/PV3sxvHb+rLIcg/Az1VErmKDFDej2e2glk95Ryq3BDoap?= =?us-ascii?Q?oRQSmUAZ1+xddRz3Q7QNgpIHEfP4Wo1kAqhWcKebv2B6Qq7pKd3Z3ANHPOIS?= =?us-ascii?Q?QFWfl2J52YimEDR0z6AuhXYBp2sHRygKoHiTGWf8BP3hgXdvuNzhInVaX48F?= =?us-ascii?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0s5IM0C3Oto35vjZS5vGD8cukbtnQwE?= =?us-ascii?Q?4Q/Mucb9V+LYL8PlI3I5AaSuVjgIsJjV7dNw3p2NkwdXo9pM0HZrfNR4Or5W?= =?us-ascii?Q?Hm4LLiK0mwlWFA+NUPKFLBIlAQyIdzn2aF3Ppv7xWE9226papLgtURDJBQXO?= =?us-ascii?Q?AVKPfTS8nqORKFnOGozjck2Hsm6TkHxittX0End6Ql+vCyvSXY1dRIKdCLrJ?= =?us-ascii?Q?IRbfJLE/cmpf38UqNb8onG6arwlWYu4++gMl/psolGmDWddiDd2pCtWuM++7?= =?us-ascii?Q?P4c22XH72PY=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-746f3.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: dd2f0a74-6797-4fcb-792c-08da1fd5663f X-MS-Exchange-CrossTenant-AuthSource: MEAP282MB0293.AUSP282.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Apr 2022 18:17:43.2933 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY6P282MB3316 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2022 18:17:51 -0000 Document the new command "print nibbles" and add a NEWS entry. --- gdb/NEWS | 5 +++++ gdb/doc/gdb.texinfo | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 760cb2b7abc..f8502d5d238 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -23,6 +23,11 @@ maintenance show ignore-prologue-end-flag used to force GDB to use prologue analyzers if the line-table is constructed from erroneous debug information. +set print nibbles [on|off] +show print nibbles + This controls whether the 'print/t' command will display binary values + in groups of four bits, known as "nibbles". The default is 'off'. + * Changed commands maintenance info line-table diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index c1e9b09e833..7be872570a1 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -2142,10 +2142,10 @@ on @code{-} after the command name. For example: @smallexample (@value{GDBP}) print -@key{TAB}@key{TAB} --address -max-depth -pretty -symbol --array -memory-tag-violations -raw-values -union --array-indexes -null-stop -repeats -vtbl --elements -object -static-members +-address -max-depth -object -static-members +-array -memory-tag-violations -pretty -symbol +-array-indexes -nibbles -raw-values -union +-elements -null-stop -repeats -vtbl @end smallexample Completion will in some cases guide you with a suggestion of what kind @@ -10021,6 +10021,10 @@ Set limit on string chars or array elements to print. The value Set the threshold after which nested structures are replaced with ellipsis. Related setting: @ref{set print max-depth}. +@item -nibbles [@code{on}|@code{off}] +Set whether to print binary values in groups of four bits, known +as ``nibbles''. @xref{set print nibbles}. + @item -memory-tag-violations [@code{on}|@code{off}] Set printing of additional information about memory tag violations. @xref{set print memory-tag-violations}. @@ -11385,6 +11389,29 @@ Stop printing element indexes when displaying arrays. Show whether the index of each element is printed when displaying arrays. +@anchor{set print nibbles} +@item set print nibbles +@itemx set print nibbles on +@cindex print binary values in groups of four bits +Print binary values in groups of four bits, known as @dfn{nibbles}, +when using the print command of @value{GDBN} with the option @samp{/t}. +For example, this is what it looks like with @code{set print nibbles on}: + +@smallexample +@group +(@value{GDBP}) print val_flags +$1 = 1230 +(@value{GDBP}) print/t val_flags +$2 = 0100 1100 1110 +@end group +@end smallexample + +@item set print nibbles off +Don't printing binary values in groups. This is the default. + +@item show print nibbles +Show whether to print binary values in groups of four bits. + @anchor{set print elements} @item set print elements @var{number-of-elements} @itemx set print elements unlimited -- 2.35.1