From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00050.outbound.protection.outlook.com [40.107.0.50]) by sourceware.org (Postfix) with ESMTPS id 860173950C1A for ; Thu, 15 Oct 2020 15:10:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 860173950C1A Received: from AM6PR05CA0010.eurprd05.prod.outlook.com (2603:10a6:20b:2e::23) by DB6PR0801MB1639.eurprd08.prod.outlook.com (2603:10a6:4:3b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21; Thu, 15 Oct 2020 15:10:43 +0000 Received: from AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:2e:cafe::cc) by AM6PR05CA0010.outlook.office365.com (2603:10a6:20b:2e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.20 via Frontend Transport; Thu, 15 Oct 2020 15:10:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT061.mail.protection.outlook.com (10.152.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.21 via Frontend Transport; Thu, 15 Oct 2020 15:10:42 +0000 Received: ("Tessian outbound c189680f801b:v64"); Thu, 15 Oct 2020 15:10:41 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 8c7860fe6954f062 X-CR-MTA-TID: 64aa7808 Received: from 73e5b187460f.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 17F2584A-D993-4C65-B819-DC0DFFFCDF1A.1; Thu, 15 Oct 2020 15:10:36 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 73e5b187460f.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 15 Oct 2020 15:10:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ck1IFiSHMZ8b7vCdXoyBXsT9INeUZ143aNgfVAUMX3Xk93g+nYDcWvkcBi6jPSaCVBZWsp6gYpTGHnmHG8GyOX8xCSIqJsBpdYBWjXkxd0e44ABVCdiDo8sKwZt03BuhowGOVB/A9pNL7v4YLUNE6gnNdiLG+koJd04W0f2mHrDE9wLA20bZ5QAAw3Q3296MJxbGL0ThvZAh3+HJVsastVBbs0gXoL5hzLCWBq5JP0wSYzrV8AIsTbJ/9uBOSSkEuAvw3ABp/fzWS3axax8C8F6flnmbQf8vCo7m6F36bU2eZtI824/AvSiHdZl0/Hd/9zj/mH5rYVGpCJLAs2+N3Q== 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-SenderADCheck; bh=zuNT1x3dPhe8rCOgH4QMq1D21ket6iknocFGZqmwzGo=; b=dX4jKO+5ZR41XdsqeEcLuLIG8JNjWi/V4UhC9wr3rW3LaLM+nb763tCKNBMESc6KF9Ou8vjRiSRN9+ZyuLOsye2L79rLHBH9WkuRYMHzDztGxLBmMFVbdIV4VzCoQP0gl30bg7WEDLgBsE6GPen8tLvMC9mQU6bf8neOzEyhM9/e9UkRhbCyHyzE4tCxhxDHraSZp0R2qCoISVpKG6eZhExp5GaW0EVwOh64lSGfgRGxWm8cqoTorBoPFwQXCYVVpf01qgSbREeDUJTYQk3Ryx1VcjkrZ+z5gAP5M2qnr0GtAQBc9e3hP56BJcBfgrNY4hMpWtoMUT0r01/AHN1QNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AM6PR08MB4295.eurprd08.prod.outlook.com (2603:10a6:20b:b7::16) by AM6PR08MB5173.eurprd08.prod.outlook.com (2603:10a6:20b:e5::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.27; Thu, 15 Oct 2020 15:10:34 +0000 Received: from AM6PR08MB4295.eurprd08.prod.outlook.com ([fe80::b813:1fe2:1bc9:6b6b]) by AM6PR08MB4295.eurprd08.prod.outlook.com ([fe80::b813:1fe2:1bc9:6b6b%5]) with mapi id 15.20.3477.021; Thu, 15 Oct 2020 15:10:34 +0000 Subject: Re: [PING] [PATCH v3] Fixed pretty printing max depth behavior To: gdb-patches@sourceware.org Cc: nd@arm.com, richard.bunt@arm.com References: <20200925150111.6544-1-kent.cheung@arm.com> From: Kent Cheung Message-ID: <0f387edf-59ac-ce1a-9dcf-0bfa1947a3fc@arm.com> Date: Thu, 15 Oct 2020 16:10:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: <20200925150111.6544-1-kent.cheung@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [217.140.99.251] X-ClientProxiedBy: LO3P265CA0007.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::12) To AM6PR08MB4295.eurprd08.prod.outlook.com (2603:10a6:20b:b7::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [10.57.53.108] (217.140.99.251) by LO3P265CA0007.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:bb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.23 via Frontend Transport; Thu, 15 Oct 2020 15:10:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6cba79b0-8680-4c23-1496-08d8711c7bc1 X-MS-TrafficTypeDiagnostic: AM6PR08MB5173:|DB6PR0801MB1639: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4941;OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: IZ1GCulKhHcPP6cwyCqaqUcgBRmN0Pyozbnl6rlsY4GwWqTc6NhnGs3PYSjWuA4esK49L0RiWgog5p4q1EpqjDC1CiKh8vzf2jk5ENL2I6ZV2YUMoW8kVwJ/gbiojVDAYZzr3g3VMWml4ZxblWYR757xSwd5j+j2M20wTkprQyuxXaEZ+taX/mDDl0vpdGRiSPeCk3RVQGVR0SvqgNg/wQq86qePH49amjzRozu/3JlRFG6VVESwmq+7MDOUAn/k+u8pGl2WrlEn0l3mvaMLn/K0yWXx6XjENGtW8+juBBkJVpwb4r4+7tbqAFOkT//D5w1qhOh5i8ZXrhb7ZGZfk7Hpp7JJZZWbpjpAEXuMq7ktqTbPkSz7Cr3+hb+NB7d09/BjTihainj7uK7TWrhb/qwelZCm5mVfIbhVcGzIbSQ= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR08MB4295.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39830400003)(136003)(376002)(366004)(346002)(396003)(66476007)(66946007)(53546011)(66556008)(5660300002)(186003)(6486002)(26005)(34490700002)(30864003)(36756003)(956004)(2616005)(16526019)(478600001)(6666004)(2906002)(6916009)(86362001)(83380400001)(31686004)(52116002)(44832011)(316002)(31696002)(16576012)(8676002)(4326008)(8936002)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: rIUmuR3CZFoOQKqnsRPqYvKCeiFYuLUynYaYpm3oBTP7N7q6tiKRGPHvtlNwv5Mco8u6M/sA+nJwmgRLCS5SXHT0XyRnxcg3R4hrhmEF7DgoQJ7qaBMq5EvEDeldzOS5NdEmPU2AwPdshMEytcthIwFv6K6E/5NH1DIHYWbM+cPYrei/R+l7s6xiwIu3I10GUo4WYXHSzovvxKBiZcKRKwdXBY/NGKarP/MSj5GrO7NgxTRgB8zQBoIea6zD6f13Hx7caIR+Ngkr7OL4ec44ngfmFf9kWNRasB1T6hvTV0VBl8mN85xN03R6xmG2W0t8Ucdclt2xlwddS+5T39hMbsw5RRM2itxi8fP3UNK972mYAtVqLyG2PVPlyQL6ulOpVwfGhvaa6TcpBCUtxlpsbiLoxBo/wHsnrgOgsTmQwfeZptxanPWfNCRGrG0RqrrZ9RsVaVCmT656DKAg5fc3Jv/3Dwu9X7TzuCiZYCT9g2gDhmQl+inhn96P2+N3h17RqdD91BPQ69nNctHaMLx9KWj7T5mZ08B3dx/lDlPcVbzzAmw+yo342zdGbGvjllzXA+yPgnLzzgZn0/4P+qYKIIn4TgriBQqcZf0bONhzcrSF217J5S57ckDqFTIgSFhRjoWXjcZX1lUFkn+4UK/tyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5173 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 6d7d89be-46af-4984-4978-08d8711c76eb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mmTjGhlQ9LgZsTvPNk1w7SzpVLec+JSUNl6PzZ8evg0BUOzIClecegW3mBM9gNlQIoF6a+4ZtPBOGMzmA0/mKSvscF5kx63rOFm4NLU4OLslj2jRCdowEcGeo436/6XJpmucRz1CRRU4ja8hUgRzqtS7IlJF7Rsygd8gNJqcSJcSX1NuNV3BmZM9cDZ4yuLJRwCdUVXr/rgoV+VE5uonFG7px8amSqM3TYidQX/ZbZzC2TW86Js/WZN54p9Vq5AizW3WGf/MOAbz8WZsV0pWIGTaJDNyfLoQ56XLBJGoYMgI33tYQmB7a1Q5GC/klUlyxsMDmEk7BK4W3XOyqHdaiR55jjbY335/jOS6OsOTZFFji9L63NM4G2mKzoS/MQWPJrCUhnYuh7sUl5JimfQCZ2gqEe2AVY1a4mhdp2rbEddO/waOxkFyPPewBEEvigPn X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(396003)(39830400003)(346002)(376002)(136003)(46966005)(4326008)(36756003)(478600001)(16576012)(83380400001)(6486002)(30864003)(86362001)(26005)(186003)(356005)(31696002)(31686004)(8676002)(336012)(956004)(81166007)(2906002)(16526019)(2616005)(8936002)(53546011)(36906005)(5660300002)(6916009)(316002)(82310400003)(6666004)(70586007)(47076004)(70206006)(44832011)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2020 15:10:42.1349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cba79b0-8680-4c23-1496-08d8711c7bc1 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1639 X-Spam-Status: No, score=-16.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 15 Oct 2020 15:10:48 -0000 On 9/25/20 4:01 PM, Kent Cheung wrote: > The 'print max-depth' feature incorrectly causes GDB to skip printing > the string representation of pretty printed variables if the variable is > stored at a nested depth corresponding to the set max-depth value. This > change ensures that it is always printed before checking whether the > maximum print depth has been reached. > > Regression tested with GCC 7.3.0 on x86_64, ppc64le, aarch64. > > gdb/ChangeLog: > > 2020-09-25 Kent Cheung > > * cp-valprint.c (cp_print_value): Replaced duplicate code. > * guile/scm-pretty-print.c (ppscm_print_children): Check > max_depth just before printing child values. > (gdbscm_apply_val_pretty_printer): Don't check max_depth before > printing string representation. > * python/py-prettyprint.c (print_children): Check max_depth just > before printing child values. > (gdbpy_apply_val_pretty_printer): Don't check max_depth before > printing string representation. > > gdb/testsuite/ChangeLog: > > 2020-09-25 Kent Cheung > > * gdb.python/py-format-string.c: Added a variable to test. > * gdb.python/py-format-string.exp: Check string representation > is printed at appropriate max_depth settings. > * gdb.python/py-nested-maps.exp: Same. > > Change-Id: Ic4f8734361ab9d262c9468f3db929a8d18462136 > --- > gdb/ChangeLog | 12 ++++++++ > gdb/cp-valprint.c | 10 ++----- > gdb/guile/scm-pretty-print.c | 30 ++++++++++--------- > gdb/python/py-prettyprint.c | 28 +++++++++-------- > gdb/testsuite/ChangeLog | 7 +++++ > gdb/testsuite/gdb.python/py-format-string.c | 6 ++++ > gdb/testsuite/gdb.python/py-format-string.exp | 9 ++++++ > gdb/testsuite/gdb.python/py-nested-maps.exp | 6 ++-- > 8 files changed, 71 insertions(+), 37 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 649131da99..8c11688984 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,15 @@ > +2020-09-25 Kent Cheung > + > + * cp-valprint.c (cp_print_value): Replaced duplicate code. > + * guile/scm-pretty-print.c (ppscm_print_children): Check max_depth > + just before printing child values. > + (gdbscm_apply_val_pretty_printer): Don't check max_depth before > + printing string representation. > + * python/py-prettyprint.c (print_children): Check max_depth just > + before printing child values. > + (gdbpy_apply_val_pretty_printer): Don't check max_depth before > + printing string representation. > + > 2020-09-24 Tom Tromey > > PR tui/26638: > diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c > index 819736dac9..aae8041c85 100644 > --- a/gdb/cp-valprint.c > +++ b/gdb/cp-valprint.c > @@ -495,14 +495,8 @@ cp_print_value (struct value *val, struct ui_file *stream, > { > int result = 0; > > - if (options->max_depth > -1 > - && recurse >= options->max_depth) > - { > - const struct language_defn *language = current_language; > - gdb_assert (language->struct_too_deep_ellipsis () != NULL); > - fputs_filtered (language->struct_too_deep_ellipsis (), stream); > - } > - else > + if (!val_print_check_max_depth (stream, recurse, options, > + current_language)) > { > struct value *baseclass_val = value_primitive_field (val, 0, > i, type); > diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c > index ccc6164451..efb95f1d12 100644 > --- a/gdb/guile/scm-pretty-print.c > +++ b/gdb/guile/scm-pretty-print.c > @@ -818,21 +818,29 @@ ppscm_print_children (SCM printer, enum display_hint hint, > gdb::unique_xmalloc_ptr name > = gdbscm_scm_to_c_string (scm_name); > > - /* Print initial "{". For other elements, there are three cases: > + /* Print initial "=" to separate print_string_repr output and > + children. For other elements, there are three cases: > 1. Maps. Print a "," after each value element. > 2. Arrays. Always print a ",". > 3. Other. Always print a ",". */ > if (i == 0) > - { > - if (printed_nothing) > - fputs_filtered ("{", stream); > - else > - fputs_filtered (" = {", stream); > - } > - > + { > + if (!printed_nothing) > + fputs_filtered (" = ", stream); > + } > else if (! is_map || i % 2 == 0) > fputs_filtered (pretty ? "," : ", ", stream); > > + /* Skip printing children if max_depth has been reached. This check > + is performed after print_string_repr and the "=" separator so that > + these steps are not skipped if the variable is located within the > + permitted depth. */ > + if (val_print_check_max_depth (stream, recurse, options, language)) > + goto done; > + else if (i == 0) > + /* Print initial "{" to bookend children. */ > + fputs_filtered ("{", stream); > + > /* In summary mode, we just want to print "= {...}" if there is > a value. */ > if (options->summary) > @@ -991,12 +999,6 @@ gdbscm_apply_val_pretty_printer (const struct extension_language_defn *extlang, > } > gdb_assert (ppscm_is_pretty_printer_worker (printer)); > > - if (val_print_check_max_depth (stream, recurse, options, language)) > - { > - result = EXT_LANG_RC_OK; > - goto done; > - } > - > /* If we are printing a map, we want some special formatting. */ > hint = ppscm_get_display_hint_enum (printer); > if (hint == HINT_ERROR) > diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c > index 7cb20df7f2..8da6b83036 100644 > --- a/gdb/python/py-prettyprint.c > +++ b/gdb/python/py-prettyprint.c > @@ -431,22 +431,29 @@ print_children (PyObject *printer, const char *hint, > continue; > } > > - /* Print initial "{". For other elements, there are three > - cases: > + /* Print initial "=" to separate print_string_repr output and > + children. For other elements, there are three cases: > 1. Maps. Print a "," after each value element. > 2. Arrays. Always print a ",". > 3. Other. Always print a ",". */ > if (i == 0) > - { > - if (is_py_none) > - fputs_filtered ("{", stream); > - else > - fputs_filtered (" = {", stream); > - } > - > + { > + if (!is_py_none) > + fputs_filtered (" = ", stream); > + } > else if (! is_map || i % 2 == 0) > fputs_filtered (pretty ? "," : ", ", stream); > > + /* Skip printing children if max_depth has been reached. This check > + is performed after print_string_repr and the "=" separator so that > + these steps are not skipped if the variable is located within the > + permitted depth. */ > + if (val_print_check_max_depth (stream, recurse, options, language)) > + return; > + else if (i == 0) > + /* Print initial "{" to bookend children. */ > + fputs_filtered ("{", stream); > + > /* In summary mode, we just want to print "= {...}" if there is > a value. */ > if (options->summary) > @@ -597,9 +604,6 @@ gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, > if (printer == Py_None) > return EXT_LANG_RC_NOP; > > - if (val_print_check_max_depth (stream, recurse, options, language)) > - return EXT_LANG_RC_OK; > - > /* If we are printing a map, we want some special formatting. */ > gdb::unique_xmalloc_ptr hint (gdbpy_get_display_hint (printer.get ())); > > diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog > index 2e35f6cdf1..f65725a288 100644 > --- a/gdb/testsuite/ChangeLog > +++ b/gdb/testsuite/ChangeLog > @@ -1,3 +1,10 @@ > +2020-09-25 Kent Cheung > + > + * gdb.python/py-format-string.c: Added a variable to test. > + * gdb.python/py-format-string.exp: Check string representation is > + printed at appropriate max_depth settings. > + * gdb.python/py-nested-maps.exp: Same. > + > 2020-09-25 Gary Benson > > * gdb.base/infcall-nested-structs.exp.tcl: Add > diff --git a/gdb/testsuite/gdb.python/py-format-string.c b/gdb/testsuite/gdb.python/py-format-string.c > index a771370fde..99b7982ebf 100644 > --- a/gdb/testsuite/gdb.python/py-format-string.c > +++ b/gdb/testsuite/gdb.python/py-format-string.c > @@ -23,6 +23,11 @@ typedef struct point > int y; > } point_t; > > +typedef struct > +{ > + point_t the_point; > +} struct_point_t; > + > typedef union > { > int an_int; > @@ -84,6 +89,7 @@ main () > point_t &a_point_t_ref = a_point_t; > #endif > struct point another_point = { 123, 456 }; > + struct_point_t a_struct_with_point = { a_point_t }; > > struct_union_t a_struct_with_union; > /* Fill the union in an endianness-independent way. */ > diff --git a/gdb/testsuite/gdb.python/py-format-string.exp b/gdb/testsuite/gdb.python/py-format-string.exp > index 792d60c09d..59a1eb94e2 100644 > --- a/gdb/testsuite/gdb.python/py-format-string.exp > +++ b/gdb/testsuite/gdb.python/py-format-string.exp > @@ -126,6 +126,7 @@ set default_regexp_dict [dict create \ > "a_point_t_pointer" $default_pointer_regexp \ > "a_point_t_ref" "Pretty Point \\(42, 12\\)" \ > "another_point" "Pretty Point \\(123, 456\\)" \ > + "a_struct_with_point" "\\{the_point = Pretty Point \\(42, 12\\)\\}" \ > "a_struct_with_union" "\\{the_union = \\{an_int = 707406378, a_char = 42 '\\*'\\}\\}" \ > "an_enum" "ENUM_BAR" \ > "a_string" "${default_pointer_regexp} \"hello world\"" \ > @@ -679,18 +680,26 @@ proc test_max_depth {} { > set opts "max_depth=-1" > with_test_prefix $opts { > check_format_string "a_struct_with_union" $opts > + check_format_string "a_point_t" $opts "Pretty Point \\(42, 12\\)" > + check_format_string "a_struct_with_point" $opts > } > set opts "max_depth=0" > with_test_prefix $opts { > check_format_string "a_struct_with_union" $opts "\\{\.\.\.\\}" > + check_format_string "a_point_t" $opts "Pretty Point \\(42, 12\\)" > + check_format_string "a_struct_with_point" $opts "\\{\.\.\.\\}" > } > set opts "max_depth=1" > with_test_prefix $opts { > check_format_string "a_struct_with_union" $opts "\\{the_union = \\{\.\.\.\\}\\}" > + check_format_string "a_point_t" $opts "Pretty Point \\(42, 12\\)" > + check_format_string "a_struct_with_point" $opts > } > set opts "max_depth=2" > with_test_prefix $opts { > check_format_string "a_struct_with_union" $opts > + check_format_string "a_point_t" $opts "Pretty Point \\(42, 12\\)" > + check_format_string "a_struct_with_point" $opts > } > } > > diff --git a/gdb/testsuite/gdb.python/py-nested-maps.exp b/gdb/testsuite/gdb.python/py-nested-maps.exp > index 9e1fca58bf..c8717e7b90 100644 > --- a/gdb/testsuite/gdb.python/py-nested-maps.exp > +++ b/gdb/testsuite/gdb.python/py-nested-maps.exp > @@ -222,15 +222,15 @@ with_test_prefix "headers=on" { > with_test_prefix "pretty=off" { > gdb_print_expr_at_depths "*m1" \ > [list \ > - "\{\\.\\.\\.\}" \ > + "pp_map = \{\\.\\.\\.\}" \ > "pp_map = \{\\\[\{a = 3, b = 4\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 4, b = 5\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 5, b = 6\}\\\] = \{\\.\\.\\.\}\}" \ > "pp_map = \{\\\[\{a = 3, b = 4\}\\\] = \{x = 0, y = 1, z = 2\}, \\\[\{a = 4, b = 5\}\\\] = \{x = 3, y = 4, z = 5\}, \\\[\{a = 5, b = 6\}\\\] = \{x = 6, y = 7, z = 8\}\}" \ > ] > > gdb_print_expr_at_depths "*mm" \ > [list \ > - "\{\\.\\.\\.\}" \ > - "pp_map_map = \{\\\[$hex \"m1\"\\\] = \{\\.\\.\\.\}, \\\[$hex \"m2\"\\\] = \{\\.\\.\\.\}\}" \ > + "pp_map_map = \{\\.\\.\\.\}" \ > + "pp_map_map = \{\\\[$hex \"m1\"\\\] = pp_map = \{\\.\\.\\.\}, \\\[$hex \"m2\"\\\] = pp_map = \{\\.\\.\\.\}\}" \ > "pp_map_map = \{\\\[$hex \"m1\"\\\] = pp_map = \{\\\[\{a = 3, b = 4\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 4, b = 5\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 5, b = 6\}\\\] = \{\\.\\.\\.\}\}, \\\[$hex \"m2\"\\\] = pp_map = \{\\\[\{a = 6, b = 7\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 7, b = 8\}\\\] = \{\\.\\.\\.\}, \\\[\{a = 8, b = 9\}\\\] = \{\\.\\.\\.\}\}\}" \ > "pp_map_map = \{\\\[$hex \"m1\"\\\] = pp_map = \{\\\[\{a = 3, b = 4\}\\\] = \{x = 0, y = 1, z = 2\}, \\\[\{a = 4, b = 5\}\\\] = \{x = 3, y = 4, z = 5\}, \\\[\{a = 5, b = 6\}\\\] = \{x = 6, y = 7, z = 8\}\}, \\\[$hex \"m2\"\\\] = pp_map = \{\\\[\{a = 6, b = 7\}\\\] = \{x = 9, y = 0, z = 1\}, \\\[\{a = 7, b = 8\}\\\] = \{x = 2, y = 3, z = 4\}, \\\[\{a = 8, b = 9\}\\\] = \{x = 5, y = 6, z = 7\}\}\}" \ > ]