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

Karthik Rao karthik.0703 at gmail.com
Tue Mar 20 23:27:03 EDT 2018


Yeah. AFAIK the bytecode you are analyzing should be compiled with debug
symbols for the getJavaSourceStartLineNumber() to work correctly. You can
check the below link for more info

https://mailman.cs.mcgill.ca/pipermail/soot-list/2015-January/007636.html


Cheers,
Kaarthik

On Wed 21 Mar, 2018, 04:11 周书林, <zhoushulin1992 at gmail.com> 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>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180321/bb36fab4/attachment-0001.html>


More information about the Soot-list mailing list