[Lldb-commits] [PATCH] Initial patch for supporting Hexagon DSP

Greg Clayton gclayton at apple.com
Tue Feb 18 11:12:30 PST 2014


The only thing I don't know about is this:

Index: source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
===================================================================
--- source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
+++ source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
@@ -31,7 +31,7 @@
    {
        const llvm::Triple &triple_ref = process->GetTarget().GetArchitecture().GetTriple();
        const llvm::Triple::OSType os_type = triple_ref.getOS();
-        if ((os_type == llvm::Triple::UnknownOS))
+        if ((os_type == llvm::Triple::UnknownOS) || (os_type == llvm::Triple::Win32))
            create = true;
    }


We don't want the DynamicLoaderStatic being used for win32 at all times. You should be specifying your arch and triples as:

(lldb) target create --arch=hexagon-unknown-unknown /path/to/hexagon/binary/a.out

This means there is no OS and then the DynamicLoaderStatic will be chosen correctly.


On Feb 18, 2014, at 6:03 AM, Deepak Panickal <deepak2427 at gmail.com> wrote:

> - Have added the architecture variants
> - Also updated the Static Loader
> - More commits to follow
> 
> http://llvm-reviews.chandlerc.com/D2820
> 
> Files:
>  include/lldb/Core/ArchSpec.h
>  source/Core/ArchSpec.cpp
>  source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
>  source/Plugins/Platform/Linux/PlatformLinux.cpp
>  source/Plugins/Platform/Windows/PlatformWindows.cpp
>  source/Target/Thread.cpp
> 
> Index: include/lldb/Core/ArchSpec.h
> ===================================================================
> --- include/lldb/Core/ArchSpec.h
> +++ include/lldb/Core/ArchSpec.h
> @@ -92,6 +92,10 @@
> 
>         eCore_x86_64_x86_64,
>         eCore_x86_64_x86_64h, // Haswell enabled x86_64
> +        eCore_hexagon_generic,
> +        eCore_hexagon_hexagonv4,
> +        eCore_hexagon_hexagonv5,
> +
>         eCore_uknownMach32,
>         eCore_uknownMach64,
>         kNumCores,
> @@ -103,6 +107,7 @@
>         kCore_ppc_any,
>         kCore_ppc64_any,
>         kCore_x86_32_any,
> +        kCore_hexagon_any,
> 
>         kCore_arm_first     = eCore_arm_generic,
>         kCore_arm_last      = eCore_arm_xscale,
> @@ -117,7 +122,10 @@
>         kCore_ppc64_last    = eCore_ppc64_ppc970_64,
> 
>         kCore_x86_32_first  = eCore_x86_32_i386,
> -        kCore_x86_32_last   = eCore_x86_32_i486sx
> +        kCore_x86_32_last   = eCore_x86_32_i486sx,
> +
> +        kCore_hexagon_first  = eCore_hexagon_generic,
> +        kCore_hexagon_last   = eCore_hexagon_hexagonv5
>     };
> 
>     //------------------------------------------------------------------
> Index: source/Core/ArchSpec.cpp
> ===================================================================
> --- source/Core/ArchSpec.cpp
> +++ source/Core/ArchSpec.cpp
> @@ -105,6 +105,10 @@
> 
>     { eByteOrderLittle, 8, 1, 15, llvm::Triple::x86_64 , ArchSpec::eCore_x86_64_x86_64  , "x86_64"    },
>     { eByteOrderLittle, 8, 1, 15, llvm::Triple::x86_64 , ArchSpec::eCore_x86_64_x86_64h , "x86_64h"   },
> +    { eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon , ArchSpec::eCore_hexagon_generic,    "hexagon"   },
> +    { eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon , ArchSpec::eCore_hexagon_hexagonv4,  "hexagonv4" },
> +    { eByteOrderLittle, 4, 4, 4, llvm::Triple::hexagon , ArchSpec::eCore_hexagon_hexagonv5,  "hexagonv5" },
> +
>     { eByteOrderLittle, 4, 4, 4 , llvm::Triple::UnknownArch , ArchSpec::eCore_uknownMach32  , "unknown-mach-32" },
>     { eByteOrderLittle, 8, 4, 4 , llvm::Triple::UnknownArch , ArchSpec::eCore_uknownMach64  , "unknown-mach-64" }
> };
> @@ -237,7 +241,8 @@
>     { ArchSpec::eCore_arm_generic     , llvm::ELF::EM_ARM    , LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }, // ARM
>     { ArchSpec::eCore_sparc9_generic  , llvm::ELF::EM_SPARCV9, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }, // SPARC V9
>     { ArchSpec::eCore_x86_64_x86_64   , llvm::ELF::EM_X86_64 , LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }, // AMD64
> -    { ArchSpec::eCore_mips64          , llvm::ELF::EM_MIPS   , LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }  // MIPS
> +    { ArchSpec::eCore_mips64          , llvm::ELF::EM_MIPS   , LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }, // MIPS
> +    { ArchSpec::eCore_hexagon_generic , llvm::ELF::EM_HEXAGON, LLDB_INVALID_CPUTYPE, 0xFFFFFFFFu, 0xFFFFFFFFu }  // HEXAGON
> };
> 
> static const ArchDefinition g_elf_arch_def = {
> @@ -919,6 +924,10 @@
>             if (core2 == ArchSpec::eCore_arm_armv7)
>                 return true;
>         }
> +
> +    case ArchSpec::kCore_hexagon_any:
> +        if ((core2 >= ArchSpec::kCore_hexagon_first && core2 <= ArchSpec::kCore_hexagon_last) || (core2 == ArchSpec::kCore_hexagon_any))
> +            return true;
>         break;
> 
>     case ArchSpec::eCore_arm_armv7m:
> Index: source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
> ===================================================================
> --- source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
> +++ source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
> @@ -31,7 +31,7 @@
>     {
>         const llvm::Triple &triple_ref = process->GetTarget().GetArchitecture().GetTriple();
>         const llvm::Triple::OSType os_type = triple_ref.getOS();
> -        if ((os_type == llvm::Triple::UnknownOS))
> +        if ((os_type == llvm::Triple::UnknownOS) || (os_type == llvm::Triple::Win32))
>             create = true;
>     }
> 
> Index: source/Plugins/Platform/Linux/PlatformLinux.cpp
> ===================================================================
> --- source/Plugins/Platform/Linux/PlatformLinux.cpp
> +++ source/Plugins/Platform/Linux/PlatformLinux.cpp
> @@ -397,6 +397,8 @@
>             trap_opcode_size = sizeof(g_i386_breakpoint_opcode);
>         }
>         break;
> +    case ArchSpec::eCore_hexagon_generic:
> +        return 0;
>     }
> 
>     if (bp_site->SetTrapOpcode(trap_opcode, trap_opcode_size))
> Index: source/Plugins/Platform/Windows/PlatformWindows.cpp
> ===================================================================
> --- source/Plugins/Platform/Windows/PlatformWindows.cpp
> +++ source/Plugins/Platform/Windows/PlatformWindows.cpp
> @@ -291,6 +291,8 @@
>         }
>         break;
> 
> +    case ArchSpec::eCore_hexagon_generic:
> +        return 0;
>     default:
>         llvm_unreachable("Unhandled architecture in PlatformWindows::GetSoftwareBreakpointTrapOpcode()");
>         break;
> Index: source/Target/Thread.cpp
> ===================================================================
> --- source/Target/Thread.cpp
> +++ source/Target/Thread.cpp
> @@ -2023,6 +2023,7 @@
>             case llvm::Triple::arm:
>             case llvm::Triple::thumb:
>             case llvm::Triple::mips64:
> +            case llvm::Triple::hexagon:
>                 m_unwinder_ap.reset (new UnwindLLDB (*this));
>                 break;
> <D2820.1.patch>_______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits




More information about the lldb-commits mailing list