nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, ovyalov.
nitesh.jain added subscribers: jaydeep, bhushan, sagar, mohit.bhakkad, 
lldb-commits.
nitesh.jain set the repository for this revision to rL LLVM.

The ArchSpec::m_flags will be set based on ELF flag ABI.

Repository:
  rL LLVM

http://reviews.llvm.org/D18858

Files:
  include/lldb/Core/ArchSpec.h
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1637,13 +1637,27 @@
                         }
                     }
                     // Settings appropriate ArchSpec ABI Flags
-                    if (header.e_flags & llvm::ELF::EF_MIPS_ABI2)
+                    switch(header.e_flags & llvm::ELF::EF_MIPS_ABI)
                     {
-                        arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
-                    }
-                    else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32)
-                    {
-                         arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;
+                        case llvm::ELF::EF_MIPS_ABI_O32:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;
+                            break;
+                        case EF_MIPS_ABI_O64:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_O64;
+                            break;
+                        case EF_MIPS_ABI_EABI32:
+                            arch_flags |= 
lldb_private::ArchSpec::eMIPSABI_EABI32;
+                            break;
+                        case EF_MIPS_ABI_EABI64:
+                            arch_flags |= 
lldb_private::ArchSpec::eMIPSABI_EABI64;
+                            break;
+                        default:
+                            // ABI Mask doesn't cover N32 and N64 ABI.
+                            if (header.e_ident[EI_CLASS] == 
llvm::ELF::ELFCLASS64)
+                                arch_flags |= 
lldb_private::ArchSpec::eMIPSABI_N64;
+                            else if (header.e_flags && llvm::ELF::EF_MIPS_ABI2)
+                                arch_flags |= 
lldb_private::ArchSpec::eMIPSABI_N32;
+                                break;                    
                     }
                     arch_spec.SetFlags (arch_flags);
                 }
Index: include/lldb/Core/ArchSpec.h
===================================================================
--- include/lldb/Core/ArchSpec.h
+++ include/lldb/Core/ArchSpec.h
@@ -69,6 +69,9 @@
         eMIPSABI_O32        = 0x00002000,
         eMIPSABI_N32        = 0x00004000,
         eMIPSABI_N64        = 0x00008000,
+        eMIPSABI_O64        = 0x00020000,
+        eMIPSABI_EABI32     = 0x00040000,
+        eMIPSABI_EABI64     = 0x00080000,
         eMIPSABI_mask       = 0x000ff000
     };
 


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1637,13 +1637,27 @@
                         }
                     }
                     // Settings appropriate ArchSpec ABI Flags
-                    if (header.e_flags & llvm::ELF::EF_MIPS_ABI2)
+                    switch(header.e_flags & llvm::ELF::EF_MIPS_ABI)
                     {
-                        arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
-                    }
-                    else if (header.e_flags & llvm::ELF::EF_MIPS_ABI_O32)
-                    {
-                         arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;
+                        case llvm::ELF::EF_MIPS_ABI_O32:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_O32;
+                            break;
+                        case EF_MIPS_ABI_O64:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_O64;
+                            break;
+                        case EF_MIPS_ABI_EABI32:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_EABI32;
+                            break;
+                        case EF_MIPS_ABI_EABI64:
+                            arch_flags |= lldb_private::ArchSpec::eMIPSABI_EABI64;
+                            break;
+                        default:
+                            // ABI Mask doesn't cover N32 and N64 ABI.
+                            if (header.e_ident[EI_CLASS] == llvm::ELF::ELFCLASS64)
+                                arch_flags |= lldb_private::ArchSpec::eMIPSABI_N64;
+                            else if (header.e_flags && llvm::ELF::EF_MIPS_ABI2)
+                                arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32;
+                                break;                    
                     }
                     arch_spec.SetFlags (arch_flags);
                 }
Index: include/lldb/Core/ArchSpec.h
===================================================================
--- include/lldb/Core/ArchSpec.h
+++ include/lldb/Core/ArchSpec.h
@@ -69,6 +69,9 @@
         eMIPSABI_O32        = 0x00002000,
         eMIPSABI_N32        = 0x00004000,
         eMIPSABI_N64        = 0x00008000,
+        eMIPSABI_O64        = 0x00020000,
+        eMIPSABI_EABI32     = 0x00040000,
+        eMIPSABI_EABI64     = 0x00080000,
         eMIPSABI_mask       = 0x000ff000
     };
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to