From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OW9KBNLsJmnQFTIAWB0awg (envelope-from ) for ; Wed, 26 Nov 2025 07:04:34 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=htecgroup.com header.i=@htecgroup.com header.a=rsa-sha256 header.s=selector1 header.b=bdLQtwNw; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0A9371E0B3; Wed, 26 Nov 2025 07:04:34 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 816541E08D for ; Wed, 26 Nov 2025 07:04:32 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 437383857806 for ; Wed, 26 Nov 2025 12:04:32 +0000 (GMT) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11021128.outbound.protection.outlook.com [52.101.70.128]) by sourceware.org (Postfix) with ESMTPS id 7BD803858410 for ; Wed, 26 Nov 2025 12:03:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7BD803858410 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=htecgroup.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=htecgroup.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7BD803858410 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=52.101.70.128 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1764158592; cv=pass; b=JNJrMfjWzU9nmwceIld2G19BSa5yK7jY7kDauwxxxcPo5u9oaZEnJw582PZphMvXpnCjqP78l1z1GP+mM6+GrLOsqFK8NvBWXya9g+rubTuE4d0BpBhGkACHfZUHsC1QkiBTKV8r07MVoBhv+hSnKTv6Zh5of19HLWqDBl/WFPg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1764158592; c=relaxed/simple; bh=Ug1v6Djtrmx2CwHJOBnoTH5wg8cKA/qkLtWDBruMPcU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kTbGrBCojb7Opp4IfG/NXFSq+Vfrnnq+Hhy4WvEDxaAlUM5Yn2k09thDfZw080cJmf4ZC/SFrk+GkinG2s8j5yqfh4ZUpq4v+nai2C2iN5YmfPnEeViZ+6Amh31/F2wk0oEcwOQog9qfS5QgmE5/tN2jZhf3XCAGDA98Im+VA1M= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eZ2uwzzipvnuiapca83G7dDKyVXzr8O7RVk9WLL2HYPPC0UyHkFteERPh4+zrKNnyOv9pemRS5PyOo11Vnxfx/OLz03WY6ZfJ1WWBu7RaZgPZDBGRLloi5pLKTsCKdryPkPDxjACPBwlO3Q7+f5IufX9yFunuwL21myclfwsqxSjnOFHpwgjykRnw1dC3GHD7TwEs+7MnVi3uJ1Vwooe94y8MjXte6nlnZf+5i2S4EA90kVe7eldAPN213UPYv6n1w7gxQ9iTU0Lgb8/k1cZ9WlNvIN7KcWKrF1FFhoYYzeI1gm3efHqCXTN+rhsyVXB5NAqikgZ5yWfGkKfFuvM0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=5nfKjNhr8wUwjGeGHx01zkwV3foNHLQA9H7LEXzzKTM=; b=pBsFY2gQW4SWI3QZ2r6ssKIeERbXozsMQA1W9gN3eptr1p30/fbtvb0cJDKfQKEvnGLo1LLIMovrMwPFJXPjeuLAfxbN7ka8H1T84FHHB3zk1/N9XxCuzw7ZSxTXWOAdo6GUk8pnCC2tXu40geniiXlyjjvyCz7rRfOkP3zX8dKxE7h2upNr1pbm63Q1b0rEAqE+aFyCOolvj5O71qPE7k5s76pXGpYSviuI/Qt8NZWnVJm+YUbkiGNAcdPgSlr0fFhRtdObhhFnPNxthqGkm59B8qdBo4nO3oTtdbDWbjYj+V3luWzfn+c3KkzNVYml7HeR+B6N9gfgGSpQ4VWLNA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=htecgroup.com; dmarc=pass action=none header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5nfKjNhr8wUwjGeGHx01zkwV3foNHLQA9H7LEXzzKTM=; b=bdLQtwNwQVH0An23GBNZppady93I9HV9OPy/j/q/6psrv0utKM6GaVfmK/2A7S2ivZmfocFC2p7cxRtwtp8/OvBaJnEN8SKpwZPFuPwZFSrYhMlxBvuC/5sBz/CiSzXL9nO2vqadJgBjl+faJxD69LnYelfhB+IfO1E7qwoxZB8BPTcXVT0q6J1tcecUqWSGlZeggGfm4AUGcggDYo+Ksb7oSb5KV+dx+u7w5bkrcA7C/u4xLWFYywjk5GN0eBd1l4FQEWFygiruFb98ijzFCNTKYVtzj3Hls+SDJplnf6+tOaspeyobP6XNcR5wp6+nQIUATOfKWN4FBC/cUeag2w== Received: from DBBPR09MB3477.eurprd09.prod.outlook.com (2603:10a6:10:d7::21) by DBBPR09MB4537.eurprd09.prod.outlook.com (2603:10a6:10:1f5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.12; Wed, 26 Nov 2025 12:03:00 +0000 Received: from DBBPR09MB3477.eurprd09.prod.outlook.com ([fe80::a339:e3f8:fe9b:112e]) by DBBPR09MB3477.eurprd09.prod.outlook.com ([fe80::a339:e3f8:fe9b:112e%7]) with mapi id 15.20.9343.016; Wed, 26 Nov 2025 12:03:00 +0000 From: Daniel Knezevic To: "gdb-patches@sourceware.org" CC: Tom Tromey , Pedro Alves , Simon Marchi , Daniel Knezevic Subject: [PATCH 2/3] gdb: Replace \r\n with multi_line to make tests more readable Thread-Topic: [PATCH 2/3] gdb: Replace \r\n with multi_line to make tests more readable Thread-Index: AQHcXsycxfY5QrHFDUaJ9mgzP/NlSw== Date: Wed, 26 Nov 2025 12:03:00 +0000 Message-ID: <20251126120210.919813-3-daniel.knezevic@htecgroup.com> References: <20251126120210.919813-1-daniel.knezevic@htecgroup.com> In-Reply-To: <20251126120210.919813-1-daniel.knezevic@htecgroup.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=htecgroup.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBBPR09MB3477:EE_|DBBPR09MB4537:EE_ x-ms-office365-filtering-correlation-id: 682986d5-697a-41cc-a54f-08de2ce3bf02 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700021; x-microsoft-antispam-message-info: =?iso-8859-1?Q?JJ46FehM/4G91bGfCsl676d/yP0pNhfcoDd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u75BJWvvvR1Eek5Ud8M91fcfn9TTD9oqzQeH7s?= =?iso-8859-1?Q?zxZBltGvdsTriBfYJl6vn5vmoUnnIPcIcXktB/Xx/xL5wIWKXUowRWNqVU?= =?iso-8859-1?Q?4irZMfQ/Rpw88FyoZXLJLm3genP3/BqSngDdK6Zz8ppKobBjgQFwNNAMcP?= =?iso-8859-1?Q?zzBEAeNfvxPcHndxqP/qv8C1ogsvCzeMJ3aaSmgJEE/DTayPAOFJITYLRI?= =?iso-8859-1?Q?jaLLCcL5xqGUmV+ZtIa8NzOG/0DDBkoqtdrkR7dzhQBDZS5FQbaaupGBEt?= =?iso-8859-1?Q?TaXMX2iAGepA/Uyv+gikhau3XOozK0I7SjgrjneZeGajZxWCMQjBjW72QI?= =?iso-8859-1?Q?vacLI/GtdBxSpUx4jvuU4PVdsz2QFgPHWAtVVJVDdMDdINh9hbrD1Dbn3v?= =?iso-8859-1?Q?hTv4q6khdDHDDmgnEH1SqjwqjEznJgv3kO+1aluqFnUKd7w5Q29K/uO397?= =?iso-8859-1?Q?7XHQl8O/RhT44Mm4hA2LhTpps4DYWRfJ2G6j4azC+9VaU08Sxht4bV4Zxk?= =?iso-8859-1?Q?7OnWbzg79KKnN9U7XLbBTNA5hO4ga5F+/513FuDuTMEo3KdKGJnMZhx8C4?= =?iso-8859-1?Q?8sJ3a0jPmIFTgiFx4BOUB+VetAxABbW1O82RqzZ1T2V/8gGr7UL6DUR98B?= =?iso-8859-1?Q?2InRHy1q5pHK/VwTgYADg3A9vqH+?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBBPR09MB3477.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(38070700021); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?NYq3cJJ5VpStrvbJcBUMa2wIHZDDTs09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q?6leLWk3C8dIWQlgaxclGrYZTI/DOAZdW3DkQ3jDhxoaQ5v4qCShk+7fLYB?= =?iso-8859-1?Q?INkXbactwQ2zo9yvKenSFh9Hz/XlFqPHerTEYDPnXfDSVyEYgByWDfuzmB?= =?iso-8859-1?Q?CVSWUJngbjKuYQs7kiiRc9TMHAjRVCk6wbN1vPg8lWi7lLKKwKTJI9+Lvz?= =?iso-8859-1?Q?1ZsCj+/3fmdc3cyWnnUPAgnSIDjLjg61iQHcMZf3XW1nFR6nomJjAR0zDe?= =?iso-8859-1?Q?n8Wb4sK/3qEX4o8DUBShqTwOD8SNpoWjnayVcmb9xwkyug6xe44vCp0N+l?= =?iso-8859-1?Q?Kb0/0cYZsR3V0czxkrw/I2xXrj7KskNGPUf0JvE63rKYBPKQSl7Q4jXKCS?= =?iso-8859-1?Q?74BPlE1kHQph281AuxdeBG5UGoFjodS26SMbglAsccKsWyhLpTbZTeXI2q?= =?iso-8859-1?Q?P0KDmdgRlZpFdnvCVJT33TnsUGzfFfkyGxr8rNCFbP1bgZbOkT6bu4UVu6?= =?iso-8859-1?Q?1AV59j08I3m0tgDeixI2NfrD5bwHEjpE72xO1/i3YgfzFjBrGmdwJ3dBO4?= =?iso-8859-1?Q?rm9tIbqca8a8L+B+PFTmtITWAukKwd1lHk4GBzbGp/F5bZOEWQcnzXudwq?= =?iso-8859-1?Q?zX5VyMexZJYCO+pjCJaZvmtIljgjklYI9fkB5Ge2O6g2vR4zIBK15r+46l?= =?iso-8859-1?Q?BOsrVgnOx1IXq6KmyFUmUbiO6SeGwQKJiDsv2Ddf/oe4wxMeHLws/nMIAQ?= =?iso-8859-1?Q?bpO0U6d0I+jVE8Fg12ibJIBkS+v/izDmjOGQ3UDcKtaFcDrXKD6gA9oFzt?= =?iso-8859-1?Q?9sGjEFVot2kyu5C+bdU=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: htecgroup.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBBPR09MB3477.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 682986d5-697a-41cc-a54f-08de2ce3bf02 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Nov 2025 12:03:00.6873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f85665b-7efd-4776-9dfe-b6bfda2565ee X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: KJin3gZC52bHN7RVUkdsxsZ8YYMksBqtyxscH6HvvII6FwCR4c7d/zlcqGTAY9w34Tw/vswKtLdkaKidOXDlSNkassX2LEU2oFnRaQHbAsk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR09MB4537 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org --- gdb/testsuite/gdb.base/ctf-ptype.exp | 105 ++++++++++++++++++++----- gdb/testsuite/gdb.base/ptype.exp | 112 ++++++++++++++++++++++----- gdb/testsuite/gdb.xml/tdesc-regs.exp | 34 ++++++-- 3 files changed, 206 insertions(+), 45 deletions(-) diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/= ctf-ptype.exp index 8baefdc005e..30f333744de 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -59,7 +59,16 @@ gdb_test_multiple "ptype red1" "ptype unnamed enumeratio= n member" { # Here and elsewhere, we accept # "long", "long int", or "int" for long variables (whatis.exp already # has an XFAIL for "int" (Sun cc bug), so no need to fail it here). -gdb_test "ptype struct t_struct" "type =3D struct t_struct \{.*\[\r\n\] = (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_mem= ber;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long= _member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_me= mber;.*\[\r\n\]\}.*" "ptype structure" +gdb_test "ptype struct t_struct" \ + [multi_line \ + "type =3D struct t_struct {" \ + " (unsigned |)char v_char_member;" \ + " (short|short int) v_short_member;" \ + " int v_int_member;" \ + " (long|long int|int) v_long_member;" \ + " float v_float_member;" \ + " double v_double_member;" \ + "}"] "ptype structure" =20 =20 # Test the equivalence between '.' and '->' for struct member references. @@ -77,12 +86,27 @@ if {[gdb_test "ptype v_t_struct_p->v_float_member" "typ= e =3D float"] < 0} { return -1 } =20 -gdb_test "ptype struct link" "type =3D struct link \{\[\r\n\]+\[ \t\]+stru= ct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct= link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.3.;\[\r\n\]= +\}.*" "ptype linked list structure" +gdb_test "ptype struct link" \ + [multi_line \ + "type =3D struct link {" \ + " struct link \\*next;" \ + " struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);"= \ + " struct t_struct stuff.3.;" \ + "}"] "ptype linked list structure" =20 # # test ptype command with unions # -gdb_test "ptype union t_union" "type =3D union t_union \{.*\[\r\n\] (un= signed |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;= .*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_mem= ber;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member= ;.*\[\r\n\]\}.*" "ptype union" +gdb_test "ptype union t_union" \ + [multi_line \ + "type =3D union t_union {" \ + " (unsigned |)char v_char_member;" \ + " (short|short int) v_short_member;" \ + " int v_int_member;" \ + " (long|long int|int) v_long_member;" \ + " float v_float_member;" \ + " double v_double_member;" \ + "}"] "ptype union" =20 # # test ptype command with enums @@ -179,33 +203,69 @@ gdb_test "ptype v_int" "type =3D int.*" "ptype int" # # test ptype command with nested structure and union # -gdb_test "ptype struct outer_struct" "type =3D struct outer_struct \{.*\[\= r\n\]+\ -.*int outer_int;.*\[\r\n\]+\ -.*(struct|) inner_struct inner_struct_instance;.*\[\r\n\]+\ -.*(union|) inner_union inner_union_instance;.*\[\r\n\]+\ -.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure" - -gdb_test "ptype struct inner_struct" "type =3D struct inner_struct \{.*\[\= r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\= n\]\}.*" "ptype inner structure" - -gdb_test "ptype union inner_union" "type =3D union inner_union \{.*\[\r\n\= ] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long= ;.*\[\r\n\]\}.*" "ptype inner union" - -gdb_test "ptype nested_su" "type =3D struct outer_struct \{.*\[\r\n\] i= nt outer_int;.*\[\r\n\] (struct |)inner_struct inner_struct_instance;.*\= [\r\n\] (union |)inner_union inner_union_instance;.*\[\r\n\] (long|lo= ng int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure" +gdb_test "ptype struct outer_struct" \ + [multi_line \ + "type =3D struct outer_struct {" \ + " int outer_int;" \ + " (struct|) inner_struct inner_struct_instance;" \ + " (union|) inner_union inner_union_instance;" \ + " (long|long int|int) outer_long;" \ + "}"] "ptype outer structure" + +gdb_test "ptype struct inner_struct" \ + [multi_line \ + "type =3D struct inner_struct {" \ + " int inner_int;" \ + " (long|long int|int) inner_long;" \ + "}"] "ptype inner structure" + +gdb_test "ptype union inner_union" \ + [multi_line \ + "type =3D union inner_union {" \ + " int inner_union_int;" \ + " (long|long int|int) inner_union_long;" \ + "}"] "ptype inner union" + +gdb_test "ptype nested_su" \ + [multi_line \ + "type =3D struct outer_struct {" \ + " int outer_int;" \ + " (struct |)inner_struct inner_struct_instance;" \ + " (union |)inner_union inner_union_instance;" \ + " (long|long int|int) outer_long;" \ + "}"] "ptype nested structure" =20 gdb_test "ptype nested_su.outer_int" "type =3D int.*" "ptype outer int" =20 -gdb_test "ptype nested_su.inner_struct_instance" "type =3D struct inner_st= ruct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_= long;.*\[\r\n\]\}.*" "ptype nested structure #2" +gdb_test "ptype nested_su.inner_struct_instance" \ + [multi_line \ + "type =3D struct inner_struct {" \ + " int inner_int;" \ + " (long|long int|int) inner_long;" \ + "}"] "ptype nested structure #2" =20 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type =3D int.*= " "ptype inner int" =20 -gdb_test "ptype nested_su.inner_union_instance" "type =3D union inner_unio= n \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inn= er_union_long;.*\[\r\n\]\}.*" "ptype nested union" +gdb_test "ptype nested_su.inner_union_instance" \ + [multi_line \ + "type =3D union inner_union {" \ + " int inner_union_int;" \ + " (long|long int|int) inner_union_long;" \ + "}"] "ptype nested union" =20 # Print the type description of variable the_highest, and verify that # the type description for the fields whose type is anonymous are # correctly printed (at nesting level 1 and 2). =20 gdb_test "ptype the_highest" \ - "type =3D struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r= \n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} = anonymous_level_1;.*\[\r\n\]}.*" \ - "ptype the_highest" + [multi_line \ + "type =3D struct highest {" \ + " int a;" \ + " struct {" \ + " int b;" \ + " struct \{\.\.\.\} anonymous_level_2;" \ + " \} anonymous_level_1;" \ + "}"] "ptype the_highest" =20 # Print the type descrption for one of the fields of variable the_highest. # The purpose is to verify that the type of a field that was printed above @@ -213,8 +273,13 @@ gdb_test "ptype the_highest" \ # nesting level is now one level less). =20 gdb_test "ptype the_highest.anonymous_level_1" \ - "type =3D struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *in= t c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \ - "ptype the_highest.anonymous_level_1" + [multi_line \ + "type =3D struct {" \ + " int b;" \ + " struct {" \ + " int c;" \ + " \} anonymous_level_2;" \ + "}"] "ptype the_highest.anonymous_level_1" =20 # Print the type of the identifier ID, and check the response: # - Expect to see PROTOTYPED as the type. PROTOTYPED is not a regular diff --git a/gdb/testsuite/gdb.base/ptype.exp b/gdb/testsuite/gdb.base/ptyp= e.exp index cf28aea2f51..3335950e93e 100644 --- a/gdb/testsuite/gdb.base/ptype.exp +++ b/gdb/testsuite/gdb.base/ptype.exp @@ -51,7 +51,16 @@ gdb_test_multiple "ptype red1" "ptype unnamed enumeratio= n member" { # Here and elsewhere, we accept # "long", "long int", or "int" for long variables (whatis.exp already # has an XFAIL for "int" (Sun cc bug), so no need to fail it here). -gdb_test "ptype struct t_struct" "type =3D struct t_struct \{.*\[\r\n\] = (unsigned |)char v_char_member;.*\[\r\n\] (short|short int) v_short_mem= ber;.*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long= _member;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_me= mber;.*\[\r\n\]\}.*" "ptype structure" +gdb_test "ptype struct t_struct" \ + [multi_line \ + "type =3D struct t_struct {" \ + " (unsigned |)char v_char_member;" \ + " (short|short int) v_short_member;" \ + " int v_int_member;" \ + " (long|long int|int) v_long_member;" \ + " float v_float_member;" \ + " double v_double_member;" \ + "}"] "ptype structure" =20 =20 # Test the equivalence between '.' and '->' for struct member references. @@ -73,16 +82,37 @@ if {[gdb_test "ptype v_t_struct_p->v_float_member" "typ= e =3D float"] < 0} { # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. =20 -gdb_test "ptype struct link" "type =3D struct link \{\[\r\n\]+\[ \t\]+stru= ct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((struct= link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3.;\[= \r\n\]+\}.*" "ptype linked list structure" +gdb_test "ptype struct link" \ + [multi_line \ + "type =3D struct link {" \ + " struct link \\*next;" \ + " struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);"= \ + " struct t_struct stuff.1..2..3.;" \ + "}"] "ptype linked list structure" =20 # # test ptype command with unions # -gdb_test "ptype union t_union" "type =3D union t_union \{.*\[\r\n\] (un= signed |)char v_char_member;.*\[\r\n\] (short|short int) v_short_member;= .*\[\r\n\] int v_int_member;.*\[\r\n\] (long|long int|int) v_long_mem= ber;.*\[\r\n\] float v_float_member;.*\[\r\n\] double v_double_member= ;.*\[\r\n\]\}.*" "ptype union" +gdb_test "ptype union t_union" \ + [multi_line \ + "type =3D union t_union {" \ + " (unsigned |)char v_char_member;" \ + " (short|short int) v_short_member;" \ + " int v_int_member;" \ + " (long|long int|int) v_long_member;" \ + " float v_float_member;" \ + " double v_double_member;" \ + "}"] "ptype union" =20 # IBM's xlc puts out bogus stabs--the stuff field is type 42, # which isn't defined. -gdb_test "ptype union tu_link" "type =3D union tu_link \{\[\r\n\]+\[ \t\]+= struct link \\*next;\[\r\n\]+\[ \t\]+struct link \\*\\(\\*linkfunc\\)\\((st= ruct link \\*, int|void|)\\);\[\r\n\]+\[ \t\]+struct t_struct stuff.1..2..3= .;\[\r\n\]+\}.*" "ptype linked list union" +gdb_test "ptype union tu_link" \ + [multi_line \ + "type =3D union tu_link {" \ + " struct link \\*next;" \ + " struct link \\*\\(\\*linkfunc\\)\\((struct link \\*, int|void|)\\);"= \ + " struct t_struct stuff.1..2..3.;" \ + "}"] "ptype linked list union" =20 # # test ptype command with enums @@ -472,32 +502,69 @@ gdb_test "ptype pv_char_array" "type =3D (|unsigned )= char \\(\\*\\)\\\[0?\\\]" # # test ptype command with nested structure and union # -gdb_test "ptype struct outer_struct" "type =3D struct outer_struct \{.*\[\= r\n\]+\ -.*int outer_int;.*\[\r\n\]+\ -.*(struct|) inner_struct inner_struct_instance;.*\[\r\n\]+\ -.*(union|) inner_union inner_union_instance;.*\[\r\n\]+\ -.*(long|long int|int) outer_long;.*\[\r\n\]\}.*" "ptype outer structure" - -gdb_test "ptype struct inner_struct" "type =3D struct inner_struct \{.*\[\= r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_long;.*\[\r\= n\]\}.*" "ptype inner structure" - -gdb_test "ptype union inner_union" "type =3D union inner_union \{.*\[\r\n\= ] int inner_union_int;.*\[\r\n\] (long|long int|int) inner_union_long= ;.*\[\r\n\]\}.*" "ptype inner union" - -gdb_test "ptype nested_su" "type =3D struct outer_struct \{.*\[\r\n\] i= nt outer_int;.*\[\r\n\] (struct |)inner_struct inner_struct_instance;.*\= [\r\n\] (union |)inner_union inner_union_instance;.*\[\r\n\] (long|lo= ng int|int) outer_long;.*\[\r\n\]\}.*" "ptype nested structure" +gdb_test "ptype struct outer_struct" \ + [multi_line \ + "type =3D struct outer_struct {" \ + " int outer_int;" \ + " (struct|) inner_struct inner_struct_instance;" \ + " (union|) inner_union inner_union_instance;" \ + " (long|long int|int) outer_long;" \ + "}"] "ptype outer structure" + +gdb_test "ptype struct inner_struct" \ + [multi_line \ + "type =3D struct inner_struct {" \ + " int inner_int;" \ + " (long|long int|int) inner_long;" \ + "}"] "ptype inner structure" + +gdb_test "ptype union inner_union" \ + [multi_line \ + "type =3D union inner_union {" \ + " int inner_union_int;" \ + " (long|long int|int) inner_union_long;" \ + "}"] "ptype inner union" + +gdb_test "ptype nested_su" \ + [multi_line \ + "type =3D struct outer_struct {" \ + " int outer_int;" \ + " (struct |)inner_struct inner_struct_instance;" \ + " (union |)inner_union inner_union_instance;" \ + " (long|long int|int) outer_long;" \ + "}"] "ptype nested structure" =20 gdb_test "ptype nested_su.outer_int" "type =3D int.*" "ptype outer int" =20 -gdb_test "ptype nested_su.inner_struct_instance" "type =3D struct inner_st= ruct \{.*\[\r\n\] int inner_int;.*\[\r\n\] (long|long int|int) inner_= long;.*\[\r\n\]\}.*" "ptype nested structure #2" +gdb_test "ptype nested_su.inner_struct_instance" \ + [multi_line \ + "type =3D struct inner_struct {" \ + " int inner_int;" \ + " (long|long int|int) inner_long;" \ + "}"] "ptype nested structure #2" =20 gdb_test "ptype nested_su.inner_struct_instance.inner_int" "type =3D int.*= " "ptype inner int" =20 -gdb_test "ptype nested_su.inner_union_instance" "type =3D union inner_unio= n \{.*\[\r\n\] int inner_union_int;.*\[\r\n\] (long|long int|int) inn= er_union_long;.*\[\r\n\]\}.*" "ptype nested union" +gdb_test "ptype nested_su.inner_union_instance" \ + [multi_line \ + "type =3D union inner_union {" \ + " int inner_union_int;" \ + " (long|long int|int) inner_union_long;" \ + "}"] "ptype nested union" =20 # Print the type description of variable the_highest, and verify that # the type description for the fields whose type is anonymous are # correctly printed (at nesting level 1 and 2). =20 gdb_test "ptype the_highest" \ - "type =3D struct highest \{.*\[\r\n\] *int a;.*\[\r\n\] *struct \{.*\[\r= \n\] *int b;.*\[\r\n\] *struct \{\.\.\.\} anonymous_level_2;.*\[\r\n\] *\} = anonymous_level_1;.*\[\r\n\]}.*" + [multi_line \ + "type =3D struct highest {" \ + " int a;" \ + " struct {" \ + " int b;" \ + " struct \{\.\.\.\} anonymous_level_2;" \ + " \} anonymous_level_1;" \ + "}"] =20 # Print the type descrption for one of the fields of variable the_highest. # The purpose is to verify that the type of a field that was printed above @@ -505,8 +572,13 @@ gdb_test "ptype the_highest" \ # nesting level is now one level less). =20 gdb_test "ptype the_highest.anonymous_level_1" \ - "type =3D struct \{.*\[\r\n\] *int b;.*\[\r\n\] *struct \{.*\[\r\n\] *in= t c;.*\[\r\n\] *\} anonymous_level_2;.*\[\r\n\]}.*" \ - "ptype the_highest.anonymous_level_1" + [multi_line \ + "type =3D struct {" \ + " int b;" \ + " struct {" \ + " int c;" \ + " \} anonymous_level_2;" \ + "}"] "ptype the_highest.anonymous_level_1" =20 get_debug_format =20 diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/t= desc-regs.exp index fa9b5b71310..63f5ebc90d8 100644 --- a/gdb/testsuite/gdb.xml/tdesc-regs.exp +++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp @@ -179,17 +179,41 @@ gdb_test "ptype \$extrareg" "type =3D (int32_t|int|lo= ng|long long)" gdb_test "ptype \$uintreg" "type =3D uint32_t" gdb_test "ptype \$vecreg" "type =3D int8_t __attribute__ \\(\\(vector_size= \\(4\\)\\)\\)" gdb_test "ptype \$unionreg" \ - "type =3D union vecint {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}" + [multi_line \ + "type =3D union vecint {" \ + " v4int8 v4;" \ + " v2int16 v2;" \ + "}"] gdb_test "ptype \$unionreg.v4" "type =3D int8_t __attribute__ \\(\\(vector= _size\\(4\\)\\)\\)" gdb_test "ptype \$structreg" \ - "type =3D struct struct1 {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}" + [multi_line \ + "type =3D struct struct1 {" \ + " v4int8 v4;" \ + " v2int16 v2;" \ + "}"] gdb_test "ptype \$structreg.v4" "type =3D int8_t __attribute__ \\(\\(vecto= r_size\\(4\\)\\)\\)" gdb_test "ptype \$bitfields" \ - "type =3D struct struct2 {\r\n *uint64_t f1 : 35;\r\n *uint64_t f2 : 1= ;\r\n}" + [multi_line \ + "type =3D struct struct2 {" \ + " uint64_t f1 : 35;" \ + " uint64_t f2 : 1;" \ + "}"] gdb_test "ptype \$flags" \ - "type =3D flag flags {\r\n *bool X @0;\r\n *uint32_t Y @2;\r\n}" + [multi_line \ + "type =3D flag flags {" \ + " bool X @0;" \ + " uint32_t Y @2;" \ + "}"] gdb_test "ptype \$mixed_flags" \ - "type =3D flag mixed_flags {\r\n *bool A @0;\r\n *uint32_t B @1-3;\r\n= *bool C @4;\r\n *uint32_t D @5;\r\n *uint32_t @6-7;\r\n *enum Z_values {ye= s =3D 1, no =3D 0, maybe =3D 2, so} Z @8-9;\r\n}" + [multi_line \ + "type =3D flag mixed_flags {" \ + " bool A @0;" \ + " uint32_t B @1-3;" \ + " bool C @4;" \ + " uint32_t D @5;" \ + " uint32_t @6-7;" \ + " enum Z_values {yes =3D 1, no =3D 0, maybe =3D 2, so} Z @8-9;" \ + "}"] # Reggroups should have at least general and the extra foo group gdb_test "maintenance print reggroups" \ "Group\[ \t\]+Type\[ \t\]+\r\n.*general\[ \t\]+user\[ \t\]+\r\n.*foo\[= \t\]+user\[ \t\]+" --=20 2.43.0