Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using IBM Wala’s Slicer for CSCI578 HW3 By Joshua Garcia.

Similar presentations

Presentation on theme: "Using IBM Wala’s Slicer for CSCI578 HW3 By Joshua Garcia."— Presentation transcript:

1 Using IBM Wala’s Slicer for CSCI578 HW3 By Joshua Garcia

2 Some Requirements Eclipse IDE SVN or Git Plugin for Eclipse (e.g. Subclipse at

3 Getting the IBM Wala code Check out all* projects form the trunk of the repository EXCEPT for Import from the zip file we provide Reference – A more general guide to starting with Wala: Guide:Getting_Started

4 Possible Building Problems Some of the projects will have errors. I have errors in the following Wala projects: – – – – However, you won’t be using all the code so it shouldn’t be a problem However, you should set your JDK compiler compliance level to 1.6 – Click Window -> Preferences – Java -> Compiler – Set Compiler compliance level to 1.6

5 Configuring Properties Files Go to this page: Guide:Getting_Started Guide:Getting_Started Follow the section called “Configuring WALA properties” Wait there’s more and it’s IMPORTANT – You need to set some properties in dat/ as well – Just copy the file and rename it

6 A Little About Slicing Before We Continue Given a statement and a subset of its variables, you can perform forward or backward slicing A slice is a set of statements that affect or are affected by the selected statement Forward slicing gives you the statements affected by your selected statement Backward slicing gives you the statements that affect the given statement

7 More on slicing, If You Are Interested s/slicing/slicingWhitepaper.html s/slicing/slicingWhitepaper.html

8 Time To Slice Some Programs You should be able to run our customized PDFSliceMod drivers There are three launcher configuration you can modify and run as needed (one for each DEB application): – PDFSliceMod KLAX – PDFSliceMod specjms from stmts file – PDFSliceMod stoxx Simple way to get to these launcher configurations – Click Run -> Run Configurations – Under Java Application select the appropriate launcher configuration

9 Customizing the launcher configuration The launcher configuration takes a few arguments You can see these arguments from the Arguments tab of the launcher configuration For example, for PDFSliceMod KLAX, here are the arguments – -appJar ${workspace_loc}/ -sliceCritFiles "${workspace_loc}/" -dd "no_base_no_heap" -cd "none" -dir "backwards" -pkgIncludes "Lc2/apps/klax" The arguments and what they do – appJar, the jar of the DEB application (no need to change it) – srcCaller, the method you will create the slice from – sliceCritFiles, file name of the file containing the input statements to the slicer – dir, “forward” or “backward” slice – pkgIncludes, which packages to analyze and show for output – For the remaining options take a look at You may not need to change dd or cd, unless you think it will give you more accurate results Changing dd or cd can make your program running for a very long time A slicer on our DEB applications can take minutes to run

10 Understanding the console output The slicer’s analysis starts from entry points in your program, which are set to all the methods of your selected class One statement can be broken up into multiple IR statements. For example line 70 of KLAX’s ChuteArtist class is made up of these statements (and some null statements): – 70 18 = invokevirtual 2,16 @22 exception:17 – 70 19 = checkcast 18 – 70 21 = invokevirtual 19 @28 exception:20

11 More on console output You get the statements of the slice and corresponding line numbers (if applicable): Printing slice with node number and line number: SLICE: 1, -1 NORMAL_RET_CALLER:Node: Context: Everywhere[1]5 = invokevirtual 2 @1 exception:4 2, 66 NORMAL handle:8 = invokevirtual 5,6 @8 exception:7 Node: Context: Everywhere 3, -1 PARAM_CALLER:Node: Context: Everywhere[5]8 = invokevirtual 5,6 @8 exception:7 v5 4, 74 NORMAL handle:12 = invokevirtual 5,10 @56 exception:11 Node: Context: Everywhere 5, -1 PARAM_CALLER:Node: Context: Everywhere[29]12 = invokevirtual 5,10 @56 exception:11 v5 Node Numbers Some IR statements have no corresponding line number Node 2 corresponds to line 66 of ChuteArtist

12 How to read your slice Printing slice with selected statements only: Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:306 NORMAL handleMessage:4 = instanceof 2 Node: Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:306 NORMAL handleMessage:conditional branch(eq) 4,5 Node: Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:19 = checkcast 2 Node: Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:21 = invokeinterface 19 @12 exception:20 Node: Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:invokevirtual 1,21 @17 exception:22 Node: Context: Everywhere Class Name Line No.

13 More Stuff You Might Need to Know How slices map to line numbers: serGuide:MappingToSourceCode#From_Slices _to_source_line_numbers serGuide:MappingToSourceCode#From_Slices _to_source_line_numbers Understanding the IR: serGuide:IR

14 Eclipse’s Reference-finding Feature Right click on method, variable, class, etc. – Select References -> Project, Hierarchy, Workspace, or Working Set – You get list of references to your selection Or simply highlight the method, variable, class etc. – Press Ctrl+Shift+G

Download ppt "Using IBM Wala’s Slicer for CSCI578 HW3 By Joshua Garcia."

Similar presentations

Ads by Google