From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 86EB13858425 for ; Sun, 3 Dec 2023 18:00:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86EB13858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86EB13858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701626457; cv=none; b=Rq8UCx0lBZgAzCS6OXr73oUiCM7j3INwh/9O8RSrnjWwqDss8oz3vJeILKKPAOBTHlHOqIE4YKw2OIkTu4YHOe/FqS7Q336DqBthVy9vYuzjaVZqYlUfzB5mQnYOLE6cHbnGSvOwXbc0TcbbLWoGhTEq6b9UeAPK04q01g4gP7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701626457; c=relaxed/simple; bh=9YnVBEajMZ7SifDnALaq7avTL5AqvS+zWV42WQuGvXg=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=q5cvcSTBuuxPpt6NLyWIlGbDRCDMjkqRxWiB/F4kSxGOUZWU4tqhb8FBUt+OWelfVhHWnXQfs/erdeXYNtb85Pr6fGXR0RunDDbigxUl6mgM6O1z5wcqyL6b89V1y9QTsbhjVcmCa110B3HsMKFQOzL7W/CBOeVHm5Ri2kTelW8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701626456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9YnVBEajMZ7SifDnALaq7avTL5AqvS+zWV42WQuGvXg=; b=Dp78YGcI2wgKWxsW16VThMk5rBlRJ+DAFaSJ0s44gz9DYQluRmkzktioJR/yDUP4H5uiyB AVF8bujux/vIbPIixfnpm/Pz7vGfIXYzfwlJ6VZJ1iAu3ZC5Y5OPUWDBNNY1IU3DhV2YEO BR6cZKXifCXiGYb/RI5odU6Tb+XZay4= Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-MXsTmwpCPoyrD-77sD5kGA-1; Sun, 03 Dec 2023 13:00:54 -0500 X-MC-Unique: MXsTmwpCPoyrD-77sD5kGA-1 Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-286b48a631aso248726a91.2 for ; Sun, 03 Dec 2023 10:00:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701626454; x=1702231254; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9YnVBEajMZ7SifDnALaq7avTL5AqvS+zWV42WQuGvXg=; b=YExD2JE90zTJk1rjWQ1rTPIol8UIVDqPD4OLAkBbGtA8NDVL+H4SAKEiph8oi+947s d40ypxezcGvt2eLeyxdJgFK/Na7N5sJfFt941FP6AkbxFlcPf12rmHaN9fbLJsccutFc 3OXH4zTlLt2dvbsZn8AWZ5KmrRxGCosiK0VcpGfo7kxa1z3yjjwq3//gnIZLGZSblEnU 6KVzZ+JPXsTSOxv1BP+4ErNBp58ryZn8JjFBrBygoZkhQopL8ALVZgKfBRsLDI3uXFzd QbktVd+d/JD8U8bORBIta6T1zzbk6KVTnOG/gVUYvPdWHcRdTzfyixWF4ysEkGUE9693 7p0A== X-Gm-Message-State: AOJu0YyZmKWESImk0yI3GnXV88Z3oYEEOsyjmcy+f7sqT1M4c2PVKgqk ng3/t+koREkhpyv1E/PwhlRjRaPeATHMYE3xMl2poOwJoYYvxgBqtu9cx7ikgxVbdJne4EcSZAA M5NX6rPA= X-Received: by 2002:a05:6a20:3c8a:b0:18f:97c:9762 with SMTP id b10-20020a056a203c8a00b0018f097c9762mr4239807pzj.74.1701626453935; Sun, 03 Dec 2023 10:00:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGm5CjxLcwcX2R704qt4OEg4RYg49dvlgE/yeW99Jil6b3sBsP++oR6B8CBZ9MTot6oLwTxHg== X-Received: by 2002:a05:6a20:3c8a:b0:18f:97c:9762 with SMTP id b10-20020a056a203c8a00b0018f097c9762mr4239796pzj.74.1701626453665; Sun, 03 Dec 2023 10:00:53 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id mh10-20020a056214564a00b0067a9235d5f0sm2905810qvb.105.2023.12.03.10.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 10:00:53 -0800 (PST) Message-ID: <8b22544e8e2add89a36eb19120777b6878542291.camel@redhat.com> Subject: Re: Debugging the tree object constructed by cp_parser From: David Malcolm To: Stan Srednyak , gcc@gcc.gnu.org Date: Sun, 03 Dec 2023 13:00:52 -0500 In-Reply-To: References: User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, 2023-12-02 at 17:41 -0500, Stan Srednyak via Gcc wrote: > Dear GCC community, >=20 > I am assigned the task to debug the trees as being produced by the > cp_parser. I was able to print some of the trees using the > debug_tree() > function. But I am still confused as to where is the tree object that > corresponds to the translation unit being parsed. There is no such > field in > cp_parser, and in the few tiers of functions calls starting from > parse_file() function that I followed so far, I was not able to find > any > variable remotely similar to the AST of functions/structs etc. that > must be > constructed by this great piece of software. I would very much > appreciate > any explanation from the great experts in gcc on this mailing list. I > posted a thread at gcc-help, but apparently it is too obvious of a > question > to be addressed there. Hi Stan FWIW I've written some notes on debugging GCC: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html and in particular you might find the following useful: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html#how-do-i-= find-where-a-particular-tree-was-created Hope this is helpful Dave