This revision was automatically updated to reflect the committed changes.
Closed by commit rL317411: Improve the posix core file triple detection 
(authored by tberghammer).

Repository:
  rL LLVM

https://reviews.llvm.org/D36046

Files:
  lldb/trunk/source/Core/ArchSpec.cpp
  lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp


Index: lldb/trunk/source/Core/ArchSpec.cpp
===================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp
+++ lldb/trunk/source/Core/ArchSpec.cpp
@@ -921,6 +921,9 @@
     m_core = other.GetCore();
     CoreUpdated(true);
   }
+  if (GetFlags() == 0) {
+    SetFlags(other.GetFlags());
+  }
 }
 
 bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
Index: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -724,15 +724,18 @@
 }
 
 ArchSpec ProcessElfCore::GetArchitecture() {
-  ObjectFileELF *core_file =
-      (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
   ArchSpec arch;
-  core_file->GetArchitecture(arch);
+  m_core_module_sp->GetObjectFile()->GetArchitecture(arch);
 
   ArchSpec target_arch = GetTarget().GetArchitecture();
-  
-  if (target_arch.IsMIPS())
+  arch.MergeFrom(target_arch);
+
+  // On MIPS there is no way to differentiate betwenn 32bit and 64bit core 
files
+  // and this information can't be merged in from the target arch so we fail
+  // back to unconditionally returning the target arch in this config.
+  if (target_arch.IsMIPS()) {
     return target_arch;
+  }
 
   return arch;
 }


Index: lldb/trunk/source/Core/ArchSpec.cpp
===================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp
+++ lldb/trunk/source/Core/ArchSpec.cpp
@@ -921,6 +921,9 @@
     m_core = other.GetCore();
     CoreUpdated(true);
   }
+  if (GetFlags() == 0) {
+    SetFlags(other.GetFlags());
+  }
 }
 
 bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
Index: lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -724,15 +724,18 @@
 }
 
 ArchSpec ProcessElfCore::GetArchitecture() {
-  ObjectFileELF *core_file =
-      (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
   ArchSpec arch;
-  core_file->GetArchitecture(arch);
+  m_core_module_sp->GetObjectFile()->GetArchitecture(arch);
 
   ArchSpec target_arch = GetTarget().GetArchitecture();
-  
-  if (target_arch.IsMIPS())
+  arch.MergeFrom(target_arch);
+
+  // On MIPS there is no way to differentiate betwenn 32bit and 64bit core files
+  // and this information can't be merged in from the target arch so we fail
+  // back to unconditionally returning the target arch in this config.
+  if (target_arch.IsMIPS()) {
     return target_arch;
+  }
 
   return arch;
 }
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to