Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Read ._trace files with java
Read ._trace files with java [message #1839207] Wed, 17 March 2021 13:22 Go to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
I'm trying to read ._trace files in a java project, with as purpose map line numbers from the java code back to the line numbers of the dsl code.
So I need soms java class/library that can read ._trace files and return line numbers from the mapping.
Can anyone help me with this, how this can be done?

Thank you
Re: Read ._trace files with java [message #1839210 is a reply to message #1839207] Wed, 17 March 2021 15:08 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
for eclipse you may check TraceForStorageProvider/ITraceForURIProvider

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Read ._trace files with java [message #1839347 is a reply to message #1839210] Fri, 19 March 2021 13:06 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
And how should I implement this in my own project?
Re: Read ._trace files with java [message #1839348 is a reply to message #1839210] Fri, 19 March 2021 13:06 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
And how should I implement this in my own project?
Re: Read ._trace files with java [message #1839351 is a reply to message #1839348] Fri, 19 March 2021 13:23 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
what do you mean by implementing?
writing traces or reading traces?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Read ._trace files with java [message #1839355 is a reply to message #1839351] Fri, 19 March 2021 13:27 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
Reading traces I guess, I need to get the line numbers from the java code and corresponding dsl code (and also the corresponding files) in my project as a variable
Re: Read ._trace files with java [message #1839356 is a reply to message #1839355] Fri, 19 March 2021 13:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i cannot give you an example.
you may check usages of
for eclipse you may check TraceForStorageProvider/ITraceForURIProvider
in Xtext codebase e.g.
DebugSourceInstallingCompilationParticipant
which is used to write trace information
into class files for Xtend/xbase


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 19 March 2021 13:29]

Report message to a moderator

Re: Read ._trace files with java [message #1839357 is a reply to message #1839356] Fri, 19 March 2021 13:30 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
But it is possible? Because I've checked TraceForStorageProvider/ITraceForURIProvider and don't know how to use this
Re: Read ._trace files with java [message #1839358 is a reply to message #1839357] Fri, 19 March 2021 13:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
please check out DebugSourceInstallingCompilationParticipant

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Read ._trace files with java [message #1839359 is a reply to message #1839358] Fri, 19 March 2021 13:40 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
No Message Body

[Updated on: Fri, 19 March 2021 14:09]

Report message to a moderator

Re: Read ._trace files with java [message #1839362 is a reply to message #1839359] Fri, 19 March 2021 14:10 Go to previous messageGo to next message
Joran Van Impe is currently offline Joran Van ImpeFriend
Messages: 7
Registered: March 2021
Junior Member
And do you know which class is used to read/parse the ._trace files?
Re: Read ._trace files with java [message #1839364 is a reply to message #1839362] Fri, 19 March 2021 14:15 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
org.eclipse.xtext.generator.trace.TraceRegionSerializer.writeTraceRegionTo(AbstractTraceRegion, OutputStream) and similar for writing,
org.eclipse.xtext.generator.trace.TraceRegionSerializer.readTraceRegionFrom(InputStream) for reading


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:xtext build fails with JavaSE-11 and 2021-03
Next Topic:Parser ambiguity
Goto Forum:
  


Current Time: Thu Mar 28 10:56:39 GMT 2024

Powered by FUDForum. Page generated in 0.02115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top