llvm-project/lldb/source/Core
Pavel Labath 16064d354a Re-land: [lldb] Use vFlash commands when writing to target's flash memory regions
The difference between this and the previous patch is that now we use
ELF physical addresses only for loading objects into the target (and the
rest of the module load address logic still uses virtual addresses).

Summary:
When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region.  A bare metal target may have this kind of setup.

- Update ObjectFileELF to set load addresses using physical addresses.  A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address.
- Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications
- Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region

Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html

Reviewers: clayborg, labath

Reviewed By: labath

Subscribers: llvm-commits, arichardson, emaste, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D42145
Patch by Owen Shaw <llvm@owenpshaw.net>.

llvm-svn: 327970
2018-03-20 11:56:24 +00:00
..
Address.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
AddressRange.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
AddressResolver.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
AddressResolverFileLine.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
AddressResolverName.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
Broadcaster.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
CMakeLists.txt Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
Communication.cpp Move Connection and IOObject interfaces to Utility module 2017-06-27 10:33:14 +00:00
Debugger.cpp Rename clang.modules-cache-path to symbols.clang-modules-cache-path 2018-03-10 01:11:25 +00:00
Disassembler.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
DumpDataExtractor.cpp [lldb][PPC64] Fixed long double variables dump 2018-01-17 15:11:20 +00:00
DynamicLoader.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
EmulateInstruction.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
Event.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
FileLineResolver.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
FileSpecList.cpp [Core] Garbage collect dead code untouched in years. NFCI. 2017-11-18 00:34:09 +00:00
FormatEntity.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
IOHandler.cpp include locale.h in IOHandler.cpp 2018-03-13 15:55:00 +00:00
Listener.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
Mangled.cpp Move Timer and TraceOptions from Core to Utility 2017-06-29 14:32:17 +00:00
Module.cpp Re-land: [lldb] Use vFlash commands when writing to target's flash memory regions 2018-03-20 11:56:24 +00:00
ModuleChild.cpp *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
ModuleList.cpp Introduce a setting to disable Spotlight while running the test suite 2018-03-12 20:52:36 +00:00
Opcode.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
PluginManager.cpp Move StopInfoOverride callback to the new architecture plugin 2017-10-25 21:05:31 +00:00
RegisterValue.cpp Add check for self-assignment. NFC 2017-11-14 18:19:41 +00:00
Scalar.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
SearchFilter.cpp Update StructuredData::String to return StringRefs. 2017-05-12 05:49:54 +00:00
Section.cpp Improve FreeBSD kernel debugging 2017-10-02 14:35:07 +00:00
SourceManager.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
State.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
StreamAsynchronousIO.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
StreamFile.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
UserSettingsController.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
Value.cpp Add check for self-assignment. NFC 2017-11-14 18:19:41 +00:00
ValueObject.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectCast.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectChild.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectConstResult.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectConstResultCast.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectConstResultChild.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectConstResultImpl.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectDynamicValue.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
ValueObjectList.cpp iwyu fixes for lldbCore. 2017-04-06 21:28:29 +00:00
ValueObjectMemory.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
ValueObjectRegister.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectSyntheticFilter.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ValueObjectVariable.cpp Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00