[Soot-list] Interface Methods in SootClass

Arzt, Steven steven.arzt at sit.fraunhofer.de
Fri Feb 9 14:31:38 EST 2018


Hi Kaarthik,

A class only declares the method inside the current class. Inheritance is a concept from virtual dispatch. If you have some class A with a super class S, then A only has the methods it declared or overrides. When calling some a.foo(), the virtual dispatch algorithm has to check whether A has a method foo() on its own, and if that is not the case, walk the class hierarchy to check for some S.foo().

Best regards,
  Steven

From: Soot-list [mailto:soot-list-bounces at cs.mcgill.ca] On Behalf Of Karthik Rao
Sent: Friday, February 9, 2018 5:26 PM
To: soot-list at cs.mcgill.ca
Subject: [Soot-list] Interface Methods in SootClass

Hello Everyone,

I am creating a class using Soot and have run into an issue with interface methods. I am essentially trying to create the below line (created by converting  Java code to Jimple) using Soot.

$z0 = interfaceinvoke d.<soot.Unit: boolean hasTag(java.lang.String)>("AnalysisInfoTag");

When I query the Scene for the method by "Scene.v().getMethod("<soot.Unit: boolean hasTag(java.lang.String)>")"  it throws an exception- "tried to get nonexistent method <soot.Unit: boolean hasTag(java.lang.String)>".

The SootClass soot.Unit has two methods addTag and removeTag , but the rest of the methods from the Host interface are missing.

It would be great if someone could point out what I am doing wrongly.

TIA!

Cheers,
Kaarthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20180209/5e630398/attachment.html>


More information about the Soot-list mailing list