summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorVadim Chugunov <vadimcn@gmail.com>2017-09-16 03:53:13 +0000
committerVadim Chugunov <vadimcn@gmail.com>2017-09-16 03:53:13 +0000
commit3293b9d42ca2d27a077242f13f1caeebf3dd7be1 (patch)
tree99fac9e6628690fd1ba0af767799691bf59ded92 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent011aec2cf17f2fca7258d3ab21772873d539111f (diff)
downloadbcm5719-llvm-3293b9d42ca2d27a077242f13f1caeebf3dd7be1.tar.gz
bcm5719-llvm-3293b9d42ca2d27a077242f13f1caeebf3dd7be1.zip
Fix compatibility with OpenOCD debug stub.
OpenOCD sends register classes as two separate <feature> nodes, fixed parser to process both of them. OpenOCD returns "l" in response to "qfThreadInfo", so IsUnsupportedResponse() was false and we were ending up without any threads in the process. I think it's reasonable to assume that there's always at least one thread. llvm-svn: 313442
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index be11dd9bc7e..383cffbaac7 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4168,7 +4168,6 @@ struct GdbServerTargetInfo {
std::string osabi;
stringVec includes;
RegisterSetMap reg_set_map;
- XMLNode feature_node;
};
bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
@@ -4374,8 +4373,8 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
XMLNode target_node = xml_document.GetRootElement("target");
if (target_node) {
- XMLNode feature_node;
- target_node.ForEachChildElement([&target_info, &feature_node](
+ std::vector<XMLNode> feature_nodes;
+ target_node.ForEachChildElement([&target_info, &feature_nodes](
const XMLNode &node) -> bool {
llvm::StringRef name = node.GetName();
if (name == "architecture") {
@@ -4387,7 +4386,7 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
if (!href.empty())
target_info.includes.push_back(href.str());
} else if (name == "feature") {
- feature_node = node;
+ feature_nodes.push_back(node);
} else if (name == "groups") {
node.ForEachChildElementWithName(
"group", [&target_info](const XMLNode &node) -> bool {
@@ -4423,7 +4422,7 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
// set the Target's architecture yet, so the ABI is also potentially
// incorrect.
ABISP abi_to_use_sp = ABI::FindPlugin(shared_from_this(), arch_to_use);
- if (feature_node) {
+ for (auto &feature_node : feature_nodes) {
ParseRegisters(feature_node, target_info, this->m_register_info,
abi_to_use_sp, cur_reg_num, reg_offset);
}
OpenPOWER on IntegriCloud