From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by sourceware.org (Postfix) with ESMTPS id 92E3A393A408 for ; Tue, 2 Mar 2021 01:54:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 92E3A393A408 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1221s5qx085941 for ; Tue, 2 Mar 2021 01:54:05 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 36ydgr5wj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 02 Mar 2021 01:54:05 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1221oVtp066218 for ; Tue, 2 Mar 2021 01:54:05 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2174.outbound.protection.outlook.com [104.47.57.174]) by userp3020.oracle.com with ESMTP id 36yyurbp8c-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 02 Mar 2021 01:54:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLCODNhWYnXP9qu7NmcrgKY9+6Cao2LLeubBVNRCw0owhZVEzOyaSwUyNaBwCkLRa1GFozzi+hHCs1sht6/U0CHF5j/hGVoB8f8tVdGUE7Zs2sEo6tEnooG95rKpceU0D7cqwGMT+BaH2OuzMJCrCLgDLo6WzJ/gjMUbcr2O+hhVF6I7+8DME+lRCKg6o/7wzO/IDjwvSCxy3/MrXDewv6wvAPUcnhhz08oaU0w24GkSFzWjOkYC8NK2AgJfE0TzynWjvyrHGTs9EKXu0ZySYEHP3DvSm10ZZlcZbvFNZ3syzrdW5z0Qwi8Pjbm8ejSn0/+bJZyM5IRWwCOpoQQLQw== 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=XACgm/g2OZGJmNIFcqNJrLY7b3G2D4CmmtmjIjjOs6k=; b=dpQmBTVXuOVQtimX/AgqZz2zpc7IIQdkP3W8LXKnNnrF+f4O1KWf79kEzDOYAMyDyRjzKkDIv1prfehAPkXfrjsxHGCaQaWmJZ432nW2Eb9Um833QFEV1g6fWaxgyPjDDAmDn0v9u2lIlNKqEiUJfn11eswArBKKYhuX44LYBya3v/Sp2FHj8V/aN8YjEoxxu/RWuJRuUKB4E031wEnHrwkLmEPmKB2/bLjwydQuZXCiIHZyxzv8C7uJ/EL402l4ofe5zPvEHWCOZ61grEFG9DG616LsOVHBHna+6+4w6lL9FvvjKYldvDKMFS9zdZrG3eaVlxHZ2bGhYaEi75TheA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none Received: from BN6PR10MB1748.namprd10.prod.outlook.com (2603:10b6:405:9::16) by BN0PR10MB5383.namprd10.prod.outlook.com (2603:10b6:408:124::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20; Tue, 2 Mar 2021 01:54:03 +0000 Received: from BN6PR10MB1748.namprd10.prod.outlook.com ([fe80::1163:f828:25bb:2538]) by BN6PR10MB1748.namprd10.prod.outlook.com ([fe80::1163:f828:25bb:2538%7]) with mapi id 15.20.3890.029; Tue, 2 Mar 2021 01:54:03 +0000 From: Weimin Pan To: gdb-patches@sourceware.org Subject: [PATCH,V2 3/5] CTF: handle forward reference type Date: Mon, 1 Mar 2021 20:53:36 -0500 Message-Id: <1614650018-9135-4-git-send-email-weimin.pan@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1614650018-9135-3-git-send-email-weimin.pan@oracle.com> References: <1614650018-9135-1-git-send-email-weimin.pan@oracle.com> <1614650018-9135-2-git-send-email-weimin.pan@oracle.com> <1614650018-9135-3-git-send-email-weimin.pan@oracle.com> Content-Type: text/plain X-Originating-IP: [148.87.23.7] X-ClientProxiedBy: SJ0PR05CA0203.namprd05.prod.outlook.com (2603:10b6:a03:330::28) To BN6PR10MB1748.namprd10.prod.outlook.com (2603:10b6:405:9::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.us.oracle.com (148.87.23.7) by SJ0PR05CA0203.namprd05.prod.outlook.com (2603:10b6:a03:330::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.11 via Frontend Transport; Tue, 2 Mar 2021 01:54:03 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbb4068f-bade-41fe-845b-08d8dd1e0e64 X-MS-TrafficTypeDiagnostic: BN0PR10MB5383: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5kMg56Cfoj1Onc9siaRCZWH4pHrlpcUDi59KY8FKtjSowI1kTNU6dUAZDtc85LHniM0Ty1Wt9LOpoTMhY+iROV6X+v6ooapONXYsuBGR5fw34LOWTN7R+gGFI2y3HibgeB70v1xIrbR7uTIByJEbu7NFgP6Z4tGVb+drt5LdRZudcBFHsai+2hwJg36BIJhJgtEEV3WHj0P2SrhrRUca0e2eOw3nplggk5fX+Kmn4JcsUGBvbOOW4KeWCA4S629CP1he2tvEMMa9F406Ti+rlhtQvOKdrcoU5uyGpSCAG9GfIqnXasv/pRKyBSfgF/DZuEtyi/H/9dHzMRTheDzkNkshBRQQ6AzrIEpQBIrHu9exyoAF2ZdNnGq/15EZ7Tro2NZRDccp036m3DglBvQbmgJSqtltoX0wLj/CbAN1sZKH+wvXrbAJ/oiJLLrdAtF/af6/N5DQPtzUbLb1v4sv2EdaFOejag96doC0YOxvZBOQxld/5p5gbR9BmISJarL/JQ8Pv04sKfzGmGo4r0eGiw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR10MB1748.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(376002)(136003)(346002)(396003)(39860400002)(66946007)(16526019)(66556008)(66476007)(6666004)(316002)(83380400001)(6486002)(44832011)(956004)(8676002)(5660300002)(2616005)(2906002)(8936002)(6916009)(478600001)(36756003)(7696005)(52116002)(86362001)(26005)(186003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?DQFxgkEZ09vrBg5M21LoGdYYevm2NQQ7MvLExElCgLgG3RvCJ3UJG94RTYKy?= =?us-ascii?Q?3vr46AEHCp4g2INKYg7F/lfGdXL4vAdsfc53f+QKOYpOOAhgN2CbyhmGK0yB?= =?us-ascii?Q?lGHlz4BWsZPMM8pqNYmnkwecyAitQpFe5Z6GY+20rFSv/Yzg6dpC+vb9zqZW?= =?us-ascii?Q?Horj5l/qY/QmTR6NdfCP4kamfuwHTlqonD2R/ahg+f+dls+7IKrMI9SGQ26K?= =?us-ascii?Q?tdrW2DJz4b/Bdwp1PiUapYpp3Ht5dWkjCyrWTXuqVivSkoCmlf/8utD3nOQ9?= =?us-ascii?Q?56x3J5Rs9aUiXqQYbl6Gj5agZTHSrTfMT0RUd0vJt9MvBPtztk85z2fzt8BO?= =?us-ascii?Q?vnsd1JkgG+PYnQMdJ9kFOkWyJFvIUDA6k/GrHqrlm22RwHLtuHqA8IbBjXtW?= =?us-ascii?Q?msxKpHtN+h8x+N6nSR8b0FO9kXIgzXwHNy2SQD4uVqspqXE8UdW/t86arlrj?= =?us-ascii?Q?5V2ILnUCXhGUN4Ws3DCsKTlEOO/x0MAUvelniXMOMZVvvvlppIOsl9MTffEN?= =?us-ascii?Q?nfXa9iTfsw1EjfHkpBR+uoC9f57xZN3Kt726RgUOQlS3X6HYeUXI2h0gKB6h?= =?us-ascii?Q?211KPSQlhYWU2Xzvp4KQpmnvNOeQuPeqeOl4Oe0sKBwkmJ08WZQNvKTFBWAa?= =?us-ascii?Q?hZMWdJjwD7CALWlkM+p2vrO68cE7tXLrJpT7PN9wsKgH7UyuetWGB5urv2Rb?= =?us-ascii?Q?WHsPfz4xX7r+fbzztJEA1VzUHWB42AwLGnI2skSkGEE6dtluWJs6o9n+s7zv?= =?us-ascii?Q?5uezSdeQOV7EsAUefM1CbhfZAHeta1Xrk1K2JQJJQTQvIhpFiLNKMvxWaPt4?= =?us-ascii?Q?mqPHc8coBT2ozYOC+2REFdbZv7YluFPukCTql1OJlus+DLp1kRQwSxvO54R0?= =?us-ascii?Q?8BFbSVogWSqsuyAf6cgAMaHIcfl7zMvNcUWUGnVMv3LrVDk3XNpZAtYDycvZ?= =?us-ascii?Q?J1l9P6UKahgTAg7jROv2lncuNMa+AASaFm9VDmorKK7WchCWTR9bw2VrBejt?= =?us-ascii?Q?S4X0zxpX0EHltAP+Wb0a28rpnhwydnYpM/2/jlomHOdtKYjd6jiGnDQKBeAa?= =?us-ascii?Q?WWptauOLWWd1iZHQWFg3zOTW4BLcDLJyyNGEhkmfVgyaHslDe4Jih0QgG32A?= =?us-ascii?Q?75HbLqgM8C7NdCGMMaMQTJ7Tn2SqDgs3A7Oj6AP43JvwegaX+tromZXDo6XS?= =?us-ascii?Q?3lxT/ellY0nY57OUDZ8EAFG5x9VXifnVLz99RYBWlPcPLc7JaF67oDuWROYP?= =?us-ascii?Q?b7DeopB7bx2J2p4tOTaIGwcJWkwV8+XR7OWQvqhKH25XU/yRzHKi3dLSX8BS?= =?us-ascii?Q?XCM5wb7tvmG9Q9IQP+JB+y4h?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbb4068f-bade-41fe-845b-08d8dd1e0e64 X-MS-Exchange-CrossTenant-AuthSource: BN6PR10MB1748.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2021 01:54:03.5120 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WYe0xKAUdNx5JqBPYMYlH9AsXdwVtZJNEtGdcM3hQrwHEMf3H3xEx3NVwmDtkRGRqCSDsf3Fpm5tSwN1oAosdA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5383 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9910 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103020011 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9910 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 impostorscore=0 clxscore=1015 suspectscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103020012 X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, MSGID_FROM_MTA_HEADER, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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: Tue, 02 Mar 2021 01:54:08 -0000 Added function fetch_tid_type which calls get_tid_type and will set up the type, associated with a tid, if it is not read in yet. Also implement function read_forward_type which handles the CTF_K_FORWARD kind. Expanded gdb.base/ctf-ptype.exp to add cases with forward references. --- gdb/ChangeLog | 6 +++ gdb/ctfread.c | 78 ++++++++++++++++++++++++++++++------ gdb/testsuite/ChangeLog | 6 +++ gdb/testsuite/gdb.base/ctf-ptype.c | 12 ++++++ gdb/testsuite/gdb.base/ctf-ptype.exp | 2 + 5 files changed, 91 insertions(+), 13 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0a839ba..dac61a3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2021-02-26 Weimin Pan + * ctfread.c (fetch_tid_type): New function, use throughout file. + (read_forward_type): New function. + (read_type_record): Call read_forward_type. + +2021-02-26 Weimin Pan + * ctfread.c (read_func_kind_type): Set up function arguments. 2021-02-26 Weimin Pan diff --git a/gdb/ctfread.c b/gdb/ctfread.c index 75b098c..d3e6ad5 100644 --- a/gdb/ctfread.c +++ b/gdb/ctfread.c @@ -186,6 +186,8 @@ static struct type *read_typedef_type (struct ctf_context *cp, ctf_id_t tid, static void process_struct_members (struct ctf_context *cp, ctf_id_t tid, struct type *type); +static struct type *read_forward_type (struct ctf_context *cp, ctf_id_t tid); + static struct symbol *new_symbol (struct ctf_context *cp, struct type *type, ctf_id_t tid); @@ -269,6 +271,25 @@ struct ctf_tid_and_type return NULL; } +/* Fetch the type for TID in CCP OF's tid_and_type hash, add the type to + context CCP if hash is empty or TID does not have a saved type. */ + +static struct type * +fetch_tid_type (struct ctf_context *ccp, ctf_id_t tid) +{ + struct objfile *of = ccp->of; + struct type *typ; + + typ = get_tid_type (of, tid); + if (typ == NULL) + { + ctf_add_type_cb (tid, ccp); + typ = get_tid_type (of, tid); + } + + return typ; +} + /* Return the size of storage in bits for INTEGER, FLOAT, or ENUM. */ static int @@ -368,7 +389,7 @@ struct ctf_tid_and_type FIELD_NAME (*fp) = name; kind = ctf_type_kind (ccp->fp, tid); - t = get_tid_type (ccp->of, tid); + t = fetch_tid_type (ccp, tid); if (t == NULL) { t = read_type_record (ccp, tid); @@ -660,7 +681,7 @@ struct ctf_tid_and_type type->set_code (TYPE_CODE_FUNC); ctf_func_type_info (fp, tid, &cfi); - rettype = get_tid_type (of, cfi.ctc_return); + rettype = fetch_tid_type (ccp, cfi.ctc_return); TYPE_TARGET_TYPE (type) = rettype; set_type_align (type, ctf_type_align (fp, tid)); @@ -787,11 +808,11 @@ struct ctf_tid_and_type return NULL; } - element_type = get_tid_type (objfile, ar.ctr_contents); + element_type = fetch_tid_type (ccp, ar.ctr_contents); if (element_type == NULL) return NULL; - idx_type = get_tid_type (objfile, ar.ctr_index); + idx_type = fetch_tid_type (ccp, ar.ctr_index); if (idx_type == NULL) idx_type = objfile_type (objfile)->builtin_int; @@ -819,7 +840,7 @@ struct ctf_tid_and_type struct objfile *objfile = ccp->of; struct type *base_type, *cv_type; - base_type = get_tid_type (objfile, btid); + base_type = fetch_tid_type (ccp, btid); if (base_type == NULL) { base_type = read_type_record (ccp, btid); @@ -843,7 +864,7 @@ struct ctf_tid_and_type ctf_dict_t *fp = ccp->fp; struct type *base_type, *cv_type; - base_type = get_tid_type (objfile, btid); + base_type = fetch_tid_type (ccp, btid); if (base_type == NULL) { base_type = read_type_record (ccp, btid); @@ -869,7 +890,7 @@ struct ctf_tid_and_type struct objfile *objfile = ccp->of; struct type *base_type, *cv_type; - base_type = get_tid_type (objfile, btid); + base_type = fetch_tid_type (ccp, btid); if (base_type == NULL) { base_type = read_type_record (ccp, btid); @@ -896,7 +917,7 @@ struct ctf_tid_and_type char *aname = obstack_strdup (&objfile->objfile_obstack, name); this_type = init_type (objfile, TYPE_CODE_TYPEDEF, 0, aname); set_tid_type (objfile, tid, this_type); - target_type = get_tid_type (objfile, btid); + target_type = fetch_tid_type (ccp, btid); if (target_type != this_type) TYPE_TARGET_TYPE (this_type) = target_type; else @@ -915,7 +936,7 @@ struct ctf_tid_and_type struct objfile *of = ccp->of; struct type *target_type, *type; - target_type = get_tid_type (of, btid); + target_type = fetch_tid_type (ccp, btid); if (target_type == NULL) { target_type = read_type_record (ccp, btid); @@ -932,6 +953,34 @@ struct ctf_tid_and_type return set_tid_type (of, tid, type); } +/* Read all information from a TID of CTF_K_FORWARD. */ + +static struct type * +read_forward_type (struct ctf_context *ccp, ctf_id_t tid) +{ + struct objfile *of = ccp->of; + ctf_dict_t *fp = ccp->fp; + struct type *type; + uint32_t kind; + + type = alloc_type (of); + + gdb::unique_xmalloc_ptr name (ctf_type_aname_raw (fp, tid)); + if (name != NULL && strlen (name.get() ) != 0) + type->set_name (obstack_strdup (&of->objfile_obstack, name.get ())); + + kind = ctf_type_kind_forwarded (fp, tid); + if (kind == CTF_K_UNION) + type->set_code (TYPE_CODE_UNION); + else + type->set_code (TYPE_CODE_STRUCT); + + TYPE_LENGTH (type) = 0; + type->set_is_stub (true); + + return set_tid_type (of, tid, type); +} + /* Read information associated with type TID. */ static struct type * @@ -985,6 +1034,9 @@ struct ctf_tid_and_type case CTF_K_ARRAY: type = read_array_type (ccp, tid); break; + case CTF_K_FORWARD: + type = read_forward_type (ccp, tid); + break; case CTF_K_UNKNOWN: break; default: @@ -1131,7 +1183,7 @@ struct ctf_tid_and_type if ((tid = ctf_lookup_by_symbol (ccp->fp, idx)) == CTF_ERR) return NULL; - type = get_tid_type (ccp->of, tid); + type = fetch_tid_type (ccp, tid); if (type == NULL) return NULL; @@ -1165,7 +1217,7 @@ struct ctf_tid_and_type return NULL; tid = ctf_lookup_by_symbol (ccp->fp, idx); - ftype = get_tid_type (ccp->of, tid); + ftype = fetch_tid_type (ccp, tid); if (finfo.ctc_flags & CTF_FUNC_VARARG) ftype->set_has_varargs (true); ftype->set_num_fields (argc); @@ -1179,7 +1231,7 @@ struct ctf_tid_and_type to find the argument type. */ for (int iparam = 0; iparam < argc; iparam++) { - atyp = get_tid_type (ccp->of, argv[iparam]); + atyp = fetch_tid_type (ccp, argv[iparam]); if (atyp) ftype->field (iparam).set_type (atyp); else @@ -1187,7 +1239,7 @@ struct ctf_tid_and_type } sym = new_symbol (ccp, ftype, tid); - rettyp = get_tid_type (ccp->of, finfo.ctc_return); + rettyp = fetch_tid_type (ccp, finfo.ctc_return); if (rettyp != NULL) SYMBOL_TYPE (sym) = rettyp; else diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 9445362..4f9a3ec 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2021-02-26 Weimin Pan + * gdb.base/ctf-ptype.c: Add struct link containing a forward + reference type. + * gdb.base/ctf-ptype.exp: Add "ptype struct link" + +2021-02-26 Weimin Pan + * gdb.base/ctf-ptype.exp: Add function tests and fix typos. 2021-02-26 Weimin Pan diff --git a/gdb/testsuite/gdb.base/ctf-ptype.c b/gdb/testsuite/gdb.base/ctf-ptype.c index cbc7815..51c7c68 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.c +++ b/gdb/testsuite/gdb.base/ctf-ptype.c @@ -124,6 +124,18 @@ struct { a symbol. */ t_struct3 v_struct3; +/**** Some misc more complicated things *******/ + +struct link { + struct link *next; +#ifdef __STDC__ + struct link *(*linkfunc) (struct link *self, int flags); +#else + struct link *(*linkfunc) (); +#endif + struct t_struct stuff[3]; +} *s_link; + /**** unions *******/ union t_union { diff --git a/gdb/testsuite/gdb.base/ctf-ptype.exp b/gdb/testsuite/gdb.base/ctf-ptype.exp index 056f712..7dd6d95 100644 --- a/gdb/testsuite/gdb.base/ctf-ptype.exp +++ b/gdb/testsuite/gdb.base/ctf-ptype.exp @@ -76,6 +76,8 @@ if [gdb_test "ptype v_t_struct_p->v_float_member" "type = float"]<0 then { return -1 } +gdb_test "ptype struct link" "type = struct link \{\[\r\n\]+\[ \t\]+struct 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" + # # test ptype command with unions # -- 1.8.3.1