<div dir="auto"><div>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</div><div dir="auto"><br></div><div dir="auto"><a href="https://mailman.cs.mcgill.ca/pipermail/soot-list/2015-January/007636.html">https://mailman.cs.mcgill.ca/pipermail/soot-list/2015-January/007636.html</a><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto">Kaarthik<br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Wed 21 Mar, 2018, 04:11 周书林, <<a href="mailto:zhoushulin1992@gmail.com">zhoushulin1992@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi <span style="font-size:14px">Kaarthik,<span class="m_3669525425819334071sewcwpzetpbm8o1"></span><span class="m_3669525425819334071sewlzee1hf3kp8z"></span></span><div><br></div><div><span style="font-size:14px">You mean that I need to generate the .jar file from java source code by myself? Thanks a lot.</span></div><div><span style="font-size:14px"><br></span></div><div><span style="font-size:14px">Sep.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-03-21 11:07 GMT+08:00 Karthik Rao <span dir="ltr"><<a href="mailto:karthik.0703@gmail.com" target="_blank" rel="noreferrer">karthik.0703@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey Sep,<div><br></div><div>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.<span style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium"><tt><b>-keep-line-number. </b>You can find a list of all the command line options which Soot accepts <a href="https://www.sable.mcgill.ca/soot/tutorial/usage/" target="_blank" rel="noreferrer">here</a>.</tt></span><dd style="color:rgb(0,0,0);font-family:"Times New Roman";font-size:medium;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br class="m_3669525425819334071m_-2994587431815018563gmail-Apple-interchange-newline">

</dd> Cheers,</div><div>Kaarthik</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_3669525425819334071h5">On Wed, Mar 21, 2018 at 3:54 AM, 周书林 <span dir="ltr"><<a href="mailto:zhoushulin1992@gmail.com" target="_blank" rel="noreferrer">zhoushulin1992@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_3669525425819334071h5"><div dir="ltr">Hi,<div><br></div><div>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 <span style="font-family:Monaco;font-size:11px">getJavaSourceStartLineNumber() </span>and<span style="font-family:Monaco;font-size:11px"> </span><span style="font-family:Monaco;font-size:11px">getJavaSourceStartColumnNumber()<span class="m_3669525425819334071m_-2994587431815018563m_6105031054824486811sewb3ipii36k3oy"></span></span>. But the return values of these two APIs are always -1.</div><div><br></div><div>Could you please point out where is wrong about these usages? And how could I get the right source location of a Stmt/Unit?</div><div><br></div><div>Thank you very much.</div><div><br></div><div>Sincerely.</div><div>Sep</div></div>
<br></div></div>_______________________________________________<br>
Soot-list mailing list<br>
<a href="mailto:Soot-list@CS.McGill.CA" target="_blank" rel="noreferrer">Soot-list@CS.McGill.CA</a><br>
<a href="https://mailman.CS.McGill.CA/mailman/listinfo/soot-list" rel="noreferrer noreferrer" target="_blank">https://mailman.CS.McGill.CA/mailman/listinfo/soot-list</a><br>
<br></blockquote></div><span class="m_3669525425819334071HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_3669525425819334071m_-2994587431815018563gmail_signature" data-smartmail="gmail_signature">Karthik Rao<br>Bangalore<br><a href="tel:+91%2094802%2020782" value="+919480220782" target="_blank" rel="noreferrer">+91-9480220782</a></div>
</font></span></div>
</blockquote></div><br></div>
</blockquote></div></div></div>