[Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special Purpose Registers
Author: abhishek Date: Tue Oct 6 02:04:03 2015 New Revision: 249379 URL: http://llvm.org/viewvc/llvm-project?rev=249379&view=rev Log: Bug 25050: X87 FPU Special Purpose Registers Summary: - For x86_64-FreeBSD Platform: -- LLDB now provides correct values of X87 FPU Special Purpose Registers like fstat, ftag, fctrl etc.. Signed-off-by: Abhishek Aggarwal Reviewers: emaste, mikesart, clayborg Subscribers: emaste Differential Revision: http://reviews.llvm.org/D13434 Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp?rev=249379&r1=249378&r2=249379&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp Tue Oct 6 02:04:03 2015 @@ -58,6 +58,9 @@ RegisterContextPOSIXProcessMonitor_x86_6 lldb_private::RegisterInfoInterface *register_info) : RegisterContextPOSIX_x86(thread, concrete_frame_idx, register_info) { +// Store byte offset of fctrl (i.e. first register of FPR) wrt 'UserArea' +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl"); +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset; } ProcessMonitor & @@ -254,8 +257,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 } // Get pointer to m_fpr.xstate.fxsave variable and set the data from it. -assert (reg_info->byte_offset < sizeof(m_fpr)); -uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset; +// Byte offsets of all registers are calculated wrt 'UserArea' structure. +// However, ReadFPR() reads fpu registers {using ptrace(PT_GETFPREGS,..)} +// and stores them in 'm_fpr' (of type FPR structure). To extract values of fpu +// registers, m_fpr should be read at byte offsets calculated wrt to FPR structure. + +// Since, FPR structure is also one of the member of UserArea structure. +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - byte_offset(fctrl wrt UserArea) +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < sizeof(m_fpr)); +uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset - m_fctrl_offset_in_userarea; switch (reg_info->byte_size) { case 2: @@ -308,8 +318,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 else { // Get pointer to m_fpr.xstate.fxsave variable and set the data to it. -assert (reg_info->byte_offset < sizeof(m_fpr)); -uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset; +// Byte offsets of all registers are calculated wrt 'UserArea' structure. +// However, WriteFPR() takes m_fpr (of type FPR structure) and writes only fpu +// registers using ptrace(PT_SETFPREGS,..) API. Hence fpu registers should +// be written in m_fpr at byte offsets calculated wrt FPR structure. + +// Since, FPR structure is also one of the member of UserArea structure. +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - byte_offset(fctrl wrt UserArea) +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < sizeof(m_fpr)); +uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset - m_fctrl_offset_in_userarea; switch (reg_info->byte_size) { case 2: Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h?rev=249379&r1=249378&r2=249379&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h Tue Oct 6 02:04:03 2015 @@ -91,6 +91,7 @@ protected: private: ProcessMonitor & GetMonitor(); +uint32_t m_fctrl_offset_in_userarea; // Offset of 'fctrl' in 'UserArea' Structure }; #endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13247: RenderScript command for printing allocation information
This revision was automatically updated to reflect the committed changes. Closed by commit rL249380: RenderScript command for printing allocation information (authored by EwanCrawford). Changed prior to commit: http://reviews.llvm.org/D13247?vs=35968&id=36587#toc Repository: rL LLVM http://reviews.llvm.org/D13247 Files: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h === --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h @@ -202,6 +202,8 @@ void DumpKernels(Stream &strm) const; +void ListAllocations(Stream &strm, StackFrame* frame_ptr, bool recompute); + void AttemptBreakpointAtKernelName(Stream &strm, const char *name, Error &error, lldb::TargetSP target); void SetBreakAllKernels(bool do_break, lldb::TargetSP target); @@ -220,6 +222,9 @@ protected: +struct ScriptDetails; +struct AllocationDetails; + void InitSearchFilter(lldb::TargetSP target) { if (!m_filtersp) @@ -230,6 +235,10 @@ void LoadRuntimeHooks(lldb::ModuleSP module, ModuleKind kind); +bool RefreshAllocation(AllocationDetails* allocation, StackFrame* frame_ptr); + +bool EvalRSExpression(const char* expression, StackFrame* frame_ptr, uint64_t* result); + lldb::BreakpointSP CreateKernelBreakpoint(const ConstString& name); void BreakOnModuleKernels(const lldb_renderscript::RSModuleDescriptorSP rsmodule_sp); @@ -256,9 +265,6 @@ typedef std::shared_ptr RuntimeHookSP; -struct ScriptDetails; -struct AllocationDetails; - lldb::ModuleSP m_libRS; lldb::ModuleSP m_libRSDriver; lldb::ModuleSP m_libRSCpuRef; @@ -292,6 +298,18 @@ void CaptureAllocationInit1(RuntimeHook* hook_info, ExecutionContext& context); void CaptureSetGlobalVar1(RuntimeHook* hook_info, ExecutionContext& context); +// +// Helper functions for jitting the runtime +// +bool JITDataPointer(AllocationDetails* allocation, StackFrame* frame_ptr, +unsigned int x = 0, unsigned int y = 0, unsigned int z = 0); + +bool JITTypePointer(AllocationDetails* allocation, StackFrame* frame_ptr); + +bool JITTypePacked(AllocationDetails* allocation, StackFrame* frame_ptr); + +bool JITElementPacked(AllocationDetails* allocation, StackFrame* frame_ptr); + // Search for a script detail object using a target address. // If a script does not currently exist this function will return nullptr. // If 'create' is true and there is no previous script with this address, Index: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp === --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp @@ -25,7 +25,7 @@ #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Target/RegisterContext.h" - +#include "lldb/Expression/UserExpression.h" #include "lldb/Symbol/VariableList.h" using namespace lldb; @@ -130,26 +130,116 @@ // allocation instance. struct RenderScriptRuntime::AllocationDetails { -~AllocationDetails () {}; + // Taken from rsDefines.h + enum DataKind + { + RS_KIND_USER, + RS_KIND_PIXEL_L = 7, + RS_KIND_PIXEL_A, + RS_KIND_PIXEL_LA, + RS_KIND_PIXEL_RGB, + RS_KIND_PIXEL_RGBA, + RS_KIND_PIXEL_DEPTH, + RS_KIND_PIXEL_YUV, + RS_KIND_INVALID = 100 + }; + + // Taken from rsDefines.h + enum DataType + { + RS_TYPE_NONE = 0, + RS_TYPE_FLOAT_16, + RS_TYPE_FLOAT_32, + RS_TYPE_FLOAT_64, + RS_TYPE_SIGNED_8, + RS_TYPE_SIGNED_16, + RS_TYPE_SIGNED_32, + RS_TYPE_SIGNED_64, + RS_TYPE_UNSIGNED_8, + RS_TYPE_UNSIGNED_16, + RS_TYPE_UNSIGNED_32, + RS_TYPE_UNSIGNED_64, + RS_TYPE_BOOLEAN +}; -enum DataType +struct Dimension { -eInt, +uint32_t dim_1; +uint32_t dim_2; +uint32_t dim_3; +uint32_t cubeMap; + +Dimension() +{ + dim_1 = 0; + dim_2 = 0; + dim_3 = 0; + cubeMap = 0; +} }; -enum Dimension +// Monotonically increasing from 1 +static unsigned int ID; + +// Maps Allocation DataType enum and vector size to printable strings +// using
[Lldb-commits] [lldb] r249380 - RenderScript command for printing allocation information
Author: ewancrawford Date: Tue Oct 6 03:42:32 2015 New Revision: 249380 URL: http://llvm.org/viewvc/llvm-project?rev=249380&view=rev Log: RenderScript command for printing allocation information This patch adds a new command 'language renderscript allocation list' for printing the details of all loaded RS allocations. In order to work out this information lldb JITs the runtime for the data it wants. This has a penalty of a couple seconds latency, so is only done once for each allocation and the results cached. If the user later wants to recalculate this information however, they can force lldb to do so with the --refresh flag. Reviewed by: jingham, clayborg Subscribers: lldb-commits, ADodds, domipheus, dean, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D13247 Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=249380&r1=249379&r2=249380&view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Tue Oct 6 03:42:32 2015 @@ -25,7 +25,7 @@ #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Breakpoint/StoppointCallbackContext.h" #include "lldb/Target/RegisterContext.h" - +#include "lldb/Expression/UserExpression.h" #include "lldb/Symbol/VariableList.h" using namespace lldb; @@ -130,26 +130,116 @@ struct RenderScriptRuntime::ScriptDetail // allocation instance. struct RenderScriptRuntime::AllocationDetails { -~AllocationDetails () {}; + // Taken from rsDefines.h + enum DataKind + { + RS_KIND_USER, + RS_KIND_PIXEL_L = 7, + RS_KIND_PIXEL_A, + RS_KIND_PIXEL_LA, + RS_KIND_PIXEL_RGB, + RS_KIND_PIXEL_RGBA, + RS_KIND_PIXEL_DEPTH, + RS_KIND_PIXEL_YUV, + RS_KIND_INVALID = 100 + }; + + // Taken from rsDefines.h + enum DataType + { + RS_TYPE_NONE = 0, + RS_TYPE_FLOAT_16, + RS_TYPE_FLOAT_32, + RS_TYPE_FLOAT_64, + RS_TYPE_SIGNED_8, + RS_TYPE_SIGNED_16, + RS_TYPE_SIGNED_32, + RS_TYPE_SIGNED_64, + RS_TYPE_UNSIGNED_8, + RS_TYPE_UNSIGNED_16, + RS_TYPE_UNSIGNED_32, + RS_TYPE_UNSIGNED_64, + RS_TYPE_BOOLEAN +}; -enum DataType +struct Dimension { -eInt, +uint32_t dim_1; +uint32_t dim_2; +uint32_t dim_3; +uint32_t cubeMap; + +Dimension() +{ + dim_1 = 0; + dim_2 = 0; + dim_3 = 0; + cubeMap = 0; +} }; -enum Dimension +// Monotonically increasing from 1 +static unsigned int ID; + +// Maps Allocation DataType enum and vector size to printable strings +// using mapping from RenderScript numerical types summary documentation +static const char* RsDataTypeToString[][4]; + +// Maps Allocation DataKind enum to printable strings +static const char* RsDataKindToString[]; + +// Give each allocation an ID as a way +// for commands to reference it. +const unsigned int id; + +empirical_type type;// Type of each data pointer stored by the allocation +empirical_type type_kind; // Defines pixel type if Allocation is created from an image +empirical_type type_vec_size; // Vector size of each data point, e.g '4' for uchar4 +empirical_type dimension; // Dimensions of the Allocation +empirical_type address; // Pointer to address of the RS Allocation +empirical_type data_ptr;// Pointer to the data held by the Allocation +empirical_type type_ptr;// Pointer to the RS Type of the Allocation +empirical_type element_ptr; // Pointer to the RS Element of the Type +empirical_type context; // Pointer to the RS Context of the Allocation + +// Give each allocation an id, so we can reference it in user commands. +AllocationDetails(): id(ID++) { -e1d, -e2d, -e3d, -eCubeMap, -}; +} -empirical_type type; -empirical_type dimension; -empirical_type address; -empirical_type dataPtr; -empirical_type context; +}; + +unsigned int RenderScriptRuntime::AllocationDetails::ID = 1; + +const char* RenderScriptRuntime::AllocationDetails::RsDataKindToString[] = +{ + "User", + "Undefined", "Undefined", "Undefined", // Enum jumps from 0 to 7 + "Undefined", "Undefin
[Lldb-commits] [lldb] r249381 - [MIPS] Emulate microMIPS instructions
Author: bhushan.attarde Date: Tue Oct 6 03:52:08 2015 New Revision: 249381 URL: http://llvm.org/viewvc/llvm-project?rev=249381&view=rev Log: [MIPS] Emulate microMIPS instructions SUMMARY: This patch includes: 1. Emulation of prologue/epilogue and branch instructions for microMIPS. 2. Setting up alternate disassembler (to be used for microMIPS). So there will be two disassembler instances, one for microMIPS and other for MIPS. Appropriate disassembler will be used based on the address class of instruction address. 3. Some of the branch instructions does not have fixed sized delay slot, that means delay slot instruction can be of 2-byte or 4-byte. For this "m_next_inst_size" has been introduced which stores the size of next instruction (i.e size of delay slot instruction in case of branch). This can be used wherever the size of next instruction is required. 4. A minor change to use mips32 register names instead of mips64 names. Reviewers: clayborg, tberghammer Subscribers: mohit.bhakkad, sagar, jaydeep, nitesh.jain, lldb-commits Differential Revision: http://reviews.llvm.org/D13282 Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Modified: lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h?rev=249381&r1=249380&r2=249381&view=diff == --- lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h (original) +++ lldb/trunk/source/Plugins/ABI/SysV-mips/ABISysV_mips.h Tue Oct 6 03:52:08 2015 @@ -74,13 +74,11 @@ public: } virtual bool -CodeAddressIsValid (lldb::addr_t pc)//must- check +CodeAddressIsValid (lldb::addr_t pc) { - if (pc & (4ull - 1ull)) - return false; // Not 4 byte aligned - -// Anything else if fair game.. -return true; +// Just make sure the address is a valid 32 bit address. Bit zero +// might be set due to MicroMIPS function calls, so don't enforce alignment. +return (pc <= UINT32_MAX); } virtual const lldb_private::RegisterInfo * Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp?rev=249381&r1=249380&r2=249381&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Tue Oct 6 03:52:08 2015 @@ -29,6 +29,7 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Stream.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Target/Target.h" #include "llvm/ADT/STLExtras.h" @@ -132,10 +133,6 @@ EmulateInstructionMIPS::EmulateInstructi features += "+dsp,"; if (arch_flags & ArchSpec::eMIPSAse_dspr2) features += "+dspr2,"; -if (arch_flags & ArchSpec::eMIPSAse_mips16) -features += "+mips16,"; -if (arch_flags & ArchSpec::eMIPSAse_micromips) -features += "+micromips,"; m_reg_info.reset (target->createMCRegInfo (triple.getTriple())); assert (m_reg_info.get()); @@ -152,6 +149,21 @@ EmulateInstructionMIPS::EmulateInstructi m_disasm.reset (target->createMCDisassembler (*m_subtype_info, *m_context)); assert (m_disasm.get()); + +/* Create alternate disassembler for microMIPS */ +if (arch_flags & ArchSpec::eMIPSAse_mips16) +features += "+mips16,"; +else if (arch_flags & ArchSpec::eMIPSAse_micromips) +features += "+micromips,"; + +m_alt_subtype_info.reset (target->createMCSubtargetInfo (triple.getTriple(), cpu, features)); +assert (m_alt_subtype_info.get()); + +m_alt_disasm.reset (target->createMCDisassembler (*m_alt_subtype_info, *m_context)); +assert (m_alt_disasm.get()); + +m_next_inst_size = 0; +m_use_alt_disaasm = false; } void @@ -485,8 +497,22 @@ EmulateInstructionMIPS::GetOpcodeForInst { "ADDiu", &EmulateInstructionMIPS::Emulate_ADDiu, "ADDIU rt,rs,immediate"}, { "SW", &EmulateInstructionMIPS::Emulate_SW, "SW rt,offset(rs)" }, { "LW", &EmulateInstructionMIPS::Emulate_LW, "LW rt,offset(base)" }, - //-- +// MicroMIPS Prologue/Epilogue instructions + //-- +{ "ADDIUSP_MM", &EmulateInstructionMIPS::Emulate_ADDIUSP, "ADDIU immediate"}, +{ "A
[Lldb-commits] [PATCH] D13462: Fix virtual/override warnings in new MIPS code.
brucem created this revision. brucem added reviewers: bhushan, tberghammer. brucem added a subscriber: lldb-commits. http://reviews.llvm.org/D13462 Files: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -60,58 +60,58 @@ return false; } -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; virtual lldb_private::ConstString GetShortPluginName() { return GetPluginNameStatic(); } -virtual uint32_t -GetPluginVersion() +uint32_t +GetPluginVersion() override { return 1; } bool -SetTargetTriple (const lldb_private::ArchSpec &arch); +SetTargetTriple (const lldb_private::ArchSpec &arch) override; EmulateInstructionMIPS (const lldb_private::ArchSpec &arch); -virtual bool -SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) +bool +SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) override { return SupportsEmulatingInstructionsOfTypeStatic (inst_type); } -virtual bool -ReadInstruction (); +bool +ReadInstruction () override; -virtual bool -EvaluateInstruction (uint32_t evaluate_options); +bool +EvaluateInstruction (uint32_t evaluate_options) override; bool SetInstruction (const lldb_private::Opcode &insn_opcode, const lldb_private::Address &inst_addr, lldb_private::Target *target) override; -virtual bool +bool TestEmulation (lldb_private::Stream *out_stream, lldb_private::ArchSpec &arch, - lldb_private::OptionValueDictionary *test_data) + lldb_private::OptionValueDictionary *test_data) override { return false; } -virtual bool +bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, - lldb_private::RegisterInfo ®_info); + lldb_private::RegisterInfo ®_info) override; -virtual bool -CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan); +bool +CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan) override; protected: Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -60,58 +60,58 @@ return false; } -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; virtual lldb_private::ConstString GetShortPluginName() { return GetPluginNameStatic(); } -virtual uint32_t -GetPluginVersion() +uint32_t +GetPluginVersion() override { return 1; } bool -SetTargetTriple (const lldb_private::ArchSpec &arch); +SetTargetTriple (const lldb_private::ArchSpec &arch) override; EmulateInstructionMIPS (const lldb_private::ArchSpec &arch); -virtual bool -SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) +bool +SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) override { return SupportsEmulatingInstructionsOfTypeStatic (inst_type); } -virtual bool -ReadInstruction (); +bool +ReadInstruction () override; -virtual bool -EvaluateInstruction (uint32_t evaluate_options); +bool +EvaluateInstruction (uint32_t evaluate_options) override; bool SetInstruction (const lldb_private::Opcode &insn_opcode, const lldb_private::Address &inst_addr, lldb_private::Target *target) override; -virtual bool +bool TestEmulation (lldb_private::Stream *out_stream, lldb_private::ArchSpec &arch, - lldb_private::OptionValueDictionary *test_data) + lldb_private::OptionValueDictionary *test_data) override { return false; } -virtual bool +bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, - lldb_private::RegisterInfo ®_info); + lldb_private::RegisterInfo ®_info) override; -virtual bool -CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan); +bool +CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan) override; protected:
[Lldb-commits] [PATCH] D13463: Remove GetShortPluginName.
brucem created this revision. brucem added a reviewer: clayborg. brucem added a subscriber: lldb-commits. This was deprecated and removed. http://reviews.llvm.org/D13463 Files: source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Index: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h === --- source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h +++ source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h @@ -63,12 +63,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -63,12 +63,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h === --- source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -53,12 +53,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h === --- source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -106,9 +106,6 @@ return GetPluginNameStatic(); } -virtual const char * -GetShortPluginName(); - virtual uint32_t GetPluginVersion(); Index: source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp === --- source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -36,7 +36,6 @@ using namespace lldb_private; static const char *pluginDesc = "Mac OS X ABI for arm64 targets"; -static const char *pluginShort = "abi.macosx-arm64"; static RegisterInfo g_register_infos[] = @@ -1092,12 +1091,6 @@ return g_plugin_name; } -const char * -ABIMacOSX_arm64::GetShortPluginName() -{ -return pluginShort; -} - uint32_t ABIMacOSX_arm64::GetPluginVersion() { Index: source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h === --- source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h +++ source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h @@ -63,12 +63,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -63,12 +63,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h === --- source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -53,12 +53,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h === --- source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -106,9 +106,6 @@ return GetPluginNameStatic(); } -virtual const char * -GetShortPluginName(); - virtual ui
[Lldb-commits] [lldb] r249387 - Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile()
Author: brucem Date: Tue Oct 6 05:17:34 2015 New Revision: 249387 URL: http://llvm.org/viewvc/llvm-project?rev=249387&view=rev Log: Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile() Summary: When `module_spec.GetFileSpec().GetDirectory().AsCString()` returned a `nullptr` this line caused a segmentation fault: `std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString()` Some context: I was remote debugging an executable built with Clang in an Ubuntu VM on my Windows machine using lldb-mi. I copied the executable and nothing else from the Ubuntu VM to the Windows machine. Then started lldb-server in the Ubuntu VM: ``` ./bin/lldb-server gdbserver *: -- /home/enlight/Projects/dbgmits/build/Debug/data_tests_target ``` And ran `lldb-mi --interpreter` on Windows with the following commands: ``` -file-exec-and-symbols C:\Projects\data_tests_target -target-select remote 192.168.56.101: -exec-continue ``` After which the segmentation fault occurred at the aforementioned line. Inside this method `module_spec.GetFileSpec()` returns an empty `FileSpec` (no dir, no filename), while `module_spec.GetSymbolFileSpec().GetFilename()` returns `"libc-2.19.so"`. Patch thanks to Vadim Macagon. Reviewers: brucem, zturner, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13201 Added: lldb/trunk/unittests/Host/SymbolsTest.cpp Modified: lldb/trunk/source/Host/common/Symbols.cpp lldb/trunk/unittests/Host/CMakeLists.txt Modified: lldb/trunk/source/Host/common/Symbols.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=249387&r1=249386&r2=249387&view=diff == --- lldb/trunk/source/Host/common/Symbols.cpp (original) +++ lldb/trunk/source/Host/common/Symbols.cpp Tue Oct 6 05:17:34 2015 @@ -249,10 +249,6 @@ Symbols::LocateExecutableSymbolFile (con uuid_str = uuid_str + ".debug"; } -// Get directory of our module. Needed to check debug files like this: -// /usr/lib/debug/usr/lib/library.so.debug -std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString(); - size_t num_directories = debug_file_search_paths.GetSize(); for (size_t idx = 0; idx < num_directories; ++idx) { @@ -267,7 +263,11 @@ Symbols::LocateExecutableSymbolFile (con files.push_back (dirname + "/" + symbol_filename); files.push_back (dirname + "/.debug/" + symbol_filename); files.push_back (dirname + "/.build-id/" + uuid_str); -files.push_back (dirname + module_directory + "/" + symbol_filename); + +// Some debug files may stored in the module directory like this: +// /usr/lib/debug/usr/lib/library.so.debug +if (!file_dir.IsEmpty()) +files.push_back (dirname + file_dir.AsCString() + "/" + symbol_filename); const uint32_t num_files = files.size(); for (size_t idx_file = 0; idx_file < num_files; ++idx_file) Modified: lldb/trunk/unittests/Host/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/CMakeLists.txt?rev=249387&r1=249386&r2=249387&view=diff == --- lldb/trunk/unittests/Host/CMakeLists.txt (original) +++ lldb/trunk/unittests/Host/CMakeLists.txt Tue Oct 6 05:17:34 2015 @@ -1,4 +1,5 @@ add_lldb_unittest(HostTests SocketAddressTest.cpp SocketTest.cpp + SymbolsTest.cpp ) Added: lldb/trunk/unittests/Host/SymbolsTest.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/SymbolsTest.cpp?rev=249387&view=auto == --- lldb/trunk/unittests/Host/SymbolsTest.cpp (added) +++ lldb/trunk/unittests/Host/SymbolsTest.cpp Tue Oct 6 05:17:34 2015 @@ -0,0 +1,30 @@ +//===-- SymbolsTest.cpp -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "gtest/gtest.h" +#include "lldb/Host/Symbols.h" +#include "lldb/Core/ModuleSpec.h" + +using namespace lldb_private; + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) +{ +ModuleSpec module_spec; +FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec); +EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); +} + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) +{ +ModuleSpec module_spec; +// using a GUID here because the symbol file shouldn't actually exist on disk + mod
Re: [Lldb-commits] [PATCH] D13201: Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile()
This revision was automatically updated to reflect the committed changes. Closed by commit rL249387: Fix segmentation fault in lldb_private::Symbols::LocateExecutableSymbolFile() (authored by brucem). Changed prior to commit: http://reviews.llvm.org/D13201?vs=36468&id=36608#toc Repository: rL LLVM http://reviews.llvm.org/D13201 Files: lldb/trunk/source/Host/common/Symbols.cpp lldb/trunk/unittests/Host/CMakeLists.txt lldb/trunk/unittests/Host/SymbolsTest.cpp Index: lldb/trunk/unittests/Host/CMakeLists.txt === --- lldb/trunk/unittests/Host/CMakeLists.txt +++ lldb/trunk/unittests/Host/CMakeLists.txt @@ -1,4 +1,5 @@ add_lldb_unittest(HostTests SocketAddressTest.cpp SocketTest.cpp + SymbolsTest.cpp ) Index: lldb/trunk/unittests/Host/SymbolsTest.cpp === --- lldb/trunk/unittests/Host/SymbolsTest.cpp +++ lldb/trunk/unittests/Host/SymbolsTest.cpp @@ -0,0 +1,30 @@ +//===-- SymbolsTest.cpp -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "gtest/gtest.h" +#include "lldb/Host/Symbols.h" +#include "lldb/Core/ModuleSpec.h" + +using namespace lldb_private; + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) +{ +ModuleSpec module_spec; +FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec); +EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); +} + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) +{ +ModuleSpec module_spec; +// using a GUID here because the symbol file shouldn't actually exist on disk + module_spec.GetSymbolFileSpec().SetFile("4A524676-B24B-4F4E-968A-551D465EBAF1.so", false); +FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec); +EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); +} Index: lldb/trunk/source/Host/common/Symbols.cpp === --- lldb/trunk/source/Host/common/Symbols.cpp +++ lldb/trunk/source/Host/common/Symbols.cpp @@ -249,10 +249,6 @@ uuid_str = uuid_str + ".debug"; } -// Get directory of our module. Needed to check debug files like this: -// /usr/lib/debug/usr/lib/library.so.debug -std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString(); - size_t num_directories = debug_file_search_paths.GetSize(); for (size_t idx = 0; idx < num_directories; ++idx) { @@ -267,7 +263,11 @@ files.push_back (dirname + "/" + symbol_filename); files.push_back (dirname + "/.debug/" + symbol_filename); files.push_back (dirname + "/.build-id/" + uuid_str); -files.push_back (dirname + module_directory + "/" + symbol_filename); + +// Some debug files may stored in the module directory like this: +// /usr/lib/debug/usr/lib/library.so.debug +if (!file_dir.IsEmpty()) +files.push_back (dirname + file_dir.AsCString() + "/" + symbol_filename); const uint32_t num_files = files.size(); for (size_t idx_file = 0; idx_file < num_files; ++idx_file) Index: lldb/trunk/unittests/Host/CMakeLists.txt === --- lldb/trunk/unittests/Host/CMakeLists.txt +++ lldb/trunk/unittests/Host/CMakeLists.txt @@ -1,4 +1,5 @@ add_lldb_unittest(HostTests SocketAddressTest.cpp SocketTest.cpp + SymbolsTest.cpp ) Index: lldb/trunk/unittests/Host/SymbolsTest.cpp === --- lldb/trunk/unittests/Host/SymbolsTest.cpp +++ lldb/trunk/unittests/Host/SymbolsTest.cpp @@ -0,0 +1,30 @@ +//===-- SymbolsTest.cpp -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "gtest/gtest.h" +#include "lldb/Host/Symbols.h" +#include "lldb/Core/ModuleSpec.h" + +using namespace lldb_private; + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndUnknownSymbolFile) +{ +ModuleSpec module_spec; +FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec); +EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty()); +} + +TEST(SymbolsTest, LocateExecutableSymbolFileForUnknownExecutableAndMissingSymbolFile) +{ +ModuleSpec module_spec; +
Re: [Lldb-commits] [PATCH] D13462: Fix virtual/override warnings in new MIPS code.
labath added a subscriber: labath. labath accepted this revision. labath added a reviewer: labath. labath added a comment. This revision is now accepted and ready to land. I think you can commit things like this as obvious. :) http://reviews.llvm.org/D13462 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13462: Fix virtual/override warnings in new MIPS code.
tberghammer accepted this revision. tberghammer added a comment. I agree with Pavel, that you don't have to send these trivial changes for core review http://reviews.llvm.org/D13462 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249405 - Fix virtual/override warnings in new MIPS code.
Author: brucem Date: Tue Oct 6 09:19:32 2015 New Revision: 249405 URL: http://llvm.org/viewvc/llvm-project?rev=249405&view=rev Log: Fix virtual/override warnings in new MIPS code. Reviewers: bhushan, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13462 Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h?rev=249405&r1=249404&r2=249405&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Tue Oct 6 09:19:32 2015 @@ -60,8 +60,8 @@ public: return false; } -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; virtual lldb_private::ConstString GetShortPluginName() @@ -69,49 +69,49 @@ public: return GetPluginNameStatic(); } -virtual uint32_t -GetPluginVersion() +uint32_t +GetPluginVersion() override { return 1; } bool -SetTargetTriple (const lldb_private::ArchSpec &arch); +SetTargetTriple (const lldb_private::ArchSpec &arch) override; EmulateInstructionMIPS (const lldb_private::ArchSpec &arch); -virtual bool -SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) +bool +SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) override { return SupportsEmulatingInstructionsOfTypeStatic (inst_type); } -virtual bool -ReadInstruction (); +bool +ReadInstruction () override; -virtual bool -EvaluateInstruction (uint32_t evaluate_options); +bool +EvaluateInstruction (uint32_t evaluate_options) override; bool SetInstruction (const lldb_private::Opcode &insn_opcode, const lldb_private::Address &inst_addr, lldb_private::Target *target) override; -virtual bool +bool TestEmulation (lldb_private::Stream *out_stream, lldb_private::ArchSpec &arch, - lldb_private::OptionValueDictionary *test_data) + lldb_private::OptionValueDictionary *test_data) override { return false; } -virtual bool +bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, - lldb_private::RegisterInfo ®_info); + lldb_private::RegisterInfo ®_info) override; -virtual bool -CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan); +bool +CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan) override; protected: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13462: Fix virtual/override warnings in new MIPS code.
This revision was automatically updated to reflect the committed changes. Closed by commit rL249405: Fix virtual/override warnings in new MIPS code. (authored by brucem). Changed prior to commit: http://reviews.llvm.org/D13462?vs=36601&id=36622#toc Repository: rL LLVM http://reviews.llvm.org/D13462 Files: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Index: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -60,58 +60,58 @@ return false; } -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; virtual lldb_private::ConstString GetShortPluginName() { return GetPluginNameStatic(); } -virtual uint32_t -GetPluginVersion() +uint32_t +GetPluginVersion() override { return 1; } bool -SetTargetTriple (const lldb_private::ArchSpec &arch); +SetTargetTriple (const lldb_private::ArchSpec &arch) override; EmulateInstructionMIPS (const lldb_private::ArchSpec &arch); -virtual bool -SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) +bool +SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) override { return SupportsEmulatingInstructionsOfTypeStatic (inst_type); } -virtual bool -ReadInstruction (); +bool +ReadInstruction () override; -virtual bool -EvaluateInstruction (uint32_t evaluate_options); +bool +EvaluateInstruction (uint32_t evaluate_options) override; bool SetInstruction (const lldb_private::Opcode &insn_opcode, const lldb_private::Address &inst_addr, lldb_private::Target *target) override; -virtual bool +bool TestEmulation (lldb_private::Stream *out_stream, lldb_private::ArchSpec &arch, - lldb_private::OptionValueDictionary *test_data) + lldb_private::OptionValueDictionary *test_data) override { return false; } -virtual bool +bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, - lldb_private::RegisterInfo ®_info); + lldb_private::RegisterInfo ®_info) override; -virtual bool -CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan); +bool +CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan) override; protected: Index: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -60,58 +60,58 @@ return false; } -virtual lldb_private::ConstString -GetPluginName(); +lldb_private::ConstString +GetPluginName() override; virtual lldb_private::ConstString GetShortPluginName() { return GetPluginNameStatic(); } -virtual uint32_t -GetPluginVersion() +uint32_t +GetPluginVersion() override { return 1; } bool -SetTargetTriple (const lldb_private::ArchSpec &arch); +SetTargetTriple (const lldb_private::ArchSpec &arch) override; EmulateInstructionMIPS (const lldb_private::ArchSpec &arch); -virtual bool -SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) +bool +SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type) override { return SupportsEmulatingInstructionsOfTypeStatic (inst_type); } -virtual bool -ReadInstruction (); +bool +ReadInstruction () override; -virtual bool -EvaluateInstruction (uint32_t evaluate_options); +bool +EvaluateInstruction (uint32_t evaluate_options) override; bool SetInstruction (const lldb_private::Opcode &insn_opcode, const lldb_private::Address &inst_addr, lldb_private::Target *target) override; -virtual bool +bool TestEmulation (lldb_private::Stream *out_stream, lldb_private::ArchSpec &arch, - lldb_private::OptionValueDictionary *test_data) + lldb_private::OptionValueDictionary *test_data) override { return false; } -virtual bool +bool GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num, - lldb_private::RegisterInfo ®_info); + lldb_private::RegisterIn
[Lldb-commits] [lldb] r249407 - Rename a test case to avoid name conflict
Author: tberghammer Date: Tue Oct 6 09:39:05 2015 New Revision: 249407 URL: http://llvm.org/viewvc/llvm-project?rev=249407&view=rev Log: Rename a test case to avoid name conflict Rename the python source file for DataFormatterOSTypeTestCase to match the purpose of the test and to avoid a name conflict with DataFormatterBoolRefPtr. The name conflict caused a race condition in the test runner what we have to address separately. Added: lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py - copied, changed from r249405, lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py Removed: lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py Removed: lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py?rev=249406&view=auto == --- lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py (original) +++ lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py (removed) @@ -1,56 +0,0 @@ -""" -Test lldb data formatter subsystem. -""" - -import os, time -import unittest2 -import lldb -from lldbtest import * -import datetime -import lldbutil - -class DataFormatterOSTypeTestCase(TestBase): - -mydir = TestBase.compute_mydir(__file__) - -def setUp(self): -# Call super's setUp(). -TestBase.setUp(self) -# Find the line number to break at. -self.line = line_number('main.mm', '// Set break point at this line.') - -@skipUnlessDarwin -def test_ostype_with_run_command(self): -"""Test the formatters we use for OSType.""" -self.build() -self.runCmd("file a.out", CURRENT_EXECUTABLE_SET) - -lldbutil.run_break_set_by_file_and_line (self, "main.mm", self.line, num_expected_locations=1, loc_exact=True) - -self.runCmd("run", RUN_SUCCEEDED) - -# The stop reason of the thread should be breakpoint. -self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, -substrs = ['stopped', - 'stop reason = breakpoint']) - -# This is the function to remove the custom formats in order to have a -# clean slate for the next test case. -def cleanup(): -self.runCmd('type format clear', check=False) -self.runCmd('type summary clear', check=False) -self.runCmd('type synth clear', check=False) - -# Execute the cleanup function during test case tear down. -self.addTearDownHook(cleanup) - -# Now check that we use the right summary for OSType -self.expect('frame variable', -substrs = ["'test'","'best'"]) - - -if __name__ == '__main__': -import atexit -lldb.SBDebugger.Initialize() -atexit.register(lambda: lldb.SBDebugger.Terminate()) -unittest2.main() Copied: lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py (from r249405, lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py) URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py?p2=lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py&p1=lldb/trunk/test/functionalities/data-formatter/ostypeformatting/TestFormattersBoolRefPtr.py&r1=249405&r2=249407&rev=249407&view=diff == (empty) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13448: Update swig generation shell scripts to run under Python 3.x
tfiala accepted this revision. tfiala added a comment. This revision is now accepted and ready to land. LGTM. I saw no issues on Ubuntu 14.04 x86_64 and the changes all look reasonable. http://reviews.llvm.org/D13448 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special Purpose Registers
Please don't submit CLs like this without a test in the future. This should be testable by writing some assembly to move a value into an FPU register, setting a breakpoint, then querying the register values. Can you submit this as a followup? On Tue, Oct 6, 2015 at 12:05 AM Abhishek Aggarwal via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: abhishek > Date: Tue Oct 6 02:04:03 2015 > New Revision: 249379 > > URL: http://llvm.org/viewvc/llvm-project?rev=249379&view=rev > Log: > Bug 25050: X87 FPU Special Purpose Registers > > Summary: > - For x86_64-FreeBSD Platform: > -- LLDB now provides correct values of X87 FPU >Special Purpose Registers like fstat, ftag, fctrl etc.. > > Signed-off-by: Abhishek Aggarwal > > Reviewers: emaste, mikesart, clayborg > > Subscribers: emaste > > Differential Revision: http://reviews.llvm.org/D13434 > > Modified: > > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h > > Modified: > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp?rev=249379&r1=249378&r2=249379&view=diff > > == > --- > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > (original) > +++ > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > Tue Oct 6 02:04:03 2015 > @@ -58,6 +58,9 @@ RegisterContextPOSIXProcessMonitor_x86_6 > > lldb_private::RegisterInfoInterface *register_info) > : RegisterContextPOSIX_x86(thread, concrete_frame_idx, register_info) > { > +// Store byte offset of fctrl (i.e. first register of FPR) wrt > 'UserArea' > +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl"); > +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset; > } > > ProcessMonitor & > @@ -254,8 +257,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 > } > > // Get pointer to m_fpr.xstate.fxsave variable and set the data from > it. > -assert (reg_info->byte_offset < sizeof(m_fpr)); > -uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset; > +// Byte offsets of all registers are calculated wrt 'UserArea' > structure. > +// However, ReadFPR() reads fpu registers {using > ptrace(PT_GETFPREGS,..)} > +// and stores them in 'm_fpr' (of type FPR structure). To extract > values of fpu > +// registers, m_fpr should be read at byte offsets calculated wrt to > FPR structure. > + > +// Since, FPR structure is also one of the member of UserArea > structure. > +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - > byte_offset(fctrl wrt UserArea) > +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < > sizeof(m_fpr)); > +uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset - > m_fctrl_offset_in_userarea; > switch (reg_info->byte_size) > { > case 2: > @@ -308,8 +318,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 > else > { > // Get pointer to m_fpr.xstate.fxsave variable and set the > data to it. > -assert (reg_info->byte_offset < sizeof(m_fpr)); > -uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset; > +// Byte offsets of all registers are calculated wrt > 'UserArea' structure. > +// However, WriteFPR() takes m_fpr (of type FPR structure) > and writes only fpu > +// registers using ptrace(PT_SETFPREGS,..) API. Hence fpu > registers should > +// be written in m_fpr at byte offsets calculated wrt FPR > structure. > + > +// Since, FPR structure is also one of the member of UserArea > structure. > +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - > byte_offset(fctrl wrt UserArea) > +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) > < sizeof(m_fpr)); > +uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset - > m_fctrl_offset_in_userarea; > switch (reg_info->byte_size) > { > case 2: > > Modified: > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h?rev=249379&r1=249378&r2=249379&view=diff > > == > --- > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h > (original) > +++ > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h > Tue Oct 6 02:04:03 2015 > @@ -91,6 +91,7 @@ protected: > private: > ProcessMonitor & > GetMon
Re: [Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special Purpose Registers
I had submitted a patch for the Bug 24457 which is similar kind of bug but on Linux x86_64 Platform. There, I had submitted a new test to reproduce this issue. The test is already there in public repository. Since, the same test goes for FreeBSD also therefore I didn’t need to write a new one. -Thanks From: Zachary Turner [mailto:ztur...@google.com] Sent: Tuesday, October 6, 2015 4:53 PM To: Aggarwal, Abhishek A; lldb-commits@lists.llvm.org Subject: Re: [Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special Purpose Registers Please don't submit CLs like this without a test in the future. This should be testable by writing some assembly to move a value into an FPU register, setting a breakpoint, then querying the register values. Can you submit this as a followup? On Tue, Oct 6, 2015 at 12:05 AM Abhishek Aggarwal via lldb-commits mailto:lldb-commits@lists.llvm.org>> wrote: Author: abhishek Date: Tue Oct 6 02:04:03 2015 New Revision: 249379 URL: http://llvm.org/viewvc/llvm-project?rev=249379&view=rev Log: Bug 25050: X87 FPU Special Purpose Registers Summary: - For x86_64-FreeBSD Platform: -- LLDB now provides correct values of X87 FPU Special Purpose Registers like fstat, ftag, fctrl etc.. Signed-off-by: Abhishek Aggarwal mailto:abhishek.a.aggar...@intel.com>> Reviewers: emaste, mikesart, clayborg Subscribers: emaste Differential Revision: http://reviews.llvm.org/D13434 Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp?rev=249379&r1=249378&r2=249379&view=diff == --- lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp (original) +++ lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp Tue Oct 6 02:04:03 2015 @@ -58,6 +58,9 @@ RegisterContextPOSIXProcessMonitor_x86_6 lldb_private::RegisterInfoInterface *register_info) : RegisterContextPOSIX_x86(thread, concrete_frame_idx, register_info) { +// Store byte offset of fctrl (i.e. first register of FPR) wrt 'UserArea' +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl"); +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset; } ProcessMonitor & @@ -254,8 +257,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 } // Get pointer to m_fpr.xstate.fxsave variable and set the data from it. -assert (reg_info->byte_offset < sizeof(m_fpr)); -uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset; +// Byte offsets of all registers are calculated wrt 'UserArea' structure. +// However, ReadFPR() reads fpu registers {using ptrace(PT_GETFPREGS,..)} +// and stores them in 'm_fpr' (of type FPR structure). To extract values of fpu +// registers, m_fpr should be read at byte offsets calculated wrt to FPR structure. + +// Since, FPR structure is also one of the member of UserArea structure. +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - byte_offset(fctrl wrt UserArea) +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < sizeof(m_fpr)); +uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset - m_fctrl_offset_in_userarea; switch (reg_info->byte_size) { case 2: @@ -308,8 +318,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 else { // Get pointer to m_fpr.xstate.fxsave variable and set the data to it. -assert (reg_info->byte_offset < sizeof(m_fpr)); -uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset; +// Byte offsets of all registers are calculated wrt 'UserArea' structure. +// However, WriteFPR() takes m_fpr (of type FPR structure) and writes only fpu +// registers using ptrace(PT_SETFPREGS,..) API. Hence fpu registers should +// be written in m_fpr at byte offsets calculated wrt FPR structure. + +// Since, FPR structure is also one of the member of UserArea structure. +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - byte_offset(fctrl wrt UserArea) +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < sizeof(m_fpr)); +uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset - m_fctrl_offset_in_userarea; switch (reg_info->byte_size) { case 2: Modified: lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Pl
[Lldb-commits] [lldb] r249419 - Switching TestCallUserDefinedFunction from xfail to flaky on OS X.
Author: tfiala Date: Tue Oct 6 10:23:52 2015 New Revision: 249419 URL: http://llvm.org/viewvc/llvm-project?rev=249419&view=rev Log: Switching TestCallUserDefinedFunction from xfail to flaky on OS X. This is passing 50/50 times for me. Moving to flaky as precautionary measure. Modified: lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py Modified: lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py?rev=249419&r1=249418&r2=249419&view=diff == --- lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py (original) +++ lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py Tue Oct 6 10:23:52 2015 @@ -22,7 +22,7 @@ class ExprCommandCallUserDefinedFunction # Find the line number to break for main.c. self.line = line_number('main.cpp', '// Please test these expressions while stopped at this line:') -@expectedFailureDarwin("llvm.org/pr20274", debug_info=["dsym"]) # intermittent failure on MacOSX +@expectedFlakeyDarwin("llvm.org/pr20274") # intermittent failure on MacOSX, dsym only @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") def test(self): """Test return values of user defined function calls.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249421 - Reduce load on TestMultipleDebuggers.
Author: tfiala Date: Tue Oct 6 10:33:51 2015 New Revision: 249421 URL: http://llvm.org/viewvc/llvm-project?rev=249421&view=rev Log: Reduce load on TestMultipleDebuggers. 4-core CPUs have a hard time keeping up with the number of debuggers we were simultaneously spawning. This leads to a timeout, which leaves processes hanging around in "suspended mode", which can't be killed with signals. Modified: lldb/trunk/test/api/multiple-debuggers/multi-process-driver.cpp Modified: lldb/trunk/test/api/multiple-debuggers/multi-process-driver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/api/multiple-debuggers/multi-process-driver.cpp?rev=249421&r1=249420&r2=249421&view=diff == --- lldb/trunk/test/api/multiple-debuggers/multi-process-driver.cpp (original) +++ lldb/trunk/test/api/multiple-debuggers/multi-process-driver.cpp Tue Oct 6 10:33:51 2015 @@ -25,7 +25,7 @@ #include #include -#define NUMBER_OF_SIMULTANEOUS_DEBUG_SESSIONS 50 +#define NUMBER_OF_SIMULTANEOUS_DEBUG_SESSIONS 20 #define DEBUG 0 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249425 - Convert expectedFlakeyDarwin to expectedFlakeyDsym for TestCallUserDefinedFunction.py
Author: tfiala Date: Tue Oct 6 10:57:55 2015 New Revision: 249425 URL: http://llvm.org/viewvc/llvm-project?rev=249425&view=rev Log: Convert expectedFlakeyDarwin to expectedFlakeyDsym for TestCallUserDefinedFunction.py Closes: https://llvm.org/bugs/show_bug.cgi?id=25076 Modified: lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py Modified: lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py?rev=249425&r1=249424&r2=249425&view=diff == --- lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py (original) +++ lldb/trunk/test/expression_command/call-function/TestCallUserDefinedFunction.py Tue Oct 6 10:57:55 2015 @@ -22,7 +22,7 @@ class ExprCommandCallUserDefinedFunction # Find the line number to break for main.c. self.line = line_number('main.cpp', '// Please test these expressions while stopped at this line:') -@expectedFlakeyDarwin("llvm.org/pr20274") # intermittent failure on MacOSX, dsym only +@expectedFlakeyDsym("llvm.org/pr20274") @expectedFailureWindows("llvm.org/pr24489: Name lookup not working correctly on Windows") def test(self): """Test return values of user defined function calls.""" ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special Purpose Registers
I see. In the future in this kind of situation could you mention in the commit message what test this fixes. For example, "This fixes TestRegisters.py on FreeBSD". On Tue, Oct 6, 2015 at 7:59 AM Aggarwal, Abhishek A < abhishek.a.aggar...@intel.com> wrote: > I had submitted a patch for the Bug 24457 which is similar kind of bug but > on Linux x86_64 Platform. There, I had submitted a new test to reproduce > this issue. The test is already there in public repository. Since, the same > test goes for FreeBSD also therefore I didn’t need to write a new one. > > > > -Thanks > > > > > > *From:* Zachary Turner [mailto:ztur...@google.com] > *Sent:* Tuesday, October 6, 2015 4:53 PM > *To:* Aggarwal, Abhishek A; lldb-commits@lists.llvm.org > *Subject:* Re: [Lldb-commits] [lldb] r249379 - Bug 25050: X87 FPU Special > Purpose Registers > > > > Please don't submit CLs like this without a test in the future. This > should be testable by writing some assembly to move a value into an FPU > register, setting a breakpoint, then querying the register values. Can you > submit this as a followup? > > > > On Tue, Oct 6, 2015 at 12:05 AM Abhishek Aggarwal via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > > Author: abhishek > Date: Tue Oct 6 02:04:03 2015 > New Revision: 249379 > > URL: http://llvm.org/viewvc/llvm-project?rev=249379&view=rev > Log: > Bug 25050: X87 FPU Special Purpose Registers > > Summary: > - For x86_64-FreeBSD Platform: > -- LLDB now provides correct values of X87 FPU >Special Purpose Registers like fstat, ftag, fctrl etc.. > > Signed-off-by: Abhishek Aggarwal > > Reviewers: emaste, mikesart, clayborg > > Subscribers: emaste > > Differential Revision: http://reviews.llvm.org/D13434 > > Modified: > > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.h > > Modified: > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp?rev=249379&r1=249378&r2=249379&view=diff > > == > --- > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > (original) > +++ > lldb/trunk/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp > Tue Oct 6 02:04:03 2015 > @@ -58,6 +58,9 @@ RegisterContextPOSIXProcessMonitor_x86_6 > > lldb_private::RegisterInfoInterface *register_info) > : RegisterContextPOSIX_x86(thread, concrete_frame_idx, register_info) > { > +// Store byte offset of fctrl (i.e. first register of FPR) wrt > 'UserArea' > +const RegisterInfo *reg_info_fctrl = GetRegisterInfoByName("fctrl"); > +m_fctrl_offset_in_userarea = reg_info_fctrl->byte_offset; > } > > ProcessMonitor & > @@ -254,8 +257,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 > } > > // Get pointer to m_fpr.xstate.fxsave variable and set the data from > it. > -assert (reg_info->byte_offset < sizeof(m_fpr)); > -uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset; > +// Byte offsets of all registers are calculated wrt 'UserArea' > structure. > +// However, ReadFPR() reads fpu registers {using > ptrace(PT_GETFPREGS,..)} > +// and stores them in 'm_fpr' (of type FPR structure). To extract > values of fpu > +// registers, m_fpr should be read at byte offsets calculated wrt to > FPR structure. > + > +// Since, FPR structure is also one of the member of UserArea > structure. > +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - > byte_offset(fctrl wrt UserArea) > +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) < > sizeof(m_fpr)); > +uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset - > m_fctrl_offset_in_userarea; > switch (reg_info->byte_size) > { > case 2: > @@ -308,8 +318,15 @@ RegisterContextPOSIXProcessMonitor_x86_6 > else > { > // Get pointer to m_fpr.xstate.fxsave variable and set the > data to it. > -assert (reg_info->byte_offset < sizeof(m_fpr)); > -uint8_t *dst = (uint8_t *)&m_fpr + reg_info->byte_offset; > +// Byte offsets of all registers are calculated wrt > 'UserArea' structure. > +// However, WriteFPR() takes m_fpr (of type FPR structure) > and writes only fpu > +// registers using ptrace(PT_SETFPREGS,..) API. Hence fpu > registers should > +// be written in m_fpr at byte offsets calculated wrt FPR > structure. > + > +// Since, FPR structure is also one of the member of UserArea > structure. > +// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) - > byte_offset(fctrl wrt UserArea) > +assert ( (reg_info->byte_offset - m_fctrl_offset_in_userarea) >
Re: [Lldb-commits] [PATCH] D13463: Remove GetShortPluginName.
clayborg accepted this revision. clayborg added a comment. This revision is now accepted and ready to land. Looks good. http://reviews.llvm.org/D13463 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13268: Simple readline functionality for interactive python on linux.
ribrdb updated this revision to Diff 36637. Repository: rL LLVM http://reviews.llvm.org/D13268 Files: CMakeLists.txt scripts/Python/modules/readline/CMakeLists.txt scripts/Python/modules/readline/readline.cpp source/CMakeLists.txt Index: source/CMakeLists.txt === --- source/CMakeLists.txt +++ source/CMakeLists.txt @@ -6,11 +6,6 @@ set(LLDB_DEFAULT_DISABLE_LIBEDIT 0) endif () -set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.") -if (LLDB_DISABLE_LIBEDIT) - add_definitions( -DLLDB_DISABLE_LIBEDIT ) -endif() - if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) include_directories( Plugins/Process/Linux Index: scripts/Python/modules/readline/readline.cpp === --- scripts/Python/modules/readline/readline.cpp +++ scripts/Python/modules/readline/readline.cpp @@ -1,23 +1,68 @@ #include #include "Python.h" -// Python readline module intentionally built to not implement the -// readline module interface. This is meant to work around llvm -// pr18841 to avoid seg faults in the stock Python readline.so linked -// against GNU readline. +#ifndef LLDB_DISABLE_LIBEDIT +#include +#endif + +// Simple implementation of the Python readline module using libedit. +// In the event that libedit is excluded from the build, this turns +// back into a null implementation that blocks the module from pulling +// in the GNU readline shared lib, which causes linkage confusion when +// both readline and libedit's readline compatibility symbols collide. +// +// Currently it only installs a PyOS_ReadlineFunctionPointer, without +// implementing any of the readline module methods. This is meant to +// work around LLVM pr18841 to avoid seg faults in the stock Python +// readline.so linked against GNU readline. static struct PyMethodDef moduleMethods[] = { {nullptr, nullptr, 0, nullptr} }; +#ifndef LLDB_DISABLE_LIBEDIT +PyDoc_STRVAR( +moduleDocumentation, +"Simple readline module implementation based on libedit."); +#else PyDoc_STRVAR( moduleDocumentation, -"Stub module meant to effectively disable readline support."); +"Stub module meant to avoid linking GNU readline."); +#endif + +#ifndef LLDB_DISABLE_LIBEDIT +static char* +simple_readline(FILE *stdin, FILE *stdout, char *prompt) +{ +rl_instream = stdin; +rl_outstream = stdout; +char* line = readline(prompt); +if (!line) +{ +char* ret = (char*)PyMem_Malloc(1); +if (ret != NULL) +*ret = '\0'; +return ret; +} +if (*line) +add_history(line); +int n = strlen(line); +char* ret = (char*)PyMem_Malloc(n + 2); +strncpy(ret, line, n); +free(line); +ret[n] = '\n'; +ret[n+1] = '\0'; +return ret; +} +#endif PyMODINIT_FUNC initreadline(void) { +#ifndef LLDB_DISABLE_LIBEDIT +PyOS_ReadlineFunctionPointer = simple_readline; +#endif Py_InitModule4( "readline", moduleMethods, Index: scripts/Python/modules/readline/CMakeLists.txt === --- scripts/Python/modules/readline/CMakeLists.txt +++ scripts/Python/modules/readline/CMakeLists.txt @@ -7,7 +7,11 @@ include_directories(${PYTHON_INCLUDE_DIR}) add_library(readline SHARED readline.cpp) -target_link_libraries(readline ${PYTHON_LIBRARY}) +if (NOT LLDB_DISABLE_LIBEDIT) + target_link_libraries(readline ${PYTHON_LIBRARY} edit) +else() + target_link_libraries(readline ${PYTHON_LIBRARY}) +endif() # FIXME: the LIBRARY_OUTPUT_PATH seems to be ignored - this is not a # functional issue for the build dir, though, since the shared lib dir Index: CMakeLists.txt === --- CMakeLists.txt +++ CMakeLists.txt @@ -4,7 +4,14 @@ include(cmake/modules/LLDBConfig.cmake) include(cmake/modules/AddLLDB.cmake) -#add_subdirectory(include) +# We need libedit support to go down both the source and +# the scripts directories. +set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.") +if (LLDB_DISABLE_LIBEDIT) + add_definitions( -DLLDB_DISABLE_LIBEDIT ) +endif() + +# add_subdirectory(include) add_subdirectory(docs) if (NOT LLDB_DISABLE_PYTHON) add_subdirectory(scripts) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249433 - Create a logging category that is specific to data formatters activity
Author: enrico Date: Tue Oct 6 12:55:14 2015 New Revision: 249433 URL: http://llvm.org/viewvc/llvm-project?rev=249433&view=rev Log: Create a logging category that is specific to data formatters activity Modified: lldb/trunk/include/lldb/Core/Logging.h lldb/trunk/source/Core/FormatEntity.cpp lldb/trunk/source/Core/Logging.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/DataFormatters/FormatManager.cpp lldb/trunk/source/DataFormatters/TypeCategoryMap.cpp Modified: lldb/trunk/include/lldb/Core/Logging.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Logging.h?rev=249433&r1=249432&r2=249433&view=diff == --- lldb/trunk/include/lldb/Core/Logging.h (original) +++ lldb/trunk/include/lldb/Core/Logging.h Tue Oct 6 12:55:14 2015 @@ -48,6 +48,7 @@ #define LIBLLDB_LOG_SYSTEM_RUNTIME (1u << 26) #define LIBLLDB_LOG_JIT_LOADER (1u << 27) #define LIBLLDB_LOG_LANGUAGE(1u << 28) +#define LIBLLDB_LOG_DATAFORMATTERS (1u << 29) #define LIBLLDB_LOG_ALL (UINT32_MAX) #define LIBLLDB_LOG_DEFAULT (LIBLLDB_LOG_PROCESS |\ LIBLLDB_LOG_THREAD |\ Modified: lldb/trunk/source/Core/FormatEntity.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=249433&r1=249432&r2=249433&view=diff == --- lldb/trunk/source/Core/FormatEntity.cpp (original) +++ lldb/trunk/source/Core/FormatEntity.cpp Tue Oct 6 12:55:14 2015 @@ -533,7 +533,7 @@ ScanBracketedRange (llvm::StringRef subp int64_t& index_lower, int64_t& index_higher) { -Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); +Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS)); close_bracket_index = llvm::StringRef::npos; const size_t open_bracket_index = subpath.find('['); if (open_bracket_index == llvm::StringRef::npos) @@ -670,7 +670,7 @@ ExpandIndexedExpression (ValueObject* va StackFrame* frame, bool deref_pointer) { -Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); +Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS)); const char* ptr_deref_format = "[%d]"; std::string ptr_deref_buffer(10,0); ::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index); @@ -731,7 +731,7 @@ DumpValue (Stream &s, if (valobj == NULL) return false; -Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); +Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_DATAFORMATTERS)); Format custom_format = eFormatInvalid; ValueObject::ValueObjectRepresentationStyle val_obj_display = entry.string.empty() ? ValueObject::eValueObjectRepresentationStyleValue : ValueObject::eValueObjectRepresentationStyleSummary; Modified: lldb/trunk/source/Core/Logging.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Logging.cpp?rev=249433&r1=249432&r2=249433&view=diff == --- lldb/trunk/source/Core/Logging.cpp (original) +++ lldb/trunk/source/Core/Logging.cpp Tue Oct 6 12:55:14 2015 @@ -148,6 +148,7 @@ lldb_private::DisableLog (const char **c else if (0 == ::strcasecmp(arg, "os")) flag_bits &= ~LIBLLDB_LOG_OS; else if (0 == ::strcasecmp(arg, "jit")) flag_bits &= ~LIBLLDB_LOG_JIT_LOADER; else if (0 == ::strcasecmp(arg, "language"))flag_bits &= ~LIBLLDB_LOG_LANGUAGE; +else if (0 == ::strncasecmp(arg, "formatters", 10)) flag_bits &= ~LIBLLDB_LOG_DATAFORMATTERS; else { feedback_strm->Printf ("error: unrecognized log category '%s'\n", arg); @@ -224,6 +225,7 @@ lldb_private::EnableLog (StreamSP &log_s else if (0 == ::strncasecmp(arg, "watch", 5)) flag_bits |= LIBLLDB_LOG_WATCHPOINTS; else if (0 == ::strcasecmp(arg, "jit")) flag_bits |= LIBLLDB_LOG_JIT_LOADER; else if (0 == ::strcasecmp(arg, "language"))flag_bits |= LIBLLDB_LOG_LANGUAGE; +else if (0 == ::strncasecmp(arg, "formatters", 10)) flag_bits |= LIBLLDB_LOG_DATAFORMATTERS; else { feedback_strm->Printf("error: unrecognized log category '%s'\n", arg); @@ -254,6 +256,7 @@ lldb_private::ListLogCategories (Stream " dyld - log shared library related activities\n" " events - log broadcaster, listener and event queue activities\n" " expr - log expressions\n" + " formatters - log data formatters related a
[Lldb-commits] [lldb] r249434 - Fix Darwin build of lldb-server.
Author: sas Date: Tue Oct 6 13:03:04 2015 New Revision: 249434 URL: http://llvm.org/viewvc/llvm-project?rev=249434&view=rev Log: Fix Darwin build of lldb-server. Summary: We were missing the symbol for the version number. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13271 Modified: lldb/trunk/cmake/LLDBDependencies.cmake lldb/trunk/source/CMakeLists.txt Modified: lldb/trunk/cmake/LLDBDependencies.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=249434&r1=249433&r2=249434&view=diff == --- lldb/trunk/cmake/LLDBDependencies.cmake (original) +++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Oct 6 13:03:04 2015 @@ -103,13 +103,6 @@ endif () # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) list(APPEND LLDB_USED_LIBS lldbPluginDynamicLoaderDarwinKernel lldbPluginObjectFileMachO Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=249434&r1=249433&r2=249434&view=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Tue Oct 6 13:03:04 2015 @@ -25,8 +25,19 @@ include_directories( ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core +> ${LLDB_VERS_GENERATED_FILE}) + + set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) +endif () + add_lldb_library(lldbBase lldb.cpp + ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13271: Fix Darwin build of lldb-server.
This revision was automatically updated to reflect the committed changes. Closed by commit rL249434: Fix Darwin build of lldb-server. (authored by sas). Changed prior to commit: http://reviews.llvm.org/D13271?vs=36035&id=36638#toc Repository: rL LLVM http://reviews.llvm.org/D13271 Files: lldb/trunk/cmake/LLDBDependencies.cmake lldb/trunk/source/CMakeLists.txt Index: lldb/trunk/cmake/LLDBDependencies.cmake === --- lldb/trunk/cmake/LLDBDependencies.cmake +++ lldb/trunk/cmake/LLDBDependencies.cmake @@ -103,13 +103,6 @@ # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) list(APPEND LLDB_USED_LIBS lldbPluginDynamicLoaderDarwinKernel lldbPluginObjectFileMachO Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -25,8 +25,19 @@ ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core +> ${LLDB_VERS_GENERATED_FILE}) + + set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) +endif () + add_lldb_library(lldbBase lldb.cpp + ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) Index: lldb/trunk/cmake/LLDBDependencies.cmake === --- lldb/trunk/cmake/LLDBDependencies.cmake +++ lldb/trunk/cmake/LLDBDependencies.cmake @@ -103,13 +103,6 @@ # Darwin-only libraries if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) - set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) - add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} -COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl -${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core -> ${LLDB_VERS_GENERATED_FILE}) - - set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) list(APPEND LLDB_USED_LIBS lldbPluginDynamicLoaderDarwinKernel lldbPluginObjectFileMachO Index: lldb/trunk/source/CMakeLists.txt === --- lldb/trunk/source/CMakeLists.txt +++ lldb/trunk/source/CMakeLists.txt @@ -25,8 +25,19 @@ ) endif () +if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" ) + set(LLDB_VERS_GENERATED_FILE ${LLDB_BINARY_DIR}/source/LLDB_vers.c) + add_custom_command(OUTPUT ${LLDB_VERS_GENERATED_FILE} +COMMAND ${LLDB_SOURCE_DIR}/scripts/generate-vers.pl +${LLDB_SOURCE_DIR}/lldb.xcodeproj/project.pbxproj liblldb_core +> ${LLDB_VERS_GENERATED_FILE}) + + set_source_files_properties(${LLDB_VERS_GENERATED_FILE} PROPERTIES GENERATED 1) +endif () + add_lldb_library(lldbBase lldb.cpp + ${LLDB_VERS_GENERATED_FILE} ) add_subdirectory(Breakpoint) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249446 - Address failing Go tests on go version from Ubuntu 14.04
Author: tfiala Date: Tue Oct 6 14:15:56 2015 New Revision: 249446 URL: http://llvm.org/viewvc/llvm-project?rev=249446&view=rev Log: Address failing Go tests on go version from Ubuntu 14.04 Go tests fail on Ubuntu 14.04's go1.2.1. This change puts a minimum go version in the skipUnlessGoInstalled() decorator of go1.3.0. Go maintainers are encouraged to modify as needed. For now this fixes failing tests on Ubuntu 14.04 x86_64 buildbots with stock distro go installed. Modified: lldb/trunk/test/lldbtest.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249446&r1=249445&r2=249446&view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Tue Oct 6 14:15:56 2015 @@ -938,7 +938,29 @@ def skipUnlessGoInstalled(func): if not compiler: self.skipTest("skipping because go compiler not found") else: -func(*args, **kwargs) +# Ensure the version is the minimum version supported by +# the go tests. Empirically this is *not* version go1.2.1 +# that comes with Ubuntu 14.04. Go maintainers should +# verify, or possibly extend this decorator to provide +# min go versions that can vary by test. +match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler) +if not match_version: +# Couldn't determine version. +self.skipTest( +"skipping because go version could not be parsed " +"out of {}".format(compiler)) +else: +from distutils.version import StrictVersion +min_strict_version = StrictVersion("1.3.0") +compiler_strict_version = StrictVersion(match_version.group(1)) +if compiler_strict_version < min_strict_version: +self.skipTest( +"skipping because available go version ({}) does " +"not meet minimum go version {}".format( +compiler_strict_version, +min_strict_version)) +if not skip_test: +func(*args, **kwargs) return wrapper def getPlatform(): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249448 - Bungled my last change in a tweak.
Author: tfiala Date: Tue Oct 6 14:23:22 2015 New Revision: 249448 URL: http://llvm.org/viewvc/llvm-project?rev=249448&view=rev Log: Bungled my last change in a tweak. I took out a skip_test check that wasn't necessary, but didn't fully yank it out. Would break a normal go install. Modified: lldb/trunk/test/lldbtest.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249448&r1=249447&r2=249448&view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Tue Oct 6 14:23:22 2015 @@ -959,8 +959,7 @@ def skipUnlessGoInstalled(func): "not meet minimum go version {}".format( compiler_strict_version, min_strict_version)) -if not skip_test: -func(*args, **kwargs) +func(*args, **kwargs) return wrapper def getPlatform(): ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13268: Simple readline functionality for interactive python on linux.
tfiala accepted this revision. tfiala added a comment. This revision is now accepted and ready to land. LGTM. Thanks, Ryan! Repository: rL LLVM http://reviews.llvm.org/D13268 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249452 - Remove GetShortPluginName.
Author: brucem Date: Tue Oct 6 15:15:27 2015 New Revision: 249452 URL: http://llvm.org/viewvc/llvm-project?rev=249452&view=rev Log: Remove GetShortPluginName. Summary: This was deprecated and removed. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13463 Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=249452&r1=249451&r2=249452&view=diff == --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original) +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Tue Oct 6 15:15:27 2015 @@ -36,7 +36,6 @@ using namespace lldb; using namespace lldb_private; static const char *pluginDesc = "Mac OS X ABI for arm64 targets"; -static const char *pluginShort = "abi.macosx-arm64"; static RegisterInfo g_register_infos[] = @@ -1092,12 +1091,6 @@ ABIMacOSX_arm64::GetPluginNameStatic() return g_plugin_name; } -const char * -ABIMacOSX_arm64::GetShortPluginName() -{ -return pluginShort; -} - uint32_t ABIMacOSX_arm64::GetPluginVersion() { Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h?rev=249452&r1=249451&r2=249452&view=diff == --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h (original) +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h Tue Oct 6 15:15:27 2015 @@ -106,9 +106,6 @@ public: return GetPluginNameStatic(); } -virtual const char * -GetShortPluginName(); - virtual uint32_t GetPluginVersion(); Modified: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h?rev=249452&r1=249451&r2=249452&view=diff == --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h (original) +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h Tue Oct 6 15:15:27 2015 @@ -53,12 +53,6 @@ public: virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Modified: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h?rev=249452&r1=249451&r2=249452&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Tue Oct 6 15:15:27 2015 @@ -63,12 +63,6 @@ public: lldb_private::ConstString GetPluginName() override; -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - uint32_t GetPluginVersion() override { Modified: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h?rev=249452&r1=249451&r2=249452&view=diff == --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h (original) +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Tue Oct 6 15:15:27 2015 @@ -63,12 +63,6 @@ public: virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D13463: Remove GetShortPluginName.
This revision was automatically updated to reflect the committed changes. Closed by commit rL249452: Remove GetShortPluginName. (authored by brucem). Changed prior to commit: http://reviews.llvm.org/D13463?vs=36602&id=36649#toc Repository: rL LLVM http://reviews.llvm.org/D13463 Files: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h === --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -106,9 +106,6 @@ return GetPluginNameStatic(); } -virtual const char * -GetShortPluginName(); - virtual uint32_t GetPluginVersion(); Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp === --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -36,7 +36,6 @@ using namespace lldb_private; static const char *pluginDesc = "Mac OS X ABI for arm64 targets"; -static const char *pluginShort = "abi.macosx-arm64"; static RegisterInfo g_register_infos[] = @@ -1092,12 +1091,6 @@ return g_plugin_name; } -const char * -ABIMacOSX_arm64::GetShortPluginName() -{ -return pluginShort; -} - uint32_t ABIMacOSX_arm64::GetPluginVersion() { Index: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h === --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -53,12 +53,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h === --- lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h +++ lldb/trunk/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h @@ -63,12 +63,6 @@ lldb_private::ConstString GetPluginName() override; -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - uint32_t GetPluginVersion() override { Index: lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h === --- lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h +++ lldb/trunk/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h @@ -63,12 +63,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -return GetPluginNameStatic(); -} - virtual uint32_t GetPluginVersion() { Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h === --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.h @@ -106,9 +106,6 @@ return GetPluginNameStatic(); } -virtual const char * -GetShortPluginName(); - virtual uint32_t GetPluginVersion(); Index: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp === --- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp +++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp @@ -36,7 +36,6 @@ using namespace lldb_private; static const char *pluginDesc = "Mac OS X ABI for arm64 targets"; -static const char *pluginShort = "abi.macosx-arm64"; static RegisterInfo g_register_infos[] = @@ -1092,12 +1091,6 @@ return g_plugin_name; } -const char * -ABIMacOSX_arm64::GetShortPluginName() -{ -return pluginShort; -} - uint32_t ABIMacOSX_arm64::GetPluginVersion() { Index: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h === --- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h +++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h @@ -53,12 +53,6 @@ virtual lldb_private::ConstString GetPluginName(); -virtual lldb_private::ConstString -GetShortPluginName() -{ -
Re: [Lldb-commits] [lldb] r249446 - Address failing Go tests on go version from Ubuntu 14.04
I was wondering if we'd need this. Go 1.4 is the minimum supported version. On Tue, Oct 6, 2015 at 12:17 PM Todd Fiala via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: tfiala > Date: Tue Oct 6 14:15:56 2015 > New Revision: 249446 > > URL: http://llvm.org/viewvc/llvm-project?rev=249446&view=rev > Log: > Address failing Go tests on go version from Ubuntu 14.04 > > Go tests fail on Ubuntu 14.04's go1.2.1. This change puts a minimum > go version in the skipUnlessGoInstalled() decorator of go1.3.0. > Go maintainers are encouraged to modify as needed. For now this fixes > failing tests on Ubuntu 14.04 x86_64 buildbots with stock distro go > installed. > > Modified: > lldb/trunk/test/lldbtest.py > > Modified: lldb/trunk/test/lldbtest.py > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249446&r1=249445&r2=249446&view=diff > > == > --- lldb/trunk/test/lldbtest.py (original) > +++ lldb/trunk/test/lldbtest.py Tue Oct 6 14:15:56 2015 > @@ -938,7 +938,29 @@ def skipUnlessGoInstalled(func): > if not compiler: > self.skipTest("skipping because go compiler not found") > else: > -func(*args, **kwargs) > +# Ensure the version is the minimum version supported by > +# the go tests. Empirically this is *not* version go1.2.1 > +# that comes with Ubuntu 14.04. Go maintainers should > +# verify, or possibly extend this decorator to provide > +# min go versions that can vary by test. > +match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler) > +if not match_version: > +# Couldn't determine version. > +self.skipTest( > +"skipping because go version could not be parsed " > +"out of {}".format(compiler)) > +else: > +from distutils.version import StrictVersion > +min_strict_version = StrictVersion("1.3.0") > +compiler_strict_version = > StrictVersion(match_version.group(1)) > +if compiler_strict_version < min_strict_version: > +self.skipTest( > +"skipping because available go version ({}) does " > +"not meet minimum go version {}".format( > +compiler_strict_version, > +min_strict_version)) > +if not skip_test: > +func(*args, **kwargs) > return wrapper > > def getPlatform(): > > > ___ > lldb-commits mailing list > lldb-commits@lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249456 - Create GoLanguageRuntime.
Author: ribrdb Date: Tue Oct 6 15:29:31 2015 New Revision: 249456 URL: http://llvm.org/viewvc/llvm-project?rev=249456&view=rev Log: Create GoLanguageRuntime. GoLanguageRuntime supports finding the runtime type for Go interfaces. Modified: lldb/trunk/cmake/LLDBDependencies.cmake lldb/trunk/lldb.xcodeproj/project.pbxproj lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Plugins/LanguageRuntime/CMakeLists.txt lldb/trunk/source/Symbol/GoASTContext.cpp Modified: lldb/trunk/cmake/LLDBDependencies.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=249456&r1=249455&r2=249456&view=diff == --- lldb/trunk/cmake/LLDBDependencies.cmake (original) +++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Oct 6 15:29:31 2015 @@ -47,6 +47,7 @@ set( LLDB_USED_LIBS lldbPluginUnwindAssemblyX86 lldbPluginAppleObjCRuntime lldbPluginRenderScriptRuntime + lldbPluginLanguageRuntimeGo lldbPluginCXXItaniumABI lldbPluginABIMacOSX_arm lldbPluginABIMacOSX_arm64 Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=249456&r1=249455&r2=249456&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Oct 6 15:29:31 2015 @@ -821,6 +821,7 @@ 9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; }; 9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; }; A36FF33C17D8E94600244D40 /* OptionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A36FF33B17D8E94600244D40 /* OptionParser.cpp */; }; + AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */; }; AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */; }; AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */; }; AE8F624919EF3E1E00326B21 /* OperatingSystemGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */; }; @@ -2638,6 +2639,8 @@ 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = source/API/SBBreakpointLocation.cpp; sourceTree = ""; }; A36FF33B17D8E94600244D40 /* OptionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionParser.cpp; sourceTree = ""; }; A36FF33D17D8E98800244D40 /* OptionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionParser.h; path = include/lldb/Host/OptionParser.h; sourceTree = ""; }; + AE44FB3C1BB4858A0033EB62 /* GoLanguageRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoLanguageRuntime.h; path = Go/GoLanguageRuntime.h; sourceTree = ""; }; + AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLanguageRuntime.cpp; path = Go/GoLanguageRuntime.cpp; sourceTree = ""; }; AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserGo.cpp; sourceTree = ""; }; AE6897271B94F6DE0018845D /* DWARFASTParserGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserGo.h; sourceTree = ""; }; AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystemGo.cpp; path = Go/OperatingSystemGo.cpp; sourceTree = ""; }; @@ -5129,6 +5132,7 @@ 4CCA643A13B40B82003BDF98 /* LanguageRuntime */ = { isa = PBXGroup; children = ( + AE44FB3B1BB485730033EB62 /* Go */, 49724D961AD6ECFA0033C538 /* RenderScript */, 4CCA643B13B40B82003BDF98 /* CPlusPlus */, 4CCA644013B40B82003BDF98 /* ObjC */, @@ -5456,6 +5460,15 @@ name = "S
[Lldb-commits] [lldb] r249459 - Add missing GoLanguageRuntime files.
Author: ribrdb Date: Tue Oct 6 15:31:08 2015 New Revision: 249459 URL: http://llvm.org/viewvc/llvm-project?rev=249459&view=rev Log: Add missing GoLanguageRuntime files. Added: lldb/trunk/source/Plugins/LanguageRuntime/Go/ lldb/trunk/source/Plugins/LanguageRuntime/Go/CMakeLists.txt lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/Go/Makefile lldb/trunk/test/lang/go/runtime/ lldb/trunk/test/lang/go/runtime/TestGoASTContext.py lldb/trunk/test/lang/go/runtime/main.go Added: lldb/trunk/source/Plugins/LanguageRuntime/Go/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/Go/CMakeLists.txt?rev=249459&view=auto == --- lldb/trunk/source/Plugins/LanguageRuntime/Go/CMakeLists.txt (added) +++ lldb/trunk/source/Plugins/LanguageRuntime/Go/CMakeLists.txt Tue Oct 6 15:31:08 2015 @@ -0,0 +1,5 @@ +set(LLVM_NO_RTTI 1) + +add_lldb_library(lldbPluginLanguageRuntimeGo + GoLanguageRuntime.cpp + ) Added: lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp?rev=249459&view=auto == --- lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp (added) +++ lldb/trunk/source/Plugins/LanguageRuntime/Go/GoLanguageRuntime.cpp Tue Oct 6 15:31:08 2015 @@ -0,0 +1,238 @@ +//===-- GoLanguageRuntime.cpp --*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#include "GoLanguageRuntime.h" + +#include "lldb/Breakpoint/BreakpointLocation.h" +#include "lldb/Core/ConstString.h" +#include "lldb/Core/Error.h" +#include "lldb/Core/Log.h" +#include "lldb/Core/Module.h" +#include "lldb/Core/PluginManager.h" +#include "lldb/Core/Scalar.h" +#include "lldb/Core/ValueObject.h" +#include "lldb/Core/ValueObjectMemory.h" +#include "lldb/Symbol/GoASTContext.h" +#include "lldb/Symbol/Symbol.h" +#include "lldb/Symbol/TypeList.h" +#include "lldb/Target/Process.h" +#include "lldb/Target/RegisterContext.h" +#include "lldb/Target/SectionLoadList.h" +#include "lldb/Target/StopInfo.h" +#include "lldb/Target/Target.h" +#include "lldb/Target/Thread.h" +#include "llvm/ADT/Twine.h" + +#include + +using namespace lldb; +using namespace lldb_private; + +namespace { +ValueObjectSP GetChild(ValueObject& obj, const char* name, bool dereference = true) { +ConstString name_const_str(name); +ValueObjectSP result = obj.GetChildMemberWithName(name_const_str, true); +if (dereference && result && result->IsPointerType()) { +Error err; +result = result->Dereference(err); +if (err.Fail()) +result.reset(); +} +return result; +} + +ConstString ReadString(ValueObject& str, Process* process) { +ConstString result; +ValueObjectSP data = GetChild(str, "str", false); +ValueObjectSP len = GetChild(str, "len"); +if (len && data) +{ +Error err; +lldb::addr_t addr = data->GetPointerValue(); +if (addr == LLDB_INVALID_ADDRESS) +return result; +uint64_t byte_size = len->GetValueAsUnsigned(0); +char* buf = new char[byte_size + 1]; +buf[byte_size] = 0; +size_t bytes_read = process->ReadMemory (addr, + buf, + byte_size, + err); +if (!(err.Fail() || bytes_read != byte_size)) +result = ConstString(buf, bytes_read); +delete[] buf; +} +return result; +} + +ConstString +ReadTypeName(ValueObjectSP type, Process* process) +{ +if (ValueObjectSP uncommon = GetChild(*type, "x")) +{ +ValueObjectSP name = GetChild(*uncommon, "name"); +ValueObjectSP package = GetChild(*uncommon, "pkgpath"); +if (name && name->GetPointerValue() != 0 && package && package->GetPointerValue() != 0) +{ +ConstString package_const_str = ReadString(*package, process); +ConstString name_const_str = ReadString(*name, process); +if (package_const_str.GetLength() == 0) +return name_const_str; +return ConstString((package_const_str.GetStringRef() + "." + name_const_str.GetStringRef()).str()); +} +} +ValueObjectSP name = GetChild(*type, "_string"); +if (name) +return ReadString(*name, process); +return ConstString(""); +} + +CompilerType
Re: [Lldb-commits] [lldb] r249456 - Create GoLanguageRuntime.
Have you added any tests for any of the Go functionality yet? If you have an AST Context, I assume there's at least some way to exercise some of this functionality, in which case it seems like there should be some tests. maybe you've already been keeping up with this, just want to make sure. On Tue, Oct 6, 2015 at 1:31 PM Ryan Brown via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: ribrdb > Date: Tue Oct 6 15:29:31 2015 > New Revision: 249456 > > URL: http://llvm.org/viewvc/llvm-project?rev=249456&view=rev > Log: > Create GoLanguageRuntime. > > GoLanguageRuntime supports finding the runtime type for Go interfaces. > > Modified: > lldb/trunk/cmake/LLDBDependencies.cmake > lldb/trunk/lldb.xcodeproj/project.pbxproj > lldb/trunk/source/API/SystemInitializerFull.cpp > lldb/trunk/source/Plugins/LanguageRuntime/CMakeLists.txt > lldb/trunk/source/Symbol/GoASTContext.cpp > > Modified: lldb/trunk/cmake/LLDBDependencies.cmake > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/LLDBDependencies.cmake?rev=249456&r1=249455&r2=249456&view=diff > > == > --- lldb/trunk/cmake/LLDBDependencies.cmake (original) > +++ lldb/trunk/cmake/LLDBDependencies.cmake Tue Oct 6 15:29:31 2015 > @@ -47,6 +47,7 @@ set( LLDB_USED_LIBS >lldbPluginUnwindAssemblyX86 >lldbPluginAppleObjCRuntime >lldbPluginRenderScriptRuntime > + lldbPluginLanguageRuntimeGo >lldbPluginCXXItaniumABI >lldbPluginABIMacOSX_arm >lldbPluginABIMacOSX_arm64 > > Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=249456&r1=249455&r2=249456&view=diff > > == > --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) > +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Oct 6 15:29:31 2015 > @@ -821,6 +821,7 @@ > 9AC703AF117675410086C050 /* SBInstruction.cpp in Sources > */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* > SBInstruction.cpp */; }; > 9AC703B1117675490086C050 /* SBInstructionList.cpp in > Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* > SBInstructionList.cpp */; }; > A36FF33C17D8E94600244D40 /* OptionParser.cpp in Sources */ > = {isa = PBXBuildFile; fileRef = A36FF33B17D8E94600244D40 /* > OptionParser.cpp */; }; > + AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in > Sources */ = {isa = PBXBuildFile; fileRef = AE44FB3D1BB485960033EB62 /* > GoLanguageRuntime.cpp */; }; > AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in > Sources */ = {isa = PBXBuildFile; fileRef = AE6897261B94F6DE0018845D /* > DWARFASTParserGo.cpp */; }; > AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ > = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* > GoASTContext.cpp */; }; > AE8F624919EF3E1E00326B21 /* OperatingSystemGo.cpp in > Sources */ = {isa = PBXBuildFile; fileRef = AE8F624719EF3E1E00326B21 /* > OperatingSystemGo.cpp */; }; > @@ -2638,6 +2639,8 @@ > 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = > {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = > sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = > source/API/SBBreakpointLocation.cpp; sourceTree = ""; }; > A36FF33B17D8E94600244D40 /* OptionParser.cpp */ = {isa = > PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; > path = OptionParser.cpp; sourceTree = ""; }; > A36FF33D17D8E98800244D40 /* OptionParser.h */ = {isa = > PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; > name = OptionParser.h; path = include/lldb/Host/OptionParser.h; sourceTree > = ""; }; > + AE44FB3C1BB4858A0033EB62 /* GoLanguageRuntime.h */ = {isa > = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = > GoLanguageRuntime.h; path = Go/GoLanguageRuntime.h; sourceTree = ""; > }; > + AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */ = > {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = > sourcecode.cpp.cpp; name = GoLanguageRuntime.cpp; path = > Go/GoLanguageRuntime.cpp; sourceTree = ""; }; > AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */ = {isa > = PBXFileReference; fileEncoding = 4; lastKnownFileType = > sourcecode.cpp.cpp; path = DWARFASTParserGo.cpp; sourceTree = ""; }; > AE6897271B94F6DE0018845D /* DWARFASTParserGo.h */ = {isa = > PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; > path = DWARFASTParserGo.h; sourceTree = ""; }; > AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */ = > {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = > sourcecode.cpp.cpp; name = OperatingSystemGo.cpp; path = > Go/OperatingSystem
Re: [Lldb-commits] [lldb] r249446 - Address failing Go tests on go version from Ubuntu 14.04
Okay, I can adjust that. On Tue, Oct 6, 2015 at 1:24 PM, Ryan Brown wrote: > I was wondering if we'd need this. Go 1.4 is the minimum supported version. > > On Tue, Oct 6, 2015 at 12:17 PM Todd Fiala via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > >> Author: tfiala >> Date: Tue Oct 6 14:15:56 2015 >> New Revision: 249446 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=249446&view=rev >> Log: >> Address failing Go tests on go version from Ubuntu 14.04 >> >> Go tests fail on Ubuntu 14.04's go1.2.1. This change puts a minimum >> go version in the skipUnlessGoInstalled() decorator of go1.3.0. >> Go maintainers are encouraged to modify as needed. For now this fixes >> failing tests on Ubuntu 14.04 x86_64 buildbots with stock distro go >> installed. >> >> Modified: >> lldb/trunk/test/lldbtest.py >> >> Modified: lldb/trunk/test/lldbtest.py >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249446&r1=249445&r2=249446&view=diff >> >> == >> --- lldb/trunk/test/lldbtest.py (original) >> +++ lldb/trunk/test/lldbtest.py Tue Oct 6 14:15:56 2015 >> @@ -938,7 +938,29 @@ def skipUnlessGoInstalled(func): >> if not compiler: >> self.skipTest("skipping because go compiler not found") >> else: >> -func(*args, **kwargs) >> +# Ensure the version is the minimum version supported by >> +# the go tests. Empirically this is *not* version go1.2.1 >> +# that comes with Ubuntu 14.04. Go maintainers should >> +# verify, or possibly extend this decorator to provide >> +# min go versions that can vary by test. >> +match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler) >> +if not match_version: >> +# Couldn't determine version. >> +self.skipTest( >> +"skipping because go version could not be parsed " >> +"out of {}".format(compiler)) >> +else: >> +from distutils.version import StrictVersion >> +min_strict_version = StrictVersion("1.3.0") >> +compiler_strict_version = >> StrictVersion(match_version.group(1)) >> +if compiler_strict_version < min_strict_version: >> +self.skipTest( >> +"skipping because available go version ({}) does >> " >> +"not meet minimum go version {}".format( >> +compiler_strict_version, >> +min_strict_version)) >> +if not skip_test: >> +func(*args, **kwargs) >> return wrapper >> >> def getPlatform(): >> >> >> ___ >> lldb-commits mailing list >> lldb-commits@lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits >> > -- -Todd ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249466 - Teach CMake to find versions of Python != 2.7
Author: zturner Date: Tue Oct 6 16:11:15 2015 New Revision: 249466 URL: http://llvm.org/viewvc/llvm-project?rev=249466&view=rev Log: Teach CMake to find versions of Python != 2.7 Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake lldb/trunk/cmake/modules/LLDBStandalone.cmake Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=249466&r1=249465&r2=249466&view=diff == --- lldb/trunk/cmake/modules/LLDBConfig.cmake (original) +++ lldb/trunk/cmake/modules/LLDBConfig.cmake Tue Oct 6 16:11:15 2015 @@ -37,6 +37,88 @@ if (LLDB_DISABLE_CURSES) add_definitions( -DLLDB_DISABLE_CURSES ) endif() +# On Windows, we can't use the normal FindPythonLibs module that comes with CMake, +# for a number of reasons. +# 1) Prior to MSVC 2015, it is only possible to embed Python if python itself was +#compiled with an identical version (and build configuration) of MSVC as LLDB. +#The standard algorithm does not take into account the differences between +#a binary release distribution of python and a custom built distribution. +# 2) From MSVC 2015 and onwards, it is only possible to use Python 3.5 or later. +# 3) FindPythonLibs queries the registry to locate Python, and when looking for a +#64-bit version of Python, since cmake.exe is a 32-bit executable, it will see +#a 32-bit view of the registry. As such, it is impossible for FindPythonLibs to +#locate 64-bit Python libraries. +# This function is designed to address those limitations. Currently it only partially +# addresses them, but it can be improved and extended on an as-needed basis. +function(find_python_libs_windows) + if ("${PYTHON_HOME}" STREQUAL "") +message("LLDB embedded Python on Windows requires specifying a value for PYTHON_HOME. Python support disabled.") +set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) +return() + endif() + + file(TO_CMAKE_PATH "${PYTHON_HOME}/Include" PYTHON_INCLUDE_DIRS) + + if(EXISTS "${PYTHON_INCLUDE_DIRS}/patchlevel.h") +file(STRINGS "${PYTHON_INCLUDE_DIRS}/patchlevel.h" python_version_str + REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"") +string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1" + PYTHONLIBS_VERSION_STRING "${python_version_str}") +message("-- Found Python version ${PYTHONLIBS_VERSION_STRING}") +string(REGEX REPLACE "([0-9]+)[.]([0-9]+)[.][0-9]+" "python\\1\\2" PYTHONLIBS_BASE_NAME "${PYTHONLIBS_VERSION_STRING}") +unset(python_version_str) + else() +message("Unable to find ${PYTHON_INCLUDE_DIRS}/patchlevel.h, Python installation is corrupt.") +message("Python support will be disabled for this build.") +set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE) +return() + endif() + + file(TO_CMAKE_PATH "${PYTHON_HOME}" PYTHON_HOME) + file(TO_CMAKE_PATH "${PYTHON_HOME}/python_d.exe" PYTHON_DEBUG_EXE) + file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}_d.lib" PYTHON_DEBUG_LIB) + file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}_d.dll" PYTHON_DEBUG_DLL) + + file(TO_CMAKE_PATH "${PYTHON_HOME}/python.exe" PYTHON_RELEASE_EXE) + file(TO_CMAKE_PATH "${PYTHON_HOME}/libs/${PYTHONLIBS_BASE_NAME}.lib" PYTHON_RELEASE_LIB) + file(TO_CMAKE_PATH "${PYTHON_HOME}/${PYTHONLIBS_BASE_NAME}.dll" PYTHON_RELEASE_DLL) + + # Generator expressions are evaluated in the context of each build configuration generated + # by CMake. Here we use the $:VALUE logical generator expression to ensure + # that the debug Python library, DLL, and executable are used in the Debug build configuration. + # + # Generator expressions can be difficult to grok at first so here's a breakdown of the one + # used for PYTHON_LIBRARY: + # + # 1. $ evaluates to 1 when the Debug configuration is being generated, + #or 0 in all other cases. + # 2. $<$:${PYTHON_DEBUG_LIB}> expands to ${PYTHON_DEBUG_LIB} when the Debug + #configuration is being generated, or nothing (literally) in all other cases. + # 3. $<$>:${PYTHON_RELEASE_LIB}> expands to ${PYTHON_RELEASE_LIB} when + #any configuration other than Debug is being generated, or nothing in all other cases. + # 4. The conditionals in 2 & 3 are mutually exclusive. + # 5. A logical expression with a conditional that evaluates to 0 yields no value at all. + # + # Due to 4 & 5 it's possible to concatenate 2 & 3 to obtain a single value specific to each + # build configuration. In this example the value will be ${PYTHON_DEBUG_LIB} when generating the + # Debug configuration, or ${PYTHON_RELEASE_LIB} when generating any other configuration. + # Note that it's imperative that there is no whitespace between the two expressions, otherwise + # CMake will insert a semicolon between the two. + set (PYTHON_EXECUTABLE $<$:${PYTHON_DEBUG_EXE}>$<$>:${PYTHON_RELEASE_EXE}>) +
[Lldb-commits] [lldb] r249467 - Update swig generation scripts to support Python 3.
Author: zturner Date: Tue Oct 6 16:11:28 2015 New Revision: 249467 URL: http://llvm.org/viewvc/llvm-project?rev=249467&view=rev Log: Update swig generation scripts to support Python 3. Modified: lldb/trunk/scripts/Python/buildSwigPython.py lldb/trunk/scripts/Python/modify-python-lldb.py lldb/trunk/scripts/buildSwigWrapperClasses.py lldb/trunk/scripts/finishSwigWrapperClasses.py lldb/trunk/scripts/utilsArgsParse.py lldb/trunk/scripts/utilsDebug.py lldb/trunk/scripts/utilsOsType.py Modified: lldb/trunk/scripts/Python/buildSwigPython.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/buildSwigPython.py?rev=249467&r1=249466&r2=249467&view=diff == --- lldb/trunk/scripts/Python/buildSwigPython.py (original) +++ lldb/trunk/scripts/Python/buildSwigPython.py Tue Oct 6 16:11:28 2015 @@ -123,7 +123,7 @@ def get_header_files( vDictArgs ): "/include/lldb/API/SBValue.h", "/include/lldb/API/SBValueList.h", "/include/lldb/API/SBWatchpoint.h" ]; - bDebug = vDictArgs.has_key( "-d" ); + bDebug = "-d" in vDictArgs; strRt = vDictArgs[ "--srcRoot" ]; strRt = os.path.normcase( strRt ); @@ -133,8 +133,8 @@ def get_header_files( vDictArgs ): strHeaderFiles += " %s%s" % (strRt, strHdr); if bDebug: - print strMsgHdrFiles; - print strHeaderFiles; + print(strMsgHdrFiles); + print(strHeaderFiles); vDictArgs[ "--headerFiles" ] = strHeaderFiles; @@ -201,7 +201,7 @@ def get_interface_files( vDictArgs ): "/scripts/interface/SBValue.i", "/scripts/interface/SBValueList.i", "/scripts/interface/SBWatchpoint.i" ]; - bDebug = vDictArgs.has_key( "-d" ); + bDebug = "-d" in vDictArgs; strRt = vDictArgs[ "--srcRoot" ]; strRt = os.path.normcase( strRt ); @@ -211,8 +211,8 @@ def get_interface_files( vDictArgs ): strInterfaceFiles += " %s%s" % (strRt, strIFace); if bDebug: - print strMsgIFaceFiles; - print strInterfaceFiles; + print(strMsgIFaceFiles); + print(strInterfaceFiles); vDictArgs[ "--ifaceFiles" ] = strInterfaceFiles; @@ -251,12 +251,12 @@ def which_file_is_newer( vFile1, vFile2 #-- def check_file_exists( vDictArgs, vstrFileNamePath ): bExists = False; - bDebug = vDictArgs.has_key( "-d" ); + bDebug = "-d" in vDictArgs; if os.path.exists( vstrFileNamePath ): bExists = True; elif bDebug: - print strMsgFileNotExist % vstrFileNamePath; + print(strMsgFileNotExist % vstrFileNamePath); return bExists; @@ -271,7 +271,7 @@ def check_file_exists( vDictArgs, vstrFi #-- def check_newer_file( vDictArgs, vstrSwigOpFileNamePath, vstrFileNamePath ): bNeedUpdate = False; - bDebug = vDictArgs.has_key( "-d" ); + bDebug = "-d" in vDictArgs; strMsg = ""; nResult = which_file_is_newer( vstrFileNamePath, vstrSwigOpFileNamePath ); @@ -284,7 +284,7 @@ def check_newer_file( vDictArgs, vstrSwi bNeedUpdate = True; if bNeedUpdate and bDebug: - print strMsg; + print(strMsg); return bNeedUpdate; @@ -328,7 +328,7 @@ def get_framework_python_dir_windows( vD # on the system other stuff may need to be put here as well. from distutils.sysconfig import get_python_lib; strPythonInstallDir = ""; - bHaveArgPrefix = vDictArgs.has_key( "--prefix" ); + bHaveArgPrefix = "--prefix" in vDictArgs; if bHaveArgPrefix: strPythonInstallDir = vDictArgs[ "--prefix" ]; if strPythonInstallDir.__len__() != 0: @@ -354,9 +354,9 @@ def get_framework_python_dir_other_platf bOk = True; strWkDir = ""; strErrMsg = ""; - bDbg = vDictArgs.has_key( "-d" ); + bDbg = "-d" in vDictArgs; - bMakeFileCalled = vDictArgs.has_key( "-m" ); + bMakeFileCalled = "-m" in vDictArgs; if bMakeFileCalled: dbg.dump_text( "Built by LLVM" ); return get_framework_python_dir_windows( vDictArgs ); @@ -368,7 +368,7 @@ def get_framework_python_dir_other_platf strWkDir += "/LLDB.framework"; if os.path.exists( strWkDir ): if bDbg: - print strMsgFoundLldbFrameWkDir % strWkDir; + print(strMsgFoundLl
Re: [Lldb-commits] [PATCH] D13234: Use the correct Python lib for each build configuration generated by the Visual Studio CMake generator
zturner added a comment. My change to support Python 3 is in. Now that that's in, would you mind trying to prettify the output messages when you get a chance? Repository: rL LLVM http://reviews.llvm.org/D13234 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r249446 - Address failing Go tests on go version from Ubuntu 14.04
Changed this here: Sendingtest/lldbtest.py Transmitting file data . Committed revision 249477. Now requires a minimum of version 1.4.0. On Tue, Oct 6, 2015 at 1:52 PM, Todd Fiala wrote: > Okay, I can adjust that. > > On Tue, Oct 6, 2015 at 1:24 PM, Ryan Brown wrote: > >> I was wondering if we'd need this. Go 1.4 is the minimum supported >> version. >> >> On Tue, Oct 6, 2015 at 12:17 PM Todd Fiala via lldb-commits < >> lldb-commits@lists.llvm.org> wrote: >> >>> Author: tfiala >>> Date: Tue Oct 6 14:15:56 2015 >>> New Revision: 249446 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=249446&view=rev >>> Log: >>> Address failing Go tests on go version from Ubuntu 14.04 >>> >>> Go tests fail on Ubuntu 14.04's go1.2.1. This change puts a minimum >>> go version in the skipUnlessGoInstalled() decorator of go1.3.0. >>> Go maintainers are encouraged to modify as needed. For now this fixes >>> failing tests on Ubuntu 14.04 x86_64 buildbots with stock distro go >>> installed. >>> >>> Modified: >>> lldb/trunk/test/lldbtest.py >>> >>> Modified: lldb/trunk/test/lldbtest.py >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249446&r1=249445&r2=249446&view=diff >>> >>> == >>> --- lldb/trunk/test/lldbtest.py (original) >>> +++ lldb/trunk/test/lldbtest.py Tue Oct 6 14:15:56 2015 >>> @@ -938,7 +938,29 @@ def skipUnlessGoInstalled(func): >>> if not compiler: >>> self.skipTest("skipping because go compiler not found") >>> else: >>> -func(*args, **kwargs) >>> +# Ensure the version is the minimum version supported by >>> +# the go tests. Empirically this is *not* version go1.2.1 >>> +# that comes with Ubuntu 14.04. Go maintainers should >>> +# verify, or possibly extend this decorator to provide >>> +# min go versions that can vary by test. >>> +match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler) >>> +if not match_version: >>> +# Couldn't determine version. >>> +self.skipTest( >>> +"skipping because go version could not be parsed " >>> +"out of {}".format(compiler)) >>> +else: >>> +from distutils.version import StrictVersion >>> +min_strict_version = StrictVersion("1.3.0") >>> +compiler_strict_version = >>> StrictVersion(match_version.group(1)) >>> +if compiler_strict_version < min_strict_version: >>> +self.skipTest( >>> +"skipping because available go version ({}) >>> does " >>> +"not meet minimum go version {}".format( >>> +compiler_strict_version, >>> +min_strict_version)) >>> +if not skip_test: >>> +func(*args, **kwargs) >>> return wrapper >>> >>> def getPlatform(): >>> >>> >>> ___ >>> lldb-commits mailing list >>> lldb-commits@lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits >>> >> > > > -- > -Todd > -- -Todd ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249477 - Modify minimumg go version to 1.4.0 for tests.
Author: tfiala Date: Tue Oct 6 17:14:33 2015 New Revision: 249477 URL: http://llvm.org/viewvc/llvm-project?rev=249477&view=rev Log: Modify minimumg go version to 1.4.0 for tests. Modified: lldb/trunk/test/lldbtest.py Modified: lldb/trunk/test/lldbtest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=249477&r1=249476&r2=249477&view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Tue Oct 6 17:14:33 2015 @@ -939,10 +939,7 @@ def skipUnlessGoInstalled(func): self.skipTest("skipping because go compiler not found") else: # Ensure the version is the minimum version supported by -# the go tests. Empirically this is *not* version go1.2.1 -# that comes with Ubuntu 14.04. Go maintainers should -# verify, or possibly extend this decorator to provide -# min go versions that can vary by test. +# the LLDB go support. match_version = re.search(r"(\d+\.\d+(\.\d+)?)", compiler) if not match_version: # Couldn't determine version. @@ -951,12 +948,12 @@ def skipUnlessGoInstalled(func): "out of {}".format(compiler)) else: from distutils.version import StrictVersion -min_strict_version = StrictVersion("1.3.0") +min_strict_version = StrictVersion("1.4.0") compiler_strict_version = StrictVersion(match_version.group(1)) if compiler_strict_version < min_strict_version: self.skipTest( "skipping because available go version ({}) does " -"not meet minimum go version {}".format( +"not meet minimum required go version ({})".format( compiler_strict_version, min_strict_version)) func(*args, **kwargs) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249478 - Simple readline functionality for interactive python on linux.
Author: ribrdb Date: Tue Oct 6 17:21:08 2015 New Revision: 249478 URL: http://llvm.org/viewvc/llvm-project?rev=249478&view=rev Log: Simple readline functionality for interactive python on linux. Differential Revision: http://reviews.llvm.org/D13268 Modified: lldb/trunk/CMakeLists.txt lldb/trunk/scripts/Python/modules/readline/CMakeLists.txt lldb/trunk/scripts/Python/modules/readline/readline.cpp lldb/trunk/source/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=249478&r1=249477&r2=249478&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Tue Oct 6 17:21:08 2015 @@ -4,7 +4,14 @@ include(cmake/modules/LLDBStandalone.cma include(cmake/modules/LLDBConfig.cmake) include(cmake/modules/AddLLDB.cmake) -#add_subdirectory(include) +# We need libedit support to go down both the source and +# the scripts directories. +set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.") +if (LLDB_DISABLE_LIBEDIT) + add_definitions( -DLLDB_DISABLE_LIBEDIT ) +endif() + +# add_subdirectory(include) add_subdirectory(docs) if (NOT LLDB_DISABLE_PYTHON) add_subdirectory(scripts) Modified: lldb/trunk/scripts/Python/modules/readline/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modules/readline/CMakeLists.txt?rev=249478&r1=249477&r2=249478&view=diff == --- lldb/trunk/scripts/Python/modules/readline/CMakeLists.txt (original) +++ lldb/trunk/scripts/Python/modules/readline/CMakeLists.txt Tue Oct 6 17:21:08 2015 @@ -7,7 +7,11 @@ SET(PYTHON_DIRECTORY python${PYTHON_VERS include_directories(${PYTHON_INCLUDE_DIR}) add_library(readline SHARED readline.cpp) -target_link_libraries(readline ${PYTHON_LIBRARY}) +if (NOT LLDB_DISABLE_LIBEDIT) + target_link_libraries(readline ${PYTHON_LIBRARY} edit) +else() + target_link_libraries(readline ${PYTHON_LIBRARY}) +endif() # FIXME: the LIBRARY_OUTPUT_PATH seems to be ignored - this is not a # functional issue for the build dir, though, since the shared lib dir Modified: lldb/trunk/scripts/Python/modules/readline/readline.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modules/readline/readline.cpp?rev=249478&r1=249477&r2=249478&view=diff == --- lldb/trunk/scripts/Python/modules/readline/readline.cpp (original) +++ lldb/trunk/scripts/Python/modules/readline/readline.cpp Tue Oct 6 17:21:08 2015 @@ -1,23 +1,68 @@ #include #include "Python.h" -// Python readline module intentionally built to not implement the -// readline module interface. This is meant to work around llvm -// pr18841 to avoid seg faults in the stock Python readline.so linked -// against GNU readline. +#ifndef LLDB_DISABLE_LIBEDIT +#include +#endif + +// Simple implementation of the Python readline module using libedit. +// In the event that libedit is excluded from the build, this turns +// back into a null implementation that blocks the module from pulling +// in the GNU readline shared lib, which causes linkage confusion when +// both readline and libedit's readline compatibility symbols collide. +// +// Currently it only installs a PyOS_ReadlineFunctionPointer, without +// implementing any of the readline module methods. This is meant to +// work around LLVM pr18841 to avoid seg faults in the stock Python +// readline.so linked against GNU readline. static struct PyMethodDef moduleMethods[] = { {nullptr, nullptr, 0, nullptr} }; +#ifndef LLDB_DISABLE_LIBEDIT +PyDoc_STRVAR( +moduleDocumentation, +"Simple readline module implementation based on libedit."); +#else PyDoc_STRVAR( moduleDocumentation, -"Stub module meant to effectively disable readline support."); +"Stub module meant to avoid linking GNU readline."); +#endif + +#ifndef LLDB_DISABLE_LIBEDIT +static char* +simple_readline(FILE *stdin, FILE *stdout, char *prompt) +{ +rl_instream = stdin; +rl_outstream = stdout; +char* line = readline(prompt); +if (!line) +{ +char* ret = (char*)PyMem_Malloc(1); +if (ret != NULL) +*ret = '\0'; +return ret; +} +if (*line) +add_history(line); +int n = strlen(line); +char* ret = (char*)PyMem_Malloc(n + 2); +strncpy(ret, line, n); +free(line); +ret[n] = '\n'; +ret[n+1] = '\0'; +return ret; +} +#endif PyMODINIT_FUNC initreadline(void) { +#ifndef LLDB_DISABLE_LIBEDIT +PyOS_ReadlineFunctionPointer = simple_readline; +#endif Py_InitModule4( "readline", moduleMethods, Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=249478&r1=249477&r2=249478&
Re: [Lldb-commits] [PATCH] D13149: Create GoLanguageRuntime
ribrdb closed this revision. ribrdb added a comment. Submitted in revisions 249456 and 249459. Repository: rL LLVM http://reviews.llvm.org/D13149 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249486 - Fix Android build.
Author: chaoren Date: Tue Oct 6 19:01:06 2015 New Revision: 249486 URL: http://llvm.org/viewvc/llvm-project?rev=249486&view=rev Log: Fix Android build. Modified: lldb/trunk/CMakeLists.txt lldb/trunk/cmake/platforms/Android.cmake lldb/trunk/source/CMakeLists.txt Modified: lldb/trunk/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=249486&r1=249485&r2=249486&view=diff == --- lldb/trunk/CMakeLists.txt (original) +++ lldb/trunk/CMakeLists.txt Tue Oct 6 19:01:06 2015 @@ -4,6 +4,12 @@ include(cmake/modules/LLDBStandalone.cma include(cmake/modules/LLDBConfig.cmake) include(cmake/modules/AddLLDB.cmake) +if (__ANDROID_NDK__ OR (CMAKE_SYSTEM_NAME MATCHES "Windows")) + set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) +else() + set(LLDB_DEFAULT_DISABLE_LIBEDIT 0) +endif () + # We need libedit support to go down both the source and # the scripts directories. set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.") Modified: lldb/trunk/cmake/platforms/Android.cmake URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/platforms/Android.cmake?rev=249486&r1=249485&r2=249486&view=diff == --- lldb/trunk/cmake/platforms/Android.cmake (original) +++ lldb/trunk/cmake/platforms/Android.cmake Tue Oct 6 19:01:06 2015 @@ -37,6 +37,7 @@ remove_definitions( -DANDROID -D__ANDROI add_definitions( -DANDROID -D__ANDROID_NDK__ -DLLDB_DISABLE_LIBEDIT ) set( ANDROID True ) set( __ANDROID_NDK__ True ) +set( LLDB_DEFAULT_DISABLE_LIBEDIT True ) # linking lldb-server statically for Android avoids the need to ship two # binaries (pie for API 21+ and non-pie for API 16-). It's possible to use Modified: lldb/trunk/source/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=249486&r1=249485&r2=249486&view=diff == --- lldb/trunk/source/CMakeLists.txt (original) +++ lldb/trunk/source/CMakeLists.txt Tue Oct 6 19:01:06 2015 @@ -1,11 +1,5 @@ include_directories(.) -if (__ANDROID_NDK__ OR (CMAKE_SYSTEM_NAME MATCHES "Windows")) - set(LLDB_DEFAULT_DISABLE_LIBEDIT 1) -else() - set(LLDB_DEFAULT_DISABLE_LIBEDIT 0) -endif () - if ( CMAKE_SYSTEM_NAME MATCHES "Linux" ) include_directories( Plugins/Process/Linux ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247773: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a comment. This test is still failing. Can you please have a look? Thanks. Users: jaydeep (Author) dawn (Auditor) http://reviews.llvm.org/rL247773 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247968: [LLDB][MIPS] Debug bare-iron targets lacking support for qC /qfThreadInfo
dawn added a comment. This test is still failing. Can you please have a look? Thanks. Users: jaydeep (Author) dawn (Auditor) http://reviews.llvm.org/rL247968 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL247709: Make the source-map help grammatical.
dawn added a comment. This test is still failing. Can you please have a look? Thanks. Users: jingham (Author) dawn (Auditor) http://reviews.llvm.org/rL247709 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [Diffusion] rL248048: Added support for resolving symbolic links to FileSpec.
dawn added a comment. Test TestTerminal.LaunchInTerminalTestCase.test_launch_in_terminal is still failing. Can you please have a look? Thanks. Users: spyffe (Author) dawn (Auditor) http://reviews.llvm.org/rL248048 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r249503 - Introduce a variant of GetSummaryAsCString() that takes a LanguageType argument, and use it when crafting summaries by running selectors
Author: enrico Date: Tue Oct 6 20:41:23 2015 New Revision: 249503 URL: http://llvm.org/viewvc/llvm-project?rev=249503&view=rev Log: Introduce a variant of GetSummaryAsCString() that takes a LanguageType argument, and use it when crafting summaries by running selectors This is the first in a series of commits that are meant to teach LLDB how to properly handle multi-language formatting of values Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/DataFormatters/FormattersHelpers.cpp lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249503&r1=249502&r2=249503&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 20:41:23 2015 @@ -610,11 +610,12 @@ public: GetLocationAsCString (); const char * -GetSummaryAsCString (); +GetSummaryAsCString (lldb::LanguageType lang = lldb::eLanguageTypeUnknown); bool GetSummaryAsCString (TypeSummaryImpl* summary_ptr, - std::string& destination); + std::string& destination, + lldb::LanguageType lang = lldb::eLanguageTypeUnknown); bool GetSummaryAsCString (std::string& destination, Modified: lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h?rev=249503&r1=249502&r2=249503&view=diff == --- lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h (original) +++ lldb/trunk/include/lldb/DataFormatters/FormattersHelpers.h Tue Oct 6 20:41:23 2015 @@ -89,7 +89,8 @@ namespace lldb_private { ExtractSummaryFromObjCExpression (ValueObject &valobj, const char* target_type, const char* selector, - Stream &stream); + Stream &stream, + lldb::LanguageType lang_type); lldb::ValueObjectSP CallSelectorOnObject (ValueObject &valobj, Modified: lldb/trunk/source/Core/ValueObject.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=249503&r1=249502&r2=249503&view=diff == --- lldb/trunk/source/Core/ValueObject.cpp (original) +++ lldb/trunk/source/Core/ValueObject.cpp Tue Oct 6 20:41:23 2015 @@ -874,9 +874,10 @@ ValueObject::CreateChildAtIndex (size_t bool ValueObject::GetSummaryAsCString (TypeSummaryImpl* summary_ptr, - std::string& destination) + std::string& destination, + lldb::LanguageType lang) { -return GetSummaryAsCString(summary_ptr, destination, TypeSummaryOptions()); +return GetSummaryAsCString(summary_ptr, destination, TypeSummaryOptions().SetLanguage(lang)); } bool @@ -885,7 +886,7 @@ ValueObject::GetSummaryAsCString (TypeSu const TypeSummaryOptions& options) { destination.clear(); - + // ideally we would like to bail out if passing NULL, but if we do so // we end up not providing the summary for function pointers anymore if (/*summary_ptr == NULL ||*/ m_is_getting_summary) @@ -893,31 +894,38 @@ ValueObject::GetSummaryAsCString (TypeSu m_is_getting_summary = true; +TypeSummaryOptions actual_options(options); + +if (actual_options.GetLanguage() == lldb::eLanguageTypeUnknown) +actual_options.SetLanguage(GetPreferredDisplayLanguage()); + // this is a hot path in code and we prefer to avoid setting this string all too often also clearing out other // information that we might care to see in a crash log. might be useful in very specific situations though. /*Host::SetCrashDescriptionWithFormat("Trying to fetch a summary for %s %s. Summary provider's description is %s", -GetTypeName().GetCString(), -GetName().GetCString(), - summary_ptr->GetDescription().c_str());*/ + GetTypeName().GetCString(), + GetName().GetCString(), + summary_ptr->GetDescription().c_str());*/ if (UpdateValueIfNeeded (false) && summary_ptr) { if (HasSyntheticValue()) m_synthetic_value->UpdateValueIfNeeded(); // the summary might depend on
[Lldb-commits] [lldb] r249506 - Enable the StringPrinter to have prefixes that are strings instead of just a single character; and also introduce a comparable suffix mechanism
Author: enrico Date: Tue Oct 6 21:06:48 2015 New Revision: 249506 URL: http://llvm.org/viewvc/llvm-project?rev=249506&view=rev Log: Enable the StringPrinter to have prefixes that are strings instead of just a single character; and also introduce a comparable suffix mechanism Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h lldb/trunk/source/DataFormatters/StringPrinter.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp lldb/trunk/source/Plugins/Language/ObjC/NSString.cpp Modified: lldb/trunk/include/lldb/DataFormatters/StringPrinter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/StringPrinter.h?rev=249506&r1=249505&r2=249506&view=diff == --- lldb/trunk/include/lldb/DataFormatters/StringPrinter.h (original) +++ lldb/trunk/include/lldb/DataFormatters/StringPrinter.h Tue Oct 6 21:06:48 2015 @@ -15,6 +15,7 @@ #include "lldb/Core/DataExtractor.h" #include +#include namespace lldb_private { namespace formatters @@ -45,7 +46,8 @@ namespace lldb_private { m_location(0), m_process_sp(), m_stream(NULL), -m_prefix_token(0), +m_prefix_token(), +m_suffix_token(), m_quote('"'), m_source_size(0), m_needs_zero_termination(true), @@ -98,16 +100,43 @@ namespace lldb_private { } ReadStringAndDumpToStreamOptions& -SetPrefixToken (char p) +SetPrefixToken (const std::string& p) { m_prefix_token = p; return *this; } -char +ReadStringAndDumpToStreamOptions& +SetPrefixToken (std::nullptr_t) +{ +m_prefix_token.clear(); +return *this; +} + +const char* GetPrefixToken () const { -return m_prefix_token; +return m_prefix_token.c_str(); +} + +ReadStringAndDumpToStreamOptions& +SetSuffixToken (const std::string& p) +{ +m_suffix_token = p; +return *this; +} + +ReadStringAndDumpToStreamOptions& +SetSuffixToken (std::nullptr_t) +{ +m_suffix_token.clear(); +return *this; +} + +const char* +GetSuffixToken () const +{ +return m_suffix_token.c_str(); } ReadStringAndDumpToStreamOptions& @@ -206,7 +235,8 @@ namespace lldb_private { uint64_t m_location; lldb::ProcessSP m_process_sp; Stream* m_stream; -char m_prefix_token; +std::string m_prefix_token; +std::string m_suffix_token; char m_quote; uint32_t m_source_size; bool m_needs_zero_termination; @@ -223,7 +253,8 @@ namespace lldb_private { ReadBufferAndDumpToStreamOptions () : m_data(), m_stream(NULL), -m_prefix_token(0), +m_prefix_token(), +m_suffix_token(), m_quote('"'), m_source_size(0), m_escape_non_printables(true), @@ -263,16 +294,43 @@ namespace lldb_private { } ReadBufferAndDumpToStreamOptions& -SetPrefixToken (char p) +SetPrefixToken (const std::string& p) { m_prefix_token = p; return *this; } -char +ReadBufferAndDumpToStreamOptions& +SetPrefixToken (std::nullptr_t) +{ +m_prefix_token.clear(); +return *this; +} + +const char* GetPrefixToken () const { -return m_prefix_token; +return m_prefix_token.c_str(); +} + +ReadBufferAndDumpToStreamOptions& +SetSuffixToken (const std::string& p) +{ +m_suffix_token = p; +return *this; +} + +ReadBufferAndDumpToStreamOptions& +SetS
[Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this in us
Author: enrico Date: Tue Oct 6 21:36:35 2015 New Revision: 249507 URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev Log: Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this in useful ways Modified: lldb/trunk/include/lldb/Core/ValueObject.h lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h lldb/trunk/source/Commands/CommandObjectExpression.cpp lldb/trunk/source/Commands/CommandObjectFrame.cpp lldb/trunk/source/Core/ValueObject.cpp lldb/trunk/source/Core/ValueObjectConstResult.cpp lldb/trunk/source/Core/ValueObjectDynamicValue.cpp lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Modified: lldb/trunk/include/lldb/Core/ValueObject.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff == --- lldb/trunk/include/lldb/Core/ValueObject.h (original) +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 21:36:35 2015 @@ -1242,6 +1242,9 @@ protected: bool IsChecksumEmpty (); +void +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType); + private: //-- // For ValueObject only Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff == --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct 6 21:36:35 2015 @@ -105,6 +105,12 @@ public: virtual TypeImpl GetTypeImpl (); +virtual lldb::LanguageType +GetPreferredDisplayLanguage (); + +void +SetPreferredDisplayLanguage (lldb::LanguageType); + virtual bool GetDeclaration (Declaration &decl); Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff == --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct 6 21:36:35 2015 @@ -152,6 +152,12 @@ public: virtual void SetFormat (lldb::Format format); +virtual lldb::LanguageType +GetPreferredDisplayLanguage (); + +void +SetPreferredDisplayLanguage (lldb::LanguageType); + virtual bool GetDeclaration (Declaration &decl); Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=249507&r1=249506&r2=249507&view=diff == --- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original) +++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Oct 6 21:36:35 2015 @@ -61,6 +61,7 @@ struct DumpValueObjectOptions lldb::Format m_format = lldb::eFormatDefault; lldb::TypeSummaryImplSP m_summary_sp; std::string m_root_valobj_name; +lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown; PointerDepth m_max_ptr_depth; bool m_use_synthetic : 1; bool m_scope_already_checked : 1; @@ -252,6 +253,13 @@ struct DumpValueObjectOptions return *this; } +DumpValueObjectOptions& +SetVariableFormatDisplayLanguage (lldb::LanguageType lang = lldb::eLanguageTypeUnknown) +{ +m_varformat_language = lang; +return *this; +} + DumpValueObjectOptions& SetRunValidator (bool run = true) { Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=249507&r1=249506&r2=249507&view=diff == --- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Tue Oct 6 21:36:35 2015 @@ -335,6 +335,7 @@ CommandObjectExpression::EvaluateExpress result_valobj_sp->SetFormat (format); DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions(m
Re: [Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this i
It looks like there's only 1 test added for all of this functionality from this and the last few commits, and that the test is specific to Objective C. The functionality itself seems language agnostic though. Is there any way to write a test that does not rely on a particular language? That would improve the test coverage of this functionality. On Tue, Oct 6, 2015 at 7:38 PM Enrico Granata via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: enrico > Date: Tue Oct 6 21:36:35 2015 > New Revision: 249507 > > URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev > Log: > Route the preferred-display-language mechanism to the ValueObjectPrinter > and actually fill in a few gaps for dynamic and synthetic values to be able > to adopt this in useful ways > > > Modified: > lldb/trunk/include/lldb/Core/ValueObject.h > lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h > lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h > lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h > lldb/trunk/source/Commands/CommandObjectExpression.cpp > lldb/trunk/source/Commands/CommandObjectFrame.cpp > lldb/trunk/source/Core/ValueObject.cpp > lldb/trunk/source/Core/ValueObjectConstResult.cpp > lldb/trunk/source/Core/ValueObjectDynamicValue.cpp > lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp > lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp > > lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py > > Modified: lldb/trunk/include/lldb/Core/ValueObject.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff > > == > --- lldb/trunk/include/lldb/Core/ValueObject.h (original) > +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 21:36:35 2015 > @@ -1242,6 +1242,9 @@ protected: > bool > IsChecksumEmpty (); > > +void > +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType); > + > private: > //-- > // For ValueObject only > > Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff > > == > --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original) > +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct 6 > 21:36:35 2015 > @@ -105,6 +105,12 @@ public: > virtual TypeImpl > GetTypeImpl (); > > +virtual lldb::LanguageType > +GetPreferredDisplayLanguage (); > + > +void > +SetPreferredDisplayLanguage (lldb::LanguageType); > + > virtual bool > GetDeclaration (Declaration &decl); > > > Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff > > == > --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) > +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct 6 > 21:36:35 2015 > @@ -152,6 +152,12 @@ public: > virtual void > SetFormat (lldb::Format format); > > +virtual lldb::LanguageType > +GetPreferredDisplayLanguage (); > + > +void > +SetPreferredDisplayLanguage (lldb::LanguageType); > + > virtual bool > GetDeclaration (Declaration &decl); > > > Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=249507&r1=249506&r2=249507&view=diff > > == > --- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original) > +++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Oct 6 > 21:36:35 2015 > @@ -61,6 +61,7 @@ struct DumpValueObjectOptions > lldb::Format m_format = lldb::eFormatDefault; > lldb::TypeSummaryImplSP m_summary_sp; > std::string m_root_valobj_name; > +lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown; > PointerDepth m_max_ptr_depth; > bool m_use_synthetic : 1; > bool m_scope_already_checked : 1; > @@ -252,6 +253,13 @@ struct DumpValueObjectOptions > return *this; > } > > +DumpValueObjectOptions& > +SetVariableFormatDisplayLanguage (lldb::LanguageType lang = > lldb::eLanguageTypeUnknown) > +{ > +m_varformat_language = lang; > +return *this; > +} > + > DumpValueObjectOptions& > SetRunValidator (bool run = true) > { > > Modified: lldb/trunk/source/Com
Re: [Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this i
Actually upon further inspection it looks like the test that was updated was not really anything new, but an update of an existing test to pass a new argument through. Can you add some tests that test this specific functionality? On Tue, Oct 6, 2015 at 9:09 PM Zachary Turner wrote: > It looks like there's only 1 test added for all of this functionality from > this and the last few commits, and that the test is specific to Objective > C. The functionality itself seems language agnostic though. Is there any > way to write a test that does not rely on a particular language? That > would improve the test coverage of this functionality. > > On Tue, Oct 6, 2015 at 7:38 PM Enrico Granata via lldb-commits < > lldb-commits@lists.llvm.org> wrote: > >> Author: enrico >> Date: Tue Oct 6 21:36:35 2015 >> New Revision: 249507 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev >> Log: >> Route the preferred-display-language mechanism to the ValueObjectPrinter >> and actually fill in a few gaps for dynamic and synthetic values to be able >> to adopt this in useful ways >> >> >> Modified: >> lldb/trunk/include/lldb/Core/ValueObject.h >> lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >> lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >> lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h >> lldb/trunk/source/Commands/CommandObjectExpression.cpp >> lldb/trunk/source/Commands/CommandObjectFrame.cpp >> lldb/trunk/source/Core/ValueObject.cpp >> lldb/trunk/source/Core/ValueObjectConstResult.cpp >> lldb/trunk/source/Core/ValueObjectDynamicValue.cpp >> lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp >> lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp >> >> lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py >> >> Modified: lldb/trunk/include/lldb/Core/ValueObject.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff >> >> == >> --- lldb/trunk/include/lldb/Core/ValueObject.h (original) >> +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 21:36:35 2015 >> @@ -1242,6 +1242,9 @@ protected: >> bool >> IsChecksumEmpty (); >> >> +void >> +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType); >> + >> private: >> //-- >> // For ValueObject only >> >> Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff >> >> == >> --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original) >> +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct 6 >> 21:36:35 2015 >> @@ -105,6 +105,12 @@ public: >> virtual TypeImpl >> GetTypeImpl (); >> >> +virtual lldb::LanguageType >> +GetPreferredDisplayLanguage (); >> + >> +void >> +SetPreferredDisplayLanguage (lldb::LanguageType); >> + >> virtual bool >> GetDeclaration (Declaration &decl); >> >> >> Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff >> >> == >> --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) >> +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct 6 >> 21:36:35 2015 >> @@ -152,6 +152,12 @@ public: >> virtual void >> SetFormat (lldb::Format format); >> >> +virtual lldb::LanguageType >> +GetPreferredDisplayLanguage (); >> + >> +void >> +SetPreferredDisplayLanguage (lldb::LanguageType); >> + >> virtual bool >> GetDeclaration (Declaration &decl); >> >> >> Modified: lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h >> URL: >> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h?rev=249507&r1=249506&r2=249507&view=diff >> >> == >> --- lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h (original) >> +++ lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h Tue Oct >> 6 21:36:35 2015 >> @@ -61,6 +61,7 @@ struct DumpValueObjectOptions >> lldb::Format m_format = lldb::eFormatDefault; >> lldb::TypeSummaryImplSP m_summary_sp; >> std::string m_root_valobj_name; >> +lldb::LanguageType m_varformat_language = lldb::eLanguageTypeUnknown; >> PointerDepth m_max_ptr_depth; >> bool m_use_synthetic : 1; >> bool m_scope_already_checked : 1; >> @@ -252,6 +
Re: [Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this i
I am not done here. Also, even once I am done, all that you will be able to see here is no regressions in existing functionality. I am plumbing through a set of facilities that I need in order to make certain parts of data formatting logic Language-plugin based. That is required to make it easier to support new source languages in a clean fashion. Since the C++ and ObjC support is already there, there will be no (unintended) change in functionality. What you want to see here testing-wise is the lack of any regression for existing languages. The benefits are to be reaped if you were to add support for a new source language, which then would require its own testing, ..., but I plan to do no such thing at the moment. tl;dr existing tests cover this already; this is refactoring work Sent from my iPhone > On Oct 6, 2015, at 9:20 PM, Zachary Turner wrote: > > Actually upon further inspection it looks like the test that was updated was > not really anything new, but an update of an existing test to pass a new > argument through. > > Can you add some tests that test this specific functionality? > >> On Tue, Oct 6, 2015 at 9:09 PM Zachary Turner wrote: >> It looks like there's only 1 test added for all of this functionality from >> this and the last few commits, and that the test is specific to Objective C. >> The functionality itself seems language agnostic though. Is there any way >> to write a test that does not rely on a particular language? That would >> improve the test coverage of this functionality. >> >>> On Tue, Oct 6, 2015 at 7:38 PM Enrico Granata via lldb-commits >>> wrote: >>> Author: enrico >>> Date: Tue Oct 6 21:36:35 2015 >>> New Revision: 249507 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev >>> Log: >>> Route the preferred-display-language mechanism to the ValueObjectPrinter >>> and actually fill in a few gaps for dynamic and synthetic values to be able >>> to adopt this in useful ways >>> >>> >>> Modified: >>> lldb/trunk/include/lldb/Core/ValueObject.h >>> lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >>> lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >>> lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h >>> lldb/trunk/source/Commands/CommandObjectExpression.cpp >>> lldb/trunk/source/Commands/CommandObjectFrame.cpp >>> lldb/trunk/source/Core/ValueObject.cpp >>> lldb/trunk/source/Core/ValueObjectConstResult.cpp >>> lldb/trunk/source/Core/ValueObjectDynamicValue.cpp >>> lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp >>> lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp >>> >>> lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObject.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObject.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 21:36:35 2015 >>> @@ -1242,6 +1242,9 @@ protected: >>> bool >>> IsChecksumEmpty (); >>> >>> +void >>> +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType); >>> + >>> private: >>> //-- >>> // For ValueObject only >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct 6 >>> 21:36:35 2015 >>> @@ -105,6 +105,12 @@ public: >>> virtual TypeImpl >>> GetTypeImpl (); >>> >>> +virtual lldb::LanguageType >>> +GetPreferredDisplayLanguage (); >>> + >>> +void >>> +SetPreferredDisplayLanguage (lldb::LanguageType); >>> + >>> virtual bool >>> GetDeclaration (Declaration &decl); >>> >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct 6 >>> 21:36:35 2015 >>> @@ -152,6 +152,12 @@ public: >>> virtual void >>> SetFormat (lldb::Format format); >>> >>> +virtual lldb::LanguageType >>> +GetPreferredDisplayLanguage (); >>> + >>> +void >>> +SetPreferredDisplayLanguage
Re: [Lldb-commits] [lldb] r249507 - Route the preferred-display-language mechanism to the ValueObjectPrinter and actually fill in a few gaps for dynamic and synthetic values to be able to adopt this i
Thanks for the clarification! On Tue, Oct 6, 2015 at 10:51 PM Enrico Granata wrote: > I am not done here. > Also, even once I am done, all that you will be able to see here is no > regressions in existing functionality. > > I am plumbing through a set of facilities that I need in order to make > certain parts of data formatting logic Language-plugin based. > > That is required to make it easier to support new source languages in a > clean fashion. > > Since the C++ and ObjC support is already there, there will be no > (unintended) change in functionality. What you want to see here > testing-wise is the lack of any regression for existing languages. > > The benefits are to be reaped if you were to add support for a new source > language, which then would require its own testing, ..., but I plan to do > no such thing at the moment. > > *tl;dr* existing tests cover this already; this is refactoring work > > Sent from my iPhone > > On Oct 6, 2015, at 9:20 PM, Zachary Turner wrote: > > Actually upon further inspection it looks like the test that was updated > was not really anything new, but an update of an existing test to pass a > new argument through. > > Can you add some tests that test this specific functionality? > > On Tue, Oct 6, 2015 at 9:09 PM Zachary Turner wrote: > >> It looks like there's only 1 test added for all of this functionality >> from this and the last few commits, and that the test is specific to >> Objective C. The functionality itself seems language agnostic though. Is >> there any way to write a test that does not rely on a particular language? >> That would improve the test coverage of this functionality. >> >> On Tue, Oct 6, 2015 at 7:38 PM Enrico Granata via lldb-commits < >> lldb-commits@lists.llvm.org> wrote: >> >>> Author: enrico >>> Date: Tue Oct 6 21:36:35 2015 >>> New Revision: 249507 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=249507&view=rev >>> Log: >>> Route the preferred-display-language mechanism to the ValueObjectPrinter >>> and actually fill in a few gaps for dynamic and synthetic values to be able >>> to adopt this in useful ways >>> >>> >>> Modified: >>> lldb/trunk/include/lldb/Core/ValueObject.h >>> lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >>> lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >>> lldb/trunk/include/lldb/DataFormatters/ValueObjectPrinter.h >>> lldb/trunk/source/Commands/CommandObjectExpression.cpp >>> lldb/trunk/source/Commands/CommandObjectFrame.cpp >>> lldb/trunk/source/Core/ValueObject.cpp >>> lldb/trunk/source/Core/ValueObjectConstResult.cpp >>> lldb/trunk/source/Core/ValueObjectDynamicValue.cpp >>> lldb/trunk/source/Core/ValueObjectSyntheticFilter.cpp >>> lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp >>> >>> lldb/trunk/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObject.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=249507&r1=249506&r2=249507&view=diff >>> >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObject.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 6 21:36:35 2015 >>> @@ -1242,6 +1242,9 @@ protected: >>> bool >>> IsChecksumEmpty (); >>> >>> +void >>> +SetPreferredDisplayLanguageIfNeeded (lldb::LanguageType); >>> + >>> private: >>> //-- >>> // For ValueObject only >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h?rev=249507&r1=249506&r2=249507&view=diff >>> >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h Tue Oct 6 >>> 21:36:35 2015 >>> @@ -105,6 +105,12 @@ public: >>> virtual TypeImpl >>> GetTypeImpl (); >>> >>> +virtual lldb::LanguageType >>> +GetPreferredDisplayLanguage (); >>> + >>> +void >>> +SetPreferredDisplayLanguage (lldb::LanguageType); >>> + >>> virtual bool >>> GetDeclaration (Declaration &decl); >>> >>> >>> Modified: lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h?rev=249507&r1=249506&r2=249507&view=diff >>> >>> == >>> --- lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h (original) >>> +++ lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h Tue Oct 6 >>> 21:36:35 2015 >>> @@ -152,6 +152,12 @@ public: >>> virtual void >>> SetFormat (lldb::Format format); >>> >>> +