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
+++ source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
@@ -1,13 +1,13 @@
-//===-- UndefinedBehaviorSanitizerRuntime.cpp -------------------*- C++ -*-===//
+//===-- UBSanRuntime.cpp ----------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 // This file is distributed under the University of Illinois Open Source
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
-#include "UndefinedBehaviorSanitizerRuntime.h"
+#include "UBSanRuntime.h"
 
 #include "Plugins/Process/Utility/HistoryThread.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
Index: source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
===================================================================
--- source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
+++ source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeUndefinedBehaviorSanitizer PLUGIN
-  UndefinedBehaviorSanitizerRuntime.cpp
+add_lldb_library(lldbPluginInstrumentationRuntimeUBSan PLUGIN
+  UBSanRuntime.cpp
 
   LINK_LIBS
     lldbBreakpoint
Index: source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h
===================================================================
--- /dev/null
+++ source/Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h
@@ -1,86 +0,0 @@
-//===-- ThreadSanitizerRuntime.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_ThreadSanitizerRuntime_h_
-#define liblldb_ThreadSanitizerRuntime_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/StructuredData.h"
-#include "lldb/Target/ABI.h"
-#include "lldb/Target/InstrumentationRuntime.h"
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-class ThreadSanitizerRuntime : public lldb_private::InstrumentationRuntime {
-public:
-  ~ThreadSanitizerRuntime() 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:
-  ThreadSanitizerRuntime(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);
-
-  std::string FormatDescription(StructuredData::ObjectSP report);
-
-  std::string GenerateSummary(StructuredData::ObjectSP report);
-
-  lldb::addr_t GetMainRacyAddress(StructuredData::ObjectSP report);
-
-  std::string GetLocationDescription(StructuredData::ObjectSP report,
-                                     lldb::addr_t &global_addr,
-                                     std::string &global_name,
-                                     std::string &filename, uint32_t &line);
-
-  lldb::addr_t GetFirstNonInternalFramePc(StructuredData::ObjectSP trace,
-                                          bool skip_one_frame = false);
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_ThreadSanitizerRuntime_h_
Index: source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
===================================================================
--- source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
@@ -1,13 +1,13 @@
-//===-- ThreadSanitizerRuntime.cpp ------------------------------*- C++ -*-===//
+//===-- TSanRuntime.cpp -----------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 // This file is distributed under the University of Illinois Open Source
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
-#include "ThreadSanitizerRuntime.h"
+#include "TSanRuntime.h"
 
 #include "Plugins/Process/Utility/HistoryThread.h"
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
Index: source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
===================================================================
--- source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
+++ source/Plugins/InstrumentationRuntime/TSan/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeThreadSanitizer PLUGIN
-  ThreadSanitizerRuntime.cpp
+add_lldb_library(lldbPluginInstrumentationRuntimeTSan PLUGIN
+  TSanRuntime.cpp
 
   LINK_LIBS
     lldbBreakpoint
Index: source/Plugins/InstrumentationRuntime/CMakeLists.txt
===================================================================
--- source/Plugins/InstrumentationRuntime/CMakeLists.txt
+++ source/Plugins/InstrumentationRuntime/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_subdirectory(AddressSanitizer)
-add_subdirectory(ThreadSanitizer)
-add_subdirectory(UndefinedBehaviorSanitizer)
+add_subdirectory(ASan)
 add_subdirectory(MainThreadChecker)
+add_subdirectory(TSan)
+add_subdirectory(UBSan)
Index: source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
===================================================================
--- source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
+++ source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
@@ -1,5 +1,5 @@
-add_lldb_library(lldbPluginInstrumentationRuntimeAddressSanitizer PLUGIN
-  AddressSanitizerRuntime.cpp
+add_lldb_library(lldbPluginInstrumentationRuntimeASan PLUGIN
+  ASanRuntime.cpp
 
   LINK_LIBS
     lldbBreakpoint
Index: source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
===================================================================
--- /dev/null
+++ source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h
@@ -1,71 +0,0 @@
-//===-- AddressSanitizerRuntime.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_AddressSanitizerRuntime_h_
-#define liblldb_AddressSanitizerRuntime_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Core/StructuredData.h"
-#include "lldb/Target/InstrumentationRuntime.h"
-#include "lldb/Target/Process.h"
-#include "lldb/lldb-private.h"
-
-namespace lldb_private {
-
-class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime {
-public:
-  ~AddressSanitizerRuntime() 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; }
-
-private:
-  AddressSanitizerRuntime(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();
-
-  std::string FormatDescription(StructuredData::ObjectSP report);
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_AddressSanitizerRuntime_h_
Index: source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
===================================================================
--- source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
@@ -1,13 +1,13 @@
-//===-- AddressSanitizerRuntime.cpp -----------------------------*- C++ -*-===//
+//===-- ASanRuntime.cpp -----------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
 // This file is distributed under the University of Illinois Open Source
 // License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
-#include "AddressSanitizerRuntime.h"
+#include "ASanRuntime.h"
 
 #include "lldb/Breakpoint/StoppointCallbackContext.h"
 #include "lldb/Core/Debugger.h"
Index: source/API/SystemInitializerFull.cpp
===================================================================
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -49,9 +49,9 @@
 #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
 #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
-#include "Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.h"
-#include "Plugins/InstrumentationRuntime/ThreadSanitizer/ThreadSanitizerRuntime.h"
-#include "Plugins/InstrumentationRuntime/UndefinedBehaviorSanitizer/UndefinedBehaviorSanitizerRuntime.h"
+#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
+#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
+#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
 #include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
 #include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
 #include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to