Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instrumentation of switch statements with control flow logger #16

Open
bestchai opened this issue May 26, 2020 · 0 comments
Open

Instrumentation of switch statements with control flow logger #16

bestchai opened this issue May 26, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@bestchai
Copy link
Member

bestchai commented May 26, 2020

#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]

@bestchai bestchai added the bug Something isn't working label May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant