From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 8A79A3857005 for ; Fri, 17 Jul 2020 06:11:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8A79A3857005 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=2ndquadrant.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=craig.ringer@2ndquadrant.com Received: by mail-lf1-x132.google.com with SMTP id k15so5408227lfc.4 for ; Thu, 16 Jul 2020 23:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=gGv9+f+qfxafmLMBhsMLCHOb+A2fw/ejYefCZgPgHWY=; b=gfZ0SOcN/BsfpFB241loyVyUGnAvchn8Rp14MdvIcgL2psx81VjSHekMh1cQ5T+c+e Buttk7vOrzmA2UaJ886W2AFRBbqOy5KWqOxQvyqbq2QtnhGLGHXvjNJTp6ptTD7A6ZrP MKNusyFlUHZqjLDHL+wut2vdbiyUDh5krh0R7vMWMr9y8gRrcRUOz1hYGMdJ9ABHtOpX CDqYS10Tbvtc6vQxA6d54CyHM6fGrpKeGFAw65p4nJWVfhlFq/stvIwwYpL42iFhdRaA JuRylxIZIgsS6Ohmsnd46eGn6OW58I61a45h/tlVpwfWZxdiMa1hl0ssjApqqTuRRMoS U2Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=gGv9+f+qfxafmLMBhsMLCHOb+A2fw/ejYefCZgPgHWY=; b=UgmjmnHW8jB3EW/4HLPWHDe+TASiVK13FmzDddpj1nsEYIQwYetztHfSB9fJKnYOV8 CVYQqkhXWJi5528uR1UBIc5x3y03ltX4qRDetrrJfvtmXTOvyeixtGIAyKqfDHFxo/79 kepQE8AUdKnoKzKQeGSwynSZBksJOchODWkrmxckrAlR9WeAuQutVs1k6ccudFTWCKRi VUqHwjSqhlpsjhJoO4Zi/9wJ9eiMCjwICqiWMkUeO91bR5+2MhZmHXlx9dURxxfc8Uz+ 0IEkMcUWRRKqRH7jal4/rrzukzDPkig8Qj5P/va9ezdK3ilE1ESevAU/N7aybMPt8HW3 UgeQ== X-Gm-Message-State: AOAM531jIPcUXSsLc9aMMVE4fw0zXXiRqtaDd32LuZmjAuUlQjL8Z4DQ oplDVWfPPuek+LZwTYWz/WReOxow3ZA+xQLpFbQ3/iNCQzg= X-Google-Smtp-Source: ABdhPJzU0z9+xNVYhWSgmi5/Df7ZENmlH6IqdgcL/4R+W0K/DNMhdLtU152zSWVWjvqkKBncM9QotKxq2+dRG3Sj52I= X-Received: by 2002:a19:c1d1:: with SMTP id r200mr3868785lff.102.1594966260971; Thu, 16 Jul 2020 23:11:00 -0700 (PDT) MIME-Version: 1.0 From: Craig Ringer Date: Fri, 17 Jul 2020 14:10:49 +0800 Message-ID: Subject: Emit preprocessor line annotations during tapset translation To: systemtap@sourceware.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 06:11:04 -0000 Hi all I'm thinking of patching the systemtap translator to inject preprocessor annotations that add the original file and line numbers for compiler error reporting. Like those used by gcc to report header file and line locations during compilation of .c files. This uses https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html . Would that be of interest to others here? I've taken a look at parse.cxx . As far as I can see, objects like "struct macrodecl" have their own "const token* tok" array of "struct token", each of which has a "source_loc location" member with "file" and "line" members. I'm not sure how best to go about translating that in the output so that the directives appear in the most meaningful places though. Ideas? -- Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise