Skip to content

Instrumentation of switch statements with control flow logger #16

Description

@bestchai

#Overview

All switch statements should be instrumented with calls to the control flow logger. Imminently before the switch statement a call to instrumenter.setFalse() should be made, setting all interior case and default statements to false. Inside of each case and default statement a call to instrumenter.setTrue() should be made indicating the path that was taken.

#Example

The following example takes place in a file source.go in package main

##Pre instrumentation

#!go
0 switch( conditional ){
1 case: "Canada"
2   harper()
3 case: "Russia"
4   putin()
5 default:
6   illuminati()
7 }

##Post Instrumentation

#!go
0  instrumenter.Cflogger.setFalse("main_source_switch_0")
1  switch( conditional ){
2  case: "Canada"
3  instrumenter.Cflogger.setTrue("main_source_case_1")
4     harper()
5  case: "Russia"
6  instrumenter.Cflogger.setTrue("main_source_case_3")
7     putin()
8  default:
9     instrumenter.Cflogger.setTrue("main_source_default_5")
10   illuminati()
11 }

[Issue created by wantonsolutions: 2015-08-21]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions