diff options
author | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
---|---|---|
committer | Kate Stone <katherine.stone@apple.com> | 2016-09-06 20:57:50 +0000 |
commit | b9c1b51e45b845debb76d8658edabca70ca56079 (patch) | |
tree | dfcb5a13ef2b014202340f47036da383eaee74aa /lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h | |
parent | d5aa73376966339caad04013510626ec2e42c760 (diff) | |
download | bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.tar.gz bcm5719-llvm-b9c1b51e45b845debb76d8658edabca70ca56079.zip |
*** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style. This kind of mass change has
*** two obvious implications:
Firstly, merging this particular commit into a downstream fork may be a huge
effort. Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit. The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;
The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.
Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit. There are alternatives available that will attempt
to look through this change and find the appropriate prior commit. YMMV.
llvm-svn: 280751
Diffstat (limited to 'lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h')
-rw-r--r-- | lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h | 288 |
1 files changed, 130 insertions, 158 deletions
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h index 61d3ece3f6c..bacce93c24e 100644 --- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h +++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h @@ -14,172 +14,144 @@ // C++ Includes // Other libraries and framework includes // Project includes -#include "lldb/lldb-private.h" #include "lldb/Core/EmulateInstruction.h" #include "lldb/Core/RegisterValue.h" #include "lldb/Symbol/UnwindPlan.h" #include "lldb/Target/UnwindAssembly.h" +#include "lldb/lldb-private.h" -class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly -{ +class UnwindAssemblyInstEmulation : public lldb_private::UnwindAssembly { public: - ~UnwindAssemblyInstEmulation() override = default; - - bool - GetNonCallSiteUnwindPlanFromAssembly(lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan) override; - - bool - AugmentUnwindPlanFromCallSite(lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan& unwind_plan) override; - - bool - GetFastUnwindPlan(lldb_private::AddressRange& func, - lldb_private::Thread& thread, - lldb_private::UnwindPlan &unwind_plan) override; - - // thread may be NULL in which case we only use the Target (e.g. if this is called pre-process-launch). - bool - FirstNonPrologueInsn(lldb_private::AddressRange& func, - const lldb_private::ExecutionContext &exe_ctx, - lldb_private::Address& first_non_prologue_insn) override; - - static lldb_private::UnwindAssembly * - CreateInstance (const lldb_private::ArchSpec &arch); - - //------------------------------------------------------------------ - // PluginInterface protocol - //------------------------------------------------------------------ - static void - Initialize(); - - static void - Terminate(); - - static lldb_private::ConstString - GetPluginNameStatic(); - - static const char * - GetPluginDescriptionStatic(); - - lldb_private::ConstString - GetPluginName() override; - - uint32_t - GetPluginVersion() override; - + ~UnwindAssemblyInstEmulation() override = default; + + bool GetNonCallSiteUnwindPlanFromAssembly( + lldb_private::AddressRange &func, lldb_private::Thread &thread, + lldb_private::UnwindPlan &unwind_plan) override; + + bool + AugmentUnwindPlanFromCallSite(lldb_private::AddressRange &func, + lldb_private::Thread &thread, + lldb_private::UnwindPlan &unwind_plan) override; + + bool GetFastUnwindPlan(lldb_private::AddressRange &func, + lldb_private::Thread &thread, + lldb_private::UnwindPlan &unwind_plan) override; + + // thread may be NULL in which case we only use the Target (e.g. if this is + // called pre-process-launch). + bool + FirstNonPrologueInsn(lldb_private::AddressRange &func, + const lldb_private::ExecutionContext &exe_ctx, + lldb_private::Address &first_non_prologue_insn) override; + + static lldb_private::UnwindAssembly * + CreateInstance(const lldb_private::ArchSpec &arch); + + //------------------------------------------------------------------ + // PluginInterface protocol + //------------------------------------------------------------------ + static void Initialize(); + + static void Terminate(); + + static lldb_private::ConstString GetPluginNameStatic(); + + static const char *GetPluginDescriptionStatic(); + + lldb_private::ConstString GetPluginName() override; + + uint32_t GetPluginVersion() override; + private: - // Call CreateInstance to get an instance of this class - UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch, - lldb_private::EmulateInstruction *inst_emulator) : - UnwindAssembly (arch), - m_inst_emulator_ap (inst_emulator), - m_range_ptr (NULL), - m_thread_ptr (NULL), - m_unwind_plan_ptr (NULL), - m_curr_row (), - m_cfa_reg_info (), - m_fp_is_cfa (false), - m_register_values (), - m_pushed_regs(), - m_curr_row_modified (false), - m_forward_branch_offset (0) - { - if (m_inst_emulator_ap.get()) - { - m_inst_emulator_ap->SetBaton (this); - m_inst_emulator_ap->SetCallbacks (ReadMemory, WriteMemory, ReadRegister, WriteRegister); - } + // Call CreateInstance to get an instance of this class + UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch, + lldb_private::EmulateInstruction *inst_emulator) + : UnwindAssembly(arch), m_inst_emulator_ap(inst_emulator), + m_range_ptr(NULL), m_thread_ptr(NULL), m_unwind_plan_ptr(NULL), + m_curr_row(), m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(), + m_pushed_regs(), m_curr_row_modified(false), + m_forward_branch_offset(0) { + if (m_inst_emulator_ap.get()) { + m_inst_emulator_ap->SetBaton(this); + m_inst_emulator_ap->SetCallbacks(ReadMemory, WriteMemory, ReadRegister, + WriteRegister); } - - static size_t - ReadMemory (lldb_private::EmulateInstruction *instruction, - void *baton, - const lldb_private::EmulateInstruction::Context &context, - lldb::addr_t addr, - void *dst, - size_t length); - - static size_t - WriteMemory (lldb_private::EmulateInstruction *instruction, - void *baton, - const lldb_private::EmulateInstruction::Context &context, - lldb::addr_t addr, - const void *dst, - size_t length); - - static bool - ReadRegister (lldb_private::EmulateInstruction *instruction, - void *baton, - const lldb_private::RegisterInfo *reg_info, - lldb_private::RegisterValue ®_value); - - static bool - WriteRegister (lldb_private::EmulateInstruction *instruction, - void *baton, - const lldb_private::EmulateInstruction::Context &context, - const lldb_private::RegisterInfo *reg_info, - const lldb_private::RegisterValue ®_value); - -// size_t -// ReadMemory (lldb_private::EmulateInstruction *instruction, -// const lldb_private::EmulateInstruction::Context &context, -// lldb::addr_t addr, -// void *dst, -// size_t length); - - size_t - WriteMemory (lldb_private::EmulateInstruction *instruction, - const lldb_private::EmulateInstruction::Context &context, - lldb::addr_t addr, - const void *dst, - size_t length); - - bool - ReadRegister (lldb_private::EmulateInstruction *instruction, - const lldb_private::RegisterInfo *reg_info, - lldb_private::RegisterValue ®_value); - - bool - WriteRegister (lldb_private::EmulateInstruction *instruction, - const lldb_private::EmulateInstruction::Context &context, - const lldb_private::RegisterInfo *reg_info, - const lldb_private::RegisterValue ®_value); - - static uint64_t - MakeRegisterKindValuePair (const lldb_private::RegisterInfo ®_info); - - void - SetRegisterValue (const lldb_private::RegisterInfo ®_info, - const lldb_private::RegisterValue ®_value); - - bool - GetRegisterValue (const lldb_private::RegisterInfo ®_info, - lldb_private::RegisterValue ®_value); - - std::unique_ptr<lldb_private::EmulateInstruction> m_inst_emulator_ap; - lldb_private::AddressRange* m_range_ptr; - lldb_private::Thread* m_thread_ptr; - lldb_private::UnwindPlan* m_unwind_plan_ptr; - lldb_private::UnwindPlan::RowSP m_curr_row; - typedef std::map<uint64_t, uint64_t> PushedRegisterToAddrMap; - uint64_t m_initial_sp; - lldb_private::RegisterInfo m_cfa_reg_info; - bool m_fp_is_cfa; - typedef std::map<uint64_t, lldb_private::RegisterValue> RegisterValueMap; - RegisterValueMap m_register_values; - PushedRegisterToAddrMap m_pushed_regs; - - // While processing the instruction stream, we need to communicate some state change - // information up to the higher level loop that makes decisions about how to push - // the unwind instructions for the UnwindPlan we're constructing. - - // The instruction we're processing updated the UnwindPlan::Row contents - bool m_curr_row_modified; - // The instruction is branching forward with the given offset. 0 value means no branching. - uint32_t m_forward_branch_offset; + } + + static size_t + ReadMemory(lldb_private::EmulateInstruction *instruction, void *baton, + const lldb_private::EmulateInstruction::Context &context, + lldb::addr_t addr, void *dst, size_t length); + + static size_t + WriteMemory(lldb_private::EmulateInstruction *instruction, void *baton, + const lldb_private::EmulateInstruction::Context &context, + lldb::addr_t addr, const void *dst, size_t length); + + static bool ReadRegister(lldb_private::EmulateInstruction *instruction, + void *baton, + const lldb_private::RegisterInfo *reg_info, + lldb_private::RegisterValue ®_value); + + static bool + WriteRegister(lldb_private::EmulateInstruction *instruction, void *baton, + const lldb_private::EmulateInstruction::Context &context, + const lldb_private::RegisterInfo *reg_info, + const lldb_private::RegisterValue ®_value); + + // size_t + // ReadMemory (lldb_private::EmulateInstruction *instruction, + // const lldb_private::EmulateInstruction::Context &context, + // lldb::addr_t addr, + // void *dst, + // size_t length); + + size_t WriteMemory(lldb_private::EmulateInstruction *instruction, + const lldb_private::EmulateInstruction::Context &context, + lldb::addr_t addr, const void *dst, size_t length); + + bool ReadRegister(lldb_private::EmulateInstruction *instruction, + const lldb_private::RegisterInfo *reg_info, + lldb_private::RegisterValue ®_value); + + bool WriteRegister(lldb_private::EmulateInstruction *instruction, + const lldb_private::EmulateInstruction::Context &context, + const lldb_private::RegisterInfo *reg_info, + const lldb_private::RegisterValue ®_value); + + static uint64_t + MakeRegisterKindValuePair(const lldb_private::RegisterInfo ®_info); + + void SetRegisterValue(const lldb_private::RegisterInfo ®_info, + const lldb_private::RegisterValue ®_value); + + bool GetRegisterValue(const lldb_private::RegisterInfo ®_info, + lldb_private::RegisterValue ®_value); + + std::unique_ptr<lldb_private::EmulateInstruction> m_inst_emulator_ap; + lldb_private::AddressRange *m_range_ptr; + lldb_private::Thread *m_thread_ptr; + lldb_private::UnwindPlan *m_unwind_plan_ptr; + lldb_private::UnwindPlan::RowSP m_curr_row; + typedef std::map<uint64_t, uint64_t> PushedRegisterToAddrMap; + uint64_t m_initial_sp; + lldb_private::RegisterInfo m_cfa_reg_info; + bool m_fp_is_cfa; + typedef std::map<uint64_t, lldb_private::RegisterValue> RegisterValueMap; + RegisterValueMap m_register_values; + PushedRegisterToAddrMap m_pushed_regs; + + // While processing the instruction stream, we need to communicate some state + // change + // information up to the higher level loop that makes decisions about how to + // push + // the unwind instructions for the UnwindPlan we're constructing. + + // The instruction we're processing updated the UnwindPlan::Row contents + bool m_curr_row_modified; + // The instruction is branching forward with the given offset. 0 value means + // no branching. + uint32_t m_forward_branch_offset; }; #endif // liblldb_UnwindAssemblyInstEmulation_h_ |