llvm-project/lldb/source/Core
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
..
Address.cpp [StopInfoMachException] Summarize arm64e BLRAx/LDRAx auth failures 2021-09-14 13:31:52 -07:00
AddressRange.cpp [lldb][NFC] Delete commented out code in AddressRange 2021-11-11 15:42:27 -08:00
AddressResolver.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
AddressResolverFileLine.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
CMakeLists.txt Added the ability to cache the finalized symbol tables subsequent debug sessions to start faster. 2021-12-16 09:59:55 -08:00
Communication.cpp [lldb] [Communication] Add a WriteAll() method that resumes writing 2021-10-26 12:45:45 +02:00
CoreProperties.td [lldb] Create a property to store the REPL language 2022-01-05 15:03:46 -08:00
DataFileCache.cpp Silence unused variable warning in release builds 2021-12-17 16:07:02 +01:00
Debugger.cpp [lldb] Create a property to store the REPL language 2022-01-05 15:03:46 -08:00
Declaration.cpp [lldb] Move and clean-up the Declaration class (NFC) 2021-05-04 16:34:44 +00:00
Disassembler.cpp [lldb] Remove ConstString from ABI, Architecture and Disassembler plugin names 2021-10-22 10:29:19 +02:00
DumpDataExtractor.cpp [lldb] Add option to show memory tags in memory read output 2022-01-26 14:40:39 +00:00
DumpRegisterValue.cpp
DynamicLoader.cpp Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names 2021-10-25 10:32:35 +02:00
EmulateInstruction.cpp Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names 2021-10-25 10:32:35 +02:00
FileLineResolver.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
FileSpecList.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
FormatEntity.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Highlighter.cpp
IOHandler.cpp [lldb][NFC] Remove never read member variable IOHandler::m_editing 2021-08-09 18:05:53 +02:00
IOHandlerCursesGUI.cpp Remove unused "using" (NFC) 2022-01-02 10:20:17 -08:00
Mangled.cpp [lldb] Fix PR52702 by fixing bool conversion of Mangled 2021-12-29 17:17:52 +08:00
Module.cpp Added the ability to cache the finalized symbol tables subsequent debug sessions to start faster. 2021-12-16 09:59:55 -08:00
ModuleChild.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ModuleList.cpp Added the ability to cache the finalized symbol tables subsequent debug sessions to start faster. 2021-12-16 09:59:55 -08:00
Opcode.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
PluginManager.cpp [lldb] Check if language is supported before creating a REPL instance 2021-12-14 12:05:35 -08:00
Progress.cpp Add a progress class that can track long running operations in LLDB. 2021-03-24 12:58:13 -07:00
RichManglingContext.cpp [lldb][NFC] Remove unused method RichManglingContext::IsFunction 2021-08-23 11:45:55 -07:00
SearchFilter.cpp [lldb][NFC] Use C++ versions of the deprecated C standard library headers 2021-05-26 12:46:12 +02:00
Section.cpp Add new key/value pairs to the module statistics for "statistics dump". 2021-10-26 15:09:31 -07:00
SourceLocationSpec.cpp [lldb/Core] Add SourceLocationSpec class (NFC) 2021-05-04 16:34:45 +00:00
SourceManager.cpp [lldb] Use a struct to pass function search options to Module::FindFunction 2021-08-05 10:18:14 -07:00
StreamAsynchronousIO.cpp
StreamFile.cpp [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat 2021-08-09 12:06:59 +02:00
UserSettingsController.cpp
Value.cpp [lldb] Use C++11 default member initializers 2021-06-09 09:43:13 -07:00
ValueObject.cpp [lldb] Print embedded nuls in char arrays (PR44649) 2021-10-14 09:50:40 +02:00
ValueObjectCast.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectChild.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectConstResult.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectConstResultCast.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectConstResultChild.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectConstResultImpl.cpp Remove unused variable. 2021-11-18 15:58:20 -08:00
ValueObjectDynamicValue.cpp Remove unused ValueObjectDynamicValue::SetOwningSP & backing ivar 2021-10-28 16:06:01 -07:00
ValueObjectList.cpp
ValueObjectMemory.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectRegister.cpp [lldb] Support querying registers via generic names without alt_names 2021-09-13 13:05:06 +02:00
ValueObjectSyntheticFilter.cpp [lldb][NFC] Cleanup ValueObject construction code 2021-02-23 09:39:18 +01:00
ValueObjectUpdater.cpp [lldb][NFC] Rename the second ValueObjectManager to ValueObjectUpdater and remove the dead code 2021-02-24 13:58:01 +01:00
ValueObjectVariable.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00