llvm-project/llvm/docs
David Spickett 070090d08e [lldb] Add option to show memory tags in memory read output
This adds an option --show-tags to "memory read".

(lldb) memory read mte_buf mte_buf+32 -f "x" -s8 --show-tags
0x900fffff7ff8000: 0x0000000000000000 0x0000000000000000 (tag: 0x0)
0x900fffff7ff8010: 0x0000000000000000 0x0000000000000000 (tag: 0x1)

Tags are printed on the end of each line, if that
line has any tags associated with it. Meaning that
untagged memory output is unchanged.

Tags are printed based on the granule(s) of memory that
a line covers. So you may have lines with 1 tag, with many
tags, no tags or partially tagged lines.

In the case of partially tagged lines, untagged granules
will show "<no tag>" so that the ordering is obvious.
For example, a line that covers 2 granules where the first
is not tagged:

(lldb) memory read mte_buf-16 mte_buf+16 -l32 -f"x" --show-tags
0x900fffff7ff7ff0: 0x00000000 <...> (tags: <no tag> 0x0)

Untagged lines will just not have the "(tags: ..." at all.
Though they may be part of a larger output that does have
some tagged lines.

To do this I've extended DumpDataExtractor to also print
memory tags where it has a valid execution context and
is asked to print them.

There are no special alignment requirements, simply
use "memory read" as usual. All alignment is handled
in DumpDataExtractor.

We use MakeTaggedRanges to find all the tagged memory
in the current dump, then read all that into a MemoryTagMap.

The tag map is populated once in DumpDataExtractor and re-used
for each subsequently printed line (or recursive call of
DumpDataExtractor, which some formats do).

Reviewed By: omjavaid

Differential Revision: https://reviews.llvm.org/D107140
2022-01-26 14:40:39 +00:00
..
AMDGPU [AMDGPU][GFX10][MC] Updated symbolic names of internal HW registers 2022-01-17 20:29:10 +03:00
AMDGPUDwarfExtensionAllowLocationDescriptionOnTheDwarfExpressionStack [AMDGPU][NFC] Update DWARF extension allowing locations on stack 2021-12-28 17:12:20 +00:00
CommandGuide [llvm-mca] Improve barriers for strict region marking (PR52198) 2022-01-21 11:25:05 +00:00
DependenceGraphs [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
Frontend
GlobalISel [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
HistoricalNotes
PDB [NFC][llvm] Inclusive language: replace master in llvm docs 2021-11-25 13:36:51 -06:00
Proposals [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
TableGen [Docs] Fix IR and TableGen grammar inconsistencies 2022-01-13 11:55:13 +01:00
_ocamldoc
_static
_templates
_themes/llvm-theme
tutorial [docs]LLVM Tutorial: fix the typo in Cpu0 URL 2021-12-20 21:45:57 +00:00
AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst [AMDGPU][NFC] Add DWARF extension support for SIMD execution 2022-01-18 17:36:39 +00:00
AMDGPUInstructionNotation.rst
AMDGPUInstructionSyntax.rst
AMDGPUModifierSyntax.rst
AMDGPUOperandSyntax.rst
AMDGPUUsage.rst [AMDGPU][NFC] Update to AMDGPUUsage for default Code Object Version 2022-01-24 14:33:12 -08:00
ARM-BE-bitcastfail.png
ARM-BE-bitcastsuccess.png
ARM-BE-ld1.png
ARM-BE-ldr.png
AddingConstrainedIntrinsics.rst
AdvancedBuilds.rst
AliasAnalysis.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
Atomics.rst
Benchmarking.rst
BigEndianNEON.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
BitCodeFormat.rst Update bitcode format doc to mention that a multi-module bitcode file is 2022-01-18 17:49:34 -08:00
BlockFrequencyTerminology.rst
BranchWeightMetadata.rst
BugLifeCycle.rst
Bugpoint.rst
BugpointRedesign.md
BuildingADistribution.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
CFIVerify.rst
CMake.rst [llvm] Use `GNUInstallDirs` to support custom installation dirs 2022-01-08 00:47:31 +00:00
CMakeLists.txt
CMakePrimer.rst
CodeGenerator.rst
CodeOfConduct.rst
CodeReview.rst
CodingStandards.rst [doc] Fix namespace comment style in Coding Guidelines 2021-12-07 13:36:25 +00:00
CommandLine.rst
CompileCudaWithLLVM.rst [CUDA] Bump supported CUDA version to 11.5 2021-11-09 08:20:53 +00:00
CompilerWriterInfo.rst [VE] Add manuals to CompilerWriterInfo 2021-12-23 14:14:37 +01:00
Contributing.rst docs: update some bug tracker references (NFC) 2022-01-10 15:59:08 -08:00
Coroutines.rst [Coroutines] Offering llvm.coro.align intrinsic 2022-01-19 09:52:45 +08:00
CoverageMappingFormat.rst
CycleTerminology.rst Reapply CycleInfo: Introduce cycles as a generalization of loops 2021-12-10 14:36:43 +05:30
DebuggingJITedCode.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
DeveloperPolicy.rst Documentation for the process of adding new targets 2021-12-28 21:00:26 +00:00
DiscourseMigrationGuide.md Add first draft of the discourse migration guide. 2022-01-07 20:24:35 -08:00
Docker.rst
ExceptionHandling.rst
ExtendedIntegerResults.txt
ExtendingLLVM.rst
Extensions.rst [X86] Selective relocation relaxation for +tagged-globals 2021-11-19 07:18:27 -08:00
FAQ.rst
FaultMaps.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
FuzzingLLVM.rst
GarbageCollection.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
GetElementPtr.rst
GettingInvolved.rst [docs] Add Loop Optimization WG to the online sync-up page 2021-11-18 16:49:11 -05:00
GettingStarted.rst Officially deprecate LLVM_ENABLE_PROJECTS for libc++, libc++abi and libunwind 2021-10-29 08:53:03 -04:00
GettingStartedTutorials.rst
GettingStartedVS.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
GitBisecting.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
GitRepositoryPolicy.md
GoldPlugin.rst
GwpAsan.rst
HowToAddABuilder.rst [docs] Update new builder instructions to starting on the staging buildmaster 2021-12-22 18:21:17 -08:00
HowToBuildOnARM.rst
HowToBuildWindowsItaniumPrograms.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
HowToBuildWithPGO.rst
HowToCrossCompileBuiltinsOnArm.rst
HowToCrossCompileLLVM.rst [docs] HowToCrossCompileLLVM.rst: prefer --target= over legacy -target 2022-01-25 12:39:32 -08:00
HowToReleaseLLVM.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
HowToSetUpLLVMStyleRTTI.rst
HowToSubmitABug.rst docs: update some bug tracker references (NFC) 2022-01-10 15:59:08 -08:00
HowToUpdateDebugInfo.rst
HowToUseAttributes.rst
HowToUseInstrMappings.rst
InAlloca.rst
JITLink.rst
LangRef.rst [IR] document and update ctlz/cttz intrinsics to optionally return poison rather than undef 2022-01-23 11:22:48 -05:00
Lexicon.rst
LibFuzzer.rst
LinkTimeOptimization.rst
LoopTerminology.rst
MCJIT-creation.png
MCJIT-dyld-load.png
MCJIT-engine-builder.png
MCJIT-load-object.png
MCJIT-load.png
MCJIT-resolve-relocations.png
MCJITDesignAndImplementation.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
MIRLangRef.rst
MarkdownQuickstartTemplate.md
MarkedUpDisassembly.rst
MeetupGuidelines.rst
MemTagSanitizer.rst
MemorySSA.rst [MemorySSA] Document details regarding MemorySSA's precision. 2021-12-13 16:49:24 -08:00
MergeFunctions.rst
MyFirstTypoFix.rst [docs] Update outdated mentions of lab.llvm.org:8011. 2021-11-18 10:51:47 +00:00
NVPTXUsage.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
NewPassManager.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
ORCv2.rst [ORC][docs] Describe removing JITDylibs, using custom program representations. 2022-01-21 22:05:17 +11:00
OpaquePointers.rst [Docs] Use anonymous reference (NFC) 2022-01-14 18:01:06 +01:00
OptBisect.rst
Packaging.rst
Passes.rst
Phabricator.rst [llvm][docs] Describe how to work with patch series on Phabricator 2021-12-16 15:32:26 +00:00
Phabricator_premerge_results.png
Phabricator_premerge_unit_tests.png
PointerAuth.md [IR] Define ptrauth intrinsics. 2021-11-14 07:59:00 -08:00
ProgrammersManual.rst [docs] There are more than three bit storage containers. 2022-01-25 10:09:18 +00:00
Projects.rst [NFC][llvm] Inclusive language: replace master in llvm docs 2021-11-25 13:36:51 -06:00
README.txt Replace references to Makefile.sphinx 2021-10-22 15:32:12 +02:00
Reference.rst Add security group 2021 transparency report. 2022-01-21 15:43:17 +01:00
ReleaseNotes.rst [lldb] Add option to show memory tags in memory read output 2022-01-26 14:40:39 +00:00
ReleaseProcess.rst
Remarks.rst
ReportingGuide.rst
ScudoHardenedAllocator.rst
Security.rst Add security group 2021 transparency report. 2022-01-21 15:43:17 +01:00
SecurityTransparencyReports.rst Add security group 2021 transparency report. 2022-01-21 15:43:17 +01:00
SegmentedStacks.rst
SourceLevelDebugging.rst [llvm] Add support for DW_TAG_immutable_type 2022-01-05 19:17:08 +00:00
SpeculativeLoadHardening.md
SphinxQuickstartTemplate.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
StackMaps.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
StackSafetyAnalysis.rst
Statepoints.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
SupportLibrary.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
SupportPolicy.rst
SystemLibrary.rst
TableGenFundamentals.rst
TestSuiteGuide.md
TestSuiteMakefileGuide.rst
TestingGuide.rst [llvm][docs] Fix code-block in the testing guide 2022-01-24 14:56:31 +00:00
TransformMetadata.rst
TypeMetadata.rst
UserGuides.rst [AMDGPU][NFC] Add documentation for location description DWARF extension 2021-12-14 00:58:17 +00:00
Vectorizers.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
WritingAnLLVMBackend.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
WritingAnLLVMNewPMPass.rst
WritingAnLLVMPass.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
XRay.rst
XRayExample.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
XRayFDRFormat.rst
YamlIO.rst [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
buildbot_worker_contact.png
conf.py
cycle-1.png Reapply CycleInfo: Introduce cycles as a generalization of loops 2021-12-10 14:36:43 +05:30
cycle-2.png Reapply CycleInfo: Introduce cycles as a generalization of loops 2021-12-10 14:36:43 +05:30
cycle-3.png Reapply CycleInfo: Introduce cycles as a generalization of loops 2021-12-10 14:36:43 +05:30
doxygen-mainpage.dox
doxygen.cfg.in [NFC] Inclusive Language: change master to main for .chm files 2021-11-08 08:23:04 -06:00
epilogue-vectorization-cfg.png
gcc-loops.png
index.rst Add first draft of the discourse migration guide. 2022-01-07 20:24:35 -08:00
linpack-pc.png
llvm-objdump.1
loop-guard.svg
loop-irreducible.svg
loop-merge.svg
loop-nested.svg
loop-nonmaximal.svg
loop-separate.svg
loop-single.svg
loop-terminology-guarded-loop.png
loop-terminology-initial-loop.png
loop-terminology-rotated-loop.png
loop-terminology.svg
make.bat
re_format.7
speculative_load_hardening_microbenchmarks.png
yaml2obj.rst

README.txt

LLVM Documentation
==================

LLVM's documentation is written in reStructuredText, a lightweight
plaintext markup language (file extension `.rst`). While the
reStructuredText documentation should be quite readable in source form, it
is mostly meant to be processed by the Sphinx documentation generation
system to create HTML pages which are hosted on <https://llvm.org/docs/> and
updated after every commit. Manpage output is also supported, see below.

If you instead would like to generate and view the HTML locally, install
Sphinx <http://sphinx-doc.org/> and then do:

    cd <build-dir>
    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_HTML=true <src-dir>
    make -j3 docs-llvm-html
    $BROWSER <build-dir>/docs/html/index.html

The mapping between reStructuredText files and generated documentation is
`docs/Foo.rst` <-> `<build-dir>/docs//html/Foo.html` <-> `https://llvm.org/docs/Foo.html`.

If you are interested in writing new documentation, you will want to read
`SphinxQuickstartTemplate.rst` which will get you writing documentation
very fast and includes examples of the most important reStructuredText
markup syntax.

Manpage Output
===============

Building the manpages is similar to building the HTML documentation. The
primary difference is to use the `man` makefile target, instead of the
default (which is `html`). Sphinx then produces the man pages in the
directory `<build-dir>/docs/man/`.

    cd <build-dir>
    cmake -DLLVM_ENABLE_SPHINX=true -DSPHINX_OUTPUT_MAN=true <src-dir>
    make -j3 docs-llvm-man
    man -l <build-dir>/docs/man/FileCheck.1

The correspondence between .rst files and man pages is
`docs/CommandGuide/Foo.rst` <-> `<build-dir>/docs//man/Foo.1`.
These .rst files are also included during HTML generation so they are also
viewable online (as noted above) at e.g.
`https://llvm.org/docs/CommandGuide/Foo.html`.

Checking links
==============

The reachability of external links in the documentation can be checked by
running:

    cd llvm/docs/
    sphinx-build -b linkcheck . _build/lintcheck/
    # report will be generated in _build/lintcheck/output.txt

Doxygen page Output
==============

Install doxygen <https://www.doxygen.nl/download.html> and dot2tex <https://dot2tex.readthedocs.io/en/latest>.

    cd <build-dir>
    cmake -DLLVM_ENABLE_DOXYGEN=On <llvm-top-src-dir>
    make doxygen-llvm # for LLVM docs
    make doxygen-clang # for clang docs

It will generate html in

    <build-dir>/docs/doxygen/html # for LLVM docs
    <build-dir>/tools/clang/docs/doxygen/html # for clang docs