[Soot-list] Getting line numbers from .java files

224 views
Skip to first unread message

Manas Thakur

unread,
Sep 13, 2014, 5:09:46 AM9/13/14
to soot...@sable.mcgill.ca
Hi,

Is it possible to get the line numbers from the “LineNumberTag” only when we are analysing class files? When I try to get the same by analysing java source directly, the line number tag is always null. I am using the following to extract the line number:

LineNumberTag tag = (LineNumberTag) ut.getTag("LineNumberTag");
if(tag != null)
int lineNumber = tag.getLineNumber();

P.S. I am using the “-keep-line-number” option, and am able to extract them properly when I give class files as input to Soot.

- Manas

Bodden, Eric

unread,
Sep 15, 2014, 9:34:36 AM9/15/14
to Manas Thakur, Soot list
Hi Manas.

No, actually this should also work when using source code.

Best wishes,
Eric
> _______________________________________________
> Soot-list mailing list
> Soot...@CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422 Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

signature.asc

Martin Schäf

unread,
Sep 15, 2014, 10:39:24 AM9/15/14
to Bodden, Eric, Manas Thakur, Soot list
Maybe you are looking for SourceLnTag or what ever it is called. Just
print all tags, one of them should have it.
There are several tags that can carry line number and LineNumberTag is
not the one that shows up when you parse from source.
---
Martin Schäf
Reply all
Reply to author
Forward
0 new messages