[Soot-list] How could I get the source location of a Stmt/Unit?

Christian Maeder c.maeder at uni-bremen.de
Wed Mar 21 03:56:11 EDT 2018


Hi Sep,

the soot command line option (Input Attribute Option) -keep-line-number
is essential. (Usually line numbers are generated by default)

Cheers Christian

https://soot-build.cs.uni-paderborn.de/public/origin/develop/soot/soot-develop/options/soot_options.htm#section_6

On 21.03.2018 04:11, 周书林 wrote:
> Hi Kaarthik,
> 
> You mean that I need to generate the .jar file from java source code by
> myself? Thanks a lot.
> 
> Sep.
> 
> 2018-03-21 11:07 GMT+08:00 Karthik Rao <karthik.0703 at gmail.com>:
> 
>> Hey Sep,
>>
>> You should instruct the Java compiler to generate debug information (which
>> includes line numbers) while generating the class files. Also there is an
>> option to preserve line number in Soot  i.e.*-keep-line-number. *You can
>> find a list of all the command line options which Soot accepts here
>> <https://www.sable.mcgill.ca/soot/tutorial/usage/>.
>>  Cheers,
>> Kaarthik
>>
>> On Wed, Mar 21, 2018 at 3:54 AM, 周书林 <zhoushulin1992 at gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am new in soot. I use it to analyse some .jar files. In this procedure,
>>> I want to get the source location of a Stmt/Unit, i.e. the line number of
>>> this Stmt/Unit is in the source file. I found there are two APIs namely
>>> getJavaSourceStartLineNumber() and getJavaSourceStartColumnNumber(). But
>>> the return values of these two APIs are always -1.
>>>
>>> Could you please point out where is wrong about these usages? And how
>>> could I get the right source location of a Stmt/Unit?
>>>
>>> Thank you very much.
>>>
>>> Sincerely.
>>> Sep
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at CS.McGill.CA
>>> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
>>>
>>>
>>
>>
>> --
>> Karthik Rao
>> Bangalore
>> +91-9480220782 <+91%2094802%2020782>
>>
> 
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list