Commit Graph

89 Commits

Author SHA1 Message Date
Julian Dolby c9ad359d65 new test to remind me that prototype no longer works with correlation tracking:
com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShapeRhino.java
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/pages/prototype.html

work (not yet finished) on fixes to property accesses for JavaScript:
com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ipa/callgraph/AstJavaSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/JSSSAPropagationCallGraphBuilder.java

currently unused tests to remind me to fix bugs:
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/tests/loops.js
com.ibm.wala.cast.js.test.data/examples-src/tests/primitive_strings.js

fixes to exception handler code generation in JavaScript:
com.ibm.wala.cast.js.rhino/source/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java
com.ibm.wala.cast.js.test.data/examples-src/tests/try.js
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java

fixes to make the system build on both juno and luna
com.ibm.wala.cast.js.test.data/pom.xml
pom.xml
targets/e42/e42.target
targets/e44/e44.target
targets/pom.xml
com.ibm.wala.core.tests/META-INF/MANIFEST.MF
com.ibm.wala.dalvik.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt/source/com/ibm/wala/cast/java/translator/jdt/FakeExceptionTypeBinding.java
com.ibm.wala.ide.jdt/source/com/ibm/wala/ide/util/JavaEclipseProjectPath.java
com.ibm.wala.ide.jsdt.tests/META-INF/MANIFEST.MF
com.ibm.wala.ide.jsdt.tests/src/com/ibm/wala/ide/jsdt/tests/AbstractJSProjectScopeTest.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/EclipseProjectPath.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java

beginnings of "pointer analysis" on top of field-based analysis
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/FlowGraph.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/PropVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/RetVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VarVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VertexFactory.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ExceptionReturnValueKey.java

fixes for crashes in correlartion tracking
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/extraction/ClosureExtractor.java

fixes for Dalvik IR generation
com.ibm.wala.core/src/com/ibm/wala/cfg/BytecodeCFG.java
com.ibm.wala.core/src/com/ibm/wala/cfg/ShrikeCFG.java
com.ibm.wala.core/src/com/ibm/wala/ssa/SSACFG.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/test/callGraph/JVMLDalvikComparison.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/classLoader/DexCFG.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/dex/instructions/UnaryOperation.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/DexSSABuilder.java

fixes to stack map generation when instrumenting for Java 7
com.ibm.wala.shrike/src/com/ibm/wala/shrike/cg/DynamicCallGraph.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/ConstantInstruction.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Analyzer.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/ClassHierarchy.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Verifier.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/shrikeCT/ClassInstrumenter.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapConstants.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableReader.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableWriter.java
2014-10-15 16:01:38 +09:00
Julian Dolby e3dfc5afe5 fixes for ir generation 2014-10-10 17:48:37 -04:00
Julian Dolby 14c9c96515 merge of java 7 changes.
fixes for Dalvik commit.
2014-10-06 17:41:58 -04:00
Julian Dolby a1bc84356d scandriod merge 2014-10-01 21:32:36 -04:00
Juergen Graf b8df435af2 fix type parameters of node decorator in dalvik frontend 2014-08-01 18:13:44 +02:00
Juergen Graf a13c0df9bd cleanup in dalvik frontend related files 2014-08-01 12:32:22 +02:00
Juergen Graf 6f8aee80c6 Merge branch 'wala' into master 2014-07-28 17:09:02 +02:00
Martin Mohr e6e6fc4159 bugfix (provided by E.Derr): left-shift literal of *HIGH_16 constants 2014-06-02 17:06:07 +02:00
Juergen Graf fad9e87654 cleanup - organize imports and remove unused code 2014-05-20 19:56:59 +02:00
Juergen Graf 9c41990d73 adapt android part to new pointer analysis interface 2014-05-20 19:56:31 +02:00
Juergen Graf ef4513d377 revert PointerAnalysis hack that makes containsAny() and contains() methods in OrdinalSet unusable 2014-05-20 19:52:01 +02:00
Juergen Graf 428a3975ed Merge branch 'wala' into master
Conflicts:
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/loader/JavaSourceLoaderImpl.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInstructionFactory.java
	com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ssa/AstJavaInvokeInstruction.java
	com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/html/WebPageLoaderFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/loader/JavaScriptLoader.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JSInstructionFactory.java
	com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ssa/JavaScriptInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstCallGraph.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AbstractLexicalInvoke.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstInstructionFactory.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalRead.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/AstLexicalWrite.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/ssa/FixedParametersInvokeInstruction.java
	com.ibm.wala.cast/source/java/com/ibm/wala/cast/ir/translator/AstTranslator.java
	com.ibm.wala.core/.classpath
	com.ibm.wala.core/.settings/org.eclipse.jdt.core.prefs
	com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java
	com.ibm.wala.util/src/com/ibm/wala/util/NullProgressMonitor.java
	com.ibm.wala.util/src/com/ibm/wala/util/ProgressMaster.java
2014-05-20 17:59:16 +02:00
Juergen Graf cf9d623b40 change to compile in eclipse - move files from util to core due to dependencies 2014-05-19 13:24:47 +02:00
Tobias Blaschke 71060b7348 Document Android-Stuff (II) 2014-04-11 17:59:10 +02:00
Tobias Blaschke f83ee59d8d Add UnknownIntent to AndroidSettingFactory 2014-04-11 17:59:09 +02:00
Tobias Blaschke 92ee930865 Document Android stuff (I)
I'm going through all "my" classes and add documentation where missing.
2014-04-11 17:59:09 +02:00
Tobias Blaschke 5f51dac201 Additional structural Models for Android
Now there are four structural models:
* SequentialAndroidModel:   No loops
* SingleStartAndroidModel:  User Interaction on a single component
* LoopAndroidModel:         Stuff goes into background and comes back
* LoopKillAndroidModel:     Restart of components due to low memory
2014-04-11 17:59:09 +02:00
Tobias Blaschke 1857121a44 Add "Custom Change" where applicable
Added the lines
BEGIN Custom Change
END Custom Change
2014-04-11 17:58:33 +02:00
Tobias Blaschke 3751366295 Bail out more information on failed assertion 2014-04-11 17:56:48 +02:00
Tobias Blaschke dc2522f937 Add debugging info
Output the method and stackTrace for my new "most favourite" assertion
and continue.
2014-04-11 17:56:48 +02:00
Tobias Blaschke e1fd417627 Extend DefaultInstantiationBehavior 2014-04-11 17:56:47 +02:00
Tobias Blaschke 2818ad33ad Document settings
Add more documentation on the settings for generationg a Livecycle-model
2014-04-11 17:56:47 +02:00
Tobias Blaschke 851594cff5 Make Intents immutable when attached to Context
Oops.
Fixes in intent-Resolution
2014-04-11 17:56:47 +02:00
Tobias Blaschke 8e7d44f6dc Better checks no system-components are included.
Before Activitys defined in the API could be pulled into the
entriepoints.

TODO: How can these get "Application" as loader?
2014-04-11 17:56:47 +02:00
Tobias Blaschke 042b1d6a01 Add some checks and output more info
AndroidPreFlightChecks now warns about entrypoints having a parameter
of type Object.
2014-04-11 17:56:47 +02:00
Tobias Blaschke 34b5c7284a Allow changing the target of an Intent.
Code oftain sets the action of an Intent after it's constructor. Until
now a call to such a setter caused the Intent to become "unbound"
(conservative).

This approch allows setting the target once for each Intent - only on
the second call the Intent gets unbound.
This new variant could be dangerous: Setting the target in a branch of
execution may be invalid. This should be detected - no guarantees so!

Methods in question are:
* Intent.setAction
* Intent.setComponent
* Intent.setClass
* Intent.setClassName
2014-04-11 17:56:47 +02:00
Tobias Blaschke b27bd944dc IntentModel also calls Application and Provider EPs.
As the IntentModel should only be used on the start of an Analysis this
is the correct approach here.
2014-04-11 17:56:47 +02:00
Tobias Blaschke cbfca1df4e Call setIntent when starting a Component.
Before the Intent would only have been set by calling .attach (if
doBootSequence is enabled). Attach is only called when the modell is
filled with instructions.

This new variant calls setIntent when creating the wrapper for the model
(getMethodAs). This is much better!
2014-04-11 17:56:47 +02:00
Tobias Blaschke eb4e3e4b58 Use setExplicit in androids Intent-Constructor 2014-04-11 17:56:46 +02:00
Tobias Blaschke 5a8c676a76 Disable extraction of AndroidContext
The AndroidContext was not used anyways.
2014-04-11 17:56:46 +02:00
Tobias Blaschke abcd578a61 Use getters and setters for Intents, add explicit-attribute
These Changes are necessary to make the target of an Intent changeable.
Additionaly some preparing changes in the IntentMap
2014-04-11 17:56:46 +02:00
Tobias Blaschke 3533156542 More info on AndroidEntryPoints selected by heuristic 2014-04-11 17:56:46 +02:00
Tobias Blaschke bf0e1a6347 Extend handling of IntentContext
* Create IntentContext even if no info available.
  This is necessary to also track the start of unknown targets.

* Invalidate the target of an Inten upon a call to Intent.setAction
  or Intent.fillIn

Additionally tidied up the classes a bit.
2014-04-11 17:56:46 +02:00
Tobias Blaschke c4eb253721 Fixes in the UnknownTarget model.
Before the model went by the wrong Name, it failed if no app-internal
implementations of the targetType existed.

Also tidied up the code.
2014-04-11 17:56:46 +02:00
Tobias Blaschke bd8f793135 Add a model for SystemServices
The SystemServiceModel creates and returns a new Instance of the
requested Service (if known).

TODO: We should use a single "global" instance per service instead.
2014-04-11 17:56:46 +02:00
Tobias Blaschke 224077d344 Fix Phi-Problem in SpecializedInstantiator
Under some curcumstances there was a hick-up when Phi-ing together some
newly generated instances.
2014-04-11 17:56:46 +02:00
Tobias Blaschke 1121b59b3b Handling getSystemService.
Code to resolve a call to getSystemService to an actual Object based on
the String given to getSystemService.

Currently there's only TelephonyManager.
2014-04-11 17:53:14 +02:00
Tobias Blaschke f561f1213d Make flat components optional 2014-04-11 17:53:14 +02:00
Tobias Blaschke d7f0d07122 Create Conponent instances in clinit 2014-04-11 17:53:14 +02:00
Tobias Blaschke a9864a5dab Added specialized instantiators.
Creating an instance of e.g. Context would pull in all compontents
yielding a ununsable result.
2014-04-11 17:53:13 +02:00
Tobias Blaschke ece84ddf76 Fix field-handling for Intent-Wrappers
The IntentContextInterpreter always returned an empty set of fields
2014-04-11 17:53:13 +02:00
Tobias Blaschke 64749b91fe Decrease some log-levels
Output was a bit to verbose.
2014-04-11 17:53:13 +02:00
Tobias Blaschke b963cc72bb Flatten Android-Component instances
Throw instances of android components into AndroidModelClass and reuse
them. This resembles Android a bit more.
2014-04-11 17:53:13 +02:00
Tobias Blaschke 594447c18f Add AndroidModel.getMethodEncap
Using getMethodEncap a new set of REUSE-Parameters will be generated
using the new Instantiator. Then the model will be called.
2014-04-11 17:53:13 +02:00
Tobias Blaschke add83148a5 Add default Overrides for Intents
Added DEFAULT_INTENT_OVERRIDES to AndroidEntryPointManager. These have
to be added manually.

Added posibility to deliberatly ignore intents
2014-04-11 17:53:13 +02:00
Tobias Blaschke 7aed4b5095 Add IntentModel for starting the analysis at an Intent 2014-04-11 17:53:13 +02:00
Tobias Blaschke 00d711dd64 InducedCFG/GoTo: Handle basic block boundarys
Building the CFG with a SSAGotoInstuction was buggy: Oftain the wrong
jump-target was selected. This has bin fixed.

Additionally InducedCFG now automaticly breaks the basic-block at the
jump-target.

Jumping to Phi-Instructions however is still unsupported (as they are
not part of the cfg-instructions)
2014-04-11 17:53:13 +02:00
Tobias Blaschke 154634dfb4 Fix resolution of Intents
There was (and is) the posibility of an endless-loop when looking up the
targets of Intents. Added an evil hack to at least prevent the most
obvious one.
2014-04-11 17:53:13 +02:00
Tobias Blaschke 14a9382ac6 Enable components in v4 2014-04-11 17:53:12 +02:00
Tobias Blaschke c8b60ef9dd BUG: Invalid def/Use of IntentSender.<init>
The Analysis has problems with the IntentSender class: Invalid DefUse an
an Init-Call.
The Intent-Starters, that use IntentSender have been made optional.
However disabling them does not help.

Currently the only solution to this problem is adding IntentSender to
the exclusions.txt
2014-04-11 17:53:12 +02:00