[Lldb-commits] [PATCH] D19303: Maintain register numbering across xml include features

Francis Ricci via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 25 14:09:51 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL267468: Maintain register numbering across xml include features (authored by fjricci).

Changed prior to commit:
  http://reviews.llvm.org/D19303?vs=54298&id=54904#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19303

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -4372,14 +4372,11 @@
 };
 
 bool
-ParseRegisters (XMLNode feature_node, GdbServerTargetInfo &target_info, GDBRemoteDynamicRegisterInfo &dyn_reg_info, ABISP abi_sp)
+ParseRegisters (XMLNode feature_node, GdbServerTargetInfo &target_info, GDBRemoteDynamicRegisterInfo &dyn_reg_info, ABISP abi_sp, uint32_t &cur_reg_num, uint32_t &reg_offset)
 {
     if (!feature_node)
         return false;
 
-    uint32_t cur_reg_num = 0;
-    uint32_t reg_offset = 0;
-
     feature_node.ForEachChildElementWithName("reg", [&target_info, &dyn_reg_info, &cur_reg_num, &reg_offset, &abi_sp](const XMLNode &reg_node) -> bool {
         std::string gdb_group;
         std::string gdb_type;
@@ -4635,12 +4632,16 @@
                 return true; // Keep iterating through all children of the target_node
             });
 
+            // Initialize these outside of ParseRegisters, since they should not be reset inside each include feature
+            uint32_t cur_reg_num = 0;
+            uint32_t reg_offset = 0;
+
             // Don't use Process::GetABI, this code gets called from DidAttach, and in that context we haven't
             // set the Target's architecture yet, so the ABI is also potentially incorrect.
             ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
             if (feature_node)
             {
-                ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp);
+                ParseRegisters(feature_node, target_info, this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
             }
 
             for (const auto &include : target_info.includes)
@@ -4658,7 +4659,7 @@
                 XMLNode include_feature_node = include_xml_document.GetRootElement("feature");
                 if (include_feature_node)
                 {
-                    ParseRegisters(include_feature_node, target_info, this->m_register_info, abi_to_use_sp);
+                    ParseRegisters(include_feature_node, target_info, this->m_register_info, abi_to_use_sp, cur_reg_num, reg_offset);
                 }
             }
             this->m_register_info.Finalize(arch_to_use);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19303.54904.patch
Type: text/x-patch
Size: 2418 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20160425/fadbe278/attachment.bin>


More information about the lldb-commits mailing list