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

control flow conditionl logger #34

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

control flow conditionl logger #34

bestchai opened this issue May 26, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@bestchai
Copy link
Member

bestchai commented May 26, 2020

The dataflow logger should exist along side the goVec logger, and keep track of the control flow at runtime. The logger should be initialized at the same time, and have the same lifespan as the vector clock logger.

The purpose of the logger is to dynamically track which conditional have been entered and which have not. The logger should maintain a tree like structure of booleans referencing every conditional in a package. The logger should have functions for setting each of the booleans sharing a root to false, and a method for setting individual booleans to true.

The names of the conditionals should be collected during instrumentation. The code for initializing the control flow logger should be injected into inject.go and run during the initdinv() procedure.

example

source.go

#!go
   0   main ( argc ) {
   1       if ( argc > 2) {
   2            panic()
   3       } else {
   4            for ( conditonal ) {                  
   5                  switch ( other ) {
   6                  case: "it"
   7                     continue
   8                  case: "happend"
   9                     break
   10                }
   11         }
   12     }
   13    if (happy) {
   14        print("good morning world")
   15    }

The logger should contain a tree structure of booleans as follows

  • main_source_ifstatement_L0
    • main_source_if_L0
    • main_source_else_L3
      * main_source_for_L4
      * main_source_switch_L5
      * main_source_case_L6
      * main_source_case_L8
  • main_source_if_L13

Interface


##setFalse(root)
The setFalse function takes a root, or internal node and sets all of its leaf values to false. for example calling cflogger.setFalse("main_source_switch_L5") would set entries main_source_case_L6 = false andmain_source_case_L8 = false`

##setTrue(leaf)
Sets an individual leaf to true.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant