diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-04-25 21:05:07 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-04-25 21:05:07 +0000 |
| commit | ffc922e3891002f2668ca8cd9a38f250c7532a93 (patch) | |
| tree | a7e86f22750e668a02fb69f00f259650caaf04ac /lldb/source | |
| parent | 50686bf55c340c5cf190745ed92efb2428b76b76 (diff) | |
| download | bcm5719-llvm-ffc922e3891002f2668ca8cd9a38f250c7532a93.tar.gz bcm5719-llvm-ffc922e3891002f2668ca8cd9a38f250c7532a93.zip | |
More moving things around for the unwind plan and assembly unwind plug-ins.
llvm-svn: 130154
Diffstat (limited to 'lldb/source')
| -rw-r--r-- | lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.cpp (renamed from lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.cpp) | 0 | ||||
| -rw-r--r-- | lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.h (renamed from lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.h) | 0 | ||||
| -rw-r--r-- | lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.cpp (renamed from lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.cpp) | 0 | ||||
| -rw-r--r-- | lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.h (renamed from lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.h) | 0 | ||||
| -rw-r--r-- | lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp | 108 | ||||
| -rw-r--r-- | lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h | 82 | ||||
| -rw-r--r-- | lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.cpp (renamed from lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.cpp) | 36 | ||||
| -rw-r--r-- | lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.h (renamed from lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.h) | 14 | ||||
| -rw-r--r-- | lldb/source/lldb.cpp | 13 |
9 files changed, 223 insertions, 30 deletions
diff --git a/lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.cpp b/lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.cpp index de8b5f8ff67..de8b5f8ff67 100644 --- a/lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.cpp +++ b/lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.cpp diff --git a/lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.h b/lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.h index 7938ef05978..7938ef05978 100644 --- a/lldb/source/Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.h +++ b/lldb/source/Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.h diff --git a/lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.cpp b/lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.cpp index 915dbf9bb7e..915dbf9bb7e 100644 --- a/lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.cpp +++ b/lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.cpp diff --git a/lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.h b/lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.h index 70e1d202672..70e1d202672 100644 --- a/lldb/source/Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.h +++ b/lldb/source/Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.h diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp new file mode 100644 index 00000000000..966b526d6c0 --- /dev/null +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp @@ -0,0 +1,108 @@ +//===-- UnwindAssemblyInstEmulation.cpp --------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "UnwindAssemblyInstEmulation.h" + +#include "llvm-c/EnhancedDisassembly.h" + +#include "lldb/Core/Address.h" +#include "lldb/Core/Error.h" +#include "lldb/Core/ArchSpec.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/ExecutionContext.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/RegisterContext.h" +#include "lldb/Target/Thread.h" +#include "lldb/Target/Target.h" +#include "lldb/Target/UnwindAssemblyProfiler.h" + +using namespace lldb; +using namespace lldb_private; + + + +//----------------------------------------------------------------------------------------------- +// UnwindAssemblyParser_x86 method definitions +//----------------------------------------------------------------------------------------------- + +bool +UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly (AddressRange& func, Thread& thread, UnwindPlan& unwind_plan) +{ + return false; +} + +bool +UnwindAssemblyInstEmulation::GetFastUnwindPlan (AddressRange& func, Thread& thread, UnwindPlan &unwind_plan) +{ + return false; +} + +bool +UnwindAssemblyInstEmulation::FirstNonPrologueInsn (AddressRange& func, Target& target, Thread* thread, Address& first_non_prologue_insn) +{ + return false; +} + +UnwindAssemblyProfiler * +UnwindAssemblyInstEmulation::CreateInstance (const ArchSpec &arch) +{ + return NULL; +} + + +//------------------------------------------------------------------ +// PluginInterface protocol in UnwindAssemblyParser_x86 +//------------------------------------------------------------------ + +const char * +UnwindAssemblyInstEmulation::GetPluginName() +{ + return "UnwindAssemblyInstEmulation"; +} + +const char * +UnwindAssemblyInstEmulation::GetShortPluginName() +{ + return "unwindassembly.inst-emulation"; +} + + +uint32_t +UnwindAssemblyInstEmulation::GetPluginVersion() +{ + return 1; +} + +void +UnwindAssemblyInstEmulation::Initialize() +{ + PluginManager::RegisterPlugin (GetPluginNameStatic(), + GetPluginDescriptionStatic(), + CreateInstance); +} + +void +UnwindAssemblyInstEmulation::Terminate() +{ + PluginManager::UnregisterPlugin (CreateInstance); +} + + +const char * +UnwindAssemblyInstEmulation::GetPluginNameStatic() +{ + return "UnwindAssemblyInstEmulation"; +} + +const char * +UnwindAssemblyInstEmulation::GetPluginDescriptionStatic() +{ + return "Instruction emulation based unwind information."; +} diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h new file mode 100644 index 00000000000..773c120a228 --- /dev/null +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -0,0 +1,82 @@ +//===-- UnwindAssemblyInstEmulation.h ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef liblldb_UnwindAssemblyInstEmulation_h_ +#define liblldb_UnwindAssemblyInstEmulation_h_ + +#include "lldb/lldb-private.h" +#include "lldb/Target/UnwindAssemblyProfiler.h" +#include "lldb/Target/Thread.h" + +class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssemblyProfiler +{ +public: + + virtual + ~UnwindAssemblyInstEmulation () + { + } + + virtual bool + GetNonCallSiteUnwindPlanFromAssembly (lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan& unwind_plan); + + virtual bool + GetFastUnwindPlan (lldb_private::AddressRange& func, + lldb_private::Thread& thread, + lldb_private::UnwindPlan &unwind_plan); + + // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch). + virtual bool + FirstNonPrologueInsn (lldb_private::AddressRange& func, + lldb_private::Target& target, + lldb_private::Thread* thread, + lldb_private::Address& first_non_prologue_insn); + + static lldb_private::UnwindAssemblyProfiler * + CreateInstance (const lldb_private::ArchSpec &arch); + + + //------------------------------------------------------------------ + // PluginInterface protocol + //------------------------------------------------------------------ + static void + Initialize(); + + static void + Terminate(); + + static const char * + GetPluginNameStatic(); + + static const char * + GetPluginDescriptionStatic(); + + virtual const char * + GetPluginName(); + + virtual const char * + GetShortPluginName(); + + virtual uint32_t + GetPluginVersion(); + +private: + + // Call CreateInstance to get an instance of this class + UnwindAssemblyInstEmulation(int cpu) : + lldb_private::UnwindAssemblyProfiler(), m_cpu(cpu) + { + } + + int m_cpu; +}; + +#endif // liblldb_UnwindAssemblyInstEmulation_h_ diff --git a/lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.cpp index 6f6baa8ee22..b1738332264 100644 --- a/lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.cpp +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.cpp @@ -1,4 +1,4 @@ -//===-- UnwindAssemblyProfiler-x86.cpp --------------------------*- C++ -*-===// +//===-- UnwindAssemblyx86.cpp -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "UnwindAssemblyProfiler-x86.h" +#include "UnwindAssemblyx86.h" #include "llvm-c/EnhancedDisassembly.h" @@ -819,34 +819,34 @@ AssemblyParse_x86::find_first_non_prologue_insn (Address &address) //----------------------------------------------------------------------------------------------- bool -UnwindAssemblyProfiler_x86::GetNonCallSiteUnwindPlanFromAssembly (AddressRange& func, Thread& thread, UnwindPlan& unwind_plan) +UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly (AddressRange& func, Thread& thread, UnwindPlan& unwind_plan) { AssemblyParse_x86 asm_parse(thread.GetProcess().GetTarget(), &thread, m_cpu, func); return asm_parse.get_non_call_site_unwind_plan (unwind_plan); } bool -UnwindAssemblyProfiler_x86::GetFastUnwindPlan (AddressRange& func, Thread& thread, UnwindPlan &unwind_plan) +UnwindAssembly_x86::GetFastUnwindPlan (AddressRange& func, Thread& thread, UnwindPlan &unwind_plan) { AssemblyParse_x86 asm_parse(thread.GetProcess().GetTarget(), &thread, m_cpu, func); return asm_parse.get_fast_unwind_plan (func, unwind_plan); } bool -UnwindAssemblyProfiler_x86::FirstNonPrologueInsn (AddressRange& func, Target& target, Thread* thread, Address& first_non_prologue_insn) +UnwindAssembly_x86::FirstNonPrologueInsn (AddressRange& func, Target& target, Thread* thread, Address& first_non_prologue_insn) { AssemblyParse_x86 asm_parse(target, thread, m_cpu, func); return asm_parse.find_first_non_prologue_insn (first_non_prologue_insn); } UnwindAssemblyProfiler * -UnwindAssemblyProfiler_x86::CreateInstance (const ArchSpec &arch) +UnwindAssembly_x86::CreateInstance (const ArchSpec &arch) { const llvm::Triple::ArchType cpu = arch.GetMachine (); if (cpu == llvm::Triple::x86) - return new UnwindAssemblyProfiler_x86 (k_i386); + return new UnwindAssembly_x86 (k_i386); else if (cpu == llvm::Triple::x86_64) - return new UnwindAssemblyProfiler_x86 (k_x86_64); + return new UnwindAssembly_x86 (k_x86_64); return NULL; } @@ -856,26 +856,26 @@ UnwindAssemblyProfiler_x86::CreateInstance (const ArchSpec &arch) //------------------------------------------------------------------ const char * -UnwindAssemblyProfiler_x86::GetPluginName() +UnwindAssembly_x86::GetPluginName() { - return "UnwindAssemblyProfiler_x86"; + return "UnwindAssembly_x86"; } const char * -UnwindAssemblyProfiler_x86::GetShortPluginName() +UnwindAssembly_x86::GetShortPluginName() { - return "unwindassemblyprofiler.x86"; + return "unwindassembly.x86"; } uint32_t -UnwindAssemblyProfiler_x86::GetPluginVersion() +UnwindAssembly_x86::GetPluginVersion() { return 1; } void -UnwindAssemblyProfiler_x86::Initialize() +UnwindAssembly_x86::Initialize() { PluginManager::RegisterPlugin (GetPluginNameStatic(), GetPluginDescriptionStatic(), @@ -883,20 +883,20 @@ UnwindAssemblyProfiler_x86::Initialize() } void -UnwindAssemblyProfiler_x86::Terminate() +UnwindAssembly_x86::Terminate() { PluginManager::UnregisterPlugin (CreateInstance); } const char * -UnwindAssemblyProfiler_x86::GetPluginNameStatic() +UnwindAssembly_x86::GetPluginNameStatic() { - return "UnwindAssemblyProfiler_x86"; + return "UnwindAssembly_x86"; } const char * -UnwindAssemblyProfiler_x86::GetPluginDescriptionStatic() +UnwindAssembly_x86::GetPluginDescriptionStatic() { return "i386 and x86_64 assembly language profiler plugin."; } diff --git a/lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.h b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.h index c1572996251..3126454781d 100644 --- a/lldb/source/Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.h +++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssemblyx86.h @@ -1,4 +1,4 @@ -//===-- UnwindAssemblyProfiler-x86.h ----------------------------*- C++ -*-===// +//===-- UnwindAssemblyx86.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#ifndef liblldb_UnwindAssemblyProfiler_x86_h_ -#define liblldb_UnwindAssemblyProfiler_x86_h_ +#ifndef liblldb_UnwindAssemblyx86_h_ +#define liblldb_UnwindAssemblyx86_h_ #include "lldb/lldb-private.h" #include "lldb/Target/UnwindAssemblyProfiler.h" @@ -16,11 +16,11 @@ namespace lldb_private { -class UnwindAssemblyProfiler_x86 : public lldb_private::UnwindAssemblyProfiler +class UnwindAssembly_x86 : public lldb_private::UnwindAssemblyProfiler { public: - ~UnwindAssemblyProfiler_x86 () { } + ~UnwindAssembly_x86 () { } virtual bool GetNonCallSiteUnwindPlanFromAssembly (AddressRange& func, lldb_private::Thread& thread, UnwindPlan& unwind_plan); @@ -61,7 +61,7 @@ public: GetPluginVersion(); private: - UnwindAssemblyProfiler_x86(int cpu) : + UnwindAssembly_x86(int cpu) : lldb_private::UnwindAssemblyProfiler(), m_cpu(cpu) { } // Call CreateInstance instead. int m_cpu; @@ -70,4 +70,4 @@ private: } // namespace lldb_private -#endif // liblldb_UnwindAssemblyProfiler_x86_h_ +#endif // liblldb_UnwindAssemblyx86_h_ diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp index 8d3b1ebb6c4..0fa46d3d620 100644 --- a/lldb/source/lldb.cpp +++ b/lldb/source/lldb.cpp @@ -30,9 +30,10 @@ #include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h" #include "Plugins/SymbolFile/Symtab/SymbolFileSymtab.h" -#include "Plugins/UnwindAssembly/UnwindAssemblyProfiler-x86.h" -#include "Plugins/ArchDefaultUnwindPlan/ArchDefaultUnwindPlan-x86.h" -#include "Plugins/ArchVolatileRegs/ArchVolatileRegs-x86.h" +#include "Plugins/UnwindAssembly/x86/UnwindAssemblyx86.h" +#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h" +#include "Plugins/ArchDefaultUnwindPlan/x86/ArchDefaultUnwindPlan-x86.h" +#include "Plugins/ArchVolatileRegs/x86/ArchVolatileRegs-x86.h" #if defined (__APPLE__) #include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h" @@ -82,7 +83,8 @@ lldb_private::Initialize () ObjectFileELF::Initialize(); SymbolFileDWARF::Initialize(); SymbolFileSymtab::Initialize(); - UnwindAssemblyProfiler_x86::Initialize(); + UnwindAssembly_x86::Initialize(); + UnwindAssemblyInstEmulation::Initialize(); ArchDefaultUnwindPlan_x86_64::Initialize(); ArchDefaultUnwindPlan_i386::Initialize(); ArchVolatileRegs_x86::Initialize(); @@ -150,7 +152,8 @@ lldb_private::Terminate () ObjectFileELF::Terminate(); SymbolFileDWARF::Terminate(); SymbolFileSymtab::Terminate(); - UnwindAssemblyProfiler_x86::Terminate(); + UnwindAssembly_x86::Terminate(); + UnwindAssemblyInstEmulation::Terminate(); ArchDefaultUnwindPlan_i386::Terminate(); ArchDefaultUnwindPlan_x86_64::Terminate(); ArchVolatileRegs_x86::Terminate(); |

