[Soot-list] end of a switch block

Eric Bodden eric.bodden at mail.mcgill.ca
Sat Jun 20 09:37:33 EDT 2009


Yes, I agree that in this case this seems to be the only solution. Too
bad that you cannot work on source code. I wonder if there is some
standard way at all in which Java compilers compile switch blocks into
bytecode. Otherwise, I guess it would just be plain impossible to
achieve what you are trying to achieve. Did you check whether e.g.
javac, eclipse and Soot produce similar bytecode/jimple for the same
switch blocks?

Can you email us some minimal example Jimple code that is causing you
problems? I would have to see what kind of code you are dealing with
before I can help you further.

Cheers,
Eric

2009/6/20 Cristina Basescu <cristina.basescu at gmail.com>:
> Indeed, I believe I need something closer to an AST on the source code,
> unfortunately my analysis starts with some .class files, so I think Jimple
> is the best I can get. I need to count how many times a certain statement
> appears on each of the case branches in a switch, I don't see some other way
> to workaround this..
>
> Cristina
>
> On Sat, Jun 20, 2009 at 3:34 AM, Eric Bodden <eric.bodden at mail.mcgill.ca>
> wrote:
>>
>> Hi Christina.
>>
>> Jimple is not really on the right level of abstraction for extracting
>> switch blocks. As you probably know, such blocks can have a different
>> representation on the Jimple level than they have in source code. Why
>> are you trying to find switch blocks? Maybe we can help you somehow
>> differently.
>>
>> Eric
>>
>> 2009/6/19 Cristina Basescu <cristina.basescu at gmail.com>:
>> > Hello,
>> >
>> > I have a question regarding the possibility of finding where a switch
>> > block ends (the next statement after a switch block). I find this problem
>> > tricky when there is no break statement on any of the case blocks excepting
>> > the last case block, because otherwise one could compute the lists of all
>> > successors for all the targets and then find the first common statement of
>> > these lists. I'm using Jimple and I thought that maybe building the AST
>> > might be the solution, but I haven't found an example on how to do this
>> > either.
>> >
>> > Any help would be appreciated.
>> >
>> > Best regards,
>> > Cristina
>> >
>> > _______________________________________________
>> > Soot-list mailing list
>> > Soot-list at sable.mcgill.ca
>> > http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>> >
>> >
>>
>>
>>
>> --
>> Eric Bodden
>> Sable Research Group, McGill University
>> Montréal, Québec, Canada
>
>



-- 
Eric Bodden
Sable Research Group, McGill University
Montréal, Québec, Canada


More information about the Soot-list mailing list