Skip to content

[docs] Update DebuggingTheCompiler.rst section with info about vim/emacs integration for viewcfg. #12491

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion docs/DebuggingTheCompiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,28 @@ using regular expressions (i.e. ignoring language semantics), ViewCFG can:
The script assumes that the relevant text is passed in via stdin and uses open
to display the .dot file.

**NOTE** Since we use open, .dot files should be associated with the Graphviz app for this to work.
Additional, both emacs and vim integration is provided. For vim integration add
the following commands to your .vimrc::

com! -nargs=? Funccfg silent ?{$?,/^}/w !viewcfg <args>
com! -range -nargs=? Viewcfg silent <line1>,<line2>w !viewcfg <args>

This will add::

:Funccfg displays the CFG of the current SIL/LLVM function.
:<range>Viewcfg displays the sub-CFG of the selected range.

For emacs users, we provide in sil-mode (``./utils/sil-mode.el``) the function::

sil-mode-display-function-cfg

To use this feature, placed the point in the sil function that you want viewcfg
to graph and then run ``sil-mode-display-function-cfg``. This will cause viewcfg
to be invoked with the sil function body. Note,
``sil-mode-display-function-cfg`` does not take any arguments.

**NOTE** viewcfg must be in the $PATH for viewcfg to work.
**NOTE** Since we use open, .dot files should be associated with the Graphviz app for viewcfg to work.

Using Breakpoints
`````````````````
Expand Down