Commit 202487e8 authored by Karsten Suehring's avatar Karsten Suehring
Browse files

remove llvm formatters

Formatters were specific to Area class in NextSoftware/VTM and not needed for HM
parent accc6694
......@@ -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" )
......
# 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()
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' )
# 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 ...
#
# 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@ )
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment