[Lldb-commits] [PATCH] D34776: Make i386-*-freebsd expression work on JIT path
labath added inline comments. Comment at: source/Plugins/Process/Utility/InferiorCallPOSIX.cpp:92 clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType(); -lldb::addr_t args[] = {addr, length, prot_arg, flags_arg, fd, offset}; +llvm::SmallVector args({ addr, length, prot_arg, +flags_arg, fd, offset }); It would be great if we could avoid OS-specific code in this file. That's what we have tried to do with the `Platform::ConvertMmapFlagsToPlatform` call (line 82), but it looks like it may not have been the right abstraction. How about we replace the `ConvertMmapFlagsToPlatform` function (it's only used in this place) with a more generic `GetMmapArguments` call (returning a vector of args)? It can still do the MAP_ANON dance as before, but in the freebsd case it will do this additional append. What do you think? Repository: rL LLVM https://reviews.llvm.org/D34776 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D34750: [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern
On 28 June 2017 at 15:16, Scott Smith wrote: > x86_64 stacks are supposed to be naturally 16-byte aligned. Maybe try a > 32-byte AVX instruction and see if the compiler aligns to a 32-byte > boundary? > I was able to generate the "andq $-16, %rsp" part of the pattern. The trick was that the compiler then chose to restore it with a simple "movq %rbp, %rsp" instead of the more fancy lea instruction. I am guessing this has something to do with the %ebx register being spilled in order to store the global offset table pointer. Normally, all other registers were spilled after the stack was realigned, but for some reason this one was spilled before the realigning took place. x86_64 PIC code is simpler and there is no need for this spill, so that's why a "mov" was sufficient. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D33035: Tool for using Intel(R) Processor Trace hardware feature
labath added a comment. Thank you for making the changes. I concede that I am not always clear in my communications, and I apologize if I was being rude. I am happy with the cmake stuff, but I noticed a new issue now. Exceptions are banned in llvm, so we need to figure out how to remove them from this code. Comment at: tools/intel-features/intel-mpx/CMakeLists.txt:9 + +set(MPX_DEPS ${MPX_DEPS} LLVMSupport PARENT_SCOPE) abhishek.aggarwal wrote: > labath wrote: > > What you want here is to define an INTERFACE dependency on the MPX library > > instead. > > vanilla cmake way would be `target_link_libraries(lldbIntelMPX INTERFACE > > LLVMSupport)`. **However**, we should use the llvm function instead, as > > that also handles other llvm-specific magic (for example, this code will > > break if someone does a LLVM_LINK_LLVM_DYLIB build). > > > > So, I am asking for the third time: > > Have you tried using add_lldb_library instead? > > > > The correct invocation should be `add_lldb_library(foo.cpp LINK_LIBS > > Support)` and the rest of this file can just go away. > I am extremely sorry Pavel but I understood it now what you were trying to > say in previous comments. Sorry about misinterpreting your comments before. I > have used add_lldb_library function now. Please see them in the next patch > set. Looks much better. Thanks. Comment at: tools/intel-features/intel-pt/Decoder.cpp:411 +std::string image_path(image_complete_path, path_length); +try { + readExecuteSectionInfos.emplace_back( We can't have exceptions in llvm code. You will have to achieve this differently. Your trick with manually adding -fexceptions will not work anyway if the rest of the code is compiled without exceptions. Although I'm not really sure why you need to protect this vector append in particular, as we don't do this for any other vector elsewhere. https://reviews.llvm.org/D33035 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34776: Make i386-*-freebsd expression work on JIT path
karnajitw added a comment. Looks like the right thing to do. I will make the changes accordingly. Repository: rL LLVM https://reviews.llvm.org/D34776 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306666 - [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern
Author: labath Date: Thu Jun 29 05:40:13 2017 New Revision: 30 URL: http://llvm.org/viewvc/llvm-project?rev=30&view=rev Log: [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern Summary: The instruction pattern: and $-16, %esp sub $imm, %esp ... lea imm(%ebp), %esp appears when the compiler is realigning the stack (for example in main(), or almost everywhere with -mstackrealign switch). The "and" instruction is very difficult to model, but that's not necessary, as these frames are always %ebp-based (the compiler also needs a way to restore the original %esp). Therefore the plans we were generating for these function were almost correct already. The only place we were doing it wrong were the last instructions of the epilogue (usually just "ret"), where we had to revert to %esp-based unwinding, as the %ebp had been popped already. This was wrong because our "distance of esp from cfa" counter had picked up the "sub" instruction (and incremented the counter) but it had not seen that the register was reset by the "lea" instruction. This patch fixes that shortcoming, and adds a test for handling functions like this. I have not been able to tickle the compiler into producing a 64-bit function with this pattern, but I don't see a reason why it couldn't produce it, if it chose to, so I add a x86_64 test as well. Reviewers: jasonmolenda, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34750 Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp?rev=30&r1=306665&r2=30&view=diff == --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp (original) +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp Thu Jun 29 05:40:13 2017 @@ -452,6 +452,33 @@ bool x86AssemblyInspectionEngine::lea_rs return false; } +// lea -0x28(%ebp), %esp +// (32-bit and 64-bit variants, 8-bit and 32-bit displacement) +bool x86AssemblyInspectionEngine::lea_rbp_rsp_pattern_p(int &amount) { + uint8_t *p = m_cur_insn; + if (m_wordsize == 8 && *p == 0x48) +p++; + + // Check opcode + if (*p != 0x8d) +return false; + ++p; + + // 8 bit displacement + if (*p == 0x65) { +amount = (int8_t)p[1]; +return true; + } + + // 32 bit displacement + if (*p == 0xa5) { +amount = (int32_t)extract_4(p + 1); +return true; + } + + return false; +} + // popq %rbx // popl %ebx bool x86AssemblyInspectionEngine::pop_reg_p(int ®no) { @@ -843,6 +870,12 @@ bool x86AssemblyInspectionEngine::GetNon in_epilogue = true; } +else if (lea_rbp_rsp_pattern_p(stack_offset) && + row->GetCFAValue().GetRegisterNumber() == m_lldb_fp_regnum) { + current_sp_bytes_offset_from_cfa = + row->GetCFAValue().GetOffset() - stack_offset; +} + else if (ret_pattern_p() && prologue_completed_row.get()) { // Reinstate the saved prologue setup for any instructions // that come after the ret instruction Modified: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h?rev=30&r1=306665&r2=30&view=diff == --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h (original) +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h Thu Jun 29 05:40:13 2017 @@ -102,6 +102,7 @@ private: bool sub_rsp_pattern_p(int &amount); bool add_rsp_pattern_p(int &amount); bool lea_rsp_pattern_p(int &amount); + bool lea_rbp_rsp_pattern_p(int &amount); bool push_reg_p(int ®no); bool pop_reg_p(int ®no); bool pop_rbp_pattern_p(); Modified: lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp?rev=30&r1=306665&r2=30&view=diff == --- lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp (original) +++ lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp Thu Jun 29 05:40:13 2017 @@ -18,6 +18,7 @@ #include "lldb/Core/AddressRange.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/Target
[Lldb-commits] [PATCH] D34750: [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern
This revision was automatically updated to reflect the committed changes. Closed by commit rL30: [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern (authored by labath). Repository: rL LLVM https://reviews.llvm.org/D34750 Files: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp Index: lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp === --- lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp +++ lldb/trunk/unittests/UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp @@ -18,6 +18,7 @@ #include "lldb/Core/AddressRange.h" #include "lldb/Core/ArchSpec.h" #include "lldb/Symbol/UnwindPlan.h" +#include "lldb/Utility/StreamString.h" #include "llvm/Support/TargetSelect.h" @@ -130,6 +131,15 @@ return engine; } +namespace lldb_private { +static std::ostream &operator<<(std::ostream &OS, +const UnwindPlan::Row::CFAValue &CFA) { + StreamString S; + CFA.Dump(S, nullptr, nullptr); + return OS << S.GetData(); +} +} // namespace lldb_private + TEST_F(Testx86AssemblyInspectionEngine, TestSimple64bitFrameFunction) { std::unique_ptr engine = Getx86_64Inspector(); @@ -2337,3 +2347,71 @@ EXPECT_FALSE(row_sp->GetRegisterInfo(k_rbp, regloc)); } + +TEST_F(Testx86AssemblyInspectionEngine, TestStackRealign8BitDisp_i386) { + std::unique_ptr engine = Geti386Inspector(); + + uint8_t data[] = { + 0x55, // pushl %ebp + 0x89, 0xe5, // movl %esp, %ebp + 0x53, // pushl %ebx + 0x83, 0xe4, 0xf0, // andl $-16, %esp + 0x83, 0xec, 0x10, // subl $16, %esp + 0x8d, 0x65, 0xfc, // leal -4(%ebp), %esp + 0x5b, // popl %ebx + 0x5d, // popl %ebp + 0xc3, // retl + }; + + AddressRange sample_range(0x1000, sizeof(data)); + UnwindPlan plan(eRegisterKindLLDB); + ASSERT_TRUE(engine->GetNonCallSiteUnwindPlanFromAssembly(data, sizeof(data), + sample_range, plan)); + + UnwindPlan::Row::CFAValue esp_plus_4, esp_plus_8, ebp_plus_8; + esp_plus_4.SetIsRegisterPlusOffset(k_esp, 4); + esp_plus_8.SetIsRegisterPlusOffset(k_esp, 8); + ebp_plus_8.SetIsRegisterPlusOffset(k_ebp, 8); + + EXPECT_EQ(esp_plus_4, plan.GetRowForFunctionOffset(0)->GetCFAValue()); + EXPECT_EQ(esp_plus_8, plan.GetRowForFunctionOffset(1)->GetCFAValue()); + for (size_t i = 3; i < sizeof(data) - 2; ++i) +EXPECT_EQ(ebp_plus_8, plan.GetRowForFunctionOffset(i)->GetCFAValue()) +<< "i: " << i; + EXPECT_EQ(esp_plus_4, +plan.GetRowForFunctionOffset(sizeof(data) - 1)->GetCFAValue()); +} + +TEST_F(Testx86AssemblyInspectionEngine, TestStackRealign32BitDisp_x86_64) { + std::unique_ptr engine = Getx86_64Inspector(); + + uint8_t data[] = { + 0x55, // pushq %rbp + 0x48, 0x89, 0xe5, // movq %rsp, %rbp + 0x53, // pushl %rbx + 0x48, 0x83, 0xe4, 0xf0, // andq $-16, %rsp + 0x48, 0x81, 0xec, 0x00, 0x01, 0x00, 0x00, // subq $256, %rsp + 0x48, 0x8d, 0x65, 0xf8, // leaq -8(%rbp), %rsp + 0x5b, // popq %rbx + 0x5d, // popq %rbp + 0xc3, // retq + }; + + AddressRange sample_range(0x1000, sizeof(data)); + UnwindPlan plan(eRegisterKindLLDB); + ASSERT_TRUE(engine->GetNonCallSiteUnwindPlanFromAssembly(data, sizeof(data), + sample_range, plan)); + + UnwindPlan::Row::CFAValue rsp_plus_8, rsp_plus_16, rbp_plus_16; + rsp_plus_8.SetIsRegisterPlusOffset(k_rsp, 8); + rsp_plus_16.SetIsRegisterPlusOffset(k_rsp, 16); + rbp_plus_16.SetIsRegisterPlusOffset(k_rbp, 16); + + EXPECT_EQ(rsp_plus_8, plan.GetRowForFunctionOffset(0)->GetCFAValue()); + EXPECT_EQ(rsp_plus_16, plan.GetRowForFunctionOffset(1)->GetCFAValue()); + for (size_t i = 4; i < sizeof(data) - 2; ++i) +EXPECT_EQ(rbp_plus_16, plan.GetRowForFunctionOffset(i)->GetCFAValue()) +<< "i: " << i; + EXPECT_EQ(rsp_plus_8, +plan.GetRowForFunctionOffset(sizeof(data) - 1)->GetCFAValue()); +} Index: lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h === --- lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h +++ lldb/trunk/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.h @@ -102,6 +102,7 @@ bool sub_rsp_pattern_p(int &amount); bool add_rsp_pattern_p(int &amount); bool lea_rsp_pattern_p(int &amount); + bool
[Lldb-commits] [PATCH] D34746: Move Timer and TraceOptions from Core to Utility
labath updated this revision to Diff 104624. labath added a comment. That's a good idea. This time I almost smuggled in a (unused) Host include into Utility -- it was a leftover from the Host::ThreadLocalStorage times. I'll make sure to run it in the future. After fixing that issue, I see no differences in the output. https://reviews.llvm.org/D34746 Files: include/lldb/Core/Timer.h include/lldb/Core/TraceOptions.h include/lldb/Host/common/NativeProcessProtocol.h include/lldb/Target/Process.h include/lldb/Utility/Timer.h include/lldb/Utility/TraceOptions.h source/API/SBTraceOptions.cpp source/API/SystemInitializerFull.cpp source/Commands/CommandObjectFrame.cpp source/Commands/CommandObjectLog.cpp source/Commands/CommandObjectTarget.cpp source/Core/CMakeLists.txt source/Core/Disassembler.cpp source/Core/Mangled.cpp source/Core/Module.cpp source/Core/Timer.cpp source/Host/common/Symbols.cpp source/Host/posix/ConnectionFileDescriptorPosix.cpp source/Initialization/SystemInitializerCommon.cpp source/Interpreter/CommandInterpreter.cpp source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp source/Plugins/Platform/MacOSX/PlatformDarwin.cpp source/Plugins/Process/Linux/ProcessorTrace.h source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp source/Symbol/DWARFCallFrameInfo.cpp source/Symbol/ObjectFile.cpp source/Symbol/Symtab.cpp source/Target/ObjCLanguageRuntime.cpp source/Target/Target.cpp source/Target/TargetList.cpp source/Utility/CMakeLists.txt source/Utility/Timer.cpp unittests/Core/CMakeLists.txt unittests/Core/TimerTest.cpp unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp unittests/Utility/CMakeLists.txt unittests/Utility/TimerTest.cpp Index: unittests/Utility/TimerTest.cpp === --- unittests/Utility/TimerTest.cpp +++ unittests/Utility/TimerTest.cpp @@ -7,10 +7,9 @@ // //===--===// -#include "lldb/Core/Timer.h" -#include "gtest/gtest.h" - #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" +#include "gtest/gtest.h" #include using namespace lldb_private; Index: unittests/Utility/CMakeLists.txt === --- unittests/Utility/CMakeLists.txt +++ unittests/Utility/CMakeLists.txt @@ -10,6 +10,7 @@ TaskPoolTest.cpp TildeExpressionResolverTest.cpp TimeoutTest.cpp + TimerTest.cpp UriParserTest.cpp VASprintfTest.cpp Index: unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp === --- unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp +++ unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp @@ -12,10 +12,10 @@ #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/TraceOptions.h" #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/Utility/DataBuffer.h" #include "lldb/Utility/StructuredData.h" +#include "lldb/Utility/TraceOptions.h" #include "lldb/lldb-enumerations.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/Testing/Support/Error.h" Index: unittests/Core/CMakeLists.txt === --- unittests/Core/CMakeLists.txt +++ unittests/Core/CMakeLists.txt @@ -6,7 +6,6 @@ ScalarTest.cpp StateTest.cpp StreamCallbackTest.cpp - TimerTest.cpp LINK_LIBS lldbCore Index: source/Utility/Timer.cpp === --- source/Utility/Timer.cpp +++ source/Utility/Timer.cpp @@ -6,11 +6,8 @@ // License. See LICENSE.TXT for details. // //===--===// -#include "lldb/Core/Timer.h" - -#include "lldb/Host/Host.h" +#include "lldb/Utility/Timer.h" #include "lldb/Utility/Stream.h" -#include "lldb/lldb-types.h" // for thread_key_t #include #include Index: source/Utility/CMakeLists.txt
[Lldb-commits] [lldb] r306668 - [unittests] Add a helper function for getting an input file
Author: labath Date: Thu Jun 29 06:02:11 2017 New Revision: 306668 URL: http://llvm.org/viewvc/llvm-project?rev=306668&view=rev Log: [unittests] Add a helper function for getting an input file Summary: Fetching an input file required about five lines of code, and this was repeated in multiple unit tests, with slight variations. Add a helper function for doing that into the lldbUtilityMocks module (which I rename to lldbUtilityHelpers to commemorate the fact it includes more than mocks) Reviewers: zturner, eugene Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34683 Added: lldb/trunk/unittests/Utility/Helpers/ lldb/trunk/unittests/Utility/Helpers/CMakeLists.txt - copied, changed from r30, lldb/trunk/unittests/Utility/Mocks/CMakeLists.txt lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp - copied, changed from r30, lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.cpp lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.h - copied, changed from r30, lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.h lldb/trunk/unittests/Utility/Helpers/TestUtilities.cpp lldb/trunk/unittests/Utility/Helpers/TestUtilities.h Removed: lldb/trunk/unittests/Utility/Mocks/CMakeLists.txt lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.cpp lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.h Modified: lldb/trunk/unittests/Interpreter/CMakeLists.txt lldb/trunk/unittests/Interpreter/TestCompletion.cpp lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp lldb/trunk/unittests/Process/minidump/CMakeLists.txt lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp lldb/trunk/unittests/Symbol/CMakeLists.txt lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp lldb/trunk/unittests/Target/CMakeLists.txt lldb/trunk/unittests/Target/ModuleCacheTest.cpp lldb/trunk/unittests/Utility/CMakeLists.txt lldb/trunk/unittests/Utility/StructuredDataTest.cpp lldb/trunk/unittests/Utility/TildeExpressionResolverTest.cpp Modified: lldb/trunk/unittests/Interpreter/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/CMakeLists.txt?rev=306668&r1=306667&r2=306668&view=diff == --- lldb/trunk/unittests/Interpreter/CMakeLists.txt (original) +++ lldb/trunk/unittests/Interpreter/CMakeLists.txt Thu Jun 29 06:02:11 2017 @@ -4,7 +4,7 @@ add_lldb_unittest(InterpreterTests LINK_LIBS lldbInterpreter -lldbUtilityMocks +lldbUtilityHelpers ) target_link_libraries(InterpreterTests Modified: lldb/trunk/unittests/Interpreter/TestCompletion.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestCompletion.cpp?rev=306668&r1=306667&r2=306668&view=diff == --- lldb/trunk/unittests/Interpreter/TestCompletion.cpp (original) +++ lldb/trunk/unittests/Interpreter/TestCompletion.cpp Thu Jun 29 06:02:11 2017 @@ -12,13 +12,12 @@ #include "lldb/Utility/StringList.h" #include "lldb/Utility/TildeExpressionResolver.h" +#include "unittests/Utility/Helpers/MockTildeExpressionResolver.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" -#include "unittests/Utility/Mocks/MockTildeExpressionResolver.h" - namespace fs = llvm::sys::fs; namespace path = llvm::sys::path; using namespace llvm; Modified: lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt?rev=306668&r1=306667&r2=306668&view=diff == --- lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt (original) +++ lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt Thu Jun 29 06:02:11 2017 @@ -6,6 +6,7 @@ add_lldb_unittest(ObjectFileELFTests lldbPluginObjectFileELF lldbPluginSymbolVendorELF lldbCore +lldbUtilityHelpers ) add_dependencies(ObjectFileELFTests yaml2obj) Modified: lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp?rev=306668&r1=306667&r2=306668&view=diff == --- lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp (original) +++ lldb/trunk/unittests/ObjectFile/ELF/TestObjectFile
[Lldb-commits] [lldb] r306669 - Make scripts/analyze-project-deps.py executable
Author: labath Date: Thu Jun 29 06:02:15 2017 New Revision: 306669 URL: http://llvm.org/viewvc/llvm-project?rev=306669&view=rev Log: Make scripts/analyze-project-deps.py executable Modified: lldb/trunk/scripts/analyze-project-deps.py (contents, props changed) Modified: lldb/trunk/scripts/analyze-project-deps.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/analyze-project-deps.py?rev=306669&r1=306668&r2=306669&view=diff == --- lldb/trunk/scripts/analyze-project-deps.py (original) +++ lldb/trunk/scripts/analyze-project-deps.py Thu Jun 29 06:02:15 2017 @@ -1,3 +1,5 @@ +#! /usr/bin/env python + import argparse import itertools import os @@ -203,4 +205,4 @@ if args.discover_cycles: for (node, inc, outg) in sorted: print " {} [{} in, {} out]".format(node, inc, outg) sys.stdout.flush() -pass \ No newline at end of file +pass Propchange: lldb/trunk/scripts/analyze-project-deps.py -- svn:executable = * ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34683: [unittests] Add a helper function for getting an input file
This revision was automatically updated to reflect the committed changes. Closed by commit rL306668: [unittests] Add a helper function for getting an input file (authored by labath). Changed prior to commit: https://reviews.llvm.org/D34683?vs=104145&id=104627#toc Repository: rL LLVM https://reviews.llvm.org/D34683 Files: lldb/trunk/unittests/Interpreter/CMakeLists.txt lldb/trunk/unittests/Interpreter/TestCompletion.cpp lldb/trunk/unittests/ObjectFile/ELF/CMakeLists.txt lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp lldb/trunk/unittests/Process/minidump/CMakeLists.txt lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp lldb/trunk/unittests/Symbol/CMakeLists.txt lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp lldb/trunk/unittests/SymbolFile/DWARF/CMakeLists.txt lldb/trunk/unittests/SymbolFile/DWARF/SymbolFileDWARFTests.cpp lldb/trunk/unittests/SymbolFile/PDB/CMakeLists.txt lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp lldb/trunk/unittests/Target/CMakeLists.txt lldb/trunk/unittests/Target/ModuleCacheTest.cpp lldb/trunk/unittests/Utility/CMakeLists.txt lldb/trunk/unittests/Utility/Helpers/CMakeLists.txt lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.cpp lldb/trunk/unittests/Utility/Helpers/MockTildeExpressionResolver.h lldb/trunk/unittests/Utility/Helpers/TestUtilities.cpp lldb/trunk/unittests/Utility/Helpers/TestUtilities.h lldb/trunk/unittests/Utility/Mocks/CMakeLists.txt lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.cpp lldb/trunk/unittests/Utility/Mocks/MockTildeExpressionResolver.h lldb/trunk/unittests/Utility/StructuredDataTest.cpp lldb/trunk/unittests/Utility/TildeExpressionResolverTest.cpp Index: lldb/trunk/unittests/Target/ModuleCacheTest.cpp === --- lldb/trunk/unittests/Target/ModuleCacheTest.cpp +++ lldb/trunk/unittests/Target/ModuleCacheTest.cpp @@ -10,8 +10,7 @@ #include "lldb/Host/HostInfo.h" #include "lldb/Symbol/SymbolContext.h" #include "lldb/Target/ModuleCache.h" - -extern const char *TestMainArgv0; +#include "unittests/Utility/Helpers/TestUtilities.h" using namespace lldb_private; using namespace lldb; @@ -26,15 +25,15 @@ protected: static FileSpec s_cache_dir; - static llvm::SmallString<128> s_test_executable; + static std::string s_test_executable; void TryGetAndPut(const FileSpec &cache_dir, const char *hostname, bool expect_download); }; } FileSpec ModuleCacheTest::s_cache_dir; -llvm::SmallString<128> ModuleCacheTest::s_test_executable; +std::string ModuleCacheTest::s_test_executable; static const char dummy_hostname[] = "dummy_hostname"; static const char dummy_remote_dir[] = "bin"; @@ -71,10 +70,7 @@ FileSpec tmpdir_spec; HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir, s_cache_dir); - - llvm::StringRef exe_folder = llvm::sys::path::parent_path(TestMainArgv0); - s_test_executable = exe_folder; - llvm::sys::path::append(s_test_executable, "Inputs", module_name); + s_test_executable = GetInputFilePath(module_name); } void ModuleCacheTest::TearDownTestCase() { Index: lldb/trunk/unittests/Target/CMakeLists.txt === --- lldb/trunk/unittests/Target/CMakeLists.txt +++ lldb/trunk/unittests/Target/CMakeLists.txt @@ -8,6 +8,7 @@ lldbSymbol lldbUtility lldbPluginObjectFileELF + lldbUtilityHelpers LINK_COMPONENTS Support ) Index: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp === --- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp +++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp @@ -23,7 +23,7 @@ #include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/FileSpec.h" - +#include "unittests/Utility/Helpers/TestUtilities.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/FileSystem.h" @@ -35,24 +35,14 @@ // C++ includes #include -extern const char *TestMainArgv0; - using namespace lldb_private; using namespace minidump; class MinidumpParserTest : public testing::Test { public: - void SetUp() override { -llvm::StringRef dmp_folder = llvm::sys::path::parent_path(TestMainArgv0); -inputs_folder = dmp_folder; -llvm::sys::path::append(inputs_folder, "Inputs"); - } - void SetUpData(const char *minidump_filename, uint64_t load_size = UINT64_MAX) { -llvm::SmallString<128> filename = inputs_folder; -llvm::sys::path::append(filename, minidump_filename); - +std::string filename = GetInputFilePath(minidump_filename); auto BufferPtr = DataBufferLLVM::CreateSliceFromPath(filename, load_size, 0); llvm::Optional optional_parser = @@ -62,7 +52,6 @@ ASSERT_GT(parser->GetData().size(),
[Lldb-commits] [PATCH] D33035: Tool for using Intel(R) Processor Trace hardware feature
abhishek.aggarwal added a comment. Thanks for your review Pavel. My comments are inlined. Let me know your opinion :) Comment at: tools/intel-features/intel-pt/Decoder.cpp:411 +std::string image_path(image_complete_path, path_length); +try { + readExecuteSectionInfos.emplace_back( labath wrote: > We can't have exceptions in llvm code. You will have to achieve this > differently. Your trick with manually adding -fexceptions will not work > anyway if the rest of the code is compiled without exceptions. Although I'm > not really sure why you need to protect this vector append in particular, as > we don't do this for any other vector elsewhere. I kept the exception handling around stl containers only to catch bad_alloc exception because if this exception occurs, I didn't want the code to just exit but provide user with whatever amount of instruction log is available in the vector. That much amount of instruction log might still be helpful to the user. What is your opinion on that? Plus, If rest of the code is not being compiled with -fexceptions but just this file, will it not solve the purpose? Let me know what you think about it. I can make changes accordingly then. https://reviews.llvm.org/D33035 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D33035: Tool for using Intel(R) Processor Trace hardware feature
labath added inline comments. Comment at: tools/intel-features/intel-pt/Decoder.cpp:411 +std::string image_path(image_complete_path, path_length); +try { + readExecuteSectionInfos.emplace_back( abhishek.aggarwal wrote: > labath wrote: > > We can't have exceptions in llvm code. You will have to achieve this > > differently. Your trick with manually adding -fexceptions will not work > > anyway if the rest of the code is compiled without exceptions. Although I'm > > not really sure why you need to protect this vector append in particular, > > as we don't do this for any other vector elsewhere. > I kept the exception handling around stl containers only to catch bad_alloc > exception because if this exception occurs, I didn't want the code to just > exit but provide user with whatever amount of instruction log is available in > the vector. That much amount of instruction log might still be helpful to the > user. What is your opinion on that? > > Plus, If rest of the code is not being compiled with -fexceptions but just > this file, will it not solve the purpose? Let me know what you think about > it. I can make changes accordingly then. I don't think there's any negotiating on this point (not with me anyway, you'd need to take this much higher up). But here's what I think anyway: - the exception catch will be generally useless as most (all?) current OSs will overcommit virtual memory (and then just kill you if they really run out of memory and swap space) - even if you disable overcommit, chances are you will hit an OOM in one of the zillion other places which allocate memory (all of which are unchecked) instead of here. So this single catch will not make a difference. https://reviews.llvm.org/D33035 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D34746: Move Timer and TraceOptions from Core to Utility
Cool, lgtm On Thu, Jun 29, 2017 at 5:52 AM Pavel Labath via Phabricator < revi...@reviews.llvm.org> wrote: > labath updated this revision to Diff 104624. > labath added a comment. > > That's a good idea. This time I almost smuggled in a (unused) Host include > into > Utility -- it was a leftover from the Host::ThreadLocalStorage times. I'll > make > sure to run it in the future. > > After fixing that issue, I see no differences in the output. > > > https://reviews.llvm.org/D34746 > > Files: > include/lldb/Core/Timer.h > include/lldb/Core/TraceOptions.h > include/lldb/Host/common/NativeProcessProtocol.h > include/lldb/Target/Process.h > include/lldb/Utility/Timer.h > include/lldb/Utility/TraceOptions.h > source/API/SBTraceOptions.cpp > source/API/SystemInitializerFull.cpp > source/Commands/CommandObjectFrame.cpp > source/Commands/CommandObjectLog.cpp > source/Commands/CommandObjectTarget.cpp > source/Core/CMakeLists.txt > source/Core/Disassembler.cpp > source/Core/Mangled.cpp > source/Core/Module.cpp > source/Core/Timer.cpp > source/Host/common/Symbols.cpp > source/Host/posix/ConnectionFileDescriptorPosix.cpp > source/Initialization/SystemInitializerCommon.cpp > source/Interpreter/CommandInterpreter.cpp > > source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp > source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp > source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp > source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp > source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp > source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp > source/Plugins/Platform/MacOSX/PlatformDarwin.cpp > source/Plugins/Process/Linux/ProcessorTrace.h > source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp > source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp > source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp > source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp > source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp > source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp > source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp > source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp > source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp > source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp > source/Symbol/DWARFCallFrameInfo.cpp > source/Symbol/ObjectFile.cpp > source/Symbol/Symtab.cpp > source/Target/ObjCLanguageRuntime.cpp > source/Target/Target.cpp > source/Target/TargetList.cpp > source/Utility/CMakeLists.txt > source/Utility/Timer.cpp > unittests/Core/CMakeLists.txt > unittests/Core/TimerTest.cpp > unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp > unittests/Utility/CMakeLists.txt > unittests/Utility/TimerTest.cpp > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306682 - Move Timer and TraceOptions from Core to Utility
Author: labath Date: Thu Jun 29 07:32:17 2017 New Revision: 306682 URL: http://llvm.org/viewvc/llvm-project?rev=306682&view=rev Log: Move Timer and TraceOptions from Core to Utility Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers. Reviewers: zturner, jingham Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34746 Added: lldb/trunk/include/lldb/Utility/Timer.h - copied, changed from r306669, lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/include/lldb/Utility/TraceOptions.h - copied, changed from r306669, lldb/trunk/include/lldb/Core/TraceOptions.h lldb/trunk/source/Utility/Timer.cpp - copied, changed from r306669, lldb/trunk/source/Core/Timer.cpp lldb/trunk/unittests/Utility/TimerTest.cpp - copied, changed from r306669, lldb/trunk/unittests/Core/TimerTest.cpp Removed: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/include/lldb/Core/TraceOptions.h lldb/trunk/source/Core/Timer.cpp lldb/trunk/unittests/Core/TimerTest.cpp Modified: lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h lldb/trunk/include/lldb/Target/Process.h lldb/trunk/source/API/SBTraceOptions.cpp lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Commands/CommandObjectFrame.cpp lldb/trunk/source/Commands/CommandObjectLog.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Core/CMakeLists.txt lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Core/Mangled.cpp lldb/trunk/source/Core/Module.cpp lldb/trunk/source/Host/common/Symbols.cpp lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Process/Linux/ProcessorTrace.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp lldb/trunk/source/Symbol/ObjectFile.cpp lldb/trunk/source/Symbol/Symtab.cpp lldb/trunk/source/Target/ObjCLanguageRuntime.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/TargetList.cpp lldb/trunk/source/Utility/CMakeLists.txt lldb/trunk/unittests/Core/CMakeLists.txt lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp lldb/trunk/unittests/Utility/CMakeLists.txt Removed: lldb/trunk/include/lldb/Core/Timer.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Timer.h?rev=306681&view=auto == --- lldb/trunk/include/lldb/Core/Timer.h (original) +++ lldb/trunk/include/lldb/Core/Timer.h (removed) @@ -1,91 +0,0 @@ -//===-- Timer.h -*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===--===// - -#ifndef liblldb_Timer_h_ -#define liblldb_Timer_h_ - -#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN -#include "llvm/Support/Chrono.h" - -#include - -#include // for uint32_t - -namespace lldb_private { -class Stream; -} - -namespace lldb_private { - -//-- -/// @class Timer Timer.h "lldb/Core/Timer.h" -/// @brief A timer class that simplifies common timing metrics. -/// -/// A scoped timer class that allows a variety of pthread mutex -/// objects to have a mutex locked when a Timer::Locker -/// object is created, and unlocked when
[Lldb-commits] [lldb] r306683 - Android.rules: build x86 tests with -mstackrealign
Author: labath Date: Thu Jun 29 07:32:23 2017 New Revision: 306683 URL: http://llvm.org/viewvc/llvm-project?rev=306683&view=rev Log: Android.rules: build x86 tests with -mstackrealign All android builds systems have switched to -mstackrealign for building x86 binaries, so follow their cue with our mini build system. This presently breaks just one test (TestReturnValue), and this is due to a compiler bug, which has already been fixed in clang, but it hasn't made it yet into the official NDK compiler. While I'm touching that test, I also remove an android-specific XFAIL, which is not relevant anymore. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py?rev=306683&r1=306682&r2=306683&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py Thu Jun 29 07:32:23 2017 @@ -31,12 +31,8 @@ class ReturnValueTestCase(TestBase): "<=", "3.6"], archs=["i386"]) -@expectedFailureAll( -bugnumber="llvm.org/pr25785", -hostoslist=["windows"], -compiler="gcc", -archs=["i386"], -triple='.*-android') +@expectedFailureAll(compiler="clang", compiler_version=["<=", "5.0.300080"], +triple='.*-android', archs=["i386"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") @add_test_categories(['pyapi']) def test_with_python(self): @@ -185,12 +181,6 @@ class ReturnValueTestCase(TestBase): "<=", "3.6"], archs=["i386"]) -@expectedFailureAll( -bugnumber="llvm.org/pr25785", -hostoslist=["windows"], -compiler="gcc", -archs=["i386"], -triple='.*-android') @expectedFailureAll(compiler=["gcc"], archs=["x86_64", "i386"]) @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778") def test_vector_values(self): Modified: lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules?rev=306683&r1=306682&r2=306683&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules (original) +++ lldb/trunk/packages/Python/lldbsuite/test/make/Android.rules Thu Jun 29 07:32:23 2017 @@ -90,3 +90,7 @@ else ARCH_LDFLAGS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a endif + +ifeq "$(ARCH)" "i386" + ARCH_CFLAGS += -mstackrealign +endif ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34746: Move Timer and TraceOptions from Core to Utility
This revision was automatically updated to reflect the committed changes. Closed by commit rL306682: Move Timer and TraceOptions from Core to Utility (authored by labath). Changed prior to commit: https://reviews.llvm.org/D34746?vs=104624&id=104647#toc Repository: rL LLVM https://reviews.llvm.org/D34746 Files: lldb/trunk/include/lldb/Core/Timer.h lldb/trunk/include/lldb/Core/TraceOptions.h lldb/trunk/include/lldb/Host/common/NativeProcessProtocol.h lldb/trunk/include/lldb/Target/Process.h lldb/trunk/include/lldb/Utility/Timer.h lldb/trunk/include/lldb/Utility/TraceOptions.h lldb/trunk/source/API/SBTraceOptions.cpp lldb/trunk/source/API/SystemInitializerFull.cpp lldb/trunk/source/Commands/CommandObjectFrame.cpp lldb/trunk/source/Commands/CommandObjectLog.cpp lldb/trunk/source/Commands/CommandObjectTarget.cpp lldb/trunk/source/Core/CMakeLists.txt lldb/trunk/source/Core/Disassembler.cpp lldb/trunk/source/Core/Mangled.cpp lldb/trunk/source/Core/Module.cpp lldb/trunk/source/Core/Timer.cpp lldb/trunk/source/Host/common/Symbols.cpp lldb/trunk/source/Host/posix/ConnectionFileDescriptorPosix.cpp lldb/trunk/source/Initialization/SystemInitializerCommon.cpp lldb/trunk/source/Interpreter/CommandInterpreter.cpp lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp lldb/trunk/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp lldb/trunk/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Process/Linux/ProcessorTrace.h lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp lldb/trunk/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp lldb/trunk/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp lldb/trunk/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp lldb/trunk/source/Symbol/DWARFCallFrameInfo.cpp lldb/trunk/source/Symbol/ObjectFile.cpp lldb/trunk/source/Symbol/Symtab.cpp lldb/trunk/source/Target/ObjCLanguageRuntime.cpp lldb/trunk/source/Target/Target.cpp lldb/trunk/source/Target/TargetList.cpp lldb/trunk/source/Utility/CMakeLists.txt lldb/trunk/source/Utility/Timer.cpp lldb/trunk/unittests/Core/CMakeLists.txt lldb/trunk/unittests/Core/TimerTest.cpp lldb/trunk/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp lldb/trunk/unittests/Utility/CMakeLists.txt lldb/trunk/unittests/Utility/TimerTest.cpp Index: lldb/trunk/include/lldb/Utility/Timer.h === --- lldb/trunk/include/lldb/Utility/Timer.h +++ lldb/trunk/include/lldb/Utility/Timer.h @@ -0,0 +1,79 @@ +//===-- Timer.h -*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===--===// + +#ifndef liblldb_Timer_h_ +#define liblldb_Timer_h_ + +#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN +#include "llvm/Support/Chrono.h" +#include +#include // for uint32_t + +namespace lldb_private { +class Stream; + +//-- +/// @class Timer Timer.h "lldb/Utility/Timer.h" +/// @brief A timer class that simplifies common timing metrics. +//-- + +class Timer { +public: + class Category { + public: +explicit Category(const char *category_name); + + private: +friend class Timer; +const char *m_name; +std::atomic m_nanos; +std::atomic m_next; + +DISALLOW_COPY_AND_ASSIGN(Category); + }; + + //-- + /// Default constructor. + //-- + Timer(Category &category, const char *format, ...) + __attribute__((format(printf, 3, 4))); + + //-- + /// Destructor + //-- + ~Timer(); + + void Dump(); + + static void SetDisplayDepth(uint32_t depth); + + static void SetQuiet(bool value); + + static vo
[Lldb-commits] [lldb] r306686 - Fix Mac build for the Timer move
Author: labath Date: Thu Jun 29 08:24:38 2017 New Revision: 306686 URL: http://llvm.org/viewvc/llvm-project?rev=306686&view=rev Log: Fix Mac build for the Timer move Modified: lldb/trunk/source/Host/macosx/Symbols.cpp lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Modified: lldb/trunk/source/Host/macosx/Symbols.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Symbols.cpp?rev=306686&r1=306685&r2=306686&view=diff == --- lldb/trunk/source/Host/macosx/Symbols.cpp (original) +++ lldb/trunk/source/Host/macosx/Symbols.cpp Thu Jun 29 08:24:38 2017 @@ -26,7 +26,6 @@ #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Module.h" #include "lldb/Core/ModuleSpec.h" -#include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/CleanUp.h" @@ -35,6 +34,7 @@ #include "lldb/Utility/Endian.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" #include "lldb/Utility/UUID.h" #include "mach/machine.h" Modified: lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=306686&r1=306685&r2=306686&view=diff == --- lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original) +++ lldb/trunk/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Thu Jun 29 08:24:38 2017 @@ -15,12 +15,12 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/Section.h" -#include "lldb/Core/Timer.h" #include "lldb/Host/Host.h" #include "lldb/Host/Symbols.h" #include "lldb/Host/XML.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/Timer.h" using namespace lldb; using namespace lldb_private; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306693 - Speculative fix for windows build broken by r306668
Author: labath Date: Thu Jun 29 09:15:42 2017 New Revision: 306693 URL: http://llvm.org/viewvc/llvm-project?rev=306693&view=rev Log: Speculative fix for windows build broken by r306668 Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Modified: lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp?rev=306693&r1=306692&r2=306693&view=diff == --- lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp (original) +++ lldb/trunk/unittests/SymbolFile/PDB/SymbolFilePDBTests.cpp Thu Jun 29 09:15:42 2017 @@ -55,12 +55,8 @@ public: ClangASTContext::Initialize(); SymbolFilePDB::Initialize(); -llvm::StringRef exe_folder = llvm::sys::path::parent_path(TestMainArgv0); -llvm::SmallString<128> inputs_folder = exe_folder; -llvm::sys::path::append(inputs_folder, "Inputs"); - -m_pdb_test_exe = GetInputFile("test-pdb.exe"); -m_types_test_exe = GetInputFile("test-pdb-types.exe"); +m_pdb_test_exe = GetInputFilePath("test-pdb.exe"); +m_types_test_exe = GetInputFilePath("test-pdb-types.exe"); } void TearDown() override { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D33035: Tool for using Intel(R) Processor Trace hardware feature
abhishek.aggarwal added inline comments. Comment at: tools/intel-features/intel-pt/Decoder.cpp:411 +std::string image_path(image_complete_path, path_length); +try { + readExecuteSectionInfos.emplace_back( labath wrote: > abhishek.aggarwal wrote: > > labath wrote: > > > We can't have exceptions in llvm code. You will have to achieve this > > > differently. Your trick with manually adding -fexceptions will not work > > > anyway if the rest of the code is compiled without exceptions. Although > > > I'm not really sure why you need to protect this vector append in > > > particular, as we don't do this for any other vector elsewhere. > > I kept the exception handling around stl containers only to catch bad_alloc > > exception because if this exception occurs, I didn't want the code to just > > exit but provide user with whatever amount of instruction log is available > > in the vector. That much amount of instruction log might still be helpful > > to the user. What is your opinion on that? > > > > Plus, If rest of the code is not being compiled with -fexceptions but just > > this file, will it not solve the purpose? Let me know what you think about > > it. I can make changes accordingly then. > I don't think there's any negotiating on this point (not with me anyway, > you'd need to take this much higher up). But here's what I think anyway: > - the exception catch will be generally useless as most (all?) current OSs > will overcommit virtual memory (and then just kill you if they really run out > of memory and swap space) > - even if you disable overcommit, chances are you will hit an OOM in one of > the zillion other places which allocate memory (all of which are unchecked) > instead of here. So this single catch will not make a difference. Got it. Then I remove exception handling code from here. Submit the patch again. Thanks for elaborating. https://reviews.llvm.org/D33035 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306725 - Timer.{h, cpp} moved, find them again in the project file.
Author: jingham Date: Thu Jun 29 11:54:40 2017 New Revision: 306725 URL: http://llvm.org/viewvc/llvm-project?rev=306725&view=rev Log: Timer.{h,cpp} moved, find them again in the project file. Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=306725&r1=306724&r2=306725&view=diff == --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original) +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Thu Jun 29 11:54:40 2017 @@ -1629,7 +1629,7 @@ 26474CC518D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_mips64.h; path = Utility/RegisterContextPOSIX_mips64.h; sourceTree = ""; }; 26474CC618D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_x86.cpp; path = Utility/RegisterContextPOSIX_x86.cpp; sourceTree = ""; }; 26474CC718D0CB5B0073DEBA /* RegisterContextPOSIX_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_x86.h; path = Utility/RegisterContextPOSIX_x86.h; sourceTree = ""; }; - 26474CC818D0CB5B0073DEBA /* RegisterContextPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX.h; path = Utility/RegisterContextPOSIX.h; sourceTree = ""; }; + 26474CC818D0CB5B0073DEBA /* RegisterContextPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIX.h; sourceTree = ""; }; 26474CD018D0CB700073DEBA /* RegisterInfos_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_i386.h; path = Utility/RegisterInfos_i386.h; sourceTree = ""; }; 26474CD118D0CB710073DEBA /* RegisterInfos_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips64.h; path = Utility/RegisterInfos_mips64.h; sourceTree = ""; }; 26474CD218D0CB710073DEBA /* RegisterInfos_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_x86_64.h; path = Utility/RegisterInfos_x86_64.h; sourceTree = ""; }; @@ -2069,7 +2069,7 @@ 26BC7D7710F1B77400F91463 /* State.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = State.h; path = include/lldb/Core/State.h; sourceTree = ""; }; 26BC7D7810F1B77400F91463 /* STLUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STLUtils.h; path = include/lldb/Core/STLUtils.h; sourceTree = ""; }; 26BC7D7A10F1B77400F91463 /* StreamFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamFile.h; path = include/lldb/Core/StreamFile.h; sourceTree = ""; }; - 26BC7D7E10F1B77400F91463 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = include/lldb/Core/Timer.h; sourceTree = ""; }; + 26BC7D7E10F1B77400F91463 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = include/lldb/Utility/Timer.h; sourceTree = ""; }; 26BC7D8110F1B77400F91463 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Value.h; path = include/lldb/Core/Value.h; sourceTree = ""; }; 26BC7D8210F1B77400F91463 /* ValueObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObject.h; path = include/lldb/Core/ValueObject.h; sourceTree = ""; }; 26BC7D8310F1B77400F91463 /* ValueObjectChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectChild.h; path = include/lldb/Core/ValueObjectChild.h; sourceTree = ""; }; @@ -2150,7 +2150,7 @@ 26BC7E8F10F1B85900F91463 /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SourceManager.cpp; path = source/Core/SourceManager.cpp; sourceTree = ""; }; 26BC7E9010F1B85900F91463 /* State.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = State.cpp; path = source/Core/State.cpp; sourceTree = ""; }; 26BC7E9210F1B85900F91463 /* StreamFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.c
[Lldb-commits] [lldb] r306752 - Update default cpu subtype for armv7 processes to armv7k, the most
Author: jmolenda Date: Thu Jun 29 15:50:53 2017 New Revision: 306752 URL: http://llvm.org/viewvc/llvm-project?rev=306752&view=rev Log: Update default cpu subtype for armv7 processes to armv7k, the most likely cpu subtype at this point. Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp Modified: lldb/trunk/tools/debugserver/source/RNBRemote.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/RNBRemote.cpp?rev=306752&r1=306751&r2=306752&view=diff == --- lldb/trunk/tools/debugserver/source/RNBRemote.cpp (original) +++ lldb/trunk/tools/debugserver/source/RNBRemote.cpp Thu Jun 29 15:50:53 2017 @@ -6058,7 +6058,7 @@ rnb_err_t RNBRemote::HandlePacket_qProce // need to override the host cpusubtype (which is in the // CPU_SUBTYPE_ARM64 subtype namespace) // with a reasonable CPU_SUBTYPE_ARMV7 subtype. -cpusubtype = 11; // CPU_SUBTYPE_ARM_V7S +cpusubtype = 12; // CPU_SUBTYPE_ARM_V7K } } rep << "cpusubtype:" << std::hex << cpusubtype << ';'; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306765 - Fix some type-based warnings
Author: penryu Date: Thu Jun 29 16:33:40 2017 New Revision: 306765 URL: http://llvm.org/viewvc/llvm-project?rev=306765&view=rev Log: Fix some type-based warnings Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp lldb/trunk/tools/debugserver/source/debugserver.cpp Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=306765&r1=306764&r2=306765&view=diff == --- lldb/trunk/source/Commands/CommandObjectThread.cpp (original) +++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Jun 29 16:33:40 2017 @@ -209,7 +209,7 @@ protected: Process *process = m_exe_ctx.GetProcessPtr(); Thread *thread = process->GetThreadList().FindThreadByID(tid).get(); if (thread == nullptr) { - result.AppendErrorWithFormat("Failed to process thread# %lu.\n", tid); + result.AppendErrorWithFormat("Failed to process thread# %llu.\n", tid); result.SetStatus(eReturnStatusFailed); return false; } Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=306765&r1=306764&r2=306765&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Thu Jun 29 16:33:40 2017 @@ -517,11 +517,11 @@ bool lldb_private::formatters::NSNumberS bool is_preserved_number = cfinfoa & 0x8; if (is_preserved_number) { - lldbassert(!"We should handle preserved numbers!"); + lldbassert(!static_cast("We should handle preserved numbers!")); return false; } -type_code = (TypeCodes)(cfinfoa & 0x7); +type_code = static_cast(cfinfoa & 0x7); } else { uint8_t data_type = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size, 1, Modified: lldb/trunk/tools/debugserver/source/debugserver.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/debugserver.cpp?rev=306765&r1=306764&r2=306765&view=diff == --- lldb/trunk/tools/debugserver/source/debugserver.cpp (original) +++ lldb/trunk/tools/debugserver/source/debugserver.cpp Thu Jun 29 16:33:40 2017 @@ -876,8 +876,8 @@ static struct option g_long_options[] = 'u'}, // If we need to handshake with our parent process, an option will be // passed down that specifies a unix socket name to use {"fd", required_argument, NULL, - 'FDSC'}, // A file descriptor was passed to this process when spawned that - // is already open and ready for communication + '2'}, // A file descriptor was passed to this process when spawned that + // is already open and ready for communication {"named-pipe", required_argument, NULL, 'P'}, {"reverse-connect", no_argument, NULL, 'R'}, {"env", required_argument, NULL, @@ -1261,7 +1261,7 @@ int main(int argc, char *argv[]) { } break; -case 'FDSC': +case '2': // File descriptor passed to this process during fork/exec and is already // open and ready for communication. communication_fd = atoi(optarg); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306773 - [Data formatters] Make NSSetM support both old- and new-style representation
Author: spyffe Date: Thu Jun 29 17:39:17 2017 New Revision: 306773 URL: http://llvm.org/viewvc/llvm-project?rev=306773&view=rev Log: [Data formatters] Make NSSetM support both old- and new-style representation NSSetM has two in-memory representations depending on what Foundation version is in use. This patch separates the two. rdar://33057292 Differential Revision: https://reviews.llvm.org/D34821 Modified: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp Modified: lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp?rev=306773&r1=306772&r2=306773&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp Thu Jun 29 17:39:17 2017 @@ -13,6 +13,7 @@ // Project includes #include "NSSet.h" +#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h" #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResult.h" #include "lldb/DataFormatters/FormattersHelpers.h" @@ -84,11 +85,12 @@ private: std::vector m_children; }; -class NSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd { +template +class GenericNSSetMSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: - NSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); + GenericNSSetMSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); - ~NSSetMSyntheticFrontEnd() override; + ~GenericNSSetMSyntheticFrontEnd() override; size_t CalculateNumChildren() override; @@ -101,32 +103,57 @@ public: size_t GetIndexOfChildWithName(const ConstString &name) override; private: + + struct SetItemDescriptor { +lldb::addr_t item_ptr; +lldb::ValueObjectSP valobj_sp; + }; + + ExecutionContextRef m_exe_ctx_ref; + uint8_t m_ptr_size; + D32 *m_data_32; + D64 *m_data_64; + std::vector m_children; +}; + +namespace Foundation1300 { struct DataDescriptor_32 { uint32_t _used : 26; uint32_t _size; uint32_t _mutations; uint32_t _objs_addr; }; - + struct DataDescriptor_64 { uint64_t _used : 58; uint64_t _size; uint64_t _mutations; uint64_t _objs_addr; }; - - struct SetItemDescriptor { -lldb::addr_t item_ptr; -lldb::ValueObjectSP valobj_sp; + + using NSSetMSyntheticFrontEnd = + GenericNSSetMSyntheticFrontEnd; +} + +namespace Foundation1400 { + struct DataDescriptor_32 { +uint32_t _used : 26; +uint32_t _size; +uint32_t _objs_addr; +uint32_t _mutations; }; - - ExecutionContextRef m_exe_ctx_ref; - uint8_t m_ptr_size; - DataDescriptor_32 *m_data_32; - DataDescriptor_64 *m_data_64; - std::vector m_children; -}; - + + struct DataDescriptor_64 { +uint64_t _used : 58; +uint64_t _size; +uint64_t _objs_addr; +uint64_t _mutations; + }; + + using NSSetMSyntheticFrontEnd = + GenericNSSetMSyntheticFrontEnd; +} + class NSSetCodeRunningSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSSetCodeRunningSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); @@ -283,7 +310,12 @@ lldb_private::formatters::NSSetSynthetic if (!strcmp(class_name, "__NSSetI")) { return (new NSSetISyntheticFrontEnd(valobj_sp)); } else if (!strcmp(class_name, "__NSSetM")) { -return (new NSSetMSyntheticFrontEnd(valobj_sp)); +AppleObjCRuntime *apple_runtime = +llvm::dyn_cast_or_null(runtime); +if (apple_runtime && apple_runtime->GetFoundationVersion() >= 1400) + return (new Foundation1400::NSSetMSyntheticFrontEnd(valobj_sp)); +else + return (new Foundation1300::NSSetMSyntheticFrontEnd(valobj_sp)); } else { auto &map(NSSet_Additionals::GetAdditionalSynthetics()); auto iter = map.find(class_name_cs), end = map.end(); @@ -442,7 +474,9 @@ lldb_private::formatters::NSSetISyntheti return set_item.valobj_sp; } -lldb_private::formatters::NSSetMSyntheticFrontEnd::NSSetMSyntheticFrontEnd( +template +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::GenericNSSetMSyntheticFrontEnd( lldb::ValueObjectSP valobj_sp) : SyntheticChildrenFrontEnd(*valobj_sp), m_exe_ctx_ref(), m_ptr_size(8), m_data_32(nullptr), m_data_64(nullptr) { @@ -450,15 +484,19 @@ lldb_private::formatters::NSSetMSyntheti Update(); } -lldb_private::formatters::NSSetMSyntheticFrontEnd::~NSSetMSyntheticFrontEnd() { +template +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::~GenericNSSetMSyntheticFrontEnd() { delete m_data_32; m_data_32 = nullptr; delete m_data_64; m_data_64 = nullptr; } +template size_t -lldb_private::formatters::NSSetMSyntheticFrontEnd::GetIndexOfChildWithName( +lldb_private::formatters:: + GenericNSSetMSyntheticFrontEnd::GetIndexOfChildWithName( const ConstString &name) { const char *item_name = name.GetCString(); uint32_t idx = ExtractIndexFromString
[Lldb-commits] [PATCH] D34853: Fix (benignly) incorrect GoogleTest specs in various lit configs.
dlj created this revision. dlj added projects: lld, clang. Herald added subscribers: mehdi_amini, sanjoy. The GoogleTest lit format accepts two parameters to its constructor: a subdirectory to find test binaries, and a required suffix for the test filenames. Typically, the config should look like this: config.test_format = lit.formats.GoogleTest('.', 'Tests') This will search the current directory for filenames ending with 'Tests', and run the matching binaries it finds as GoogleTests. It appears that several lit configs pass a different value for the subdirectory, however. They use "config.llvm_build_mode", which would be set by @LLVM_BUILD_MODE@, but never is. Fortunately, this means that the Python lookup passes and finds an empty string, which means that lit searches the current directory. I can imagine cases where looking for a build-specific subdirectory might have worked in the paste, but I suspect it is no longer the right behaviour to check with cmake. So, I'm removing the (somewhat confusing) LLVM_BUILD_MODE logic altogether. Repository: rL LLVM https://reviews.llvm.org/D34853 Files: cfe/trunk/test/Unit/lit.cfg cfe/trunk/test/Unit/lit.site.cfg.in compiler-rt/trunk/test/lit.common.configured.in compiler-rt/trunk/unittests/lit.common.unit.cfg compiler-rt/trunk/unittests/lit.common.unit.configured.in lld/trunk/test/Unit/lit.cfg lld/trunk/test/Unit/lit.site.cfg.in lldb/trunk/lit/Unit/lit.site.cfg.in llvm/trunk/test/Unit/lit.site.cfg.in Index: llvm/trunk/test/Unit/lit.site.cfg.in === --- llvm/trunk/test/Unit/lit.site.cfg.in +++ llvm/trunk/test/Unit/lit.site.cfg.in @@ -5,15 +5,13 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@" config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" config.enable_shared = @ENABLE_SHARED@ config.shlibdir = "@SHLIBDIR@" -# Support substitution of the tools_dir and build_mode with user parameters. +# Support substitution of the tools_dir with user parameters. # This is used when we can't determine the tool dir at configuration time. try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params -config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError: e = sys.exc_info()[1] key, = e.args Index: lldb/trunk/lit/Unit/lit.site.cfg.in === --- lldb/trunk/lit/Unit/lit.site.cfg.in +++ lldb/trunk/lit/Unit/lit.site.cfg.in @@ -5,7 +5,6 @@ config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_src_root = "@LLDB_SOURCE_DIR@" @@ -17,7 +16,6 @@ try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) Index: lld/trunk/test/Unit/lit.site.cfg.in === --- lld/trunk/test/Unit/lit.site.cfg.in +++ lld/trunk/test/Unit/lit.site.cfg.in @@ -4,7 +4,6 @@ config.llvm_obj_root = "@LLVM_BINARY_DIR@" config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" config.llvm_libs_dir = "@LLVM_LIBS_DIR@" -config.llvm_build_mode = "@LLVM_BUILD_MODE@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" config.lld_obj_root = "@LLD_BINARY_DIR@" config.lld_src_root = "@LLD_SOURCE_DIR@" @@ -16,7 +15,6 @@ try: config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params -config.llvm_build_mode = config.llvm_build_mode % lit_config.params except KeyError as e: key, = e.args lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) Index: lld/trunk/test/Unit/lit.cfg === --- lld/trunk/test/Unit/lit.cfg +++ lld/trunk/test/Unit/lit.cfg @@ -18,6 +18,4 @@ config.test_exec_root = config.test_source_root # testFormat: The test format to use to interpret tests. -if not hasattr(config, 'llvm_build_mode'): -lit_config.fatal("unable to find llvm_build_mode value on config") -config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests') +config.test_format = lit.formats.GoogleTest('.', 'Tests') Index: compiler-rt/trunk/unittests/lit.common.unit.configured.in === --- compiler-rt/trunk/unittests/lit.common.unit.configured.in +++ compiler-rt/trunk/unittests/lit.common.unit.configured.in @@ -7,15 +7,13 @@ config
[Lldb-commits] [PATCH] D34750: [UnwindAssembly/x86] Add support for "lea imm(%ebp), %esp" pattern
jasonmolenda added a comment. Yeah, looks good. You'll only see this on i386 because the SysV ABI require 4-byte stack alignment. On x86_64 it's 16-byte so the compiler doesn't need to emit the AND instruction to realign it. On darwin we required 16 byte alignment on i386 too so we never saw this problem there. Repository: rL LLVM https://reviews.llvm.org/D34750 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits