From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id EF95A3857C47 for ; Mon, 4 Dec 2023 15:09:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF95A3857C47 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EF95A3857C47 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::29 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701702586; cv=none; b=pHhYW+Pb3d2TPEz39UOrjcF4DUplbLU+S/iCEYL4oZhBYjL++cjAc5ARuxdbTLeBm8M4LSbJUPI3vy3h3vnGCC8RI8kTpy1geRV0sjr8ll3q518YGUm7uOCjFO6e2Q2oxcEBXtlKwCxTjuD0V6QgdWukPbspcnqpCA30J55/ycI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701702586; c=relaxed/simple; bh=WVUUerhOr3mKSdfb6D77zczGnPWpHi6gKYgiGge7Ld8=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Dw8zFE/SKvGLJsiQlbVNLuZaW6av9MdCOyOVJrD6J/J6yFowRnzBkD6yllJLUdsUB556P8sdwjUMnF/yP3zIN72UnCCu1zDzNu8MbI8PHX/lzFcEN/qEjEWMTj0Zio6PBnLgRSOwjAP0+pIDHah2piNzAXDShC9qlXWornt8o7w= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1faf46f96ebso1979368fac.1 for ; Mon, 04 Dec 2023 07:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701702583; x=1702307383; darn=gcc.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vuAmME+jlg0kO2AoOTuOE1B597NRA5/druiQOFTmayM=; b=f7NcrEqkYqG8AYubaXRtybRjH3/aC2ibeMaTMuzPAk7QxoYzBtZ/YTS04E/j5KmQk2 tOe4NyYgnh827oB/bHj07hd7L3GvkcJufO7vCxJ9KZjRlDzcoeYsBeJIpTemC+wwos+J DAnbEGwqo9FZa1jQQ9txswc4XAYXLsZeTnjeDLvPOYhhH3UBdDfyyxHo94AR7NqJx1gH E3a1E1X/25HnIvM8fPe0Q5EXQBuu8g044d1A7kKb5lac+V7gHgRiQVW/o4LS73X8+S0f LVlR350rhdI3d+ObMB9w6Ninzb+PDTvQSh4TYHUAhcX6uG3E4Yd34r5ErBbRbEPLnAfj d6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701702583; x=1702307383; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=vuAmME+jlg0kO2AoOTuOE1B597NRA5/druiQOFTmayM=; b=HneKNlXF87oXECkvGQDy2idCiTBQEmKf3eylp2TR4TCxZrOW7AWFOiFnIoWywrEu2p aSQX3jUkuK9whJgwyQ2ENah5rLw+Sf0LvNm+ssnBm4hzkOVBgXxh8zBb+CFVE0demr+s usYcwMUqzuV1mnLbVDKY8OlO9nk/HpK9AG8BROVe1B4YscWoC2N0Hrp8sQR4Y3MsWHfI yhAFIvkZL8RMLgRNY03vDTi5xDCTR5nWewqA5nLe9PlxMkX4NU7LjralVBRme+4oRbOM nTvz8NvP2WKASNxpZPXLfe5Ubnj8/7HTTrSk6UjdIe7DPNLoibc/si+gf/E5CyPIzk4T ZyXQ== X-Gm-Message-State: AOJu0Yxx+NU7RW2lS7xzd70LDizON3z57ZEoFUpolUGEdMu0tFIv2PzW mTQkC9HoZbubh3iXSldQFavnWTbQB0N/Pf9ufi8= X-Google-Smtp-Source: AGHT+IEd6HdRvws4lEsL7u9Hfo4h89JmpGSYIwmalGZ2AkWgz6QUrM6ev463kZBa2xDlUuWCmwjRqiRwAl0BIDuUaHs= X-Received: by 2002:a05:6870:41c8:b0:1fb:210:5511 with SMTP id z8-20020a05687041c800b001fb02105511mr6170339oac.18.1701702581937; Mon, 04 Dec 2023 07:09:41 -0800 (PST) MIME-Version: 1.0 References: <8b22544e8e2add89a36eb19120777b6878542291.camel@redhat.com> In-Reply-To: <8b22544e8e2add89a36eb19120777b6878542291.camel@redhat.com> From: Stan Srednyak Date: Mon, 4 Dec 2023 10:09:30 -0500 Message-ID: Subject: Re: Debugging the tree object constructed by cp_parser To: David Malcolm Cc: gcc@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000e8ea2d060bb08109" X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: --000000000000e8ea2d060bb08109 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi David, thanks for your email. I really appreciate it. Your notes are certainly of help, but I also had a specific question: how to access the trees as they are being constructed by the front end. Do you have an answer to this? I looked into GCC internals docs. The section on the front end (sec 5) is wonderfully concise, of course, but it does not answer this question. Do you know any sources where this is documented? best regards, Stan On Sun, Dec 3, 2023 at 1:00=E2=80=AFPM David Malcolm = wrote: > On Sat, 2023-12-02 at 17:41 -0500, Stan Srednyak via Gcc wrote: > > Dear GCC community, > > > > 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 > > --000000000000e8ea2d060bb08109--