public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Emit preprocessor line annotations during tapset translation
@ 2020-07-17  6:10 Craig Ringer
  0 siblings, 0 replies; only message in thread
From: Craig Ringer @ 2020-07-17  6:10 UTC (permalink / raw)
  To: systemtap

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-07-17  6:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17  6:10 Emit preprocessor line annotations during tapset translation Craig Ringer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).