# In a .smali file...



## Despyse (Jan 12, 2012)

Is there a specific file that the ".line (#)" is referring to? Or is it mentioned in the file to find the reference? Any help would be appreciated.

Sent from my Galaxy Nexus using Tapatalk


----------



## yarly (Jun 22, 2011)

.line refers to debugging only. They're just a label (a marker) that points the dalvik virtual machine to where it is in the code on errors or for other debugging reasons. In other words, the errors you see when things happen in log cat are related to those areas in the code. They are used to show where the error happens and to give a stack trace report on exceptions and such. If you mess them up or remove them, you will get incorrect error data (or the lack of any error data) as a result. However, it wont cause errors to anything since they're benign in use.

http://jasmin.sourceforge.net/guide.html (smali is based on Jasmin and is nearly identical):

.line <integer>
This is used to tag the subsequent instruction(s) with a line number. Debuggers use this information, together with the name of the source file (see .source above) to show at what line in a method things went wrong. If you are generating Jasmin files by compiling a source file, this directive lets you indicate what line numbers in the source file produced corrosponding Jasmin instructions. For example:
.method foo()V
.line 5 
bipush 10 // these instructions generated from line 5
istore_2 // of the source file.
.line 6
...


----------

