[Soot-list] Cannot get self-defined Tags D

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Tue Sep 8 07:29:58 EDT 2009


Hi Martin.

Unfortunately I cannot  test-run the code because it references some
pathfinder library that I don't have. But I had a look at Soot because
I remember having problems with this myself. I think the problem is
that your Tag has to extend soot.tagkit.JasminAttribute because only
such tags are actually written out into Jasmin (which is the
representation that then gets converted into bytecode).

Also, the subclass soot.tagkit.CodeAttribute could be helpful.

I have never tried writing out custom attributes with Soot but I am
sure others have, so maybe someone else can be of more help when it
comes to using these classes.

Eric

P.S. I saw that you invoke soot.Main.main(...) on every class
separately. You can instead just pass all classes to Soot at once -
that is more efficient.



2009/9/8 dragonwang <dragonwanghuai at gmail.com>:
> soot-list-request at sable.mcgill.ca wrote:
>>
>> Send Soot-list mailing list submissions to
>>        soot-list at sable.mcgill.ca
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> or, via email, send a message with subject or body 'help' to
>>        soot-list-request at sable.mcgill.ca
>>
>> You can reach the person managing the list at
>>        soot-list-owner at sable.mcgill.ca
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Soot-list digest..."
>>
>>
>> Today's Topics:
>>
>>   1. Can not get LineNumberTag for some of the JVM98   benchmarks
>>      (Kelvin Tian)
>>   2. Re: Can not get LineNumberTag for some of the JVM98
>>      benchmarks (Eric Bodden)
>>   3. Re: Can not get LineNumberTag for some of the JVM98
>>      benchmarks (Kelvin Tian)
>>   4. Re: Can not get LineNumberTag for some of the JVM98
>>      benchmarks (Eric Bodden)
>>   5. Bug in soot.util.ArraySet (Khilan Gudka)
>>   6. Re: Bug in soot.util.ArraySet (Eric Bodden)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Mon, 31 Aug 2009 15:12:31 -0400
>> From: Kelvin Tian <kevinn.tian at gmail.com>
>> Subject: [Soot-list] Can not get LineNumberTag for some of the JVM98
>>        benchmarks
>> To: soot-list at sable.mcgill.ca
>> Message-ID:
>>        <9846fcd40908311212q5ac40bb1w7082b4c8bcd84fc7 at mail.gmail.com>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Hi,
>>
>>     I'm trying to instrument jvm98 benchmarks, and I need to get some
>> information using LineNumberTag.  My program works well for most of the
>> benchmarks, but for some benchmarks, such as Db, Mtrt, etc, LineNumberTag
>> is
>> null for some programs in these benchmarks. I'm confused why the
>> LineNumberTag is empty only for some programs.  Are there any suggestions?
>> Thanks a lot!
>>
>>
>> --
>> Best regards,
>> Kelvin
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL:
>> http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20090831/355cdc57/attachment-0001.html
>> ------------------------------
>>
>> Message: 2
>> Date: Mon, 31 Aug 2009 22:03:05 +0200
>> From: Eric Bodden <bodden at st.informatik.tu-darmstadt.de>
>> Subject: Re: [Soot-list] Can not get LineNumberTag for some of the
>>        JVM98   benchmarks
>> To: Kelvin Tian <kevinn.tian at gmail.com>
>> Cc: soot-list at sable.mcgill.ca
>> Message-ID:
>>        <804e3c660908311303k6414d00dlaf9629f82f47efa0 at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi Kelvin.
>>
>> Please search the archives. The problem is likely that the class files
>> were compiled with debug symbols disabled.
>>
>> Eric
>>
>> 2009/8/31 Kelvin Tian <kevinn.tian at gmail.com>:
>>
>>>
>>> Hi,
>>>
>>> ???? I'm trying to instrument jvm98 benchmarks, and I need to get some
>>> information using LineNumberTag.? My program works well for most of the
>>> benchmarks, but for some benchmarks, such as Db, Mtrt, etc, LineNumberTag
>>> is
>>> null for some programs in these benchmarks. I'm confused why the
>>> LineNumberTag is empty only for some programs.? Are there any
>>> suggestions?
>>> Thanks a lot!
>>>
>>>
>>> --
>>> Best regards,
>>> Kelvin
>>>
>>>
>>> _______________________________________________
>>> Soot-list mailing list
>>> Soot-list at sable.mcgill.ca
>>> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>>>
>>>
>>>
>>
>>
>>
>>
>
> Dear Eric:
>
> I try to instrument a class file by adding some probes into the .class file,
> and these probes are labeled
> by a customized tag "MyTag". Additionally, I also write a "MyTagAggregator"
> to attach the probes with my tags.
> Before I invoke soot.main.Main(), I have set the options like
> "-keep-line-numbers" and "print-tags". However, these
> tags still missed in the final instrumented class files. Do you have any
> suggestions on this problem please?
>
> I run my program on Eclipse 3.3.1.1 and JDK 1.5, the soot is downloaded
> from:
>
> /
> http://plg.uwaterloo.ca/~olhotak/build/sootclasses.jar<http://plg.uwaterloo.ca/%7Eolhotak/build/sootclasses.jar
> <http://plg.uwaterloo.ca/%7Eolhotak/build/sootclasses.jar%3Chttp://plg.uwaterloo.ca/%7Eolhotak/build/sootclasses.jar>>
> /
> And I also attach my source code files to illustrate my situations:
>
> InstrumentMain: the entry point to instrument a class(for example: java
> InstrumentMain TestClass)
> TestClass: class under test
> MyTag & MyTagAggregator: self-defined tags and its aggregator
> Instrument_block: the BodyTransformer to implement my own instrumentation,
> which adds probes into each block
> Probe_block: self-defines probes to collect block/statement coverage
> information
>
> Many Thanks  in advance!
>
> Regards
> Martin
>
>
> /
> /
>
>
>
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>



-- 
Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt


More information about the Soot-list mailing list