[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
labath created this revision. Herald added a subscriber: mgorny. The new UndefinedBehaviorSanitizer plugin was breaking file path length limits, because it's (fairly long name) appears multiple times in the path. Cmake ends up putting the object file at path tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj which is 191 characters long and very dangerously close to the 260 character path limit on windows systems (also, just the include line for that file was breaking the 80 character line limit). This renames the sanitizer plugins to use shorter names (asan, ubsan, tsan). I think this will still be quite understandable to everyone as those are the names everyone uses to refer to them anyway. https://reviews.llvm.org/D34553 Files: source/API/SystemInitializerFull.cpp source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h source/Plugins/InstrumentationRuntime/AddressSanitizer/CMakeLists.txt source/Plugins/InstrumentationRuntime/CMakeLists.txt source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h source/Plugins/InstrumentationRuntime/ThreadSanitizer/CMakeLists.txt source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeLists.txt source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.cpp source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h Index: source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h === --- /dev/null +++ source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h @@ -1,69 +0,0 @@ -//===-- UndefinedBehaviorSanitizerRuntime.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_UndefinedBehaviorSanitizerRuntime_h_ -#define liblldb_UndefinedBehaviorSanitizerRuntime_h_ - -#include "lldb/Core/StructuredData.h" -#include "lldb/Target/ABI.h" -#include "lldb/Target/InstrumentationRuntime.h" -#include "lldb/lldb-private.h" - -namespace lldb_private { - -class UndefinedBehaviorSanitizerRuntime -: public lldb_private::InstrumentationRuntime { -public: - ~UndefinedBehaviorSanitizerRuntime() override; - - static lldb::InstrumentationRuntimeSP - CreateInstance(const lldb::ProcessSP &process_sp); - - static void Initialize(); - - static void Terminate(); - - static lldb_private::ConstString GetPluginNameStatic(); - - static lldb::InstrumentationRuntimeType GetTypeStatic(); - - lldb_private::ConstString GetPluginName() override { -return GetPluginNameStatic(); - } - - virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); } - - uint32_t GetPluginVersion() override { return 1; } - - lldb::ThreadCollectionSP - GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override; - -private: - UndefinedBehaviorSanitizerRuntime(const lldb::ProcessSP &process_sp) - : lldb_private::InstrumentationRuntime(process_sp) {} - - const RegularExpression &GetPatternForRuntimeLibrary() override; - - bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override; - - void Activate() override; - - void Deactivate(); - - static bool NotifyBreakpointHit(void *baton, - StoppointCallbackContext *context, - lldb::user_id_t break_id, - lldb::user_id_t break_loc_id); - - StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref); -}; - -} // namespace lldb_private - -#endif // liblldb_UndefinedBehaviorSanitizerRuntime_h_ Index: source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp === --- source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
Re: [Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
No objections here On Fri, Jun 23, 2017 at 5:48 AM Pavel Labath via Phabricator < revi...@reviews.llvm.org> wrote: > labath created this revision. > Herald added a subscriber: mgorny. > > The new UndefinedBehaviorSanitizer plugin was breaking file path length > limits, because it's (fairly long name) appears multiple times in the > path. Cmake ends up putting the object file at path > > tools/lldb/source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeFiles/lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer.dir/UndefinedBehaviorSanitizerRuntime.cpp.obj > which is 191 characters long and very dangerously close to the 260 > character path limit on windows systems (also, just the include line for > that file was breaking the 80 character line limit). > > This renames the sanitizer plugins to use shorter names (asan, ubsan, > tsan). I think this will still be quite understandable to everyone as > those are the names everyone uses to refer to them anyway. > > > https://reviews.llvm.org/D34553 > > Files: > source/API/SystemInitializerFull.cpp > source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp > source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h > source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt > > source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp > > source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h > source/Plugins/InstrumentationRuntime/AddressSanitizer/CMakeLists.txt > source/Plugins/InstrumentationRuntime/CMakeLists.txt > source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt > source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp > source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h > source/Plugins/InstrumentationRuntime/ThreadSanitizer/CMakeLists.txt > > source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.cpp > > source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h > source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt > source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp > source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h > > source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/CMakeLists.txt > > source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.cpp > > source/Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h > > ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
kubamracek added a comment. Oh wow, we really need to limit path lengths? What about files like `./packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py`? https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
labath added a comment. In https://reviews.llvm.org/D34553#789023, @kubamracek wrote: > Oh wow, we really need to limit path lengths? It's a bit annoying, but windows has issues with paths like that. It's actually possible to avoid it nowadays, if you use the right APIs, but not all programs have been updated to do that. Ironically enough, the error here comes from the MSVC linker, which means clang either succeeded in creating the object file, or failed silently doing that (I can't say which one as this was happening on the buildbot). > What about files like > `./packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py`? That's another fine example of an incredibly long path, and it was causing some problems already (it broke dotest log file name length), but I've managed to work around those. However, even without these limits, I feel that our file names/paths tend to be unnecessarily long. https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
amccarth added a comment. Thanks for doing this. This seems a reasonable alternative to fixing all the build tools upstream. And overly long paths are difficult to read. https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
vsk added a comment. Thanks, this lgtm. Our tools don't depend on these plugins having a particular file name. https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34550: Fix typo: using && instead of & when evaluating a mask
This revision was automatically updated to reflect the committed changes. Closed by commit rL306134: Fix typo: using && instead of & when evaluating a mask (authored by mehdi_amini). Changed prior to commit: https://reviews.llvm.org/D34550?vs=103690&id=103752#toc Repository: rL LLVM https://reviews.llvm.org/D34550 Files: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp === --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1693,7 +1693,7 @@ // ABI Mask doesn't cover N32 and N64 ABI. if (header.e_ident[EI_CLASS] == llvm::ELF::ELFCLASS64) arch_flags |= lldb_private::ArchSpec::eMIPSABI_N64; -else if (header.e_flags && llvm::ELF::EF_MIPS_ABI2) +else if (header.e_flags & llvm::ELF::EF_MIPS_ABI2) arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32; break; } Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp === --- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -1693,7 +1693,7 @@ // ABI Mask doesn't cover N32 and N64 ABI. if (header.e_ident[EI_CLASS] == llvm::ELF::ELFCLASS64) arch_flags |= lldb_private::ArchSpec::eMIPSABI_N64; -else if (header.e_flags && llvm::ELF::EF_MIPS_ABI2) +else if (header.e_flags & llvm::ELF::EF_MIPS_ABI2) arch_flags |= lldb_private::ArchSpec::eMIPSABI_N32; break; } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
jingham accepted this revision. jingham added a comment. This revision is now accepted and ready to land. I try to avoid making cryptic file names just to get them under some character count, since that also makes code hard to comprehend particularly for new users. But in this case everybody calls these features ASAN, UBSAN, etc. So this change shouldn't cause any confusion. https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r306180 - Updated the NSArray and NSDictionary formatters to support new storage formats.
Author: spyffe Date: Fri Jun 23 18:15:03 2017 New Revision: 306180 URL: http://llvm.org/viewvc/llvm-project?rev=306180&view=rev Log: Updated the NSArray and NSDictionary formatters to support new storage formats. Also un-xfailed a testcase that was affected by this. Thanks to Jason Molenda for the patch. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=306180&r1=306179&r2=306180&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Fri Jun 23 18:15:03 2017 @@ -121,8 +121,6 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) -@expectedFailureAll( -bugnumber="rdar://32777981") def test_update_dictionary(self): self.runToBreakpoint() @@ -165,8 +163,6 @@ class ObjCNewSyntaxTestCase(TestBase): '7.0.0']) @skipIf(macos_version=["<", "10.12"]) @expectedFailureAll(archs=["i[3-6]86"]) -@expectedFailureAll( -bugnumber="rdar://32777981") def test_dictionary_literal(self): self.runToBreakpoint() Modified: lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp?rev=306180&r1=306179&r2=306180&view=diff == --- lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp (original) +++ lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp Fri Jun 23 18:15:03 2017 @@ -160,11 +160,47 @@ private: DataDescriptor_64 *m_data_64; }; -class NSArrayISyntheticFrontEnd : public SyntheticChildrenFrontEnd { +class NSArrayMSyntheticFrontEnd_1400 : public NSArrayMSyntheticFrontEnd { public: - NSArrayISyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); + NSArrayMSyntheticFrontEnd_1400(lldb::ValueObjectSP valobj_sp); - ~NSArrayISyntheticFrontEnd() override = default; + ~NSArrayMSyntheticFrontEnd_1400() override; + + bool Update() override; + +protected: + lldb::addr_t GetDataAddress() override; + + uint64_t GetUsedCount() override; + + uint64_t GetOffset() override; + + uint64_t GetSize() override; + +private: + struct DataDescriptor_32 { +uint32_t used; +uint32_t offset; +uint32_t size; +uint32_t list; + }; + + struct DataDescriptor_64 { +uint64_t used; +uint64_t offset; +uint64_t size; +uint64_t list; + }; + + DataDescriptor_32 *m_data_32; + DataDescriptor_64 *m_data_64; +}; + +class NSArrayISyntheticFrontEnd_1300 : public SyntheticChildrenFrontEnd { +public: + NSArrayISyntheticFrontEnd_1300(lldb::ValueObjectSP valobj_sp); + + ~NSArrayISyntheticFrontEnd_1300() override = default; size_t CalculateNumChildren() override; @@ -184,6 +220,45 @@ private: CompilerType m_id_type; }; +class NSArrayISyntheticFrontEnd_1400 : public SyntheticChildrenFrontEnd { +public: + NSArrayISyntheticFrontEnd_1400(lldb::ValueObjectSP valobj_sp); + + ~NSArrayISyntheticFrontEnd_1400() override; + + size_t CalculateNumChildren() override; + + lldb::ValueObjectSP GetChildAtIndex(size_t idx) override; + + bool Update() override; + + bool MightHaveChildren() override; + + size_t GetIndexOfChildWithName(const ConstString &name) override; + +private: + ExecutionContextRef m_exe_ctx_ref; + uint8_t m_ptr_size; + + struct DataDescriptor_32 { +uint32_t used; +uint32_t offset; +uint32_t size; +uint32_t list; + }; + + struct DataDescriptor_64 { +uint64_t used; +uint64_t offset; +uint64_t size; +uint64_t list; + }; + + DataDescriptor_32 *m_data_32; + DataDescriptor_64 *m_data_64; + CompilerType m_id_type; +}; + class NSArray0SyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: NSArray0SyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); @@ -257,6 +332,8 @@ bool lldb_private::formatters::NSArraySu static const ConstString g_NSArray0("__NSArray0"); static const ConstString g_NSArray1("__NSSingleObjectArrayI"); static const ConstString g_NSArrayCF("__NSCFArray"); + static const ConstString g_NSArrayMLegacy("__NSArrayM_Legacy"); + static const ConstString g_NSArrayMImmutable("__NSArrayM_Immutable"); if (class_name.IsEmpty()) return false; @@ -273,6 +350,18 @@ bool lldb_private::formatters::NSArraySu ptr_size, 0,
[Lldb-commits] [lldb] r306186 - Fix LLDB build.
Author: zturner Date: Fri Jun 23 18:55:32 2017 New Revision: 306186 URL: http://llvm.org/viewvc/llvm-project?rev=306186&view=rev Log: Fix LLDB build. This was broken due to directly including windows.h, which caused a problem when someone in LLVM called std::min in a header file. LLDB has a windows.h include to work around this, but it wasn't being used in these two files. Modified: lldb/trunk/source/Core/IOHandler.cpp lldb/trunk/source/Core/Mangled.cpp Modified: lldb/trunk/source/Core/IOHandler.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/IOHandler.cpp?rev=306186&r1=306185&r2=306186&view=diff == --- lldb/trunk/source/Core/IOHandler.cpp (original) +++ lldb/trunk/source/Core/IOHandler.cpp Fri Jun 23 18:55:32 2017 @@ -58,7 +58,7 @@ #include "llvm/ADT/StringRef.h" // for StringRef #ifdef _MSC_VER -#include +#include "lldb/Host/windows/windows.h" #endif #include // for shared_ptr Modified: lldb/trunk/source/Core/Mangled.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Mangled.cpp?rev=306186&r1=306185&r2=306186&view=diff == --- lldb/trunk/source/Core/Mangled.cpp (original) +++ lldb/trunk/source/Core/Mangled.cpp Fri Jun 23 18:55:32 2017 @@ -10,7 +10,7 @@ #include "lldb/Core/Mangled.h" #if defined(_WIN32) -#include +#include "lldb/Host/windows/windows.h" #include #pragma comment(lib, "dbghelp.lib") ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D34553: Shorten sanitizer plugin names
krytarowski added a comment. Looks good. It's easier to parse [at least for my eyes]: ubsan, asan, tsan etc than full-names. https://reviews.llvm.org/D34553 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits