Domiii / dbux

Dbux is an Integrated Debugging Environment (IDbE) and Omniscient Debugger that makes JavaScript application's run-time behavior come alive, visible and interactive.
https://domiii.github.io/dbux
Apache License 2.0
162 stars 13 forks source link

feature: DDG control comprehension #738

Closed Domiii closed 2 years ago

Domiii commented 2 years ago

Control Comprehension Basics

Goal: produce ControlStatements/ControlGroups that user can use to comprehend control flow.

Vis

Summarization ops

Instrumentation

DDG.buildGraph:

Utils:

getControlStaticIdsByRootId(dp, staticControlStatementId) {
  TODO
},

getControlIdsByRootId(dp, controlRootTraceId) {
  TODO
},

Indexes:

More Data Structures + Queries

class Queries {
  getBranchBlockLabel(blockOrStatementStaticTraceId) {
    // TODO: label is unambiguous for loops, but requires knowing the block for `NonLoop`s
    // NOTE: block information can be determined by `statement type` + `controlTrace.value`
  }
}

By syntax

Conditional statements generate complex conditional trees. Each such tree has a single controlStatementId.

Loops

HOFs

NOTE: Higher-order functions, such as map don't have specific grammar, but instead require customized monkey-patching

Generators

TODO

Future Work

Proper Error Handling

Domiii commented 2 years ago

We have most control groups done, but control dependencies are not a thing for now.