[Lldb-commits] [lldb] r237239 - Remote Non-Stop Support
Author: ewancrawford Date: Wed May 13 04:18:18 2015 New Revision: 237239 URL: http://llvm.org/viewvc/llvm-project?rev=237239view=rev Log: Remote Non-Stop Support Summary: This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely. Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection. Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop. A setting for querying the remote for default thread on setup is also included. Handling of '%' async notification packets will be added next. Reviewers: clayborg Subscribers: lldb-commits, ADodds, ted, deepak2427 Differential Revision: http://reviews.llvm.org/D9656 Modified: lldb/trunk/include/lldb/Target/Target.h lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp lldb/trunk/source/Utility/StringExtractorGDBRemote.h Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=237239r1=237238r2=237239view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Wed May 13 04:18:18 2015 @@ -189,6 +189,9 @@ public: void SetUserSpecifiedTrapHandlerNames (const Args args); + +bool +GetNonStopModeEnabled () const; bool GetDisplayRuntimeSupportValues () const; Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=237239r1=237238r2=237239view=diff == --- lldb/trunk/source/Commands/CommandObjectThread.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectThread.cpp Wed May 13 04:18:18 2015 @@ -433,6 +433,12 @@ public: m_step_in_avoid_no_debug = eLazyBoolCalculate; m_step_out_avoid_no_debug = eLazyBoolCalculate; m_run_mode = eOnlyDuringStepping; + +// Check if we are in Non-Stop mode +lldb::TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget(); +if (target_sp.get() != nullptr target_sp-GetNonStopModeEnabled()) +m_run_mode = eOnlyThisThread; + m_avoid_regexp.clear(); m_step_in_target.clear(); m_class_name.clear(); Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp?rev=237239r1=237238r2=237239view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp Wed May 13 04:18:18 2015 @@ -424,6 +424,7 @@ GDBRemoteCommunication::CheckForPacket ( content_length = total_length = 1; // The command is one byte long... break; +case '%': // Async notify packet case '$': // Look for a standard gdb packet? { @@ -466,6 +467,7 @@ GDBRemoteCommunication::CheckForPacket ( case '+': case '-': case '\x03': +case '%': case '$': done = true; break; @@ -586,7 +588,7 @@ GDBRemoteCommunication::CheckForPacket ( } } -if (m_bytes[0] == '$') +if (m_bytes[0] == '$' || m_bytes[0] == '%') { assert (checksum_idx m_bytes.size()); if (::isxdigit (m_bytes[checksum_idx+0]) || Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp?rev=237239r1=237238r2=237239view=diff == ---
[Lldb-commits] [lldb] r237238 - Fix a few compile warnings
Author: ki.stfu Date: Wed May 13 04:04:59 2015 New Revision: 237238 URL: http://llvm.org/viewvc/llvm-project?rev=237238view=rev Log: Fix a few compile warnings Modified: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Modified: lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp?rev=237238r1=237237r2=237238view=diff == --- lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp (original) +++ lldb/trunk/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp Wed May 13 04:04:59 2015 @@ -401,7 +401,7 @@ DynamicLoaderHexagonDYLD::RendezvousBrea dyld_instance-m_rendezvous.SetRendezvousAddress( structAddr ); if ( log ) -log-Printf( Found _rtld_debug structure @ 0x%08lx, structAddr ); +log-Printf( Found _rtld_debug structure @ 0x%08 PRIx64, structAddr ); } else { Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=237238r1=237237r2=237238view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Wed May 13 04:04:59 2015 @@ -465,7 +465,7 @@ DWARFCompileUnit::BuildAddressRangeTable { const LineTable::FileAddressRanges::Entry range = file_ranges.GetEntryRef(idx); debug_aranges-AppendRange(GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); -printf (0x%8.8x: [0x%16.16lx - 0x%16.16lx)\n, GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); +printf (0x%8.8x: [0x%16.16 PRIx64 - 0x%16.16 PRIx64 )\n, GetOffset(), range.GetRangeBase(), range.GetRangeEnd()); } } } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237240 - Fix arm instruction emulation of add (imm) and sub (imm)
Author: tberghammer Date: Wed May 13 04:25:06 2015 New Revision: 237240 URL: http://llvm.org/viewvc/llvm-project?rev=237240view=rev Log: Fix arm instruction emulation of add (imm) and sub (imm) Differential revision: http://reviews.llvm.org/D9704 Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Modified: lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp?rev=237240r1=237239r2=237240view=diff == --- lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp (original) +++ lldb/trunk/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp Wed May 13 04:25:06 2015 @@ -2642,7 +2642,11 @@ EmulateInstructionARM::EmulateADDImmARM AddWithCarryResult res = AddWithCarry(val1, imm32, 0); EmulateInstruction::Context context; -context.type = eContextArithmetic; +if (Rd == 13) +context.type = EmulateInstruction::eContextAdjustStackPointer; +else +context.type = EmulateInstruction::eContextRegisterPlusOffset; + RegisterInfo dwarf_reg; GetRegisterInfo (eRegisterKindDWARF, Rn, dwarf_reg); context.SetRegisterPlusOffset (dwarf_reg, imm32); @@ -9165,46 +9169,55 @@ EmulateInstructionARM::EmulateSUBImmARM bool success = false; -uint32_t Rd; // the destination register -uint32_t Rn; // the first operand -bool setflags; -uint32_t imm32; // the immediate value to be subtracted from the value obtained from Rn -switch (encoding) { -case eEncodingA1: -Rd = Bits32(opcode, 15, 12); -Rn = Bits32(opcode, 19, 16); -setflags = BitIsSet(opcode, 20); -imm32 = ARMExpandImm(opcode); // imm32 = ARMExpandImm(imm12) +if (ConditionPassed(opcode)) +{ +uint32_t Rd; // the destination register +uint32_t Rn; // the first operand +bool setflags; +uint32_t imm32; // the immediate value to be subtracted from the value obtained from Rn +switch (encoding) { +case eEncodingA1: +Rd = Bits32(opcode, 15, 12); +Rn = Bits32(opcode, 19, 16); +setflags = BitIsSet(opcode, 20); +imm32 = ARMExpandImm(opcode); // imm32 = ARMExpandImm(imm12) -// if Rn == '' S == '0' then SEE ADR; -if (Rn == 15 !setflags) -return EmulateADR (opcode, eEncodingA2); +// if Rn == '' S == '0' then SEE ADR; +if (Rn == 15 !setflags) +return EmulateADR (opcode, eEncodingA2); + +// if Rn == '1101' then SEE SUB (SP minus immediate); +if (Rn == 13) +return EmulateSUBSPImm (opcode, eEncodingA1); -// if Rn == '1101' then SEE SUB (SP minus immediate); -if (Rn == 13) -return EmulateSUBSPImm (opcode, eEncodingA1); +// if Rd == '' S == '1' then SEE SUBS PC, LR and related instructions; +if (Rd == 15 setflags) +return EmulateSUBSPcLrEtc (opcode, encoding); +break; +default: +return false; +} +// Read the register value from the operand register Rn. +uint32_t reg_val = ReadCoreReg(Rn, success); +if (!success) +return false; -// if Rd == '' S == '1' then SEE SUBS PC, LR and related instructions; -if (Rd == 15 setflags) -return EmulateSUBSPcLrEtc (opcode, encoding); -break; -default: -return false; -} -// Read the register value from the operand register Rn. -uint32_t reg_val = ReadCoreReg(Rn, success); -if (!success) -return false; - -AddWithCarryResult res = AddWithCarry(reg_val, ~imm32, 1); +AddWithCarryResult res = AddWithCarry(reg_val, ~imm32, 1); -EmulateInstruction::Context context; -context.type = EmulateInstruction::eContextImmediate; -context.SetNoArgs (); +EmulateInstruction::Context context; +if (Rd == 13) +context.type = EmulateInstruction::eContextAdjustStackPointer; +else +context.type = EmulateInstruction::eContextRegisterPlusOffset; -if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, res.carry_out, res.overflow)) -return false; +RegisterInfo dwarf_reg; +GetRegisterInfo (eRegisterKindDWARF, Rn, dwarf_reg); +int64_t imm32_signed = imm32; +context.SetRegisterPlusOffset (dwarf_reg, -imm32_signed); +if (!WriteCoreRegOptionalFlags(context, res.result, Rd, setflags, res.carry_out, res.overflow)) +return false; +} return true; } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu
[Lldb-commits] [lldb] r237248 - Refactor lldb-mi's prompt
Author: ki.stfu Date: Wed May 13 07:18:20 2015 New Revision: 237248 URL: http://llvm.org/viewvc/llvm-project?rev=237248view=rev Log: Refactor lldb-mi's prompt Summary: This patch fixes/cleans code around of (gdb) prompt: # Add CMICmnStreamStdout::WritePrompt # Clean up CMICmnStreamStdout::TextToStdout (don't lock the m_mutex twice because it will be locked in CMICmnStreamStdout::WritePriv) # Remove unused CMICmnStreamStdin::m_bShowPrompt field # Refactor CMICmnLLDBDebuggerHandleEvents to use CMICmnStreamStdout::WritePrompt instead of TextToStdout((gdb)) # Refactor CMIDriver to use CMICmnStreamStdout::WritePrompt instead of ``` if (bOk m_rStdin.GetEnablePrompt()) bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt()); ``` Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/ Reviewers: abidh Reviewed By: abidh Subscribers: lldb-commits, abidh Differential Revision: http://reviews.llvm.org/D9737 Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp lldb/trunk/tools/lldb-mi/MICmnStreamStdin.cpp lldb/trunk/tools/lldb-mi/MICmnStreamStdin.h lldb/trunk/tools/lldb-mi/MICmnStreamStdout.cpp lldb/trunk/tools/lldb-mi/MICmnStreamStdout.h lldb/trunk/tools/lldb-mi/MIDriver.cpp Modified: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp?rev=237248r1=237247r2=237248view=diff == --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp (original) +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp Wed May 13 07:18:20 2015 @@ -1022,7 +1022,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr const CMICmnMIValueResult miValueResult7(stopped-threads, miValueConst7); bOk = bOk miOutOfBandRecord.Add(miValueResult7); bOk = bOk MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); } else if (nStopReason == m_SIGSEGV) { @@ -1090,7 +1090,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr const CMICmnMIValueResult miValueResult4(stopped-threads, miValueConst4); bOk = bOk miOutOfBandRecord.Add(miValueResult4); bOk = bOk MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); } return bOk; } @@ -1128,7 +1128,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr const CMICmnMIValueResult miValueResult4(stopped-threads, miValueConst4); bOk = bOk miOutOfBandRecord.Add(miValueResult4); bOk = bOk MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); return bOk; } @@ -1248,7 +1248,7 @@ CMICmnLLDBDebuggerHandleEvents::MiStoppe const CMICmnMIValueResult miValueResult6(stopped-threads, miValueConst6); bOk = bOk miOutOfBandRecord.Add(miValueResult6); bOk = bOk MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); return bOk; } @@ -1290,7 +1290,7 @@ CMICmnLLDBDebuggerHandleEvents::MiStoppe const CMICmnMIValueResult miValueResult9(stopped-threads, miValueConst9); bOk = miOutOfBandRecord.Add(miValueResult9); bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); } return MIstatus::success; @@ -1321,7 +1321,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr const CMICmnMIValueResult miValueResult2(stopped-threads, miValueConst2); bOk = miOutOfBandRecord.Add(miValueResult2); bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); return bOk; } @@ -1355,7 +1355,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr const CMICmnMIValueResult miValueResult9(stopped-threads, miValueConst9); bOk = miOutOfBandRecord.Add(miValueResult9); bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); } return bOk; @@ -1447,7 +1447,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr CMICmnMIValueResult miValueResult(thread-id, miValueConst); CMICmnMIOutOfBandRecord miOutOfBandRecord(CMICmnMIOutOfBandRecord::eOutOfBand_Running, miValueResult); bool bOk = MiOutOfBandRecordToStdout(miOutOfBandRecord); -bOk = bOk TextToStdout((gdb)); +bOk = bOk CMICmnStreamStdout::WritePrompt(); return bOk; } @@ -1491,7 +1491,7 @@ CMICmnLLDBDebuggerHandleEvents::HandlePr CMICmnMIOutOfBandRecord
[Lldb-commits] [lldb] r237278 - Change Linux Platform to support non-host Linux architectures
Author: ted Date: Wed May 13 13:52:56 2015 New Revision: 237278 URL: http://llvm.org/viewvc/llvm-project?rev=237278view=rev Log: Change Linux Platform to support non-host Linux architectures Summary: This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly. Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709. D8709 summary: The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform. Reviewers: clayborg, flackr Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9683 Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Modified: lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp?rev=237278r1=237277r2=237278view=diff == --- lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Linux/PlatformLinux.cpp Wed May 13 13:52:56 2015 @@ -501,6 +501,30 @@ PlatformLinux::GetSupportedArchitectureA { if (m_remote_platform_sp) return m_remote_platform_sp-GetSupportedArchitectureAtIndex(idx, arch); + +llvm::Triple triple; +// Set the OS to linux +triple.setOS(llvm::Triple::Linux); +// Set the architecture +switch (idx) +{ +case 0: triple.setArchName(x86_64); break; +case 1: triple.setArchName(i386); break; +case 2: triple.setArchName(arm); break; +case 3: triple.setArchName(aarch64); break; +case 4: triple.setArchName(mips64); break; +case 5: triple.setArchName(hexagon); break; +case 6: triple.setArchName(mips); break; +default: return false; +} +// Leave the vendor as llvm::Triple:UnknownVendor and don't specify the vendor by +// calling triple.SetVendorName(unknown) so that it is a unspecified unknown. +// This means when someone calls triple.GetVendorName() it will return an empty string +// which indicates that the vendor can be set when two architectures are merged + +// Now set the triple into arch and return true +arch.SetTriple(triple); +return true; } return false; } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237291 - Fix broken test, this wasn't supposed to get committed.
Author: zturner Date: Wed May 13 15:21:22 2015 New Revision: 237291 URL: http://llvm.org/viewvc/llvm-project?rev=237291view=rev Log: Fix broken test, this wasn't supposed to get committed. Modified: lldb/trunk/test/functionalities/paths/TestPaths.py Modified: lldb/trunk/test/functionalities/paths/TestPaths.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/paths/TestPaths.py?rev=237291r1=237290r2=237291view=diff == --- lldb/trunk/test/functionalities/paths/TestPaths.py (original) +++ lldb/trunk/test/functionalities/paths/TestPaths.py Wed May 13 15:21:22 2015 @@ -28,12 +28,6 @@ class TestPaths(TestBase): # No directory path types should have the filename set self.assertTrue (f.GetFilename() == None); -def test_filespec_resolve_doesnt_prepend_cwd_if_file_doesnt_exist (self): -file_only = lldb.SBFileSpec(VeryUnlikelToExistInTheCurrentWorkingDirectory, True) -# SBFileSpec(path, True) should not prepend the current-working-directory to the -# file path if it doesn't exist in the current directory. -self.assertTrue (file_only.GetDirectory() == None) - def test_directory_doesnt_end_with_slash(self): current_directory_spec = lldb.SBFileSpec(os.path.curdir) current_directory_string = current_directory_spec.GetDirectory() ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237292 - Don't import lock on Windows.
Author: zturner Date: Wed May 13 15:21:33 2015 New Revision: 237292 URL: http://llvm.org/viewvc/llvm-project?rev=237292view=rev Log: Don't import lock on Windows. lock imports fcntl, which doesn't exist on Windows. If we need to use this class on Windows, we will need to implement something based on the CreateMutex API. Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=237292r1=237291r2=237292view=diff == --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Wed May 13 15:21:33 2015 @@ -23,7 +23,6 @@ for available options. import commands import os import errno -import lock import platform import progress import signal @@ -439,6 +438,7 @@ def setupCrashInfoHook(): global setCrashInfoHook setCrashInfoHook = setCrashInfoHook_NonMac # safe default if platform.system() == Darwin: +import lock test_dir = os.environ['LLDB_TEST'] if not test_dir or not os.path.exists(test_dir): return ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237288 - Select expected remote libc++ library name based on remote platform.
Author: flackr Date: Wed May 13 15:17:34 2015 New Revision: 237288 URL: http://llvm.org/viewvc/llvm-project?rev=237288view=rev Log: Select expected remote libc++ library name based on remote platform. Select expected remote libc++ library name based on remote platform. This is used to verify libc++ is in the loaded image list by various tests which use it. Test Plan: Passes the following tests mac - linux with this patch: TestDataFormatterLibccIterator.py TestDataFormatterLibccMap.py TestDataFormatterLibccMultiMap.py TestDataFormatterLibcxxMultiSet.py TestDataFormatterLibcxxSet.py TestDataFormatterUnordered.py Differential Revision: http://reviews.llvm.org/D9759 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=237288r1=237287r2=237288view=diff == --- lldb/trunk/test/lldbtest.py (original) +++ lldb/trunk/test/lldbtest.py Wed May 13 15:17:34 2015 @@ -1836,7 +1836,7 @@ class Base(unittest2.TestCase): return self.lib_dir def getLibcPlusPlusLibs(self): -if sys.platform.startswith('freebsd') or sys.platform.startswith('linux'): +if self.getPlatform() == 'freebsd' or self.getPlatform() == 'linux': return ['libc++.so.1'] else: return ['libc++.1.dylib','libc++abi.dylib'] ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237282 - Fix an issue with finding python on Windows.
Author: zturner Date: Wed May 13 14:44:57 2015 New Revision: 237282 URL: http://llvm.org/viewvc/llvm-project?rev=237282view=rev Log: Fix an issue with finding python on Windows. Someone must have changed the behavior of FileSpec slightly relating to whether or not there is a trailing backslash when calling GetPath() and GetDirectory(). This caused ScriptInterpreterPython to find the wrong values when initializing sys.path, and as a result we couldn't find the lldb module. This patch fixes the issue, and also adds a test to make sure that GetDirectory() does not return a string containing a trailing slash. Modified: lldb/trunk/source/Host/windows/HostInfoWindows.cpp lldb/trunk/test/functionalities/paths/TestPaths.py Modified: lldb/trunk/source/Host/windows/HostInfoWindows.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/HostInfoWindows.cpp?rev=237282r1=237281r2=237282view=diff == --- lldb/trunk/source/Host/windows/HostInfoWindows.cpp (original) +++ lldb/trunk/source/Host/windows/HostInfoWindows.cpp Wed May 13 14:44:57 2015 @@ -109,8 +109,7 @@ HostInfoWindows::ComputePythonDirectory( FileSpec lldb_file_spec; if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec)) return false; -llvm::SmallString64 path; -lldb_file_spec.GetPath(path); +llvm::SmallString64 path(lldb_file_spec.GetDirectory().AsCString()); llvm::sys::path::remove_filename(path); llvm::sys::path::append(path, lib, site-packages); std::replace(path.begin(), path.end(), '\\', '/'); Modified: lldb/trunk/test/functionalities/paths/TestPaths.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/paths/TestPaths.py?rev=237282r1=237281r2=237282view=diff == --- lldb/trunk/test/functionalities/paths/TestPaths.py (original) +++ lldb/trunk/test/functionalities/paths/TestPaths.py Wed May 13 14:44:57 2015 @@ -34,6 +34,12 @@ class TestPaths(TestBase): # file path if it doesn't exist in the current directory. self.assertTrue (file_only.GetDirectory() == None) +def test_directory_doesnt_end_with_slash(self): +current_directory_spec = lldb.SBFileSpec(os.path.curdir) +current_directory_string = current_directory_spec.GetDirectory() +self.assertNotEqual(current_directory_string[-1:], '/') +pass + @skipUnlessPlatform([windows]) def test_windows_double_slash (self): '''Test to check the path with double slash is handled correctly ''' ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237303 - Initial FreeBSD/arm live debugging support
Author: emaste Date: Wed May 13 17:33:12 2015 New Revision: 237303 URL: http://llvm.org/viewvc/llvm-project?rev=237303view=rev Log: Initial FreeBSD/arm live debugging support Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files added in r235305 instead. Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237303r1=237302r2=237303view=diff == --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 17:33:12 2015 @@ -591,6 +591,12 @@ PlatformFreeBSD::GetSoftwareBreakpointTr default: assert(false Unhandled architecture in PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode()); break; +case llvm::Triple::arm: +{ +static const uint8_t g_arm_opcode[] = { 0xfe, 0xde, 0xff, 0xe7 }; +trap_opcode = g_arm_opcode; +trap_opcode_size = sizeof(g_arm_opcode); +} case llvm::Triple::x86: case llvm::Triple::x86_64: { Modified: lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp?rev=237303r1=237302r2=237303view=diff == --- lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp (original) +++ lldb/trunk/source/Plugins/Process/POSIX/POSIXThread.cpp Wed May 13 17:33:12 2015 @@ -41,6 +41,7 @@ #include Plugins/Process/Utility/RegisterContextLinux_arm64.h #include Plugins/Process/Utility/RegisterContextLinux_i386.h #include Plugins/Process/Utility/RegisterContextLinux_x86_64.h +#include Plugins/Process/Utility/RegisterContextFreeBSD_arm.h #include Plugins/Process/Utility/RegisterContextFreeBSD_i386.h #include Plugins/Process/Utility/RegisterContextFreeBSD_mips64.h #include Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.h @@ -171,6 +172,9 @@ POSIXThread::GetRegisterContext() case llvm::Triple::FreeBSD: switch (target_arch.GetMachine()) { +case llvm::Triple::arm: +reg_interface = new RegisterContextFreeBSD_arm(target_arch); +break; case llvm::Triple::ppc: #ifndef __powerpc64__ reg_interface = new RegisterContextFreeBSD_powerpc32(target_arch); ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237302 - Rearrange PlatformFreeBSD to match PlatformLinux
Author: emaste Date: Wed May 13 17:26:24 2015 New Revision: 237302 URL: http://llvm.org/viewvc/llvm-project?rev=237302view=rev Log: Rearrange PlatformFreeBSD to match PlatformLinux No functional change, but this simplifies diffs of the two. Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237302r1=237301r2=237302view=diff == --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 17:26:24 2015 @@ -123,27 +123,6 @@ PlatformFreeBSD::Terminate () Platform::Terminate (); } -//-- -/// Default Constructor -//-- -PlatformFreeBSD::PlatformFreeBSD (bool is_host) : -Platform(is_host), -m_remote_platform_sp() -{ -} - -//-- -/// Destructor. -/// -/// The destructor is virtual since this class is designed to be -/// inherited from by the plug-in instance. -//-- -PlatformFreeBSD::~PlatformFreeBSD() -{ -} - -//TODO:VK: inherit PlatformPOSIX - bool PlatformFreeBSD::GetModuleSpec (const FileSpec module_file_spec, const ArchSpec arch, @@ -174,7 +153,6 @@ PlatformFreeBSD::RunShellCommand (const } } - Error PlatformFreeBSD::ResolveExecutable (const ModuleSpec module_spec, lldb::ModuleSP exe_module_sp, @@ -295,41 +273,46 @@ PlatformFreeBSD::ResolveExecutable (cons return error; } -size_t -PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode (Target target, BreakpointSite *bp_site) +// From PlatformMacOSX only +Error +PlatformFreeBSD::GetFileWithUUID (const FileSpec platform_file, + const UUID *uuid_ptr, + FileSpec local_file) { -ArchSpec arch = target.GetArchitecture(); -const uint8_t *trap_opcode = NULL; -size_t trap_opcode_size = 0; - -switch (arch.GetMachine()) +if (IsRemote()) { -default: -assert(false Unhandled architecture in PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode()); -break; -case llvm::Triple::x86: -case llvm::Triple::x86_64: -{ -static const uint8_t g_i386_opcode[] = { 0xCC }; -trap_opcode = g_i386_opcode; -trap_opcode_size = sizeof(g_i386_opcode); -} -break; -case llvm::Triple::ppc: -case llvm::Triple::ppc64: -{ -static const uint8_t g_ppc_opcode[] = { 0x7f, 0xe0, 0x00, 0x08 }; -trap_opcode = g_ppc_opcode; -trap_opcode_size = sizeof(g_ppc_opcode); -} +if (m_remote_platform_sp) +return m_remote_platform_sp-GetFileWithUUID (platform_file, uuid_ptr, local_file); } -if (bp_site-SetTrapOpcode(trap_opcode, trap_opcode_size)) -return trap_opcode_size; +// Default to the local case +local_file = platform_file; +return Error(); +} -return 0; + +//-- +/// Default Constructor +//-- +PlatformFreeBSD::PlatformFreeBSD (bool is_host) : +Platform(is_host), +m_remote_platform_sp() +{ } +//-- +/// Destructor. +/// +/// The destructor is virtual since this class is designed to be +/// inherited from by the plug-in instance. +//-- +PlatformFreeBSD::~PlatformFreeBSD() +{ +} + +//TODO:VK: inherit PlatformPOSIX + + bool PlatformFreeBSD::GetRemoteOSVersion () { @@ -460,8 +443,6 @@ PlatformFreeBSD::GetProcessInfo (lldb::p return success; } - - uint32_t PlatformFreeBSD::FindProcesses (const ProcessInstanceInfoMatch match_info, ProcessInstanceInfoList process_infos) @@ -481,71 +462,6 @@ PlatformFreeBSD::FindProcesses (const Pr return match_count; } -Error -PlatformFreeBSD::LaunchProcess (ProcessLaunchInfo launch_info) -{ -Error error; -if (IsHost()) -{ -error = Platform::LaunchProcess (launch_info); -} -else -{ -if (m_remote_platform_sp) -error = m_remote_platform_sp-LaunchProcess (launch_info); -else -error.SetErrorString (the platform is not currently connected); -} -return error; -} - -lldb::ProcessSP -PlatformFreeBSD::Attach(ProcessAttachInfo attach_info, -Debugger debugger, -
[Lldb-commits] [lldb] r237313 - Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode
Author: emaste Date: Wed May 13 18:09:43 2015 New Revision: 237313 URL: http://llvm.org/viewvc/llvm-project?rev=237313view=rev Log: Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcode Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237313r1=237312r2=237313view=diff == --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 18:09:43 2015 @@ -597,12 +597,14 @@ PlatformFreeBSD::GetSoftwareBreakpointTr trap_opcode = g_aarch64_opcode; trap_opcode_size = sizeof(g_aarch64_opcode); } +break; case llvm::Triple::arm: { static const uint8_t g_arm_opcode[] = { 0xfe, 0xde, 0xff, 0xe7 }; trap_opcode = g_arm_opcode; trap_opcode_size = sizeof(g_arm_opcode); } +break; case llvm::Triple::mips64: { static const uint8_t g_hex_opcode[] = { 0x00, 0x00, 0x00, 0x0d }; @@ -617,6 +619,7 @@ PlatformFreeBSD::GetSoftwareBreakpointTr trap_opcode = g_ppc_opcode; trap_opcode_size = sizeof(g_ppc_opcode); } +break; case llvm::Triple::x86: case llvm::Triple::x86_64: { ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237306 - Add AArch64 and MIPS breakpoint opcodes and sort cases
Author: emaste Date: Wed May 13 17:40:01 2015 New Revision: 237306 URL: http://llvm.org/viewvc/llvm-project?rev=237306view=rev Log: Add AArch64 and MIPS breakpoint opcodes and sort cases New opcodes from PlatformLinux.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237306r1=237305r2=237306view=diff == --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 17:40:01 2015 @@ -591,18 +591,23 @@ PlatformFreeBSD::GetSoftwareBreakpointTr default: assert(false Unhandled architecture in PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode()); break; +case llvm::Triple::aarch64: +{ +static const uint8_t g_aarch64_opcode[] = { 0x00, 0x00, 0x20, 0xd4 }; +trap_opcode = g_aarch64_opcode; +trap_opcode_size = sizeof(g_aarch64_opcode); +} case llvm::Triple::arm: { static const uint8_t g_arm_opcode[] = { 0xfe, 0xde, 0xff, 0xe7 }; trap_opcode = g_arm_opcode; trap_opcode_size = sizeof(g_arm_opcode); } -case llvm::Triple::x86: -case llvm::Triple::x86_64: +case llvm::Triple::mips64: { -static const uint8_t g_i386_opcode[] = { 0xCC }; -trap_opcode = g_i386_opcode; -trap_opcode_size = sizeof(g_i386_opcode); +static const uint8_t g_hex_opcode[] = { 0x00, 0x00, 0x00, 0x0d }; +trap_opcode = g_hex_opcode; +trap_opcode_size = sizeof(g_hex_opcode); } break; case llvm::Triple::ppc: @@ -612,11 +617,18 @@ PlatformFreeBSD::GetSoftwareBreakpointTr trap_opcode = g_ppc_opcode; trap_opcode_size = sizeof(g_ppc_opcode); } +case llvm::Triple::x86: +case llvm::Triple::x86_64: +{ +static const uint8_t g_i386_opcode[] = { 0xCC }; +trap_opcode = g_i386_opcode; +trap_opcode_size = sizeof(g_i386_opcode); +} +break; } if (bp_site-SetTrapOpcode(trap_opcode, trap_opcode_size)) return trap_opcode_size; - return 0; } ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237315 - Add mips64el trap opcode to PlatformFreeBSD as well
Author: emaste Date: Wed May 13 18:12:51 2015 New Revision: 237315 URL: http://llvm.org/viewvc/llvm-project?rev=237315view=rev Log: Add mips64el trap opcode to PlatformFreeBSD as well Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=237315r1=237314r2=237315view=diff == --- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original) +++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Wed May 13 18:12:51 2015 @@ -612,6 +612,13 @@ PlatformFreeBSD::GetSoftwareBreakpointTr trap_opcode_size = sizeof(g_hex_opcode); } break; +case llvm::Triple::mips64el: +{ +static const uint8_t g_hex_opcode[] = { 0x0d, 0x00, 0x00, 0x00 }; +trap_opcode = g_hex_opcode; +trap_opcode_size = sizeof(g_hex_opcode); +} +break; case llvm::Triple::ppc: case llvm::Triple::ppc64: { ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237319 - Added XTIMEOUT for TestAttachDenied.py
Author: vharron Date: Wed May 13 18:59:03 2015 New Revision: 237319 URL: http://llvm.org/viewvc/llvm-project?rev=237319view=rev Log: Added XTIMEOUT for TestAttachDenied.py Modified: lldb/trunk/test/dosep.py Modified: lldb/trunk/test/dosep.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dosep.py?rev=237319r1=237318r2=237319view=diff == --- lldb/trunk/test/dosep.py (original) +++ lldb/trunk/test/dosep.py Wed May 13 18:59:03 2015 @@ -167,6 +167,7 @@ def getExpectedTimeouts(dotest_options): if target.startswith(linux): expected_timeout |= { +TestAttachDenied.py, TestAttachResume.py, TestConnectRemote.py, TestCreateAfterAttach.py, ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237322 - Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents
Author: enrico Date: Wed May 13 19:46:47 2015 New Revision: 237322 URL: http://llvm.org/viewvc/llvm-project?rev=237322view=rev Log: Implement an objc tagged-pointer info command that will provide information about what LLDB thinks an ObjC tagged pointer represents Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h Modified: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=237322r1=237321r2=237322view=diff == --- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original) +++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h Wed May 13 19:46:47 2015 @@ -310,6 +310,30 @@ public: std::unordered_setstd::string m_class_names; }; +class TaggedPointerVendor +{ +public: +virtual bool +IsPossibleTaggedPointer (lldb::addr_t ptr) = 0; + +virtual ObjCLanguageRuntime::ClassDescriptorSP +GetClassDescriptor (lldb::addr_t ptr) = 0; + +virtual +~TaggedPointerVendor () { } +protected: +TaggedPointerVendor () = default; + +private: +DISALLOW_COPY_AND_ASSIGN(TaggedPointerVendor); +}; + +virtual TaggedPointerVendor* +GetTaggedPointerVendor () +{ +return nullptr; +} + typedef std::shared_ptrEncodingToType EncodingToTypeSP; virtual EncodingToTypeSP Modified: lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp?rev=237322r1=237321r2=237322view=diff == --- lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp (original) +++ lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp Wed May 13 19:46:47 2015 @@ -32,6 +32,7 @@ #include lldb/Core/ValueObjectVariable.h #include lldb/Expression/ClangFunction.h #include lldb/Expression/ClangUtilityFunction.h +#include lldb/Host/StringConvert.h #include lldb/Interpreter/CommandObject.h #include lldb/Interpreter/CommandObjectMultiword.h #include lldb/Interpreter/CommandReturnObject.h @@ -363,7 +364,7 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2 ( m_has_object_getClass (false), m_loaded_objc_opt (false), m_non_pointer_isa_cache_ap(NonPointerISACache::CreateInstance(*this,objc_module_sp)), - m_tagged_pointer_vendor_ap(TaggedPointerVendor::CreateInstance(*this,objc_module_sp)), + m_tagged_pointer_vendor_ap(TaggedPointerVendorV2::CreateInstance(*this,objc_module_sp)), m_encoding_to_type_sp(), m_noclasses_warning_emitted(false) { @@ -508,6 +509,106 @@ protected: } }; +class CommandObjectMultiwordObjC_TaggedPointer_Info : public CommandObjectParsed +{ +public: + +CommandObjectMultiwordObjC_TaggedPointer_Info (CommandInterpreter interpreter) : +CommandObjectParsed (interpreter, + info, + Dump information on a tagged pointer., + language objc tagged-pointer info, + eFlagRequiresProcess | + eFlagProcessMustBeLaunched | + eFlagProcessMustBePaused ) +{ +CommandArgumentEntry arg; +CommandArgumentData index_arg; + +// Define the first (and only) variant of this arg. +index_arg.arg_type = eArgTypeAddress; +index_arg.arg_repetition = eArgRepeatPlus; + +// There is only one variant this argument could be; put it into the argument entry. +arg.push_back (index_arg); + +// Push the data for the first argument into the m_arguments vector. +m_arguments.push_back (arg); +} + +~CommandObjectMultiwordObjC_TaggedPointer_Info () +{ +} + +protected: +bool +DoExecute (Args command, CommandReturnObject result) +{ +if (command.GetArgumentCount() == 0) +{ +result.AppendError(this command requires arguments); +result.SetStatus(lldb::eReturnStatusFailed); +return false; +} + +Process *process = m_exe_ctx.GetProcessPtr(); +ExecutionContext exe_ctx(process); +ObjCLanguageRuntime *objc_runtime = process-GetObjCLanguageRuntime(); +if (objc_runtime) +{ +ObjCLanguageRuntime::TaggedPointerVendor *tagged_ptr_vendor = objc_runtime-GetTaggedPointerVendor(); +if (tagged_ptr_vendor) +{ +
Re: [Lldb-commits] [lldb] r237230 - Darwin - fix intermitent crashes in import crashinfo
After your changes the ./dotest.py leaves crashinfo.lock file in test dir. Could you fix it? Thanks, Ilia On Wed, May 13, 2015 at 8:00 AM, Vince Harron vi...@nethacker.com wrote: Author: vharron Date: Wed May 13 00:00:23 2015 New Revision: 237230 URL: http://llvm.org/viewvc/llvm-project?rev=237230view=rev Log: Darwin - fix intermitent crashes in import crashinfo Summary: import crashinfo was probably failing because multiple dotest invocations are all trying to compile crashinfo.so at the same time. I've put a mutex around the compile step to prevent this. Reviewers: clayborg, chying Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9732 Added: lldb/trunk/test/lock.py Modified: lldb/trunk/test/dotest.py Modified: lldb/trunk/test/dotest.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/dotest.py?rev=237230r1=237229r2=237230view=diff == --- lldb/trunk/test/dotest.py (original) +++ lldb/trunk/test/dotest.py Wed May 13 00:00:23 2015 @@ -23,6 +23,7 @@ for available options. import commands import os import errno +import lock import platform import progress import signal @@ -441,11 +442,23 @@ def setupCrashInfoHook(): test_dir = os.environ['LLDB_TEST'] if not test_dir or not os.path.exists(test_dir): return +dylib_lock = os.path.join(test_dir,crashinfo.lock) dylib_src = os.path.join(test_dir,crashinfo.c) dylib_dst = os.path.join(test_dir,crashinfo.so) -cmd = SDKROOT= xcrun clang %s -o %s -framework Python -Xlinker -dylib -iframework /System/Library/Frameworks/ -Xlinker -F /System/Library/Frameworks/ % (dylib_src,dylib_dst) -if subprocess.call(cmd,shell=True) == 0 and os.path.exists(dylib_dst): -setCrashInfoHook = setCrashInfoHook_Mac +try: +compile_lock = lock.Lock(dylib_lock) +compile_lock.acquire() +if not os.path.isfile(dylib_dst) or os.path.getmtime(dylib_dst) os.path.getmtime(dylib_src): +# we need to compile +cmd = SDKROOT= xcrun clang %s -o %s -framework Python -Xlinker -dylib -iframework /System/Library/Frameworks/ -Xlinker -F /System/Library/Frameworks/ % (dylib_src,dylib_dst) +if subprocess.call(cmd,shell=True) != 0 or not os.path.isfile(dylib_dst): +raise Exception('command failed: {}'.format(cmd)) +finally: +compile_lock.release() +del compile_lock + +setCrashInfoHook = setCrashInfoHook_Mac + else: pass Added: lldb/trunk/test/lock.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lock.py?rev=237230view=auto == --- lldb/trunk/test/lock.py (added) +++ lldb/trunk/test/lock.py Wed May 13 00:00:23 2015 @@ -0,0 +1,23 @@ + +Interprocess mutex based on file locks + + +import fcntl +import os + +class Lock: + +def __init__(self, filename): +self.filename = filename +# This will create it if it does not exist already +self.handle = open(filename, 'w') + +# Bitwise OR fcntl.LOCK_NB if you need a non-blocking lock +def acquire(self): +fcntl.flock(self.handle, fcntl.LOCK_EX) + +def release(self): +fcntl.flock(self.handle, fcntl.LOCK_UN) + +def __del__(self): +self.handle.close() ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237270 - Enable workaround for finding functions in global namespace on linux binaries on
Author: flackr Date: Wed May 13 13:20:02 2015 New Revision: 237270 URL: http://llvm.org/viewvc/llvm-project?rev=237270view=rev Log: Enable workaround for finding functions in global namespace on linux binaries on all hosts. We require a workaround to be able to locate global and anonymous namespace functions in the dwarf symbols on linux binaries. This patch enables this code on all platforms so that we can still find these symbols when debugging from a different host platform. Test Plan: The following tests begin passing when running with a mac host to linux client: TestCallCPPFunction.py TestCallStopAndContinue.py TestExprs.py TestExprsChar.py TestNamespace.py TestOverloadedFunctions.py TestRvalueReferences.py TestThreadExit.py Differential Revision: http://reviews.llvm.org/D9754 Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=237270r1=237269r2=237270view=diff == --- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original) +++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Wed May 13 13:20:02 2015 @@ -4033,8 +4033,7 @@ SymbolFileDWARF::FindFunctions (const Co FindFunctions (name, m_function_fullname_index, include_inlines, sc_list); // FIXME Temporary workaround for global/anonymous namespace -// functions on FreeBSD and Linux -#if defined (__FreeBSD__) || defined (__linux__) +// functions debugging FreeBSD and Linux binaries. // If we didn't find any functions in the global namespace try // looking in the basename index but ignore any returned // functions that have a namespace (ie. mangled names starting with @@ -4061,7 +4060,6 @@ SymbolFileDWARF::FindFunctions (const Co } } } -#endif } DIEArray die_offsets; DWARFCompileUnit *dwarf_cu = NULL; ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237271 - Check the host platform to determine logging channel to test in TestRegisters.py
Author: flackr Date: Wed May 13 13:23:10 2015 New Revision: 237271 URL: http://llvm.org/viewvc/llvm-project?rev=237271view=rev Log: Check the host platform to determine logging channel to test in TestRegisters.py Checks the host platform to determine logging channel to test in TestRegisters.py as the logging runs host side. Test Plan: ./dotest.py $DOTEST_OPTS -v -t -p TestRegisters.py This passes mac - linux as it's logging the correct channel. Differential Revision: http://reviews.llvm.org/D9755 Modified: lldb/trunk/test/functionalities/register/TestRegisters.py Modified: lldb/trunk/test/functionalities/register/TestRegisters.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/register/TestRegisters.py?rev=237271r1=237270r2=237271view=diff == --- lldb/trunk/test/functionalities/register/TestRegisters.py (original) +++ lldb/trunk/test/functionalities/register/TestRegisters.py Wed May 13 13:23:10 2015 @@ -88,14 +88,16 @@ class RegisterCommandsTestCase(TestBase) # platform specific logging of the specified category def log_enable(self, category): +# This intentionally checks the host platform rather than the target +# platform as logging is host side. self.platform = -if self.platformIsDarwin(): +if sys.platform.startswith(darwin): self.platform = # TODO: add support for log enable darwin registers -if self.getPlatform() == freebsd: +if sys.platform.startswith(freebsd): self.platform = freebsd -if self.getPlatform() == linux: +if sys.platform.startswith(linux): self.platform = linux if self.platform != : ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r237279 - Add a comment clarifying what func_name_type_mask is.
Author: jingham Date: Wed May 13 14:01:15 2015 New Revision: 237279 URL: http://llvm.org/viewvc/llvm-project?rev=237279view=rev Log: Add a comment clarifying what func_name_type_mask is. Modified: lldb/trunk/include/lldb/Target/Target.h Modified: lldb/trunk/include/lldb/Target/Target.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=237279r1=237278r2=237279view=diff == --- lldb/trunk/include/lldb/Target/Target.h (original) +++ lldb/trunk/include/lldb/Target/Target.h Wed May 13 14:01:15 2015 @@ -733,7 +733,8 @@ public: // Use this to create a function breakpoint by name in containingModule, or all modules if it is NULL // When skip_prologue is set to eLazyBoolCalculate, we use the current target -// setting, else we use the values passed in +// setting, else we use the values passed in. +// func_name_type_mask is or'ed values from the FunctionNameType enum. lldb::BreakpointSP CreateBreakpoint (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, @@ -754,6 +755,7 @@ public: // This is the same as the func_name breakpoint except that you can specify a vector of names. This is cheaper // than a regular expression breakpoint in the case where you just want to set a breakpoint on a set of names // you already know. +// func_name_type_mask is or'ed values from the FunctionNameType enum. lldb::BreakpointSP CreateBreakpoint (const FileSpecList *containingModules, const FileSpecList *containingSourceFiles, ___ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits