llvm-project/lldb/source/Host
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
..
android *** This commit represents a complete reformatting of the LLDB source code 2016-09-06 20:57:50 +00:00
common Re-land: [lldb] Use vFlash commands when writing to target's flash memory regions 2018-03-20 11:56:24 +00:00
freebsd Delete some unused #includes of CleanUp.h, NFC 2018-02-23 00:29:40 +00:00
linux [Host] Respect LLVM_LIBDIR_SUFFIX when looking for LLDB plugins on Linux 2018-01-29 18:25:06 +00:00
macosx Introduce a setting to disable Spotlight while running the test suite 2018-03-12 20:52:36 +00:00
netbsd Delete some unused #includes of CleanUp.h, NFC 2018-02-23 00:29:40 +00:00
openbsd Delete some unused #includes of CleanUp.h, NFC 2018-02-23 00:29:40 +00:00
posix HostThreadPosix::Cancel: remove android-specific implementation 2018-03-06 12:46:05 +00:00
windows Fix windows and freebsd builds for r322174 (Environment) 2018-01-10 12:25:48 +00:00
CMakeLists.txt Remove ObjectFile usage from HostLinux::GetProcessInfo 2018-01-29 10:46:00 +00:00