Re: [Lldb-commits] [PATCH] D20368: Remove Platform usages from NativeProcessLinux
nitesh.jain added a comment. I will check it and let you know asap. Thanks http://reviews.llvm.org/D20368 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272354 - Make all the SBFrame API's take the target lock.
Author: jingham Date: Thu Jun 9 19:37:44 2016 New Revision: 272354 URL: http://llvm.org/viewvc/llvm-project?rev=272354&view=rev Log: Make all the SBFrame API's take the target lock. For some reason, the conversion to taking the target lock when acquiring the ExecutionContext was only done for some of the functions here. That was allowing lock inversion in some complex uses. Modified: lldb/trunk/source/API/SBFrame.cpp Modified: lldb/trunk/source/API/SBFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=272354&r1=272353&r2=272354&view=diff == --- lldb/trunk/source/API/SBFrame.cpp (original) +++ lldb/trunk/source/API/SBFrame.cpp Thu Jun 9 19:37:44 2016 @@ -455,7 +455,9 @@ SBFrame::GetFrameID () const { uint32_t frame_idx = UINT32_MAX; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); if (frame) frame_idx = frame->GetFrameIndex (); @@ -470,7 +472,9 @@ SBFrame::GetFrameID () const lldb::addr_t SBFrame::GetCFA () const { -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); if (frame) return frame->GetStackID().GetCallFrameAddress(); @@ -689,7 +693,9 @@ lldb::SBValue SBFrame::GetValueForVariablePath (const char *var_path) { SBValue sb_value; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -754,7 +760,9 @@ SBValue SBFrame::FindVariable (const char *name) { SBValue value; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -844,7 +852,9 @@ SBValue SBFrame::FindValue (const char *name, ValueType value_type) { SBValue value; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1027,7 +1037,9 @@ SBFrame::GetThread () const { Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + ThreadSP thread_sp (exe_ctx.GetThreadSP()); SBThread sb_thread (thread_sp); @@ -1091,7 +1103,9 @@ SBFrame::GetVariables (bool arguments, bool in_scope_only) { SBValueList value_list; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1119,7 +1133,9 @@ SBFrame::GetVariables (bool arguments, bool in_scope_only, lldb::DynamicValueType use_dynamic) { -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + Target *target = exe_ctx.GetTargetPtr(); const bool include_runtime_support_values = target ? target->GetDisplayRuntimeSupportValues() : false; SBVariablesOptions options; @@ -1403,7 +1419,9 @@ SBValue SBFrame::EvaluateExpression (const char *expr) { SBValue result; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (frame && target) @@ -1429,7 +1447,9 @@ SBFrame::EvaluateExpression (const char options.SetFetchDynamicValue (fetch_dynamic_value); options.SetUnwindOnError (true); options.SetIgnoreBreakpoints (true); -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + StackFrame *frame = exe_ctx.GetFramePtr(); Target *target = exe_ctx.GetTargetPtr(); if (target && target->GetLanguage() != eLanguageTypeUnknown) @@ -1443,7 +1463,9 @@ SBValue SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dynamic_value, bool unwind_on_error) { SBExpressionOptions options; -ExecutionContext exe_ctx(m_opaque_sp.get()); +std::unique_lock lock; +ExecutionContext exe_ctx(m_opaque_sp.get(), lock); + options.SetFetchDynamicValue (fetch_
[Lldb-commits] [lldb] r272348 - Fix "frame variable" to show all variables defined in functions and any contained lexical blocks, even if they are static variables.
Author: gclayton Date: Thu Jun 9 18:56:12 2016 New Revision: 272348 URL: http://llvm.org/viewvc/llvm-project?rev=272348&view=rev Log: Fix "frame variable" to show all variables defined in functions and any contained lexical blocks, even if they are static variables. For code like: int g_global = 234; int g_static = 345; int main(int argc, char **argv) { int a = 22333; static int g_int = 123; return g_global + g_static + g_int + a; } If we stop at the "return" statement, we expect to see "argc", "argv", "a" and "g_int" when we type "frame variable" since "g_int" is a locally defined static variable, but we don't expect to see "g_global" or "g_static" unless we add the -g option to "frame variable". Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=272348&r1=272347&r2=272348&view=diff == --- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Thu Jun 9 18:56:12 2016 @@ -373,12 +373,10 @@ protected: Stream &s = result.GetOutputStream(); -bool get_file_globals = true; - // Be careful about the stack frame, if any summary formatter runs code, it might clear the StackFrameList // for the thread. So hold onto a shared pointer to the frame so it stays alive. -VariableList *variable_list = frame->GetVariableList (get_file_globals); +VariableList *variable_list = frame->GetVariableList (m_option_variable.show_globals); VariableSP var_sp; ValueObjectSP valobj_sp; @@ -515,13 +513,16 @@ protected: switch (var_sp->GetScope()) { case eValueTypeVariableGlobal: -dump_variable = m_option_variable.show_globals; +// Always dump globals since we only fetched them if +// m_option_variable.show_scope was true if (dump_variable && m_option_variable.show_scope) scope_string = "GLOBAL: "; break; case eValueTypeVariableStatic: -dump_variable = m_option_variable.show_globals; +// Always dump globals since we only fetched them if +// m_option_variable.show_scope was true, or this is +// a static variable from a block in the current scope if (dump_variable && m_option_variable.show_scope) scope_string = "STATIC: "; break; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272326 - Enable some tests on linux
Author: labath Date: Thu Jun 9 17:39:36 2016 New Revision: 272326 URL: http://llvm.org/viewvc/llvm-project?rev=272326&view=rev Log: Enable some tests on linux This enables a couple of tests which have been shown to run reliably on the linux x86 buildbot. If you see a failure after this commit, feel free to add the xfail back, but please make it as specific as possible (i.e., try to make it not cover i386/x86_64 with clang-3.5, clang-3.9 or gcc-4.9). Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py?rev=272326&r1=272325&r2=272326&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py Thu Jun 9 17:39:36 2016 @@ -17,7 +17,6 @@ class BreakpointLocationsTestCase(TestBa mydir = TestBase.compute_mydir(__file__) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528") -@expectedFailureAll(oslist=["linux"], compiler="clang", compiler_version=[">=", "3.8"], archs=["i386"], debug_info="dwo") def test(self): """Test breakpoint enable/disable for a breakpoint ID with multiple locations.""" self.build() Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py?rev=272326&r1=272325&r2=272326&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py Thu Jun 9 17:39:36 2016 @@ -16,6 +16,7 @@ from lldbsuite.test import lldbutil class CommandScriptImmediateOutputTestCase (PExpectTest): mydir = TestBase.compute_mydir(__file__) +NO_DEBUG_INFO_TESTCASE = True def setUp(self): # Call super's setUp(). @@ -23,7 +24,7 @@ class CommandScriptImmediateOutputTestCa @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") -@expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") +@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output_console (self): """Test that LLDB correctly allows scripted commands to set immediate output to the console.""" self.launch(timeout=10) @@ -39,7 +40,7 @@ class CommandScriptImmediateOutputTestCa @skipIfRemote # test not remote-ready llvm.org/pr24813 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr22274: need a pexpect replacement for windows") -@expectedFailureAll(oslist=["freebsd","linux"], bugnumber="llvm.org/pr26139") +@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr26139") def test_command_script_immediate_output_file (self): """Test that LLDB correctly allows scripted commands to set immediate output to a file.""" self.launch(timeout=10) Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py?rev=272326&r1=272325&r2=272326&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py Thu Jun 9 17:39:36 2016 @@ -21,7
[Lldb-commits] [lldb] r272322 - Fixed an issue in the ProcessMachCore where segments are not always contiguous in mach-o core files. We have core files that have segments like:
Author: gclayton Date: Thu Jun 9 17:26:49 2016 New Revision: 272322 URL: http://llvm.org/viewvc/llvm-project?rev=272322&view=rev Log: Fixed an issue in the ProcessMachCore where segments are not always contiguous in mach-o core files. We have core files that have segments like: AddressSize File off File size -- -- -- -- LC_SEGMENT 0x000f6000 0x1000 0x1d509ee8 0x1000 --- --- 0 0x __TEXT LC_SEGMENT 0x0f60 0x0010 0x1d50aee8 0x0010 --- --- 0 0x __TEXT LC_SEGMENT 0x000f7000 0x1000 0x1d60aee8 0x1000 --- --- 0 0x __TEXT Any if the user executes the following command: (lldb) mem read 0xf6ff0 We would attempt to read 32 bytes from 0xf6ff0 but would only get 16 unless we loop through consecutive memory ranges that are contiguous in the address space, but not in the file data. This fixes the ProcessMachCore::DoReadMemory() to do the right thing. Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=272322&r1=272321&r2=272322&view=diff == --- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original) +++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Thu Jun 9 17:26:49 2016 @@ -513,25 +513,54 @@ size_t ProcessMachCore::DoReadMemory (addr_t addr, void *buf, size_t size, Error &error) { ObjectFile *core_objfile = m_core_module_sp->GetObjectFile(); +size_t bytes_read = 0; if (core_objfile) { -const VMRangeToFileOffset::Entry *core_memory_entry = m_core_aranges.FindEntryThatContains (addr); -if (core_memory_entry) + //-- +// Segments are not always contiguous in mach-o core files. We have core +// files that have segments like: +//AddressSize File off File size +//-- -- -- -- +// LC_SEGMENT 0x000f6000 0x1000 0x1d509ee8 0x1000 --- --- 0 0x __TEXT +// LC_SEGMENT 0x0f60 0x0010 0x1d50aee8 0x0010 --- --- 0 0x __TEXT +// LC_SEGMENT 0x000f7000 0x1000 0x1d60aee8 0x1000 --- --- 0 0x __TEXT +// +// Any if the user executes the following command: +// +// (lldb) mem read 0xf6ff0 +// +// We would attempt to read 32 bytes from 0xf6ff0 but would only +// get 16 unless we loop through consecutive memory ranges that are +// contiguous in the address space, but not in the file data. + //-- +while (bytes_read < size) { -const addr_t offset = addr - core_memory_entry->GetRangeBase(); -const addr_t bytes_left = core_memory_entry->GetRangeEnd() - addr; -size_t bytes_to_read = size; -if (bytes_to_read > bytes_left) -bytes_to_read = bytes_left; -return core_objfile->CopyData (core_memory_entry->data.GetRangeBase() + offset, bytes_to_read, buf); -} -else -{ -error.SetErrorStringWithFormat ("core file does not contain 0x%" PRIx64, addr); +const addr_t curr_addr = addr + bytes_read; +const VMRangeToFileOffset::Entry *core_memory_entry = m_core_aranges.FindEntryThatContains(curr_addr); + +if (core_memory_entry) +{ +const addr_t offset = curr_addr - core_memory_entry->GetRangeBase(); +const addr_t bytes_left = core_memory_entry->GetRangeEnd() - curr_addr; +const size_t bytes_to_read = std::min(size - bytes_read, (size_t)bytes_left); +const size_t curr_bytes_read = core_objfile->CopyData(core_memory_entry->data.GetRangeBase() + offset, + bytes_to_read, (char *)buf + bytes_read); +if (curr_bytes_read == 0) +break; +bytes_read += curr_bytes_read; +} +else +{ +// Only set the error if we didn't read any bytes +if (bytes_read == 0) +error.SetErrorStringWithFormat("core file does not contain 0x%" PRIx64, curr_addr); +break; +} } } -return 0; + +return bytes_read; } Error ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272320 - Fixed a problem in IRMemoryMap where the flag to zero out memory was ignored.
Author: spyffe Date: Thu Jun 9 17:22:40 2016 New Revision: 272320 URL: http://llvm.org/viewvc/llvm-project?rev=272320&view=rev Log: Fixed a problem in IRMemoryMap where the flag to zero out memory was ignored. Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=272320&r1=272319&r2=272320&view=diff == --- lldb/trunk/source/Expression/IRMemoryMap.cpp (original) +++ lldb/trunk/source/Expression/IRMemoryMap.cpp Thu Jun 9 17:22:40 2016 @@ -430,6 +430,13 @@ IRMemoryMap::Malloc (size_t size, uint8_ alignment, policy); +if (zero_memory) +{ +Error write_error; +std::vector zero_buf(size, 0); +WriteMemory(aligned_address, zero_buf.data(), size, write_error); +} + if (log) { const char * policy_string; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20368: Remove Platform usages from NativeProcessLinux
labath added a comment. @nitesh.jain could you give the new version one more spin. I tried it on the auxv files you sent me, and it should work, but maybe there are other issues we did not notice. And thank you again for the help and all the patience. Everyone else: The new version has only mips-specific changes, so I don't think there any action for you here. http://reviews.llvm.org/D20368 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20368: Remove Platform usages from NativeProcessLinux
labath updated this revision to Diff 60256. labath added a comment. This revision is now accepted and ready to land. Use an auxv-based approach for detecting the architecture in case of mips. http://reviews.llvm.org/D20368 Files: source/Plugins/Process/Linux/NativeProcessLinux.cpp source/Plugins/Process/Linux/NativeProcessLinux.h source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux.h source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.h source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h source/Plugins/Process/Linux/NativeThreadLinux.cpp Index: source/Plugins/Process/Linux/NativeThreadLinux.cpp === --- source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -158,14 +158,8 @@ if (!m_process_sp) return NativeRegisterContextSP (); -ArchSpec target_arch; -if (!m_process_sp->GetArchitecture (target_arch)) -return NativeRegisterContextSP (); - const uint32_t concrete_frame_idx = 0; -m_reg_context_sp.reset (NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(target_arch, - *this, - concrete_frame_idx)); +m_reg_context_sp.reset(NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(*this, concrete_frame_idx)); return m_reg_context_sp; } Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h === --- source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h +++ source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h @@ -24,9 +24,7 @@ class NativeRegisterContextLinux_x86_64 : public NativeRegisterContextLinux { public: -NativeRegisterContextLinux_x86_64 (const ArchSpec& target_arch, - NativeThreadProtocol &native_thread, - uint32_t concrete_frame_idx); +NativeRegisterContextLinux_x86_64(NativeThreadProtocol &native_thread, uint32_t concrete_frame_idx); uint32_t GetRegisterSetCount () const override; @@ -138,6 +136,9 @@ uint64_t m_gpr_x86_64[k_num_gpr_registers_x86_64]; uint32_t m_fctrl_offset_in_userarea; +static RegisterInfoInterface * +CreateRegisterInfoInterface(NativeThreadProtocol &native_thread); + // Private member methods. bool IsRegisterSetAvailable (uint32_t set_index) const; Index: source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp === --- source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -11,11 +11,12 @@ #include "NativeRegisterContextLinux_x86_64.h" +#include + #include "lldb/Core/Log.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Error.h" #include "lldb/Core/RegisterValue.h" -#include "lldb/Host/HostInfo.h" #include "Plugins/Process/Utility/RegisterContextLinux_i386.h" #include "Plugins/Process/Utility/RegisterContextLinux_x86_64.h" @@ -331,21 +332,22 @@ #define NT_PRXFPREG 0x46e62b7f #endif -NativeRegisterContextLinux* -NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(const ArchSpec& target_arch, - NativeThreadProtocol &native_thread, +NativeRegisterContextLinux * +NativeRegisterContextLinux::CreateHostNativeRegisterContextLinux(NativeThreadProtocol &native_thread, uint32_t concrete_frame_idx) { -return new NativeRegisterContextLinux_x86_64(target_arch, native_thread, concrete_frame_idx); +return new NativeRegisterContextLinux_x86_64(native_thread, concrete_frame_idx); } // // NativeRegisterContextLinux_x86_64 members. // -static RegisterInfoInterface* -CreateRegisterInfoInterface(const ArchSpec& target_arch) +
Re: [Lldb-commits] Does anyone need these zorg modules?
Hello, Last call for the next builder modules: ChrootSetup.py DragonEggBuilder.py KLEEBuilder.py ScriptedBuilder.py gccSuiteBuilder.py I am going to remove them. If anyone have plans for any of them please speak up! Thanks Galina ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] LLVM buildmaster will be restarted tonight
Hello everyone, LLVM buildmaster will be updated and restarted after 6 PM Pacific time today. Thanks Galina ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21159: [zorg] Add a step to run unit tests to the scripted LLDB builder
This revision was automatically updated to reflect the committed changes. Closed by commit rL272311: [zorg] Add a step to run unit tests to the scripted LLDB builder (authored by labath). Changed prior to commit: http://reviews.llvm.org/D21159?vs=60121&id=60235#toc Repository: rL LLVM http://reviews.llvm.org/D21159 Files: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py Index: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py === --- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py +++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py @@ -967,6 +967,13 @@ # Test if runTest: +f.addStep(LitTestCommand(name="run unit tests", + command=[pathSep + 'testUnit' + scriptExt], + description=["testing"], + descriptionDone=["unit test"], + flunkOnFailure=False, + warnOnFailure=False, + workdir='scripts')) getTestSteps(f, scriptExt, pathSep) # upload test traces getShellCommandStep(f, name='upload test traces', Index: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py === --- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py +++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py @@ -967,6 +967,13 @@ # Test if runTest: +f.addStep(LitTestCommand(name="run unit tests", + command=[pathSep + 'testUnit' + scriptExt], + description=["testing"], + descriptionDone=["unit test"], + flunkOnFailure=False, + warnOnFailure=False, + workdir='scripts')) getTestSteps(f, scriptExt, pathSep) # upload test traces getShellCommandStep(f, name='upload test traces', ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272301 - Updated the FindSpace() algorithm to avoid the 0 page when it's unsafe.
Author: spyffe Date: Thu Jun 9 15:22:25 2016 New Revision: 272301 URL: http://llvm.org/viewvc/llvm-project?rev=272301&view=rev Log: Updated the FindSpace() algorithm to avoid the 0 page when it's unsafe. Previously we eliminated the randomized scheme for finding memory when the underlying process cannot allocate memory, and replaced it with an algorithm that starts the allocations at 00x. This was more determinstic, but runs into problems on embedded targets where the pages near 0x0 are in fact interesting memory. To deal with those cases, this patch does two things: - It makes the default fallback be an address that is less likely than 0x0 to contain interesting information. - Before falling back to this, it adds an algorithm that consults the GetMemoryRegionInfo() API to see if it can find an unmapped area. This should eliminate the randomness (and unpredictable memory accesseas) of the previous scheme while making expressions more likely to return correct results. Modified: lldb/trunk/include/lldb/Expression/IRMemoryMap.h lldb/trunk/source/Expression/IRMemoryMap.cpp Modified: lldb/trunk/include/lldb/Expression/IRMemoryMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRMemoryMap.h?rev=272301&r1=272300&r2=272301&view=diff == --- lldb/trunk/include/lldb/Expression/IRMemoryMap.h (original) +++ lldb/trunk/include/lldb/Expression/IRMemoryMap.h Thu Jun 9 15:22:25 2016 @@ -129,7 +129,7 @@ private: typedef std::map AllocationMap; AllocationMap m_allocations; -lldb::addr_t FindSpace (size_t size, bool zero_memory = false); +lldb::addr_t FindSpace (size_t size); bool ContainsHostOnlyAllocations (); AllocationMap::iterator FindAllocation (lldb::addr_t addr, size_t size); Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=272301&r1=272300&r2=272301&view=diff == --- lldb/trunk/source/Expression/IRMemoryMap.cpp (original) +++ lldb/trunk/source/Expression/IRMemoryMap.cpp Thu Jun 9 15:22:25 2016 @@ -13,8 +13,10 @@ #include "lldb/Core/Log.h" #include "lldb/Core/Scalar.h" #include "lldb/Expression/IRMemoryMap.h" +#include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Target/Process.h" #include "lldb/Target/Target.h" +#include "lldb/Utility/LLDBAssert.h" using namespace lldb_private; @@ -47,32 +49,131 @@ IRMemoryMap::~IRMemoryMap () } lldb::addr_t -IRMemoryMap::FindSpace (size_t size, bool zero_memory) +IRMemoryMap::FindSpace (size_t size) { +// The FindSpace algorithm's job is to find a region of memory that the +// underlying process is unlikely to be using. +// +// The memory returned by this function will never be written to. The only +// point is that it should not shadow process memory if possible, so that +// expressions processing real values from the process do not use the +// wrong data. +// +// If the process can in fact allocate memory (CanJIT() lets us know this) +// then this can be accomplished just be allocating memory in the inferior. +// Then no guessing is required. + lldb::TargetSP target_sp = m_target_wp.lock(); lldb::ProcessSP process_sp = m_process_wp.lock(); + +const bool process_is_alive = process_sp && process_sp->IsAlive(); lldb::addr_t ret = LLDB_INVALID_ADDRESS; if (size == 0) return ret; -if (process_sp && process_sp->CanJIT() && process_sp->IsAlive()) +if (process_is_alive && process_sp->CanJIT()) { Error alloc_error; -if (!zero_memory) -ret = process_sp->AllocateMemory(size, lldb::ePermissionsReadable | lldb::ePermissionsWritable, alloc_error); -else -ret = process_sp->CallocateMemory(size, lldb::ePermissionsReadable | lldb::ePermissionsWritable, alloc_error); +ret = process_sp->AllocateMemory(size, lldb::ePermissionsReadable | lldb::ePermissionsWritable, alloc_error); if (!alloc_error.Success()) return LLDB_INVALID_ADDRESS; else return ret; } + +// At this point we know that we need to hunt. +// +// First, go to the end of the existing allocations we've made if there are +// any allocations. Otherwise start at the beginning of memory. -ret = 0; -if (!m_allocations.empty()) +if (m_allocations.empty()) +{ +ret = 0x0; +} +else +{ +auto back = m_allocations.rbegin(); +lldb::addr_t addr = back->first; +size_t alloc_size = back->second.m_size; +ret = llvm::alignTo(addr+alloc_size, 4096); +} + +// Now, if it's possible to use the GetMemoryRegionInfo API to detect mapped +// regions, walk forward
Re: [Lldb-commits] [PATCH] D21159: [zorg] Add a step to run unit tests to the scripted LLDB builder
gkistanova added a comment. The patch looks Ok. Thanks Galina http://reviews.llvm.org/D21159 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272284 - Fix a no newline at end of file warning.
Author: gclayton Date: Thu Jun 9 13:06:09 2016 New Revision: 272284 URL: http://llvm.org/viewvc/llvm-project?rev=272284&view=rev Log: Fix a no newline at end of file warning. Modified: lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp Modified: lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp?rev=272284&r1=272283&r2=272284&view=diff == --- lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp (original) +++ lldb/trunk/unittests/ScriptInterpreter/Python/PythonExceptionStateTests.cpp Thu Jun 9 13:06:09 2016 @@ -171,4 +171,4 @@ TEST_F(PythonExceptionStateTest, TestAut EXPECT_TRUE(PythonExceptionState::HasErrorOccurred()); PyErr_Clear(); -} \ No newline at end of file +} ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272281 - Some core files on MacOSX don't have permissions setup correctly on the LC_SEGMENT load commands. Assume read + execute if the permissions are not set.
Author: gclayton Date: Thu Jun 9 12:52:02 2016 New Revision: 272281 URL: http://llvm.org/viewvc/llvm-project?rev=272281&view=rev Log: Some core files on MacOSX don't have permissions setup correctly on the LC_SEGMENT load commands. Assume read + execute if the permissions are not set. Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Modified: lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp?rev=272281&r1=272280&r2=272281&view=diff == --- lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp (original) +++ lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp Thu Jun 9 12:52:02 2016 @@ -306,8 +306,15 @@ ProcessMachCore::DoLoadCore () { m_core_aranges.Append(range_entry); } +// Some core files don't fill in the permissions correctly. If that is the case +// assume read + execute so clients don't think the memory is not readable, +// or executable. The memory isn't writable since this plug-in doesn't implement +// DoWriteMemory. +uint32_t permissions = section->GetPermissions(); +if (permissions == 0) +permissions = lldb::ePermissionsReadable | lldb::ePermissionsExecutable; m_core_range_infos.Append( -VMRangeToPermissions::Entry(section_vm_addr, section->GetByteSize(), section->GetPermissions())); +VMRangeToPermissions::Entry(section_vm_addr, section->GetByteSize(), permissions)); } } if (!ranges_are_sorted) ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r270745 - Mark some arm-linux specific xfails marking bug entries
On 8 June 2016 at 17:24, Omair Javaid wrote: > On 26 May 2016 at 18:07, Pavel Labath wrote: >> These tests pass on soft float targets (e.g. android), so we should >> not disable it there. I think we should figure out a way to make it >> possible to disambiguate these. Right now it is possible to match >> based on the triple of the target using a regular expression, but >> maybe we could make that a bit easier. How about introducing a >> "environment" variable, so that you could specify 'environment = >> "eabihf"' or something like that? > > I have these tests failing on arm-linux-gnueabi (armel) and > arm-linux-gnueabihf targets. > > I think putting in ABI as an environment variable is the right idea. I > will see how I can separate out tests ABI based failures. Sounds good. > >> >>> --- >>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py >>> (original) >>> +++ >>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py >>> Wed May 25 13:48:39 2016 >>> @@ -21,6 +21,7 @@ class BSDArchivesTestCase(TestBase): >>> self.line = line_number('a.c', '// Set file and line breakpoint >>> inside a().') >>> >>> @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24527. >>> Makefile.rules doesn't know how to build static libs on Windows") >>> +@expectedFailureAll(oslist=["linux"], archs=["arm"], >>> bugnumber="llvm.org/pr27795") >> >> This test was passing in all configurations we are testing. The fact >> that you are getting a unicode error here tells me that the problem is >> probably specific to your setup (different locale or something). I >> don't think we should be disabling tests on all arm builds because of >> that. The problem is probably not that hard to fix, and it would be >> extremely valuable to weed out system dependencies like this in order >> to get more reproducible test results. Can you look into this ASAP? > > There exists a discussion regarding this unicode error. > http://reviews.llvm.org/D16736 > > I seem to be getting this on all kind of hardware i have right now. All the more reason to not put in xfails for random configurations. > >> >>> Modified: >>> lldb/trunk/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py >>> URL: >>> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py?rev=270745&r1=270744&r2=270745&view=diff >>> == >>> --- >>> lldb/trunk/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py >>> (original) >>> +++ >>> lldb/trunk/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py >>> Wed May 25 13:48:39 2016 >>> @@ -25,6 +25,7 @@ class BuiltinTrapTestCase(TestBase): >>> >>> @expectedFailureAll("llvm.org/pr15936", compiler="gcc", >>> compiler_version=["<=","4.6"]) >>> @expectedFailureAll(archs="arm", compiler="gcc", triple=".*-android") >>> # gcc generates incorrect linetable >>> +@expectedFailureAll(oslist=['linux'], archs=['arm']) >>> @skipIfWindows >>> def test_with_run_command(self): >>> """Test that LLDB handles a function with __builtin_trap >>> correctly.""" >>> >> >> You're saying that the problem is due to gcc linetables. Then please >> specify compiler="gcc" here (if you know an approximate version range, >> even better). > > I will correct this. Thanks. pl ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21164: Improve watchpoint error reporting specially for arm/aarch64 targets
labath added a reviewer: clayborg. labath added a comment. Native register context changes seem legit. Adding Greg for the Target.cpp changes. http://reviews.llvm.org/D21164 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r272276 - Since our expression parser needs to locate areas of memory that are not in use when you have a process that can't JIT code, like core file debugging, the core file pro
Author: gclayton Date: Thu Jun 9 11:34:06 2016 New Revision: 272276 URL: http://llvm.org/viewvc/llvm-project?rev=272276&view=rev Log: Since our expression parser needs to locate areas of memory that are not in use when you have a process that can't JIT code, like core file debugging, the core file process plug-ins should be able to override the Process::GetMemoryRegionInfo(...) function. In order to make this happen, I have added permissions to sections so that we can know what the permissions are for a given section, and modified both core file plug-ins to override Process::GetMemoryRegionInfo() and answer things correctly. Modified: lldb/trunk/include/lldb/Core/RangeMap.h lldb/trunk/include/lldb/Core/Section.h lldb/trunk/include/lldb/Target/MemoryRegionInfo.h lldb/trunk/source/Commands/CommandObjectMemory.cpp lldb/trunk/source/Core/Section.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.cpp lldb/trunk/source/Plugins/Process/elf-core/ProcessElfCore.h lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.cpp lldb/trunk/source/Plugins/Process/mach-core/ProcessMachCore.h Modified: lldb/trunk/include/lldb/Core/RangeMap.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/RangeMap.h?rev=272276&r1=272275&r2=272276&view=diff == --- lldb/trunk/include/lldb/Core/RangeMap.h (original) +++ lldb/trunk/include/lldb/Core/RangeMap.h Thu Jun 9 11:34:06 2016 @@ -1340,7 +1340,27 @@ namespace lldb_private { } return nullptr; } - + +const Entry * +FindEntryThatContainsOrFollows(B addr) const +{ +#ifdef ASSERT_RANGEMAP_ARE_SORTED +assert(IsSorted()); +#endif +if (!m_entries.empty()) +{ +typename Collection::const_iterator end = m_entries.end(); +typename Collection::const_iterator pos = +std::lower_bound(m_entries.begin(), end, addr, [](const Entry &lhs, B rhs_base) -> bool { +return lhs.GetRangeBase() < rhs_base; +}); + +if (pos != end) +return &(*pos); +} +return nullptr; +} + Entry * Back() { Modified: lldb/trunk/include/lldb/Core/Section.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Section.h?rev=272276&r1=272275&r2=272276&view=diff == --- lldb/trunk/include/lldb/Core/Section.h (original) +++ lldb/trunk/include/lldb/Core/Section.h Thu Jun 9 11:34:06 2016 @@ -273,7 +273,19 @@ public: { m_thread_specific = b; } - + +//-- +/// Get the permissions as OR'ed bits from lldb::Permissions +//-- +uint32_t +GetPermissions() const; + +//-- +/// Set the permissions using bits OR'ed from lldb::Permissions +//-- +void +SetPermissions(uint32_t permissions); + ObjectFile * GetObjectFile () { @@ -356,12 +368,15 @@ protected: lldb::offset_t m_file_size;// Object file size (can be smaller than m_byte_size for zero filled sections...) uint32_tm_log2align;// log_2(align) of the section (i.e. section has to be aligned to 2^m_log2align) SectionList m_children; // Child sections -boolm_fake:1, // If true, then this section only can contain the address if one of its +bool m_fake : 1,// If true, then this section only can contain the address if one of its // children contains an address. This allows for gaps between the children // that are contained in the address range for this section, but do not produce // hits unless the children contain the address. -m_encrypted:1, // Set to true if the contents are encrypted -m_thread_specific:1;// This section is thread specific +m_encrypted : 1,// Set to true if the contents are encrypted +m_thread_specific : 1, // This section is thread specific +m_readable : 1, // If this section has read permissions +m_writable : 1, // If this section has write permissions +m_executable : 1; // If this section has executable
Re: [Lldb-commits] [PATCH] D21064: [LLDB][MIPS] Fix Emulation of Compact branch and ADDIU instructions
bhushan accepted this revision. bhushan added a comment. Looks good. Repository: rL LLVM http://reviews.llvm.org/D21064 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits