The ElfImporter is not a real trace importer, but we locate it into the import-trace utility, since here the infrastructure is already in place to import things related to an elf binary into the database. The ElfImporter calls objdump and dissassembles an elf binary and imports the results into the database. Change-Id: I6e35673c8dbee3b7e8dfc7549d10e5dca9b55935
43 lines
1.0 KiB
CMake
43 lines
1.0 KiB
CMake
set(SRCS
|
|
Importer.cc
|
|
MemoryImporter.cc
|
|
)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
set(SRCS ${SRCS}
|
|
InstructionImporter.cc
|
|
RegisterImporter.cc
|
|
RandomJumpImporter.cc
|
|
AdvancedMemoryImporter.cc
|
|
ElfImporter.cc
|
|
)
|
|
|
|
include(FindLLVM)
|
|
|
|
# llvm-config does add -fno-exception to the command line. But this
|
|
# breaks some boost libraries.
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS} -fexceptions")
|
|
|
|
find_package(Boost 1.42 COMPONENTS regex REQUIRED)
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
link_directories(${Boost_LIBRARY_DIRS})
|
|
endif(BUILD_LLVM_DISASSEMBLER)
|
|
|
|
find_package(MySQL REQUIRED)
|
|
include_directories(${MYSQL_INCLUDE_DIR})
|
|
|
|
add_executable(import-trace main.cc ${SRCS})
|
|
|
|
target_link_libraries(import-trace
|
|
${PROTOBUF_LIBRARY}
|
|
${MYSQL_LIBRARIES}
|
|
fail-util
|
|
fail-comm
|
|
fail-sal)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
target_link_libraries(import-trace fail-llvmdisassembler fail-sal ${LLVM_LIBS} ${LLVM_LDFLAGS} ${Boost_LIBRARIES})
|
|
endif (BUILD_LLVM_DISASSEMBLER)
|
|
|
|
install(TARGETS import-trace RUNTIME DESTINATION bin)
|