feat: prototype of upg html generation#219
Open
Unparalleled-Calvin wants to merge 1 commit intosafer-rust:mainfrom
Open
feat: prototype of upg html generation#219Unparalleled-Calvin wants to merge 1 commit intosafer-rust:mainfrom
Unparalleled-Calvin wants to merge 1 commit intosafer-rust:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modification
rapx/src/analysis/upg/draw_dot.rs.rapx/src/analysis/utils/datatorapx/src/analysis/utils/assets.rapx/src/analysis/utils/assets.struct DotGraphfordraw_dot.rsand refactor existing code.Description
The newly generated html can display the dot graph and open the source code page while clicking the node.
The placeholders in
index.html.templateare :TITLE: the title of the graphDOT: the dot description of the graphURL_MAP: a map with node label as its key and relative url as its value.e.g., "DefId(0:4 ~ recursion[3bdf]::main)" -> "main.rs.html#9"
BASE_URL: the source code (generated by cargo doc) base urlhttps://github.com/Artisan-Lab/RAPx/blob/5752fef086bf4403bbb0099de1ef0161d3a79e90/rapx/src/analysis/utils/assets/index.html.template#L24-L29
In the current implementation,
TITLE,DOTandURL_MAPare filled byRAPx. AndBASE_URLis filled by the scriptserve.sh. The nodes in the html are binded with a click event to open corresponding doc page.Usage of
serve.shhttps://github.com/Artisan-Lab/RAPx/blob/5752fef086bf4403bbb0099de1ef0161d3a79e90/serve.sh#L4-L18
A typical example:
When clicking

main:Issues
rapx/tests/callgraph/recursion(need more knowledge of UPG)url mapnow only supports doc link of local projects. For external symbols, e.g. std symbols, dependencies, the processing is skipped.