summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/XML.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-03-20 11:56:24 +0000
committerPavel Labath <labath@google.com>2018-03-20 11:56:24 +0000
commit16064d354afba2cbfd8826c96e8f3b575977df9d (patch)
treeb486a229b286d08601731e166ce88f45bb2f2b2d /lldb/source/Host/common/XML.cpp
parent3ce2d7f270380bd7573611f6211b8f4ae6af842d (diff)
downloadbcm5719-llvm-16064d354afba2cbfd8826c96e8f3b575977df9d.tar.gz
bcm5719-llvm-16064d354afba2cbfd8826c96e8f3b575977df9d.zip
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
Diffstat (limited to 'lldb/source/Host/common/XML.cpp')
-rw-r--r--lldb/source/Host/common/XML.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Host/common/XML.cpp b/lldb/source/Host/common/XML.cpp
index c3169bd6e08..42e3d4b6e92 100644
--- a/lldb/source/Host/common/XML.cpp
+++ b/lldb/source/Host/common/XML.cpp
@@ -151,6 +151,18 @@ llvm::StringRef XMLNode::GetAttributeValue(const char *name,
return llvm::StringRef();
}
+bool XMLNode::GetAttributeValueAsUnsigned(const char *name, uint64_t &value,
+ uint64_t fail_value, int base) const {
+#if defined(LIBXML2_DEFINED)
+ llvm::StringRef str_value = GetAttributeValue(name, "");
+#else
+ llvm::StringRef str_value;
+#endif
+ bool success = false;
+ value = StringConvert::ToUInt64(str_value.data(), fail_value, base, &success);
+ return success;
+}
+
void XMLNode::ForEachChildNode(NodeCallback const &callback) const {
#if defined(LIBXML2_DEFINED)
if (IsValid())
OpenPOWER on IntegriCloud