[Soot-list] How to set -process-dir and -cp correctly in this case? I got the error: class small.DataClass read in from a classfile in which DataClass was expected.

Bodden, Eric eric.bodden at sit.fraunhofer.de
Fri Nov 22 03:20:56 EST 2013


Hi Khanh.

When you set Soot's classpath or process dir then the path must always point to the root of the package hierarchy, not to some particular package folder, i.e., in your setting it must point to C:\test\bin\
You can then the include/exclude options to include/exclude certain packages from analysis. See here:
http://www.sable.mcgill.ca/soot/tutorial/usage/index.html

Does that work for you?


Cheers,
Eric



On 18.11.2013, at 08:47, Khanh Nguyen <khanhtn1 at uci.edu> wrote:

> Hello,
> 
> I know that this question has been in the list since a long time ago, I read all those posts and got what I wanted to do but still, I want it work in another way (if possible)
> The background is this: In C:\test\bin I have 2 folders, "simple" and "small" (equivalent to 2 different packages) in "small", I have one class: DataClass.class, in "simple", I also have one class called DataClass.class
> 
> I want to apply my analysis only on folder "small". Thus I used the command line :-process-dir C:\test\bin\small -cp C:\test\bin\small.
> I understand that by setting -process-dir C:\test\bin\small, the class Soot will find to load is DataClass.class (i.e. no info about the package 'small') which is okay, that's why I thought the -cp must be set as C:\test\bin\small. So now the file structure is identical. But I got the error instead("class small.DataClass read in from a classfile in which DataClass was expected.") 
> Is it because even when setting -cp: C:\test\bin\small the class loaded is still be considered as small.DataClass? (because the actual class is read and thus, the name is small.DataClass?)
> 
> 
> Of course I can make my analysis to work only on "small" by deleting the "simple" and set both -process-dir and -cp to C:\test\bin (so that -process-dir sets the target class is actually small.DataClass and -cp will let me see small\DataClass.class)
> But, even with only "small" under C:\test\bin, I cant do -process-dir C:\test\bin -cp C:\test\bin\small, either (Soot will complain there is no small.DataClass on classpath- why? now -cp only see DataClass.class?)
> 
> But, bottom line is, isnt there anyway to just set the target of the analysis restricted to only 1 package like what I wanted?
> 
> Thank you,
> 
> Khanh Nguyen
> UC Irvine
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list

--
Prof. Eric Bodden, Ph.D., http://sse.ec-spride.de/ http://bodden.de/
Head of Secure Software Engineering  at Fraunhofer SIT, TU Darmstadt and EC SPRIDE
Tel: +49 6151 16-75422    Fax: +49 6151 16-72051
Room 3.2.14, Mornewegstr. 30, 64293 Darmstadt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
Url : http://mailman.cs.mcgill.ca/pipermail/soot-list/attachments/20131122/39d59492/attachment.bin 


More information about the Soot-list mailing list