In Roslyn, a control flow graph has the list of BasicBlocks which constitute the program. Is it possible to get code statements from each block to reconstruct the entire code?
Roslyn: Reconstruct code from BasicBlocks in a CFG
147 Views Asked by Sherwin At
1
There are 1 best solutions below
Related Questions in ROSLYN
- Source generators get the referencing project path - retrieve useful value from IncrementalValueProvider<string>
- Roslyn diagnostics reported through CompilationAnalysisContext.ReportDiagnostic do not show up in Visual Studio
- Using Roslyn and .NET Core : how do I resolve "type or namespace name "Forms" does not exist in the namespace 'System.Windows'
- Sharing runtime assembly in C# Roslyn script
- Detecting unused using statements with Roslyn
- Roslyn generated dll can't be referenced
- Memory Leak caused by Roslyn, how do I contain it?
- How to use Roslyn in wpf application
- Roslyn INamedTypeSymbol.ContainingNamespace.Name an empty string
- Add System.Text.Json to incremental source generator
- No CS0184 warning for impossible check
- Enforce Code Cleanup code-style that is not available in editorconfig
- How to execute Roslyn fixers that rely on internal interfaces
- C# runtime compilation complains The type 'Object' is defined in an assembly that is not referenced
- Dotnet build is using old version of IIncrementalGenerator
Related Questions in ROSLYN-CODE-ANALYSIS
- Roslyn diagnostics reported through CompilationAnalysisContext.ReportDiagnostic do not show up in Visual Studio
- C# CodeAnalysis can't compile code with dynamic keyword
- Unit test C# source generator to emulate a user changing source code?
- Checking project configuration in Roslyn analyzer
- Visual Studio 2022: Impossible to install a VSIX extension from 'Analyzer with Code Fix (.NET Standard)' project template
- In c# code cleanup, How to stop visual studio 2022 adding comments /* Unmerged change from project 'xxxx (net6.0)'
- Code analysis only shows CSxxx and IDExxx notes I see no CAxxx messages
- Why Rider does not highlight some warnings in C#?
- Roslyn Analyzer: How to handle a side effect of renaming classes
- NET Analyzers and AnalysisLevel confusion
- Is there a technical reason why code analysis can't figure out that this variable has been set?
- Roslyn workspace API not loading properly for a third-party solution
- How to hide Visual Studio squiggly lines from analyzers suppressed by a DiagnosticSuppressor
- Set a value to a field in a compiled assembly from an object that exists outside the compiled assembly
- Speed up Roslyn solution analyser
Related Questions in CONTROL-FLOW-GRAPH
- How to get reasonable "topological order" of control flow graph (CFG) which may have loops when calculating MD index?
- Static analysis of unused assignments
- Drawing cfg using antlr4, graphiz and python and parser is empty
- Decompilation independent pattern structuring of cfg
- Decompilation creating basic blocks
- Is there a way to get Program Dependency Graph of a binary with angr?
- Control Flow Graph : properly identify loop "condition"
- Number of edges and nodes in this control flow graph (CFG)?
- Is there a way to get the filepaths of a given route's middleware in Express? Or create CFG that does?
- How exactly to construct "basic blocks" for a compiler (using JavaScript as an example)?
- Clarification on what exactly constitutes as a continue target in Vulkan SPIR-V
- It is possible to generate CFG + Callgraph in one file?
- How to determine if a BasicBlock is controled by a `if`
- Soot - Get JimpleBody from a CFG
- Time of Day affecting how Python Package is Loaded
Related Questions in MICROSOFT.CODEANALYSIS
- Using RazorEngineCore Library getting error Could not load file or assembly 'Microsoft.CodeAnalysis Version=4.7.0.0,PublicKeyToken=31bf3856ad364e35'
- Getting constant value inside a cshtml file by Roslyn library
- Is there a technical reason why code analysis can't figure out that this variable has been set?
- How to set cyclomatic complexity limit for specific method?
- Referencing Cross project compilation within custom DiagnosticAnalyzer - Microsoft.CodeAnalysis.CSharp
- How to update `Microsoft.CodeAnalysis` in .net6 project
- Warning CS8032 Cannot find System.Collections.Immutable after upgrade to .NET 6.0
- Use StyleCop.Analyzers, Microsoft.CodeAnalysis.* or both?
- Canot resolve argument parameters in Roslyn Source Generation
- Merge SonarAnalyzer.CSharp and the Microsoft.CodeAnalysis rulesets
- How to get the Target Framework/s of a project (.csproj) using Microsoft.CodeAnalysis (or similar)?
- How to fix Visual Studio 2022 Warning CA1416 "Call site reachable by all platforms" but "only supported on: 'windows'"?
- Roslyn - OutOfMemoryException due to assemblies loaded in memor
- Roslyn - Navigate to SourceText in a Visual Studio extension
- Visual Studio editorconfig and code analysis is frustrating
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This is not possible using Roslyn's in-built methods in my knowledge. I achieved a similar result by constructing a dictionary of blocks and sets of line numbers corresponding to those blocks using string matching. Additional filtering done to the same in order to improve accuracy in case of blocks that include locks etc. The result is not 100 percent accurate, but it comes pretty close in most cases.