forked from OSchip/llvm-project
88fdce5be6
Addresses on AArch64 can have top byte tags, memory tags and pointer authentication signatures in the upper bits. While testing memory tagging I found that memory read couldn't read a range if the two addresses had different tags. The same could apply to signed pointers given the right circumstance. (lldb) memory read mte_buf_alt_tag mte_buf+16 error: end address (0x900fffff7ff8010) must be greater than the start address (0xa00fffff7ff8000). Or it would try to read a lot more memory than expected. (lldb) memory read mte_buf mte_buf_alt_tag+16 error: Normally, 'memory read' will not read over 1024 bytes of data. error: Please use --force to override this restriction just once. error: or set target.max-memory-read-size if you will often need a larger limit. Fix this by removing non address bits before we calculate the read range. A test is added for AArch64 Linux that confirms this by using the top byte ignore feature. This means that if you do read with a tagged pointer the output does not include those tags. This is potentially confusing but I think overall it's better that we don't pretend that we're reading memory from a range that the process is unable to map. (lldb) p ptr1 (char *) $4 = 0x3400fffffffff140 "\x80\xf1\xff\xff\xff\xff" (lldb) p ptr2 (char *) $5 = 0x5600fffffffff140 "\x80\xf1\xff\xff\xff\xff" (lldb) memory read ptr1 ptr2+16 0xfffffffff140: 80 f1 ff ff ff ff 00 00 38 70 bc f7 ff ff 00 00 ........8p...... Reviewed By: omjavaid, danielkiss Differential Revision: https://reviews.llvm.org/D103626 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CommandCompletions.cpp | ||
CommandObjectApropos.cpp | ||
CommandObjectApropos.h | ||
CommandObjectBreakpoint.cpp | ||
CommandObjectBreakpoint.h | ||
CommandObjectBreakpointCommand.cpp | ||
CommandObjectBreakpointCommand.h | ||
CommandObjectCommands.cpp | ||
CommandObjectCommands.h | ||
CommandObjectDisassemble.cpp | ||
CommandObjectDisassemble.h | ||
CommandObjectExpression.cpp | ||
CommandObjectExpression.h | ||
CommandObjectFrame.cpp | ||
CommandObjectFrame.h | ||
CommandObjectGUI.cpp | ||
CommandObjectGUI.h | ||
CommandObjectHelp.cpp | ||
CommandObjectHelp.h | ||
CommandObjectLanguage.cpp | ||
CommandObjectLanguage.h | ||
CommandObjectLog.cpp | ||
CommandObjectLog.h | ||
CommandObjectMemory.cpp | ||
CommandObjectMemory.h | ||
CommandObjectMemoryTag.cpp | ||
CommandObjectMemoryTag.h | ||
CommandObjectMultiword.cpp | ||
CommandObjectPlatform.cpp | ||
CommandObjectPlatform.h | ||
CommandObjectPlugin.cpp | ||
CommandObjectPlugin.h | ||
CommandObjectProcess.cpp | ||
CommandObjectProcess.h | ||
CommandObjectQuit.cpp | ||
CommandObjectQuit.h | ||
CommandObjectRegexCommand.cpp | ||
CommandObjectRegexCommand.h | ||
CommandObjectRegister.cpp | ||
CommandObjectRegister.h | ||
CommandObjectReproducer.cpp | ||
CommandObjectReproducer.h | ||
CommandObjectScript.cpp | ||
CommandObjectScript.h | ||
CommandObjectSession.cpp | ||
CommandObjectSession.h | ||
CommandObjectSettings.cpp | ||
CommandObjectSettings.h | ||
CommandObjectSource.cpp | ||
CommandObjectSource.h | ||
CommandObjectStats.cpp | ||
CommandObjectStats.h | ||
CommandObjectTarget.cpp | ||
CommandObjectTarget.h | ||
CommandObjectThread.cpp | ||
CommandObjectThread.h | ||
CommandObjectThreadUtil.cpp | ||
CommandObjectThreadUtil.h | ||
CommandObjectTrace.cpp | ||
CommandObjectTrace.h | ||
CommandObjectType.cpp | ||
CommandObjectType.h | ||
CommandObjectVersion.cpp | ||
CommandObjectVersion.h | ||
CommandObjectWatchpoint.cpp | ||
CommandObjectWatchpoint.h | ||
CommandObjectWatchpointCommand.cpp | ||
CommandObjectWatchpointCommand.h | ||
CommandOptionsProcessLaunch.cpp | ||
CommandOptionsProcessLaunch.h | ||
Options.td | ||
OptionsBase.td |