mirror of
https://github.com/revanced/smali.git
synced 2025-05-16 14:17:04 +02:00
Add support to smali for a .source directive with no source file
This commit is contained in:
parent
3e4e5ec7a4
commit
b6435e7a47
@ -49,7 +49,6 @@ public class SetSourceFileMethodItem extends DebugMethodItem {
|
||||
|
||||
@Override
|
||||
public boolean writeTo(IndentingWriter writer) throws IOException {
|
||||
//TODO: make sure smali can handle an empty .source directive
|
||||
writer.write(".source");
|
||||
|
||||
if (sourceFile != null) {
|
||||
|
@ -269,7 +269,7 @@ public class DebugInfoPool {
|
||||
public void emitSetSourceFile(@Nonnull SetSourceFile setSourceFile) throws IOException {
|
||||
emitAdvancePC(setSourceFile.getCodeAddress());
|
||||
writer.write(9);
|
||||
writer.write(dexFile.stringPool.getIndexNullable(setSourceFile.getSourceFile()));
|
||||
writer.writeUleb128(dexFile.stringPool.getIndexNullable(setSourceFile.getSourceFile()) + 1);
|
||||
}
|
||||
|
||||
private static final int LINE_BASE = -4;
|
||||
|
@ -807,8 +807,8 @@ epilogue_directive
|
||||
-> ^(I_EPILOGUE[$start, "I_EPILOGUE"] I_ADDRESS[$start, Integer.toString($method::currentAddress)]);
|
||||
|
||||
source_directive
|
||||
: SOURCE_DIRECTIVE STRING_LITERAL
|
||||
-> ^(I_SOURCE[$start, "I_SOURCE"] STRING_LITERAL I_ADDRESS[$start, Integer.toString($method::currentAddress)]);
|
||||
: SOURCE_DIRECTIVE STRING_LITERAL?
|
||||
-> ^(I_SOURCE[$start, "I_SOURCE"] STRING_LITERAL? I_ADDRESS[$start, Integer.toString($method::currentAddress)]);
|
||||
|
||||
instruction_format12x
|
||||
: INSTRUCTION_FORMAT12x
|
||||
|
@ -702,7 +702,7 @@ epilogue returns[DebugItem debugItem]
|
||||
};
|
||||
|
||||
source returns[DebugItem debugItem]
|
||||
: ^(I_SOURCE string_literal address)
|
||||
: ^(I_SOURCE string_literal? address)
|
||||
{
|
||||
$debugItem = new ImmutableSetSourceFile($address.address, $string_literal.value);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user