From 202487e82d820481dc28e571f0c7dea84b613b7f Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Fri, 14 Feb 2020 14:57:04 +0100
Subject: [PATCH] remove llvm formatters

Formatters were specific to Area class in NextSoftware/VTM and not needed for HM
---
 CMakeLists.txt                                |   9 --
 lldb/CMakeLists.txt                           |  48 -------
 lldb/HM.py                                    | 123 ------------------
 lldb/lldbinit-HM.in                           |  11 --
 lldb/lldbinit_update-in.cmake                 |  11 --
 source/App/TAppDecoder/CMakeLists.txt         |   5 -
 source/App/TAppDecoderAnalyser/CMakeLists.txt |   5 -
 source/App/TAppEncoder/CMakeLists.txt         |   5 -
 source/App/TAppMCTSExtractor/CMakeLists.txt   |   5 -
 9 files changed, 222 deletions(-)
 delete mode 100644 lldb/CMakeLists.txt
 delete mode 100644 lldb/HM.py
 delete mode 100644 lldb/lldbinit-HM.in
 delete mode 100644 lldb/lldbinit_update-in.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bc0118d8..71664a722 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,15 +117,6 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
   endif()
 endif()
 
-# modify .lldbinit for lldb custom data formatters
-if( XCODE )
-  set( LLDB_INSTALL_ROOT "$ENV{HOME}/.lldb.d" )
-  set( LLDBINIT_FILE "$ENV{HOME}/.lldbinit" )
-  set( ENABLE_LLDBINIT_UPDATE ON )
-  # add custom target to install LLDB files.
-  add_subdirectory( "lldb" )
-endif()
-
 # add needed subdirectories
 add_subdirectory( "source/Lib/TLibCommon" )
 add_subdirectory( "source/Lib/TLibCommonAnalyser" )
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
deleted file mode 100644
index e3128ee12..000000000
--- a/lldb/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-# BoostBuild/lldb/CMakeLists.txt
-
-if( NOT DEFINED LLDB_INSTALL_ROOT )
-  set( LLDB_INSTALL_ROOT "$ENV{HOME}/.lldb.d" ) 
-  message( STATUS "${CMAKE_CURRENT_LIST_FILE}: LLDB_INSTALL_ROOT not set, using default ${LLDB_INSTALL_ROOT}." )
-endif()
-
-if( NOT DEFINED LLDBINIT_FILE )
-  set( LLDBINIT_FILE "$ENV{HOME}/.lldbinit" ) 
-  message( STATUS "${CMAKE_CURRENT_LIST_FILE}: LLDBINIT_FILE not set, using default ${LLDBINIT_FILE}." )
-endif()
-
-if( NOT DEFINED ENABLE_LLDBINIT_UPDATE )
-  set( ENABLE_LLDBINIT_UPDATE TRUE ) 
-  message( STATUS "${CMAKE_CURRENT_LIST_FILE}: ENABLE_LLDBINIT_UPDATE not set, using default ${ENABLE_LLDBINIT_UPDATE}." )
-endif()
-
-set( LLDB_INSTALL_DIR ${LLDB_INSTALL_ROOT}/${PROJECT_NAME} )
-
-# Get all LLDB python modules
-file( GLOB LLDB_MODULES "*.py" )
-
-configure_file( lldbinit-${PROJECT_NAME}.in ${CMAKE_CURRENT_BINARY_DIR}/lldbinit-${PROJECT_NAME} @ONLY )
-
-if( ENABLE_LLDBINIT_UPDATE )
-  # Install LLDB files and update  ~/.lldbinit
-
-  # ---
-  # Create a cmake script to update ~/.ldbinit 
-  set( cmake_lldbinit_module ${CMAKE_SOURCE_DIR}/cmake/CMakeBuild/cmake/modules/BBuildEnvLldb.cmake )
-  set( input_file ${LLDBINIT_FILE} )
-  set( section_marker ${PROJECT_NAME} )
-  set( lldbinit_content "command source -s 0 ${LLDB_INSTALL_ROOT}/lldbinit-${PROJECT_NAME}" )
-  configure_file( lldbinit_update-in.cmake ${CMAKE_CURRENT_BINARY_DIR}/lldbinit_update.cmake )
-  # ---
-
-  add_custom_target( Install${PROJECT_NAME}LldbFiles ${CMAKE_COMMAND} -E make_directory ${LLDB_INSTALL_DIR}
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/lldbinit-${PROJECT_NAME} ${LLDB_INSTALL_ROOT}
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LLDB_MODULES} ${LLDB_INSTALL_DIR} 
-                     COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/lldbinit_update.cmake
-                     SOURCES lldbinit-${PROJECT_NAME}.in ${LLDB_MODULES} )
-else()
-  # Install LLDB files without touching ~/.lldbinit
-  add_custom_target( Install${PROJECT_NAME}LldbFiles ${CMAKE_COMMAND} -E make_directory ${LLDB_INSTALL_DIR}
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/lldbinit-${PROJECT_NAME} ${LLDB_INSTALL_ROOT}
-                     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${LLDB_MODULES} ${LLDB_INSTALL_DIR} 
-                     SOURCES lldbinit-${PROJECT_NAME}.in ${LLDB_MODULES} )
-endif()
diff --git a/lldb/HM.py b/lldb/HM.py
deleted file mode 100644
index 3d98fec17..000000000
--- a/lldb/HM.py
+++ /dev/null
@@ -1,123 +0,0 @@
-import lldb
-
-
-# Synthetic view for static_vector objects
-class static_vector_SynthChildProvider:
-  def __init__( self, valobj, dict ):
-    self.valobj = valobj
-
-  def num_children( self ):
-    size = self.valobj.GetChildMemberWithName( '_size' ).GetValueAsUnsigned()
-    return size + 2
-
-  def has_children( self ):
-    return self.num_children() != 0
-
-  def get_child_at_index( self, index ):
-    if index < 0:
-      return None
-    if index >= self.num_children():
-      return None
-    if index == self.num_children() - 2:
-      return self.valobj.GetChildMemberWithName( '_arr' )
-    if index == self.num_children() - 1:
-      return self.valobj.GetChildMemberWithName( '_size' )
-    arr = self.valobj.GetChildMemberWithName( '_arr' )
-    return arr.GetChildAtIndex(index)
-
-  def update( self ):
-    pass
-
-
-# Summary for UnitArea objects
-def static_vector_SummaryProvider( valobj, dict ):
-  size = valobj.GetNumChildren() - 2
-  return 'size=' + str( size )
-
-# Synthetic view for UnitArea objects
-class UnitArea_SynthChildProvider:
-  def __init__( self, valobj, dict ):
-    self.valobj = valobj
-
-  def num_children( self ):
-    blocks = self.valobj.GetChildMemberWithName( 'blocks' )
-    size = blocks.GetChildMemberWithName( '_size' ).GetValueAsUnsigned()
-    return size + 3
-
-  def has_children( self ):
-    return True
-
-  def get_child_at_index( self, index ):
-    if index < 0:
-      return None
-    if index >= self.num_children():
-      return None
-    if index == 0:
-      return self.valobj.GetChildMemberWithName( 'chromaFormat' )
-    if index == self.num_children()-2:
-      return self.valobj.GetChildMemberWithName( 'blocks' ).GetChildMemberWithName( '_arr' )
-    if index == self.num_children()-1:
-      return self.valobj.GetChildMemberWithName( 'blocks' ).GetChildMemberWithName( '_size' )
-    if index > 0:
-      arr = self.valobj.GetChildMemberWithName( 'blocks' ).GetChildMemberWithName( '_arr' )
-      return arr.GetChildAtIndex( index - 1 )
-
-  def update( self ):
-    pass
-
-# Summary for Area objects
-def Area_SummaryProvider( valobj, dict ):
-  x      = valobj.GetChildMemberWithName( 'x' ).GetValueAsUnsigned()
-  y      = valobj.GetChildMemberWithName( 'y' ).GetValueAsUnsigned()
-  width  = valobj.GetChildMemberWithName( 'width' ).GetValueAsUnsigned()
-  height = valobj.GetChildMemberWithName( 'height' ).GetValueAsUnsigned()
-  return 'x=' + str( x ) + ', y=' + str( y ) + ', width=' + str( width ) + ', height=' + str( height )
-
-# Summary for CompArea objects
-def CompArea_SummaryProvider( valobj, dict ):
-  compid = valobj.GetChildMemberWithName( 'compID' ).GetValueAsUnsigned()
-  if compid == 0:
-    comp = 'Y '
-  elif compid == 1:
-    comp = 'Cb '
-  elif compid == 2:
-    comp = 'Cr '
-  elif compid == 3:
-    comp = 'Cb2 '
-  elif compid == 4:
-    comp = 'Cr2 '
-  else:
-    comp = 'invalid '
-  return comp + Area_SummaryProvider( valobj, dict)
-
-# Summary for UnitArea objects
-def UnitArea_SummaryProvider( valobj, dict ):
-  area = valobj.GetChildAtIndex( 1 )
-  return Area_SummaryProvider( area, dict)
-
-# Summary for CodingUnit objects
-def CodingUnit_SummaryProvider( valobj, dict ):
-  area = valobj.GetChildMemberWithName( 'blocks' ).GetChildAtIndex( 0 )
-  return 'CU: ' + Area_SummaryProvider( area, dict)
-
-# Summary for PredictionUnit objects
-def PredictionUnit_SummaryProvider( valobj, dict ):
-  area = valobj.GetChildMemberWithName( 'blocks' ).GetChildAtIndex( 0 )
-  return 'PU: ' + Area_SummaryProvider( area, dict)
-
-# Summary for TransformUnit objects
-def TransformUnit_SummaryProvider( valobj, dict ):
-  area = valobj.GetChildMemberWithName( 'blocks' ).GetChildAtIndex( 0 )
-  return 'TU: ' + Area_SummaryProvider( area, dict)
-
-def __lldb_init_module( debugger, dict ):
-  debugger.HandleCommand( 'type synthetic add -l NextSoftware.static_vector_SynthChildProvider -x "static_vector<.*>$"' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.static_vector_SummaryProvider -e -x "static_vector<.*>$"' )
-#  debugger.HandleCommand( 'type summary add --summary-string size=${svar%#} -e -x "static_vector<.*>$"' )
-  debugger.HandleCommand( 'type synthetic add -l NextSoftware.UnitArea_SynthChildProvider UnitArea' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.UnitArea_SummaryProvider -e  UnitArea' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.Area_SummaryProvider -e Area' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.CompArea_SummaryProvider -e CompArea' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.CodingUnit_SummaryProvider -e CodingUnit' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.PredictionUnit_SummaryProvider -e PredictionUnit' )
-  debugger.HandleCommand( 'type summary add -F NextSoftware.TransformUnit_SummaryProvider -e TransformUnit' )
diff --git a/lldb/lldbinit-HM.in b/lldb/lldbinit-HM.in
deleted file mode 100644
index 54a97e225..000000000
--- a/lldb/lldbinit-HM.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# lldbinit-@PROJECT_NAME@
-#
-# Add the following line to ~/.lldbinit
-# command source -s 0 @LLDB_INSTALL_ROOT@/lldbinit-@PROJECT_NAME@
-# 
-
-# Load a custom LLDB python module.
-command script import @LLDB_INSTALL_DIR@/NextSoftware.py
-
-
-# Other settings , aliases ...
diff --git a/lldb/lldbinit_update-in.cmake b/lldb/lldbinit_update-in.cmake
deleted file mode 100644
index 577d7412a..000000000
--- a/lldb/lldbinit_update-in.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# lldbinit_update-in.cmake
-#
-
-include( @cmake_lldbinit_module@ )
-
-# in-place add
-bb_lldbinit_update( ADD "@input_file@" @section_marker@ "@lldbinit_content@" )
-
-# in-place remove
-# bb_lldbinit_update( REMOVE "@input_file@" @section_marker@ )
diff --git a/source/App/TAppDecoder/CMakeLists.txt b/source/App/TAppDecoder/CMakeLists.txt
index 4337e6cc2..f510840ee 100644
--- a/source/App/TAppDecoder/CMakeLists.txt
+++ b/source/App/TAppDecoder/CMakeLists.txt
@@ -44,11 +44,6 @@ endif()
 
 target_link_libraries( ${EXE_NAME} TLibCommon TLibDecoder Utilities Threads::Threads ${ADDITIONAL_LIBS} )
 
-# lldb custom data formatters
-if( XCODE )
-  add_dependencies( ${EXE_NAME} Install${PROJECT_NAME}LldbFiles )
-endif()
-
 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
   add_custom_command( TARGET ${EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
                                                           $<$<CONFIG:Debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/TAppDecoder>
diff --git a/source/App/TAppDecoderAnalyser/CMakeLists.txt b/source/App/TAppDecoderAnalyser/CMakeLists.txt
index 153d34f67..6832639f2 100644
--- a/source/App/TAppDecoderAnalyser/CMakeLists.txt
+++ b/source/App/TAppDecoderAnalyser/CMakeLists.txt
@@ -46,11 +46,6 @@ endif()
 
 target_link_libraries( ${EXE_NAME} TLibCommonAnalyser TLibDecoderAnalyser Utilities Threads::Threads ${ADDITIONAL_LIBS} )
 
-# lldb custom data formatters
-if( XCODE )
-  add_dependencies( ${EXE_NAME} Install${PROJECT_NAME}LldbFiles )
-endif()
-
 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
   add_custom_command( TARGET ${EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
                                                           $<$<CONFIG:Debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/TAppDecoderAnalyser>
diff --git a/source/App/TAppEncoder/CMakeLists.txt b/source/App/TAppEncoder/CMakeLists.txt
index a85bc6b33..ce1edb342 100644
--- a/source/App/TAppEncoder/CMakeLists.txt
+++ b/source/App/TAppEncoder/CMakeLists.txt
@@ -50,11 +50,6 @@ if( EXTENSION_360_VIDEO )
   target_link_libraries( ${EXE_NAME} Lib360 AppEncHelper360 )
 endif()
 
-# lldb custom data formatters
-if( XCODE )
-  add_dependencies( ${EXE_NAME} Install${PROJECT_NAME}LldbFiles )
-endif()
-
 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
   add_custom_command( TARGET ${EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
                                                           $<$<CONFIG:Debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/TAppEncoder>
diff --git a/source/App/TAppMCTSExtractor/CMakeLists.txt b/source/App/TAppMCTSExtractor/CMakeLists.txt
index 9b245b90c..3beb3ac41 100644
--- a/source/App/TAppMCTSExtractor/CMakeLists.txt
+++ b/source/App/TAppMCTSExtractor/CMakeLists.txt
@@ -44,11 +44,6 @@ endif()
 
 target_link_libraries( ${EXE_NAME} TLibCommon TLibEncoder TLibDecoder Utilities Threads::Threads ${ADDITIONAL_LIBS} )
 
-# lldb custom data formatters
-if( XCODE )
-  add_dependencies( ${EXE_NAME} Install${PROJECT_NAME}LldbFiles )
-endif()
-
 if( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
   add_custom_command( TARGET ${EXE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy
                                                           $<$<CONFIG:Debug>:${CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG}/MCTSExtractor>
-- 
GitLab