Question

Please take a look at this question

Decompiled smali code contains things like .line 3 or .line 7.

I cannot understand what .line is supposed to be, please elaborate on the usage.

Was it helpful?

Solution

.line n markers are used for debugging and stacktraces. When an exception goes uncaught, or the stacktrace needs to be filled in, the line number is taken from the .line statement. If this were missing, then stacktraces would lack line numbers.

OTHER TIPS

Almost everything in the smali language has a direct analogue in the dalvik bytecode or dex format.

The .line directive in particular corresponds to the position entries emitted by the state machine that the debug_info_item defines, as specified at https://source.android.com/devices/tech/dalvik/dex-format.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top