Compare commits

..

1 Commits
master ... v0.6

Author SHA1 Message Date
Stefani Seibold
ea008608d1 bump to new version 2016-05-24 10:09:50 +02:00
109 changed files with 77738 additions and 1892 deletions

View File

@ -1,165 +0,0 @@
cmake_minimum_required(VERSION 3.5)
set(MT "mtrace-ng")
project(${MT} C)
set(MT_VERSION_STRING "0.8.2")
option(DISABLE_CLIENT "whether to disable client support" OFF)
set(default_build_type "Release")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose type of build" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "LTO")
endif()
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(${CMAKE_SOURCE_DIR}/Utilities.cmake)
SET(C_SRCS
breakpoint.c
common.c
debug.c
dict.c
dwarf.c
event.c
library.c
main.c
mtelf.c
options.c
rbtree.c
report.c
server.c
task.c
trace.c
)
include_directories(
"${PROJECT_BINARY_DIR}"
"${PROJECT_SOURCE_DIR}"
"${PROJECT_SOURCE_DIR}/sysdeps"
)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined -D__FORITFY_SOURCE=2 -rdynamic -DDEBUG")
set(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
set(CMAKE_C_FLAGS_LTO "${CMAKE_C_FLAGS_RELEASE} -flto")
set(CMAKE_EXE_LINKER_FLAGS_LTO "${CMAKE_LINKER_FLAGS_RELEASE} -flto")
add_compile_options(-Wall -Wextra)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7)
add_compile_options(-Wno-implicit-fallthrough)
endif()
if (NOT DISABLE_CLIENT)
SET(C_SRCS
${C_SRCS}
client/binfile.c
client/client.c
client/dump.c
client/job.c
client/process.c
client/readline.c
)
include_directories(
"${PROJECT_SOURCE_DIR}/client"
)
endif()
target_architecture(TARGET_ARCH)
if (TARGET_ARCH)
message(STATUS "target architecture is ${TARGET_ARCH}")
else()
message(FATAL_ERROR "unknown target architecture")
endif()
if (TARGET_ARCH MATCHES "x86|x86_64")
set(MT_CPU "x86")
elseif (TARGET_ARCH MATCHES "arm")
set(MT_CPU "arm")
elseif (TARGET_ARCH MATCHES "powerpc")
set(MT_CPU "ppc")
else()
message(FATAL_ERROR "unsuported target architecture: ${TARGET_ARCH}")
endif()
target_os(TARGET_OS)
if (TARGET_OS)
message(STATUS "target OS is ${TARGET_OS}")
else()
message(FATAL_ERROR "unknown target OS: ${TARGET_OS}")
endif()
if (TARGET_OS STREQUAL "linux")
set(MT_OS "linux-gnu")
else()
message(FATAL_ERROR "unsuported target os ${TARGET_OS}")
endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIB_ELF REQUIRED libelf)
find_and_test_library(LIB_PTHREAD pthread "pthread.h" "pthread_create")
set(CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
find_and_test_library(LIB_DL dl "dlfcn.h" dladdr)
unset(CMAKE_REQUIRED_DEFINITIONS)
find_and_test_library(LIB_RT rt "time.h" "clock_gettime")
if (NOT DISABLE_CLIENT)
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses REQUIRED)
find_and_test_library(LIB_READLINE readline "stdio.h;readline/readline.h" "rl_callback_read_char")
set(CMAKE_REQUIRED_DEFINITIONS "-DPACKAGE_VERSION=${MT_VERSION_STRING} -DPACKAGE=1")
find_library(LIB_BFD bfd)
if(NOT LIB_BFD)
message(FATAL_ERROR "libbfd not found.")
endif()
find_library(LIB_IBERTY iberty)
if(NOT LIB_IBERTY)
message(FATAL_ERROR "liberty not found.")
endif()
pkg_check_modules(LIB_ZLIB REQUIRED zlib)
CHECK_INCLUDE_FILES_ERROR("termcap.h" HAVE_TERMCAP_H)
endif()
check_function_exists(process_vm_readv HAVE_PROCESS_VM_READV)
configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
include(${CMAKE_SOURCE_DIR}/sysdeps/${MT_OS}/sysdeps.cmake)
if (LIB_ELF_INCLUDE_DIRS)
include_directories("${LIB_ELF_INCLUDE_DIRS}")
endif()
add_executable(${MT} ${C_SRCS})
target_link_libraries(${MT} ${LIB_ELF_LIBRARIES} ${LIB_PTHREAD} ${LIB_DL} ${LIB_RT} ${LIB_READLINE})
if(LIB_BFD)
target_compile_options(${MT} PRIVATE -DPACKAGE)
target_link_libraries(${MT} ${LIB_BFD} ${LIB_ZLIB_LIBRARIES} ${LIB_IBERTY})
endif()
target_compile_options(${MT} PUBLIC ${LIB_ELF_CFLAGS_OTHER})
install(TARGETS ${PROJECT_NAME} DESTINATION bin/)
install(FILES ${MT}.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc)
install(FILES ${MT}.conf.5 DESTINATION ${CMAKE_INSTALL_MANDIR}/man5 COMPONENT doc)
#echo_all_cmake_variable_values()

117
Makefile.am Normal file
View File

@ -0,0 +1,117 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
ACLOCAL_AMFLAGS = -I config/m4
SUBDIRS = sysdeps
if !DISABLE_CLIENT
SUBDIRS += client
endif
SUBDIRS += .
AM_CPPFLAGS += \
$(libelf_CFLAGS) \
-DSYSCONFDIR=\"$(sysconfdir)\"
AM_LDFLAGS += \
-Wl,--no-as-needed
mtrace_ng_SOURCES = \
breakpoint.c \
common.c \
debug.c \
dict.c \
dwarf.c \
event.c \
library.c \
main.c \
mtelf.c \
options.c \
rbtree.c \
report.c \
server.c \
task.c \
trace.c
mtrace_ng_LDADD = \
$(libelf_LIBS) \
sysdeps/libos.la
if !DISABLE_CLIENT
mtrace_ng_LDADD += libclient.la
endif
bin_PROGRAMS = \
mtrace-ng
noinst_HEADERS = \
backend.h \
backtrace.h \
breakpoint.h \
common.h \
debug.h \
dict.h \
dwarf.h \
event.h \
forward.h \
library.h \
list.h \
main.h \
mtelf.h \
mtrace.h \
options.h \
rbtree.h \
report.h \
task.h \
thread.h \
trace.h
dist_man1_MANS = mtrace-ng.1
dist_man5_MANS = mtrace-ng.conf.5
dist_doc_DATA = COPYING CREDITS INSTALL README TODO HOWTO
EXTRA_DIST =
MAINTAINERCLEANFILES = \
configure \
Makefile.in \
aclocal.m4 \
config.h.in \
config.h.in~ \
config/autoconf/compile \
config/autoconf/config.guess \
config/autoconf/config.sub \
config/autoconf/depcomp \
config/autoconf/install-sh \
config/autoconf/ltmain.sh \
config/autoconf/mdate-sh \
config/autoconf/missing \
config/autoconf/texinfo.tex \
libtool.m4 \
ltoptions.m4 \
ltsugar.m4 \
ltversion.m4 \
lt~obsolete.m4 \
$(DIST_ARCHIVES)
maintainer-clean-local:
-chmod -R a+rw $(distdir)
-rm -fr $(distdir)

1208
Makefile.in Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,131 +0,0 @@
function(target_architecture output_var)
set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM)
#error cmake_ARCH arm
#elif defined(__aarch64__) || defined(_M_ARM64)
#error cmake_ARCH aarch64
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH x86
#elif defined(__x86_64) || defined(x__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) || defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error cmake_ARCH ppc64
#else
#error cmake_ARCH ppc
#endif
#elif defined(__mips64)
#error cmake_ARCH mips64
#elif defined(__mips)
#error cmake_ARCH mips
#endif
#error cmake_ARCH unknown
")
set(F "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/_test_.c")
file(WRITE ${F} "${archdetect_c_code}")
enable_language(C)
try_run(
run_result_unused
compile_result_unused
"${CMAKE_BINARY_DIR}"
"${F}"
COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
file(REMOVE "${F}" "${osdetect_c_code}")
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
if (NOT ARCH)
set(ARCH unknown)
endif()
set(${output_var} "${ARCH}" PARENT_SCOPE)
endfunction()
function(target_os output_var)
set(osdetect_c_code "
#if defined(_WIN32) || defined(_WIN64)
#error cmake_OS windows
#elif defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
#error cmake_OS linux
#elif defined(__APPLE__) && defined(TARGET_OS_MAC)
#error cmake_OS osx
#elif defined(__unix__)
#error cmake_OS unix
#endif
#error cmake_ARCH unknown
")
set(F "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/_test_.c")
file(WRITE ${F} "${osdetect_c_code}")
enable_language(C)
try_run(
run_result_unused
compile_result_unused
"${CMAKE_BINARY_DIR}"
"${F}"
COMPILE_OUTPUT_VARIABLE OS
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
)
file(REMOVE "${F}" "${osdetect_c_code}")
string(REGEX MATCH "cmake_OS ([a-zA-Z0-9_]+)" OS "${OS}")
string(REPLACE "cmake_OS " "" OS "${OS}")
if (NOT OS)
set(OS unknown)
endif()
set(${output_var} "${OS}" PARENT_SCOPE)
endfunction()
macro(CHECK_INCLUDE_FILES_ERROR INCLUDE_FILES HAVE_FILE)
CHECK_INCLUDE_FILES("${INCLUDE_FILES}" ${HAVE_FILE})
IF(NOT ${HAVE_FILE})
message(FATAL_ERROR "${INCLUDE_FILE} not found")
ENDIF()
endmacro()
function(find_library_error VAR LIB)
find_library(${VAR} ${LIB})
IF (NOT ${VAR})
message(FATAL_ERROR "lib ${LIB} not found")
ENDIF()
endfunction()
function(find_and_test_library VAR LIB INCLUDES SYM)
find_library_error(${VAR} "${LIB}")
CHECK_INCLUDE_FILES_ERROR("${INCLUDES}" _HAVE_FILE)
set(CMAKE_REQUIRED_LIBRARIES "${${VAR}}")
set(HAVE_SYM "_HAVE_SYM_${SYM}")
check_symbol_exists("${SYM}" "${INCLUDES}" ${HAVE_SYM})
IF (NOT ${HAVE_SYM})
message(FATAL_ERROR "symbol ${SYM} not found in library ${LIB}")
endif()
endfunction()
function(echo_all_cmake_variable_values)
get_cmake_property(vs VARIABLES)
foreach(v ${vs})
message(STATUS "${v}='${${v}}'")
endforeach(v)
endfunction()

1193
aclocal.m4 vendored Normal file

File diff suppressed because it is too large Load Diff

15652
autom4te.cache/output.0 Normal file

File diff suppressed because it is too large Load Diff

15652
autom4te.cache/output.1 Normal file

File diff suppressed because it is too large Load Diff

15652
autom4te.cache/output.2 Normal file

File diff suppressed because it is too large Load Diff

522
autom4te.cache/requests Normal file
View File

@ -0,0 +1,522 @@
# This file was generated.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf-2.69'
],
[
'/usr/share/autoconf-2.69/autoconf/autoconf.m4f',
'-',
'/usr/share/aclocal-1.15/internal/ac-config-macro-dirs.m4',
'/usr/share/aclocal/libtool.m4',
'/usr/share/aclocal/ltargz.m4',
'/usr/share/aclocal/ltdl.m4',
'/usr/share/aclocal/ltoptions.m4',
'/usr/share/aclocal/ltsugar.m4',
'/usr/share/aclocal/ltversion.m4',
'/usr/share/aclocal/lt~obsolete.m4',
'/usr/share/aclocal-1.15/amversion.m4',
'/usr/share/aclocal-1.15/auxdir.m4',
'/usr/share/aclocal-1.15/cond.m4',
'/usr/share/aclocal-1.15/depend.m4',
'/usr/share/aclocal-1.15/depout.m4',
'/usr/share/aclocal-1.15/init.m4',
'/usr/share/aclocal-1.15/install-sh.m4',
'/usr/share/aclocal-1.15/lead-dot.m4',
'/usr/share/aclocal-1.15/maintainer.m4',
'/usr/share/aclocal-1.15/make.m4',
'/usr/share/aclocal-1.15/missing.m4',
'/usr/share/aclocal-1.15/options.m4',
'/usr/share/aclocal-1.15/prog-cc-c-o.m4',
'/usr/share/aclocal-1.15/runlog.m4',
'/usr/share/aclocal-1.15/sanity.m4',
'/usr/share/aclocal-1.15/silent.m4',
'/usr/share/aclocal-1.15/strip.m4',
'/usr/share/aclocal-1.15/substnot.m4',
'/usr/share/aclocal-1.15/tar.m4',
'configure.ac'
],
{
'AC_LTDL_SHLIBEXT' => 1,
'LT_AC_PROG_EGREP' => 1,
'AC_LIBTOOL_WIN32_DLL' => 1,
'_LT_DLL_DEF_P' => 1,
'AC_ENABLE_SHARED' => 1,
'_m4_warn' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
'LTDL_INSTALLABLE' => 1,
'LT_FUNC_ARGZ' => 1,
'AC_LIBTOOL_PROG_CC_C_O' => 1,
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
'AM_DISABLE_SHARED' => 1,
'LT_SYS_DLSEARCH_PATH' => 1,
'AC_LTDL_SHLIBPATH' => 1,
'AC_LTDL_SYSSEARCHPATH' => 1,
'LT_PATH_NM' => 1,
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
'LT_FUNC_DLSYM_USCORE' => 1,
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
'_LT_REQUIRED_DARWIN_CHECKS' => 1,
'AC_WITH_LTDL' => 1,
'_LT_LINKER_OPTION' => 1,
'_LT_AC_LANG_RC_CONFIG' => 1,
'LTOBSOLETE_VERSION' => 1,
'LT_LIB_DLLOAD' => 1,
'_LT_AC_TAGCONFIG' => 1,
'_LT_AC_TRY_DLOPEN_SELF' => 1,
'AC_PROG_NM' => 1,
'AM_SANITY_CHECK' => 1,
'_LT_AC_LANG_F77' => 1,
'LTSUGAR_VERSION' => 1,
'LT_SYS_DLOPEN_DEPLIBS' => 1,
'LT_PROG_RC' => 1,
'AC_LIBTOOL_RC' => 1,
'_LT_PROG_ECHO_BACKSLASH' => 1,
'_LT_AC_TAGVAR' => 1,
'AC_LTDL_SYMBOL_USCORE' => 1,
'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
'AC_LIBTOOL_COMPILER_OPTION' => 1,
'_LT_AC_LANG_GCJ_CONFIG' => 1,
'_LT_WITH_SYSROOT' => 1,
'AM_SILENT_RULES' => 1,
'_LT_COMPILER_BOILERPLATE' => 1,
'_LT_AC_CHECK_DLFCN' => 1,
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
'_AM_IF_OPTION' => 1,
'_LT_PROG_F77' => 1,
'LT_CMD_MAX_LEN' => 1,
'include' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_LTDL_OBJDIR' => 1,
'_AM_DEPENDENCIES' => 1,
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
'AC_LIB_LTDL' => 1,
'AC_PATH_TOOL_PREFIX' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'AC_CHECK_LIBM' => 1,
'LT_SYS_MODULE_PATH' => 1,
'AC_PROG_LD_RELOAD_FLAG' => 1,
'AM_RUN_LOG' => 1,
'AC_DISABLE_STATIC' => 1,
'AC_LIBTOOL_CONFIG' => 1,
'AC_LIBLTDL_INSTALLABLE' => 1,
'_AM_CONFIG_MACRO_DIRS' => 1,
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
'AC_LIBTOOL_SETUP' => 1,
'_LT_PROG_CXX' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_LTDL_DLSYM_USCORE' => 1,
'_LT_AC_SYS_LIBPATH_AIX' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'_LT_AC_LANG_CXX_CONFIG' => 1,
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
'_AM_PROG_CC_C_O' => 1,
'LTDL_INIT' => 1,
'_LT_AC_SYS_COMPILER' => 1,
'LT_PROG_GCJ' => 1,
'LT_WITH_LTDL' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'AM_DISABLE_STATIC' => 1,
'AM_PROG_NM' => 1,
'LT_PATH_LD' => 1,
'_LT_AC_SHELL_INIT' => 1,
'LT_SYS_MODULE_EXT' => 1,
'_LT_LINKER_BOILERPLATE' => 1,
'm4_pattern_forbid' => 1,
'AC_LIBTOOL_CXX' => 1,
'AC_DEPLIBS_CHECK_METHOD' => 1,
'LT_LANG' => 1,
'AC_CONFIG_MACRO_DIR' => 1,
'AU_DEFUN' => 1,
'AM_MAINTAINER_MODE' => 1,
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
'LT_PROG_GO' => 1,
'AM_ENABLE_STATIC' => 1,
'_AM_SET_OPTIONS' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
'_LT_AC_LANG_GCJ' => 1,
'AC_LIBTOOL_FC' => 1,
'AC_LIBTOOL_DLOPEN' => 1,
'_LT_AC_LANG_F77_CONFIG' => 1,
'AM_MISSING_PROG' => 1,
'_LT_AC_PROG_CXXCPP' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'AM_ENABLE_SHARED' => 1,
'_LT_COMPILER_OPTION' => 1,
'LT_INIT' => 1,
'LTOPTIONS_VERSION' => 1,
'AC_DISABLE_SHARED' => 1,
'AC_LIBTOOL_DLOPEN_SELF' => 1,
'AM_SUBST_NOTMAKE' => 1,
'_LT_AC_LANG_CXX' => 1,
'_LT_PROG_LTMAIN' => 1,
'AC_DEFUN' => 1,
'AM_DEP_TRACK' => 1,
'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
'_LT_PROG_FC' => 1,
'm4_include' => 1,
'LT_AC_PROG_SED' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AM_PROG_CC_C_O' => 1,
'LT_OUTPUT' => 1,
'AM_MAKE_INCLUDE' => 1,
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'_LT_LIBOBJ' => 1,
'AC_LTDL_ENABLE_INSTALL' => 1,
'AC_LIBTOOL_GCJ' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'LTVERSION_VERSION' => 1,
'LT_SYS_DLOPEN_SELF' => 1,
'AC_DISABLE_FAST_INSTALL' => 1,
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
'_LTDL_SETUP' => 1,
'LT_AC_PROG_RC' => 1,
'_AC_PROG_LIBTOOL' => 1,
'AM_PROG_LIBTOOL' => 1,
'_LT_PATH_TOOL_PREFIX' => 1,
'_LT_CC_BASENAME' => 1,
'_AM_MANGLE_OPTION' => 1,
'_AM_SET_OPTION' => 1,
'AC_ENABLE_STATIC' => 1,
'AC_PROG_LD_GNU' => 1,
'_AM_PROG_TAR' => 1,
'AM_MISSING_HAS_RUN' => 1,
'_LT_AC_LOCK' => 1,
'_LT_AC_LANG_C_CONFIG' => 1,
'AC_ENABLE_FAST_INSTALL' => 1,
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
'LT_LIB_M' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_LIBLTDL_CONVENIENCE' => 1,
'LT_AC_PROG_GCJ' => 1,
'AC_PROG_EGREP' => 1,
'AC_LIBTOOL_PICMODE' => 1,
'AC_LIBTOOL_LINKER_OPTION' => 1,
'AM_PROG_INSTALL_SH' => 1,
'LT_SYS_SYMBOL_USCORE' => 1,
'AC_LTDL_DLLIB' => 1,
'AM_CONDITIONAL' => 1,
'LTDL_CONVENIENCE' => 1,
'AC_DEFUN_ONCE' => 1,
'AM_SET_DEPDIR' => 1,
'AC_PROG_LD' => 1,
'AC_LTDL_PREOPEN' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'm4_pattern_allow' => 1,
'_LT_AC_FILE_LTDLL_C' => 1,
'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
'AM_PROG_LD' => 1,
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
'_LT_PREPARE_SED_QUOTE_VARS' => 1,
'AC_PATH_MAGIC' => 1,
'AC_LIBTOOL_F77' => 1,
'AC_LIBTOOL_OBJDIR' => 1,
'AM_SET_LEADING_DOT' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1
}
], 'Autom4te::Request' ),
bless( [
'1',
1,
[
'/usr/share/autoconf-2.69'
],
[
'/usr/share/autoconf-2.69/autoconf/autoconf.m4f',
'-',
'/usr/share/aclocal-1.15/internal/ac-config-macro-dirs.m4',
'/usr/share/aclocal/ltargz.m4',
'/usr/share/aclocal/ltdl.m4',
'/usr/share/aclocal-1.15/amversion.m4',
'/usr/share/aclocal-1.15/auxdir.m4',
'/usr/share/aclocal-1.15/cond.m4',
'/usr/share/aclocal-1.15/depend.m4',
'/usr/share/aclocal-1.15/depout.m4',
'/usr/share/aclocal-1.15/init.m4',
'/usr/share/aclocal-1.15/install-sh.m4',
'/usr/share/aclocal-1.15/lead-dot.m4',
'/usr/share/aclocal-1.15/maintainer.m4',
'/usr/share/aclocal-1.15/make.m4',
'/usr/share/aclocal-1.15/missing.m4',
'/usr/share/aclocal-1.15/options.m4',
'/usr/share/aclocal-1.15/prog-cc-c-o.m4',
'/usr/share/aclocal-1.15/runlog.m4',
'/usr/share/aclocal-1.15/sanity.m4',
'/usr/share/aclocal-1.15/silent.m4',
'/usr/share/aclocal-1.15/strip.m4',
'/usr/share/aclocal-1.15/substnot.m4',
'/usr/share/aclocal-1.15/tar.m4',
'config/m4/libtool.m4',
'config/m4/ltoptions.m4',
'config/m4/ltsugar.m4',
'config/m4/ltversion.m4',
'config/m4/lt~obsolete.m4',
'configure.ac'
],
{
'_AM_SET_OPTIONS' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_ENABLE_STATIC' => 1,
'LT_PROG_GO' => 1,
'AC_LIBTOOL_POSTDEP_PREDEP' => 1,
'AC_CONFIG_MACRO_DIR' => 1,
'AM_MAINTAINER_MODE' => 1,
'AU_DEFUN' => 1,
'AC_DEPLIBS_CHECK_METHOD' => 1,
'AC_LIBTOOL_CXX' => 1,
'LT_LANG' => 1,
'm4_pattern_forbid' => 1,
'LT_SYS_MODULE_EXT' => 1,
'_LT_LINKER_BOILERPLATE' => 1,
'LT_PATH_LD' => 1,
'_LT_AC_SHELL_INIT' => 1,
'AM_DISABLE_STATIC' => 1,
'AM_PROG_NM' => 1,
'AM_PROG_INSTALL_STRIP' => 1,
'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1,
'AM_MAKE_INCLUDE' => 1,
'LT_OUTPUT' => 1,
'_AC_AM_CONFIG_HEADER_HOOK' => 1,
'AM_PROG_CC_C_O' => 1,
'm4_include' => 1,
'_LT_PROG_FC' => 1,
'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1,
'LT_AC_PROG_SED' => 1,
'_LT_AC_LANG_CXX' => 1,
'AM_SUBST_NOTMAKE' => 1,
'_LT_PROG_LTMAIN' => 1,
'AM_DEP_TRACK' => 1,
'AC_DEFUN' => 1,
'LTOPTIONS_VERSION' => 1,
'AC_DISABLE_SHARED' => 1,
'AC_LIBTOOL_DLOPEN_SELF' => 1,
'LT_INIT' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'_LT_COMPILER_OPTION' => 1,
'AM_ENABLE_SHARED' => 1,
'_LT_AC_PROG_CXXCPP' => 1,
'AM_MISSING_PROG' => 1,
'AC_LIBTOOL_DLOPEN' => 1,
'_LT_AC_LANG_GCJ' => 1,
'AC_LIBTOOL_FC' => 1,
'_LT_AC_LANG_F77_CONFIG' => 1,
'AC_LIBTOOL_LANG_CXX_CONFIG' => 1,
'AC_ENABLE_FAST_INSTALL' => 1,
'_LT_AC_LANG_C_CONFIG' => 1,
'_LT_AC_LOCK' => 1,
'AM_MISSING_HAS_RUN' => 1,
'_AM_PROG_TAR' => 1,
'AC_PROG_LD_GNU' => 1,
'_AM_SET_OPTION' => 1,
'AC_ENABLE_STATIC' => 1,
'_AM_MANGLE_OPTION' => 1,
'_LT_CC_BASENAME' => 1,
'_LT_PATH_TOOL_PREFIX' => 1,
'AM_PROG_LIBTOOL' => 1,
'_AC_PROG_LIBTOOL' => 1,
'_LTDL_SETUP' => 1,
'AC_LIBTOOL_LANG_RC_CONFIG' => 1,
'LT_AC_PROG_RC' => 1,
'AC_DISABLE_FAST_INSTALL' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'LT_SYS_DLOPEN_SELF' => 1,
'LTVERSION_VERSION' => 1,
'_LT_LIBOBJ' => 1,
'AC_LTDL_ENABLE_INSTALL' => 1,
'AC_LIBTOOL_GCJ' => 1,
'_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AC_LIBTOOL_F77' => 1,
'AC_LIBTOOL_OBJDIR' => 1,
'AM_SET_LEADING_DOT' => 1,
'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1,
'AC_PATH_MAGIC' => 1,
'_LT_PREPARE_SED_QUOTE_VARS' => 1,
'_LT_AC_PROG_ECHO_BACKSLASH' => 1,
'AM_PROG_LD' => 1,
'_LT_AC_FILE_LTDLL_C' => 1,
'AC_LTDL_SYS_DLOPEN_DEPLIBS' => 1,
'AC_PROG_LD' => 1,
'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1,
'AC_LTDL_PREOPEN' => 1,
'm4_pattern_allow' => 1,
'AC_DEFUN_ONCE' => 1,
'AM_SET_DEPDIR' => 1,
'AM_CONDITIONAL' => 1,
'LT_SYS_SYMBOL_USCORE' => 1,
'AC_LTDL_DLLIB' => 1,
'LTDL_CONVENIENCE' => 1,
'AM_PROG_INSTALL_SH' => 1,
'AC_LIBTOOL_PICMODE' => 1,
'AC_LIBTOOL_LINKER_OPTION' => 1,
'AC_PROG_EGREP' => 1,
'AC_LIBTOOL_SYS_LIB_STRIP' => 1,
'AC_LIBLTDL_CONVENIENCE' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'LT_LIB_M' => 1,
'LT_AC_PROG_GCJ' => 1,
'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1,
'_LT_REQUIRED_DARWIN_CHECKS' => 1,
'AC_LIBTOOL_LANG_F77_CONFIG' => 1,
'LT_FUNC_DLSYM_USCORE' => 1,
'AC_LTDL_SYSSEARCHPATH' => 1,
'LT_PATH_NM' => 1,
'AC_LTDL_SHLIBPATH' => 1,
'AC_LIBTOOL_PROG_COMPILER_PIC' => 1,
'AM_DISABLE_SHARED' => 1,
'LT_SYS_DLSEARCH_PATH' => 1,
'LT_FUNC_ARGZ' => 1,
'AC_LIBTOOL_PROG_CC_C_O' => 1,
'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1,
'LTDL_INSTALLABLE' => 1,
'AM_INIT_AUTOMAKE' => 1,
'_LT_DLL_DEF_P' => 1,
'AC_ENABLE_SHARED' => 1,
'_m4_warn' => 1,
'AC_LTDL_SHLIBEXT' => 1,
'AC_LIBTOOL_WIN32_DLL' => 1,
'LT_AC_PROG_EGREP' => 1,
'_LT_AC_CHECK_DLFCN' => 1,
'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1,
'AC_LIBTOOL_COMPILER_OPTION' => 1,
'_LT_AC_LANG_GCJ_CONFIG' => 1,
'_LT_WITH_SYSROOT' => 1,
'_LT_COMPILER_BOILERPLATE' => 1,
'AM_SILENT_RULES' => 1,
'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1,
'AC_LTDL_SYMBOL_USCORE' => 1,
'_LT_AC_TAGVAR' => 1,
'AC_LIBTOOL_RC' => 1,
'_LT_PROG_ECHO_BACKSLASH' => 1,
'LT_PROG_RC' => 1,
'LT_SYS_DLOPEN_DEPLIBS' => 1,
'AM_SANITY_CHECK' => 1,
'_LT_AC_LANG_F77' => 1,
'LTSUGAR_VERSION' => 1,
'AC_PROG_NM' => 1,
'_LT_AC_TAGCONFIG' => 1,
'_LT_AC_TRY_DLOPEN_SELF' => 1,
'LT_LIB_DLLOAD' => 1,
'LTOBSOLETE_VERSION' => 1,
'AC_WITH_LTDL' => 1,
'_LT_LINKER_OPTION' => 1,
'_LT_AC_LANG_RC_CONFIG' => 1,
'AC_PROG_LD_RELOAD_FLAG' => 1,
'AC_CHECK_LIBM' => 1,
'LT_SYS_MODULE_PATH' => 1,
'AC_PATH_TOOL_PREFIX' => 1,
'AM_AUX_DIR_EXPAND' => 1,
'AC_LIB_LTDL' => 1,
'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1,
'_AM_DEPENDENCIES' => 1,
'AC_LTDL_OBJDIR' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'include' => 1,
'LT_CMD_MAX_LEN' => 1,
'AC_LIBTOOL_PROG_LD_SHLIBS' => 1,
'_AM_IF_OPTION' => 1,
'_LT_PROG_F77' => 1,
'LT_WITH_LTDL' => 1,
'LT_PROG_GCJ' => 1,
'_LT_AC_SYS_COMPILER' => 1,
'_LT_AC_LANG_CXX_CONFIG' => 1,
'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1,
'LTDL_INIT' => 1,
'_AM_PROG_CC_C_O' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'_LT_AC_SYS_LIBPATH_AIX' => 1,
'AC_LTDL_DLSYM_USCORE' => 1,
'_LT_PROG_CXX' => 1,
'AC_PROG_LIBTOOL' => 1,
'AC_LIBTOOL_SETUP' => 1,
'AC_LIBTOOL_LANG_C_CONFIG' => 1,
'AC_LIBTOOL_CONFIG' => 1,
'AC_LIBLTDL_INSTALLABLE' => 1,
'_AM_CONFIG_MACRO_DIRS' => 1,
'AC_DISABLE_STATIC' => 1,
'AM_RUN_LOG' => 1
}
], 'Autom4te::Request' ),
bless( [
'2',
1,
[
'/usr/share/autoconf-2.69'
],
[
'/usr/share/autoconf-2.69/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.ac'
],
{
'AM_MAINTAINER_MODE' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_CONFIG_HEADERS' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AC_LIBSOURCE' => 1,
'AC_CANONICAL_TARGET' => 1,
'AC_INIT' => 1,
'AC_CONFIG_FILES' => 1,
'LT_SUPPORTED_TAG' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'include' => 1,
'AM_NLS' => 1,
'AM_PROG_MOC' => 1,
'AM_PROG_FC_C_O' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PATH_GUILE' => 1,
'AM_POT_TOOLS' => 1,
'm4_sinclude' => 1,
'_m4_warn' => 1,
'AM_PROG_AR' => 1,
'AC_SUBST' => 1,
'AC_FC_SRCEXT' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'_AM_COND_IF' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AM_XGETTEXT_OPTION' => 1,
'sinclude' => 1,
'AM_GNU_GETTEXT' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'm4_pattern_forbid' => 1,
'AC_FC_FREEFORM' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AM_PROG_CXX_C_O' => 1,
'AC_SUBST_TRACE' => 1,
'AM_PROG_CC_C_O' => 1,
'AH_OUTPUT' => 1,
'm4_include' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_CONFIG_LINKS' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AM_PROG_MKDIR_P' => 1,
'AM_SILENT_RULES' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'_AM_COND_ENDIF' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AM_EXTRA_RECURSIVE_TARGETS' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'_LT_AC_TAGCONFIG' => 1,
'AC_FC_PP_DEFINE' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AC_CANONICAL_HOST' => 1,
'AM_PROG_F77_C_O' => 1,
'AM_CONDITIONAL' => 1,
'LT_INIT' => 1,
'_AM_COND_ELSE' => 1,
'AC_PROG_LIBTOOL' => 1,
'm4_pattern_allow' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1
}
], 'Autom4te::Request' )
);

2764
autom4te.cache/traces.0 Normal file

File diff suppressed because it is too large Load Diff

2764
autom4te.cache/traces.1 Normal file

File diff suppressed because it is too large Load Diff

733
autom4te.cache/traces.2 Normal file
View File

@ -0,0 +1,733 @@
m4trace:aclocal.m4:1189: -1- m4_include([config/m4/libtool.m4])
m4trace:aclocal.m4:1190: -1- m4_include([config/m4/ltoptions.m4])
m4trace:aclocal.m4:1191: -1- m4_include([config/m4/ltsugar.m4])
m4trace:aclocal.m4:1192: -1- m4_include([config/m4/ltversion.m4])
m4trace:aclocal.m4:1193: -1- m4_include([config/m4/lt~obsolete.m4])
m4trace:configure.ac:27: -1- AC_INIT([mtrace-ng], [0.6], [stefani@seibold.net])
m4trace:configure.ac:27: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:27: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:27: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:27: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:27: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:27: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:27: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:27: -1- AC_SUBST([SHELL])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:27: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:27: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:27: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:27: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:27: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:27: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:27: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:27: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:27: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:27: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:27: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:27: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:27: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:27: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:27: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:27: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:27: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:27: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:27: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:27: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:27: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:27: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:27: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:27: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:27: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:27: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:27: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:27: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:27: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:27: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:27: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:27: -1- AC_SUBST([DEFS])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:27: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:27: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:27: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:27: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:27: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:27: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:27: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:27: -1- AC_SUBST([LIBS])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:27: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:27: -1- AC_SUBST([build_alias])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:27: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:27: -1- AC_SUBST([host_alias])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:27: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:27: -1- AC_SUBST([target_alias])
m4trace:configure.ac:27: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:27: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:28: -1- AC_CONFIG_HEADERS([config.h])
m4trace:configure.ac:31: -1- AC_CONFIG_AUX_DIR([config/autoconf])
m4trace:configure.ac:32: -1- AC_CANONICAL_BUILD
m4trace:configure.ac:32: -1- AC_REQUIRE_AUX_FILE([config.sub])
m4trace:configure.ac:32: -1- AC_REQUIRE_AUX_FILE([config.guess])
m4trace:configure.ac:32: -1- AC_SUBST([build], [$ac_cv_build])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([build])
m4trace:configure.ac:32: -1- m4_pattern_allow([^build$])
m4trace:configure.ac:32: -1- AC_SUBST([build_cpu], [$[1]])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([build_cpu])
m4trace:configure.ac:32: -1- m4_pattern_allow([^build_cpu$])
m4trace:configure.ac:32: -1- AC_SUBST([build_vendor], [$[2]])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([build_vendor])
m4trace:configure.ac:32: -1- m4_pattern_allow([^build_vendor$])
m4trace:configure.ac:32: -1- AC_SUBST([build_os])
m4trace:configure.ac:32: -1- AC_SUBST_TRACE([build_os])
m4trace:configure.ac:32: -1- m4_pattern_allow([^build_os$])
m4trace:configure.ac:33: -1- AC_CANONICAL_HOST
m4trace:configure.ac:33: -1- AC_SUBST([host], [$ac_cv_host])
m4trace:configure.ac:33: -1- AC_SUBST_TRACE([host])
m4trace:configure.ac:33: -1- m4_pattern_allow([^host$])
m4trace:configure.ac:33: -1- AC_SUBST([host_cpu], [$[1]])
m4trace:configure.ac:33: -1- AC_SUBST_TRACE([host_cpu])
m4trace:configure.ac:33: -1- m4_pattern_allow([^host_cpu$])
m4trace:configure.ac:33: -1- AC_SUBST([host_vendor], [$[2]])
m4trace:configure.ac:33: -1- AC_SUBST_TRACE([host_vendor])
m4trace:configure.ac:33: -1- m4_pattern_allow([^host_vendor$])
m4trace:configure.ac:33: -1- AC_SUBST([host_os])
m4trace:configure.ac:33: -1- AC_SUBST_TRACE([host_os])
m4trace:configure.ac:33: -1- m4_pattern_allow([^host_os$])
m4trace:configure.ac:40: -1- AC_SUBST([HOST_OS])
m4trace:configure.ac:40: -1- AC_SUBST_TRACE([HOST_OS])
m4trace:configure.ac:40: -1- m4_pattern_allow([^HOST_OS$])
m4trace:configure.ac:52: -1- AC_SUBST([HOST_CPU])
m4trace:configure.ac:52: -1- AC_SUBST_TRACE([HOST_CPU])
m4trace:configure.ac:52: -1- m4_pattern_allow([^HOST_CPU$])
m4trace:configure.ac:55: -1- AC_SUBST([CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:55: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:55: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:55: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:55: -1- AC_SUBST([LIBS])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:55: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:55: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:55: -1- AC_SUBST([CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:55: -1- AC_SUBST([CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:55: -1- AC_SUBST([CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:55: -1- AC_SUBST([CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:55: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:55: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:55: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:55: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:55: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:55: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:55: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:55: -1- AC_REQUIRE_AUX_FILE([compile])
m4trace:configure.ac:56: -1- LT_INIT
m4trace:configure.ac:56: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$])
m4trace:configure.ac:56: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])
m4trace:configure.ac:56: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])
m4trace:configure.ac:56: -1- AC_SUBST([LIBTOOL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([LIBTOOL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LIBTOOL$])
m4trace:configure.ac:56: -1- AC_SUBST([SED])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([SED])
m4trace:configure.ac:56: -1- m4_pattern_allow([^SED$])
m4trace:configure.ac:56: -1- AC_SUBST([GREP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:56: -1- AC_SUBST([EGREP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([EGREP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^EGREP$])
m4trace:configure.ac:56: -1- AC_SUBST([FGREP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([FGREP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^FGREP$])
m4trace:configure.ac:56: -1- AC_SUBST([GREP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([GREP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^GREP$])
m4trace:configure.ac:56: -1- AC_SUBST([LD])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([LD])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LD$])
m4trace:configure.ac:56: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:56: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:56: -1- AC_SUBST([ac_ct_DUMPBIN])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN])
m4trace:configure.ac:56: -1- m4_pattern_allow([^ac_ct_DUMPBIN$])
m4trace:configure.ac:56: -1- AC_SUBST([DUMPBIN])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([DUMPBIN])
m4trace:configure.ac:56: -1- m4_pattern_allow([^DUMPBIN$])
m4trace:configure.ac:56: -1- AC_SUBST([NM])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([NM])
m4trace:configure.ac:56: -1- m4_pattern_allow([^NM$])
m4trace:configure.ac:56: -1- AC_SUBST([LN_S], [$as_ln_s])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([LN_S])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LN_S$])
m4trace:configure.ac:56: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:56: -1- AC_SUBST([OBJDUMP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([OBJDUMP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^OBJDUMP$])
m4trace:configure.ac:56: -1- AC_SUBST([DLLTOOL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([DLLTOOL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^DLLTOOL$])
m4trace:configure.ac:56: -1- AC_SUBST([DLLTOOL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([DLLTOOL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^DLLTOOL$])
m4trace:configure.ac:56: -1- AC_SUBST([AR])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:56: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:56: -1- AC_SUBST([ac_ct_AR])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([ac_ct_AR])
m4trace:configure.ac:56: -1- m4_pattern_allow([^ac_ct_AR$])
m4trace:configure.ac:56: -1- AC_SUBST([STRIP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:56: -1- AC_SUBST([RANLIB])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([RANLIB])
m4trace:configure.ac:56: -1- m4_pattern_allow([^RANLIB$])
m4trace:configure.ac:56: -1- AC_SUBST([AWK])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([AWK])
m4trace:configure.ac:56: -1- m4_pattern_allow([^AWK$])
m4trace:configure.ac:56: -1- m4_pattern_allow([LT_OBJDIR])
m4trace:configure.ac:56: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LT_OBJDIR$])
m4trace:configure.ac:56: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory where libtool stores uninstalled libraries. */
@%:@undef LT_OBJDIR])
m4trace:configure.ac:56: -1- LT_SUPPORTED_TAG([CC])
m4trace:configure.ac:56: -1- AC_SUBST([MANIFEST_TOOL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([MANIFEST_TOOL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^MANIFEST_TOOL$])
m4trace:configure.ac:56: -1- AC_SUBST([DSYMUTIL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([DSYMUTIL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^DSYMUTIL$])
m4trace:configure.ac:56: -1- AC_SUBST([NMEDIT])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([NMEDIT])
m4trace:configure.ac:56: -1- m4_pattern_allow([^NMEDIT$])
m4trace:configure.ac:56: -1- AC_SUBST([LIPO])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([LIPO])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LIPO$])
m4trace:configure.ac:56: -1- AC_SUBST([OTOOL])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([OTOOL])
m4trace:configure.ac:56: -1- m4_pattern_allow([^OTOOL$])
m4trace:configure.ac:56: -1- AC_SUBST([OTOOL64])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([OTOOL64])
m4trace:configure.ac:56: -1- m4_pattern_allow([^OTOOL64$])
m4trace:configure.ac:56: -1- AC_SUBST([LT_SYS_LIBRARY_PATH])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([LT_SYS_LIBRARY_PATH])
m4trace:configure.ac:56: -1- m4_pattern_allow([^LT_SYS_LIBRARY_PATH$])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
m4trace:configure.ac:56: -1- AC_SUBST([CPP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:56: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:56: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:56: -1- AC_SUBST([CPP])
m4trace:configure.ac:56: -1- AC_SUBST_TRACE([CPP])
m4trace:configure.ac:56: -1- m4_pattern_allow([^CPP$])
m4trace:configure.ac:56: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
m4trace:configure.ac:56: -1- m4_pattern_allow([^STDC_HEADERS$])
m4trace:configure.ac:56: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
@%:@undef STDC_HEADERS])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
@%:@undef HAVE_SYS_TYPES_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
@%:@undef HAVE_SYS_STAT_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
@%:@undef HAVE_MEMORY_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
@%:@undef HAVE_STRINGS_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
@%:@undef HAVE_INTTYPES_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
m4trace:configure.ac:56: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:56: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:56: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
m4trace:configure.ac:58: -1- AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$])
m4trace:configure.ac:58: -1- AM_AUTOMAKE_VERSION([1.15])
m4trace:configure.ac:58: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:58: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
m4trace:configure.ac:58: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:58: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
m4trace:configure.ac:58: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:58: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([INSTALL_DATA])
m4trace:configure.ac:58: -1- m4_pattern_allow([^INSTALL_DATA$])
m4trace:configure.ac:58: -1- AC_SUBST([am__isrc], [' -I$(srcdir)'])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__isrc])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__isrc$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([am__isrc])
m4trace:configure.ac:58: -1- AC_SUBST([CYGPATH_W])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([CYGPATH_W])
m4trace:configure.ac:58: -1- m4_pattern_allow([^CYGPATH_W$])
m4trace:configure.ac:58: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([PACKAGE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:58: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([VERSION])
m4trace:configure.ac:58: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:58: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^PACKAGE$])
m4trace:configure.ac:58: -1- AH_OUTPUT([PACKAGE], [/* Name of package */
@%:@undef PACKAGE])
m4trace:configure.ac:58: -1- AC_DEFINE_TRACE_LITERAL([VERSION])
m4trace:configure.ac:58: -1- m4_pattern_allow([^VERSION$])
m4trace:configure.ac:58: -1- AH_OUTPUT([VERSION], [/* Version number of package */
@%:@undef VERSION])
m4trace:configure.ac:58: -1- AC_REQUIRE_AUX_FILE([missing])
m4trace:configure.ac:58: -1- AC_SUBST([ACLOCAL])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([ACLOCAL])
m4trace:configure.ac:58: -1- m4_pattern_allow([^ACLOCAL$])
m4trace:configure.ac:58: -1- AC_SUBST([AUTOCONF])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AUTOCONF])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AUTOCONF$])
m4trace:configure.ac:58: -1- AC_SUBST([AUTOMAKE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AUTOMAKE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AUTOMAKE$])
m4trace:configure.ac:58: -1- AC_SUBST([AUTOHEADER])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AUTOHEADER])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AUTOHEADER$])
m4trace:configure.ac:58: -1- AC_SUBST([MAKEINFO])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([MAKEINFO])
m4trace:configure.ac:58: -1- m4_pattern_allow([^MAKEINFO$])
m4trace:configure.ac:58: -1- AC_SUBST([install_sh])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([install_sh])
m4trace:configure.ac:58: -1- m4_pattern_allow([^install_sh$])
m4trace:configure.ac:58: -1- AC_SUBST([STRIP])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:58: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:58: -1- AC_SUBST([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM])
m4trace:configure.ac:58: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$])
m4trace:configure.ac:58: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:58: -1- AC_SUBST([MKDIR_P])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:58: -1- m4_pattern_allow([^MKDIR_P$])
m4trace:configure.ac:58: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([mkdir_p])
m4trace:configure.ac:58: -1- m4_pattern_allow([^mkdir_p$])
m4trace:configure.ac:58: -1- AC_SUBST([SET_MAKE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([SET_MAKE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^SET_MAKE$])
m4trace:configure.ac:58: -1- AC_SUBST([am__leading_dot])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__leading_dot])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__leading_dot$])
m4trace:configure.ac:58: -1- AC_SUBST([AMTAR], ['$${TAR-tar}'])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AMTAR])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AMTAR$])
m4trace:configure.ac:58: -1- AC_SUBST([am__tar])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__tar])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__tar$])
m4trace:configure.ac:58: -1- AC_SUBST([am__untar])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__untar])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__untar$])
m4trace:configure.ac:58: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([DEPDIR])
m4trace:configure.ac:58: -1- m4_pattern_allow([^DEPDIR$])
m4trace:configure.ac:58: -1- AC_SUBST([am__include])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__include])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__include$])
m4trace:configure.ac:58: -1- AC_SUBST([am__quote])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__quote])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__quote$])
m4trace:configure.ac:58: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
m4trace:configure.ac:58: -1- AC_SUBST([AMDEP_TRUE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AMDEP_TRUE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AMDEP_TRUE$])
m4trace:configure.ac:58: -1- AC_SUBST([AMDEP_FALSE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AMDEP_FALSE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AMDEP_FALSE$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE])
m4trace:configure.ac:58: -1- AC_SUBST([AMDEPBACKSLASH])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AMDEPBACKSLASH])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AMDEPBACKSLASH$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])
m4trace:configure.ac:58: -1- AC_SUBST([am__nodep])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__nodep])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__nodep$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([am__nodep])
m4trace:configure.ac:58: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([CCDEPMODE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^CCDEPMODE$])
m4trace:configure.ac:58: -1- AM_CONDITIONAL([am__fastdepCC], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3])
m4trace:configure.ac:58: -1- AC_SUBST([am__fastdepCC_TRUE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__fastdepCC_TRUE$])
m4trace:configure.ac:58: -1- AC_SUBST([am__fastdepCC_FALSE])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE])
m4trace:configure.ac:58: -1- m4_pattern_allow([^am__fastdepCC_FALSE$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE])
m4trace:configure.ac:58: -1- AM_SILENT_RULES
m4trace:configure.ac:58: -1- AC_SUBST([AM_V])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AM_V])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AM_V$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AM_V])
m4trace:configure.ac:58: -1- AC_SUBST([AM_DEFAULT_V])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AM_DEFAULT_V])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AM_DEFAULT_V$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V])
m4trace:configure.ac:58: -1- AC_SUBST([AM_DEFAULT_VERBOSITY])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$])
m4trace:configure.ac:58: -1- AC_SUBST([AM_BACKSLASH])
m4trace:configure.ac:58: -1- AC_SUBST_TRACE([AM_BACKSLASH])
m4trace:configure.ac:58: -1- m4_pattern_allow([^AM_BACKSLASH$])
m4trace:configure.ac:58: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH])
m4trace:configure.ac:59: -1- AM_MAINTAINER_MODE
m4trace:configure.ac:59: -1- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
m4trace:configure.ac:59: -1- AC_SUBST([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:59: -1- AC_SUBST_TRACE([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:59: -1- m4_pattern_allow([^MAINTAINER_MODE_TRUE$])
m4trace:configure.ac:59: -1- AC_SUBST([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:59: -1- AC_SUBST_TRACE([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:59: -1- m4_pattern_allow([^MAINTAINER_MODE_FALSE$])
m4trace:configure.ac:59: -1- _AM_SUBST_NOTMAKE([MAINTAINER_MODE_TRUE])
m4trace:configure.ac:59: -1- _AM_SUBST_NOTMAKE([MAINTAINER_MODE_FALSE])
m4trace:configure.ac:59: -1- AC_SUBST([MAINT])
m4trace:configure.ac:59: -1- AC_SUBST_TRACE([MAINT])
m4trace:configure.ac:59: -1- m4_pattern_allow([^MAINT$])
m4trace:configure.ac:72: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_CLIENT])
m4trace:configure.ac:72: -1- m4_pattern_allow([^DISABLE_CLIENT$])
m4trace:configure.ac:72: -1- AH_OUTPUT([DISABLE_CLIENT], [/* disable client */
@%:@undef DISABLE_CLIENT])
m4trace:configure.ac:74: -1- AM_CONDITIONAL([DISABLE_CLIENT], [test "${CONFIG_DISABLE_CLIENT}" = "yes"])
m4trace:configure.ac:74: -1- AC_SUBST([DISABLE_CLIENT_TRUE])
m4trace:configure.ac:74: -1- AC_SUBST_TRACE([DISABLE_CLIENT_TRUE])
m4trace:configure.ac:74: -1- m4_pattern_allow([^DISABLE_CLIENT_TRUE$])
m4trace:configure.ac:74: -1- AC_SUBST([DISABLE_CLIENT_FALSE])
m4trace:configure.ac:74: -1- AC_SUBST_TRACE([DISABLE_CLIENT_FALSE])
m4trace:configure.ac:74: -1- m4_pattern_allow([^DISABLE_CLIENT_FALSE$])
m4trace:configure.ac:74: -1- _AM_SUBST_NOTMAKE([DISABLE_CLIENT_TRUE])
m4trace:configure.ac:74: -1- _AM_SUBST_NOTMAKE([DISABLE_CLIENT_FALSE])
m4trace:configure.ac:101: -1- AH_OUTPUT([HAVE_ELF_H], [/* Define to 1 if you have the <elf.h> header file. */
@%:@undef HAVE_ELF_H])
m4trace:configure.ac:101: -1- AH_OUTPUT([HAVE_GELF_H], [/* Define to 1 if you have the <gelf.h> header file. */
@%:@undef HAVE_GELF_H])
m4trace:configure.ac:104: -1- AH_OUTPUT([HAVE_LIBELF], [/* Define to 1 if you have the `elf\' library (-lelf). */
@%:@undef HAVE_LIBELF])
m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBELF])
m4trace:configure.ac:104: -1- m4_pattern_allow([^HAVE_LIBELF$])
m4trace:configure.ac:112: -1- AH_OUTPUT([HAVE_READLINE_READLINE_H], [/* Define to 1 if you have the <readline/readline.h> header file. */
@%:@undef HAVE_READLINE_READLINE_H])
m4trace:configure.ac:112: -1- AC_DEFINE_TRACE_LITERAL([HAVE_READLINE_READLINE_H])
m4trace:configure.ac:112: -1- m4_pattern_allow([^HAVE_READLINE_READLINE_H$])
m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_LIBREADLINE], [/* Define to 1 if you have the `readline\' library (-lreadline). */
@%:@undef HAVE_LIBREADLINE])
m4trace:configure.ac:115: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBREADLINE])
m4trace:configure.ac:115: -1- m4_pattern_allow([^HAVE_LIBREADLINE$])
m4trace:configure.ac:122: -1- AH_OUTPUT([HAVE_BFD_H], [/* Define to 1 if you have the <bfd.h> header file. */
@%:@undef HAVE_BFD_H])
m4trace:configure.ac:122: -1- AC_DEFINE_TRACE_LITERAL([HAVE_BFD_H])
m4trace:configure.ac:122: -1- m4_pattern_allow([^HAVE_BFD_H$])
m4trace:configure.ac:125: -1- AH_OUTPUT([HAVE_LIBBFD], [/* Define to 1 if you have the `bfd\' library (-lbfd). */
@%:@undef HAVE_LIBBFD])
m4trace:configure.ac:125: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBBFD])
m4trace:configure.ac:125: -1- m4_pattern_allow([^HAVE_LIBBFD$])
m4trace:configure.ac:131: -1- AH_OUTPUT([HAVE_PTHREAD_H], [/* Define to 1 if you have the <pthread.h> header file. */
@%:@undef HAVE_PTHREAD_H])
m4trace:configure.ac:131: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PTHREAD_H])
m4trace:configure.ac:131: -1- m4_pattern_allow([^HAVE_PTHREAD_H$])
m4trace:configure.ac:134: -1- AH_OUTPUT([HAVE_LIBPTHREAD], [/* Define to 1 if you have the `pthread\' library (-lpthread). */
@%:@undef HAVE_LIBPTHREAD])
m4trace:configure.ac:134: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBPTHREAD])
m4trace:configure.ac:134: -1- m4_pattern_allow([^HAVE_LIBPTHREAD$])
m4trace:configure.ac:139: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the <dlfcn.h> header file. */
@%:@undef HAVE_DLFCN_H])
m4trace:configure.ac:139: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DLFCN_H])
m4trace:configure.ac:139: -1- m4_pattern_allow([^HAVE_DLFCN_H$])
m4trace:configure.ac:142: -1- AH_OUTPUT([HAVE_LIBDL], [/* Define to 1 if you have the `dl\' library (-ldl). */
@%:@undef HAVE_LIBDL])
m4trace:configure.ac:142: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDL])
m4trace:configure.ac:142: -1- m4_pattern_allow([^HAVE_LIBDL$])
m4trace:configure.ac:150: -1- AH_OUTPUT([HAVE_LIBTERMCAP], [/* Define to 1 if you have the `termcap\' library (-ltermcap). */
@%:@undef HAVE_LIBTERMCAP])
m4trace:configure.ac:150: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBTERMCAP])
m4trace:configure.ac:150: -1- m4_pattern_allow([^HAVE_LIBTERMCAP$])
m4trace:configure.ac:155: -1- AH_OUTPUT([HAVE_SELINUX_SELINUX_H], [/* Define to 1 if you have the <selinux/selinux.h> header file. */
@%:@undef HAVE_SELINUX_SELINUX_H])
m4trace:configure.ac:155: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SELINUX_SELINUX_H])
m4trace:configure.ac:155: -1- m4_pattern_allow([^HAVE_SELINUX_SELINUX_H$])
m4trace:configure.ac:156: -1- AH_OUTPUT([HAVE_LIBSELINUX], [/* Define to 1 if you have the `selinux\' library (-lselinux). */
@%:@undef HAVE_LIBSELINUX])
m4trace:configure.ac:156: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSELINUX])
m4trace:configure.ac:156: -1- m4_pattern_allow([^HAVE_LIBSELINUX$])
m4trace:configure.ac:165: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ELF_C_READ_MMAP])
m4trace:configure.ac:165: -1- m4_pattern_allow([^HAVE_ELF_C_READ_MMAP$])
m4trace:configure.ac:165: -1- AH_OUTPUT([HAVE_ELF_C_READ_MMAP], [/* we have read mmap support */
@%:@undef HAVE_ELF_C_READ_MMAP])
m4trace:configure.ac:180: -1- AC_DEFINE_TRACE_LITERAL([ELF_HASH_TAKES_CHARP])
m4trace:configure.ac:180: -1- m4_pattern_allow([^ELF_HASH_TAKES_CHARP$])
m4trace:configure.ac:180: -1- AH_OUTPUT([ELF_HASH_TAKES_CHARP], [/* elf_hash() takes char* (as opposed to unsigned char *) */
@%:@undef ELF_HASH_TAKES_CHARP])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the <fcntl.h> header file. */
@%:@undef HAVE_FCNTL_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the <limits.h> header file. */
@%:@undef HAVE_LIMITS_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_STDDEF_H], [/* Define to 1 if you have the <stddef.h> header file. */
@%:@undef HAVE_STDDEF_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
@%:@undef HAVE_STDINT_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
@%:@undef HAVE_STDLIB_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
@%:@undef HAVE_STRING_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_SYS_IOCTL_H], [/* Define to 1 if you have the <sys/ioctl.h> header file. */
@%:@undef HAVE_SYS_IOCTL_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the <sys/param.h> header file. */
@%:@undef HAVE_SYS_PARAM_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the <sys/time.h> header file. */
@%:@undef HAVE_SYS_TIME_H])
m4trace:configure.ac:201: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
@%:@undef HAVE_UNISTD_H])
m4trace:configure.ac:215: -1- AC_DEFINE_TRACE_LITERAL([uid_t])
m4trace:configure.ac:215: -1- m4_pattern_allow([^uid_t$])
m4trace:configure.ac:215: -1- AH_OUTPUT([uid_t], [/* Define to `int\' if <sys/types.h> doesn\'t define. */
@%:@undef uid_t])
m4trace:configure.ac:215: -1- AC_DEFINE_TRACE_LITERAL([gid_t])
m4trace:configure.ac:215: -1- m4_pattern_allow([^gid_t$])
m4trace:configure.ac:215: -1- AH_OUTPUT([gid_t], [/* Define to `int\' if <sys/types.h> doesn\'t define. */
@%:@undef gid_t])
m4trace:configure.ac:216: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler
calls it, or to nothing if \'inline\' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif])
m4trace:configure.ac:217: -1- AC_DEFINE_TRACE_LITERAL([pid_t])
m4trace:configure.ac:217: -1- m4_pattern_allow([^pid_t$])
m4trace:configure.ac:217: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if <sys/types.h> does not define. */
@%:@undef pid_t])
m4trace:configure.ac:218: -1- AC_DEFINE_TRACE_LITERAL([size_t])
m4trace:configure.ac:218: -1- m4_pattern_allow([^size_t$])
m4trace:configure.ac:218: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if <sys/types.h> does not define. */
@%:@undef size_t])
m4trace:configure.ac:219: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG])
m4trace:configure.ac:219: -1- m4_pattern_allow([^SIZEOF_LONG$])
m4trace:configure.ac:219: -1- AH_OUTPUT([SIZEOF_LONG], [/* The size of `long\', as computed by sizeof. */
@%:@undef SIZEOF_LONG])
m4trace:configure.ac:223: -1- AC_LIBSOURCE([error.h])
m4trace:configure.ac:223: -1- AC_LIBSOURCE([error.c])
m4trace:configure.ac:223: -1- AC_SUBST([LIB@&t@OBJS], ["$LIB@&t@OBJS error.$ac_objext"])
m4trace:configure.ac:223: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:223: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:223: -1- AC_LIBSOURCE([error.c])
m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_VFORK_H], [/* Define to 1 if you have the <vfork.h> header file. */
@%:@undef HAVE_VFORK_H])
m4trace:configure.ac:224: -1- AC_DEFINE_TRACE_LITERAL([HAVE_VFORK_H])
m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_VFORK_H$])
m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_FORK], [/* Define to 1 if you have the `fork\' function. */
@%:@undef HAVE_FORK])
m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_VFORK], [/* Define to 1 if you have the `vfork\' function. */
@%:@undef HAVE_VFORK])
m4trace:configure.ac:224: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_VFORK])
m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_WORKING_VFORK$])
m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_WORKING_VFORK], [/* Define to 1 if `vfork\' works. */
@%:@undef HAVE_WORKING_VFORK])
m4trace:configure.ac:224: -1- AC_DEFINE_TRACE_LITERAL([vfork])
m4trace:configure.ac:224: -1- m4_pattern_allow([^vfork$])
m4trace:configure.ac:224: -1- AH_OUTPUT([vfork], [/* Define as `fork\' if `vfork\' does not work. */
@%:@undef vfork])
m4trace:configure.ac:224: -1- AC_DEFINE_TRACE_LITERAL([HAVE_WORKING_FORK])
m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_WORKING_FORK$])
m4trace:configure.ac:224: -1- AH_OUTPUT([HAVE_WORKING_FORK], [/* Define to 1 if `fork\' works. */
@%:@undef HAVE_WORKING_FORK])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_ALARM], [/* Define to 1 if you have the `alarm\' function. */
@%:@undef HAVE_ALARM])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_ATEXIT], [/* Define to 1 if you have the `atexit\' function. */
@%:@undef HAVE_ATEXIT])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the `getcwd\' function. */
@%:@undef HAVE_GETCWD])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */
@%:@undef HAVE_GETTIMEOFDAY])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_CLOCK_GETTIME], [/* Define to 1 if you have the `clock_gettime\' function. */
@%:@undef HAVE_CLOCK_GETTIME])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */
@%:@undef HAVE_MEMSET])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_MKDIR], [/* Define to 1 if you have the `mkdir\' function. */
@%:@undef HAVE_MKDIR])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_RMDIR], [/* Define to 1 if you have the `rmdir\' function. */
@%:@undef HAVE_RMDIR])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRCHR], [/* Define to 1 if you have the `strchr\' function. */
@%:@undef HAVE_STRCHR])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRDUP], [/* Define to 1 if you have the `strdup\' function. */
@%:@undef HAVE_STRDUP])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the `strerror\' function. */
@%:@undef HAVE_STRERROR])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRTOL], [/* Define to 1 if you have the `strtol\' function. */
@%:@undef HAVE_STRTOL])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_STRTOUL], [/* Define to 1 if you have the `strtoul\' function. */
@%:@undef HAVE_STRTOUL])
m4trace:configure.ac:225: -1- AH_OUTPUT([HAVE_PROCESS_VM_READV], [/* Define to 1 if you have the `process_vm_readv\' function. */
@%:@undef HAVE_PROCESS_VM_READV])
m4trace:configure.ac:242: -1- AH_OUTPUT([HAVE_LIBRT], [/* Define to 1 if you have the `rt\' library (-lrt). */
@%:@undef HAVE_LIBRT])
m4trace:configure.ac:242: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRT])
m4trace:configure.ac:242: -1- m4_pattern_allow([^HAVE_LIBRT$])
m4trace:configure.ac:259: -1- AC_DEFINE_TRACE_LITERAL([DEBUG])
m4trace:configure.ac:259: -1- m4_pattern_allow([^DEBUG$])
m4trace:configure.ac:259: -1- AH_OUTPUT([DEBUG], [/* debugging */
@%:@undef DEBUG])
m4trace:configure.ac:273: -1- AC_SUBST([AM_CPPFLAGS])
m4trace:configure.ac:273: -1- AC_SUBST_TRACE([AM_CPPFLAGS])
m4trace:configure.ac:273: -1- m4_pattern_allow([^AM_CPPFLAGS$])
m4trace:configure.ac:274: -1- AC_SUBST([AM_CFLAGS])
m4trace:configure.ac:274: -1- AC_SUBST_TRACE([AM_CFLAGS])
m4trace:configure.ac:274: -1- m4_pattern_allow([^AM_CFLAGS$])
m4trace:configure.ac:275: -1- AC_SUBST([AM_LDFLAGS])
m4trace:configure.ac:275: -1- AC_SUBST_TRACE([AM_LDFLAGS])
m4trace:configure.ac:275: -1- m4_pattern_allow([^AM_LDFLAGS$])
m4trace:configure.ac:276: -1- AC_SUBST([libelf_LD_LIBRARY_PATH])
m4trace:configure.ac:276: -1- AC_SUBST_TRACE([libelf_LD_LIBRARY_PATH])
m4trace:configure.ac:276: -1- m4_pattern_allow([^libelf_LD_LIBRARY_PATH$])
m4trace:configure.ac:278: -1- AC_CONFIG_FILES([
Makefile
client/Makefile
sysdeps/Makefile
sysdeps/linux-gnu/Makefile
sysdeps/linux-gnu/x86/Makefile
sysdeps/linux-gnu/ppc/Makefile
sysdeps/linux-gnu/arm/Makefile
])
m4trace:configure.ac:287: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:287: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:287: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:287: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:287: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])
m4trace:configure.ac:287: -1- AC_SUBST([am__EXEEXT_TRUE])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE])
m4trace:configure.ac:287: -1- m4_pattern_allow([^am__EXEEXT_TRUE$])
m4trace:configure.ac:287: -1- AC_SUBST([am__EXEEXT_FALSE])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE])
m4trace:configure.ac:287: -1- m4_pattern_allow([^am__EXEEXT_FALSE$])
m4trace:configure.ac:287: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE])
m4trace:configure.ac:287: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([INSTALL])
m4trace:configure.ac:287: -1- AC_SUBST_TRACE([MKDIR_P])
m4trace:configure.ac:287: -1- AC_REQUIRE_AUX_FILE([ltmain.sh])

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -55,8 +56,8 @@ int trace_set_options(struct task *task);
/* make the forked process traceable */ /* make the forked process traceable */
void trace_me(void); void trace_me(void);
/* stop tracing of a task. */ /* stop tracing a task. */
int untrace_task(struct task *task); int untrace_task(struct task *task, int signum);
/* Called when mtrace-ng needs to attach to task */ /* Called when mtrace-ng needs to attach to task */
int trace_attach(struct task *task); int trace_attach(struct task *task);

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

9
bootstrap Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
make clean
make maintainer-clean
rm -rf config autom4te.cache
libtoolize -c
aclocal
autoheader
automake --add-missing -c
autoconf

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -69,37 +70,28 @@ static void enable_sw_breakpoint(struct task *task, struct breakpoint *bp)
{ {
static unsigned char break_insn[] = BREAKPOINT_VALUE; static unsigned char break_insn[] = BREAKPOINT_VALUE;
assert(task->stopped);
assert(bp->sw == 0);
assert(bp->hw == 0);
debug(DEBUG_PROCESS, "pid=%d, addr=%#lx", task->pid, bp->addr); debug(DEBUG_PROCESS, "pid=%d, addr=%#lx", task->pid, bp->addr);
copy_from_to_proc(task, bp->addr, break_insn, bp->orig_value, BREAKPOINT_LENGTH); copy_from_to_proc(task, bp->addr, break_insn, bp->orig_value, BREAKPOINT_LENGTH);
bp->break_insn = !memcmp(break_insn, bp->orig_value, BREAKPOINT_LENGTH); bp->break_insn = !memcmp(break_insn, bp->orig_value, BREAKPOINT_LENGTH);
bp->was_hw = 0; bp->was_hw = 0;
bp->sw = 1;
bp->enabled = 1;
if (unlikely(options.verbose && bp->break_insn))
fprintf(stderr, "!!!break insn pid=%d, addr=%#lx\n", task->pid, bp->addr);
} }
static void disable_sw_breakpoint(struct task *task, struct breakpoint *bp) static void disable_sw_breakpoint(struct task *task, const struct breakpoint *bp)
{ {
debug(DEBUG_PROCESS, "pid=%d, addr=%lx", task->pid, bp->addr); debug(DEBUG_PROCESS, "pid=%d, addr=%lx", task->pid, bp->addr);
assert(task->stopped);
assert(bp->sw);
assert(bp->hw == 0);
copy_to_proc(task, bp->addr, bp->orig_value, BREAKPOINT_LENGTH); copy_to_proc(task, bp->addr, bp->orig_value, BREAKPOINT_LENGTH);
bp->sw = 0;
bp->enabled = 0;
} }
int breakpoint_on_hit(struct task *task, struct breakpoint *bp)
{
if (bp->on_hit)
return (bp->on_hit)(task, bp);
return 0;
}
struct breakpoint *breakpoint_find(struct task *task, arch_addr_t addr) struct breakpoint *breakpoint_find(struct task *task, arch_addr_t addr)
{ {
@ -117,7 +109,6 @@ static void enable_hw_bp(struct task *task, struct breakpoint *bp)
assert(bp->type != BP_SW); assert(bp->type != BP_SW);
assert(bp->type < BP_HW || task->hw_bp[slot] == NULL); assert(bp->type < BP_HW || task->hw_bp[slot] == NULL);
assert(bp->sw == 0);
task->hw_bp[slot] = bp; task->hw_bp[slot] = bp;
@ -129,8 +120,6 @@ static void disable_hw_bp(struct task *task, struct breakpoint *bp)
{ {
unsigned int slot = bp->hw_bp_slot; unsigned int slot = bp->hw_bp_slot;
assert(bp->sw == 0);
if (unlikely(!task->hw_bp[slot])) if (unlikely(!task->hw_bp[slot]))
return; return;
@ -196,16 +185,13 @@ void reorder_hw_bp(struct task *task)
} }
} }
if (n < HW_BREAKPOINTS - 1) { if (!n)
for(i = 0; i < n; ++i)
bp_list[i]->hwcnt = 0;
return; return;
}
qsort(bp_list, n, sizeof(*bp_list), hw_bp_sort); qsort(bp_list, n, sizeof(*bp_list), hw_bp_sort);
for(i = 0; i < n; ++i) for(i = 0; i < n; ++i)
bp_list[i]->hwcnt = 0; bp_list[i]->hwcnt = (i < HW_BREAKPOINTS - 1) ? BP_REORDER_THRESHOLD >> (i + 4) : 0;
if (n > HW_BREAKPOINTS - 1) if (n > HW_BREAKPOINTS - 1)
n = HW_BREAKPOINTS - 1; n = HW_BREAKPOINTS - 1;
@ -219,11 +205,9 @@ void reorder_hw_bp(struct task *task)
assert((hw_bp_set & 1 << bp_list[i]->hw_bp_slot) == 0); assert((hw_bp_set & 1 << bp_list[i]->hw_bp_slot) == 0);
hw_bp_set |= 1 << bp_list[i]->hw_bp_slot; hw_bp_set |= 1 << bp_list[i]->hw_bp_slot;
continue;
} }
else
*p++ = bp_list[i]; *p++ = bp_list[i];
} }
if (p == bp_list) if (p == bp_list)
@ -247,7 +231,6 @@ void reorder_hw_bp(struct task *task)
if (leader->hw_bp[i]) if (leader->hw_bp[i])
hw2sw_bp(leader, leader->hw_bp[i]); hw2sw_bp(leader, leader->hw_bp[i]);
bp->enabled = 1;
bp->hw_bp_slot = i; bp->hw_bp_slot = i;
bp->hw = 1; bp->hw = 1;
bp->was_hw = 1; bp->was_hw = 1;
@ -383,7 +366,6 @@ struct breakpoint *breakpoint_new_ext(struct task *task, arch_addr_t addr, struc
bp->ext = ext; bp->ext = ext;
bp->refcnt = 1; bp->refcnt = 1;
bp->count = 0; bp->count = 0;
bp->sw = 0;
#if HW_BREAKPOINTS > 1 #if HW_BREAKPOINTS > 1
bp->hwcnt = 0; bp->hwcnt = 0;
#endif #endif
@ -450,6 +432,7 @@ void breakpoint_enable(struct task *task, struct breakpoint *bp)
#endif #endif
bp->hw = 0; bp->hw = 0;
enable_sw_breakpoint(task, bp); enable_sw_breakpoint(task, bp);
bp->enabled = 1;
} }
} }
@ -484,6 +467,7 @@ void breakpoint_disable(struct task *task, struct breakpoint *bp)
} }
#endif #endif
disable_sw_breakpoint(task, bp); disable_sw_breakpoint(task, bp);
bp->enabled = 0;
} }
} }
@ -528,11 +512,13 @@ void breakpoint_delete(struct task *task, struct breakpoint *bp)
if (unlikely(options.verbose > 1 && bp->libsym)) { if (unlikely(options.verbose > 1 && bp->libsym)) {
fprintf(stderr, fprintf(stderr,
"delete %s breakpoint %s:%s [%#lx]\n", "delete %s breakpoint %s:%s [%#lx] count=%u was_hw=%u\n",
bp->type == BP_SW ? "sw" : "hw", bp->type == BP_SW ? "sw" : "hw",
bp->libsym->libref->filename, bp->libsym->libref->filename,
bp->libsym->func->demangled_name, bp->libsym->func->demangled_name,
bp->addr); bp->addr,
bp->count,
bp->was_hw);
} }
bp->deleted = 1; bp->deleted = 1;
@ -543,8 +529,6 @@ void breakpoint_delete(struct task *task, struct breakpoint *bp)
static int enable_nonlocked_bp_cb(unsigned long key, const void *value, void *data) static int enable_nonlocked_bp_cb(unsigned long key, const void *value, void *data)
{ {
(void)key;
struct breakpoint *bp = (struct breakpoint *)value; struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data; struct task *leader = (struct task *)data;
@ -566,8 +550,6 @@ void breakpoint_enable_all_nonlocked(struct task *leader)
static int disable_nonlocked_bp_cb(unsigned long key, const void *value, void *data) static int disable_nonlocked_bp_cb(unsigned long key, const void *value, void *data)
{ {
(void)key;
struct breakpoint *bp = (struct breakpoint *)value; struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data; struct task *leader = (struct task *)data;
@ -585,6 +567,7 @@ void breakpoint_disable_all_nonlocked(struct task *leader)
if (leader->breakpoints) if (leader->breakpoints)
dict_apply_to_all(leader->breakpoints, disable_nonlocked_bp_cb, leader); dict_apply_to_all(leader->breakpoints, disable_nonlocked_bp_cb, leader);
leader->attached = 1;
} }
static int enable_bp_cb(unsigned long key, const void *value, void *data) static int enable_bp_cb(unsigned long key, const void *value, void *data)
@ -592,8 +575,6 @@ static int enable_bp_cb(unsigned long key, const void *value, void *data)
struct breakpoint *bp = (struct breakpoint *)value; struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data; struct task *leader = (struct task *)data;
(void)key;
debug(DEBUG_FUNCTION, "pid=%d", leader->pid); debug(DEBUG_FUNCTION, "pid=%d", leader->pid);
breakpoint_enable(leader, bp); breakpoint_enable(leader, bp);
@ -614,8 +595,6 @@ static int disable_bp_cb(unsigned long key, const void *value, void *data)
struct breakpoint *bp = (struct breakpoint *)value; struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data; struct task *leader = (struct task *)data;
(void)key;
debug(DEBUG_FUNCTION, "pid=%d", leader->pid); debug(DEBUG_FUNCTION, "pid=%d", leader->pid);
breakpoint_disable(leader, bp); breakpoint_disable(leader, bp);
@ -629,30 +608,7 @@ void breakpoint_disable_all(struct task *leader)
if (leader->breakpoints) if (leader->breakpoints)
dict_apply_to_all(leader->breakpoints, disable_bp_cb, leader); dict_apply_to_all(leader->breakpoints, disable_bp_cb, leader);
} leader->attached = 1;
static int invalidate_bp_cb(unsigned long key, const void *value, void *data)
{
struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data;
(void)key;
debug(DEBUG_FUNCTION, "pid=%d", leader->pid);
bp->enabled = 0;
bp->sw = 0;
bp->hw = 0;
return 0;
}
void breakpoint_invalidate_all(struct task *leader)
{
debug(DEBUG_FUNCTION, "pid=%d", leader->pid);
if (leader->breakpoints)
dict_apply_to_all(leader->breakpoints, invalidate_bp_cb, leader);
} }
static int destroy_breakpoint_cb(unsigned long key, const void *value, void *data) static int destroy_breakpoint_cb(unsigned long key, const void *value, void *data)
@ -660,8 +616,6 @@ static int destroy_breakpoint_cb(unsigned long key, const void *value, void *dat
struct breakpoint *bp = (struct breakpoint *)value; struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data; struct task *leader = (struct task *)data;
(void)key;
breakpoint_delete(leader, bp); breakpoint_delete(leader, bp);
return 0; return 0;
} }
@ -670,9 +624,7 @@ void breakpoint_clear_all(struct task *leader)
{ {
if (leader->breakpoints) { if (leader->breakpoints) {
dict_apply_to_all(leader->breakpoints, &destroy_breakpoint_cb, leader); dict_apply_to_all(leader->breakpoints, &destroy_breakpoint_cb, leader);
#if HW_BREAKPOINTS > 0
assert(leader->hw_bp_num == 0); assert(leader->hw_bp_num == 0);
#endif
dict_clear(leader->breakpoints); dict_clear(leader->breakpoints);
leader->breakpoints = NULL; leader->breakpoints = NULL;
} }
@ -691,8 +643,6 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
struct task *new_task = (struct task *)data; struct task *new_task = (struct task *)data;
size_t ext = bp->ext; size_t ext = bp->ext;
(void)key;
if (bp->deleted) if (bp->deleted)
return 0; return 0;
@ -715,7 +665,6 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
new_bp->enabled = bp->enabled; new_bp->enabled = bp->enabled;
new_bp->locked = bp->locked; new_bp->locked = bp->locked;
new_bp->hw = bp->hw; new_bp->hw = bp->hw;
new_bp->sw = bp->sw;
new_bp->type = bp->type; new_bp->type = bp->type;
new_bp->ext = ext; new_bp->ext = ext;
new_bp->refcnt = 1; new_bp->refcnt = 1;
@ -746,8 +695,7 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
} }
else else
#endif #endif
if (new_bp->sw) memcpy(new_bp->orig_value, bp->orig_value, sizeof(bp->orig_value));
memcpy(new_bp->orig_value, bp->orig_value, sizeof(bp->orig_value));
if (ext) if (ext)
memcpy((void *)new_bp + ext, (void *)bp + ext, ext); memcpy((void *)new_bp + ext, (void *)bp + ext, ext);
@ -784,8 +732,6 @@ int breakpoint_put(struct breakpoint *bp)
if (--bp->refcnt) if (--bp->refcnt)
return 0; return 0;
assert(bp->enabled == 0);
free(bp); free(bp);
} }
return 1; return 1;

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -49,7 +50,6 @@ struct breakpoint {
unsigned int enabled:1; unsigned int enabled:1;
unsigned int locked:1; unsigned int locked:1;
unsigned int deleted:1; unsigned int deleted:1;
unsigned int sw:1;
unsigned int hw:1; unsigned int hw:1;
unsigned int was_hw:1; unsigned int was_hw:1;
unsigned int break_insn:1; unsigned int break_insn:1;
@ -69,6 +69,9 @@ struct breakpoint {
/* setup the basic breakpoint support for a given leader */ /* setup the basic breakpoint support for a given leader */
void breakpoint_setup(struct task *leader); void breakpoint_setup(struct task *leader);
/* Call on-hit handler of BP, if any is set. */
int breakpoint_on_hit(struct task *task, struct breakpoint *bp);
/* get a new breakpoint structure. */ /* get a new breakpoint structure. */
struct breakpoint *breakpoint_new(struct task *task, arch_addr_t addr, struct library_symbol *libsym, int type); struct breakpoint *breakpoint_new(struct task *task, arch_addr_t addr, struct library_symbol *libsym, int type);
@ -89,7 +92,6 @@ void breakpoint_disable(struct task *task, struct breakpoint *bp);
void breakpoint_enable_all(struct task *leader); void breakpoint_enable_all(struct task *leader);
void breakpoint_disable_all(struct task *leader); void breakpoint_disable_all(struct task *leader);
void breakpoint_invalidate_all(struct task *leader);
void breakpoint_enable_all_nonlocked(struct task *leader); void breakpoint_enable_all_nonlocked(struct task *leader);
void breakpoint_disable_all_nonlocked(struct task *leader); void breakpoint_disable_all_nonlocked(struct task *leader);
void breakpoint_clear_all(struct task *leader); void breakpoint_clear_all(struct task *leader);
@ -103,14 +105,10 @@ void disable_scratch_hw_bp(struct task *task, struct breakpoint *bp);
#else #else
static inline void enable_scratch_hw_bp(struct task *task, struct breakpoint *bp) static inline void enable_scratch_hw_bp(struct task *task, struct breakpoint *bp)
{ {
(void)task;
(void)bp;
} }
static inline void disable_scratch_hw_bp(struct task *task, struct breakpoint *bp) static inline void disable_scratch_hw_bp(struct task *task, struct breakpoint *bp)
{ {
(void)task;
(void)bp;
} }
#endif #endif
@ -122,12 +120,10 @@ void breakpoint_hw_destroy(struct task *task);
#else #else
static inline void breakpoint_hw_clone(struct task *task) static inline void breakpoint_hw_clone(struct task *task)
{ {
(void)task;
} }
static inline void breakpoint_hw_destroy(struct task *task) static inline void breakpoint_hw_destroy(struct task *task)
{ {
(void)task;
} }
#endif #endif

33
client/Makefile.am Normal file
View File

@ -0,0 +1,33 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
noinst_LTLIBRARIES = \
../libclient.la
___libclient_la_SOURCES = \
binfile.c \
client.c \
dump.c \
job.c \
process.c \
readline.c
noinst_HEADERS = bfdinc.h binfile.h client.h dump.h job.h process.h
MAINTAINERCLEANFILES = \
Makefile.in

639
client/Makefile.in Normal file
View File

@ -0,0 +1,639 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = client
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
___libclient_la_LIBADD =
am____libclient_la_OBJECTS = binfile.lo client.lo dump.lo job.lo \
process.lo readline.lo
___libclient_la_OBJECTS = $(am____libclient_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__dirstamp = $(am__leading_dot)dirstamp
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/autoconf/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(___libclient_la_SOURCES)
DIST_SOURCES = $(___libclient_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = \
../libclient.la
___libclient_la_SOURCES = \
binfile.c \
client.c \
dump.c \
job.c \
process.c \
readline.c
noinst_HEADERS = bfdinc.h binfile.h client.h dump.h job.h process.h
MAINTAINERCLEANFILES = \
Makefile.in
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign client/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign client/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
../$(am__dirstamp):
@$(MKDIR_P) ..
@: > ../$(am__dirstamp)
../libclient.la: $(___libclient_la_OBJECTS) $(___libclient_la_DEPENDENCIES) $(EXTRA____libclient_la_DEPENDENCIES) ../$(am__dirstamp)
$(AM_V_CCLD)$(LINK) $(___libclient_la_OBJECTS) $(___libclient_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binfile.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dump.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readline.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf ../.libs ../_libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -28,20 +28,6 @@
#include <string.h> #include <string.h>
#include <libiberty/demangle.h> #include <libiberty/demangle.h>
#include <bfd.h>
/* try to detect libfd version and set up wrapper accprdingly. */
#ifdef bfd_get_section_flags
// 2.31 (and possibly earlier) has bfd_get_section_flags
#define bfd_section_size_wrapper(_ptr, _section) bfd_section_size(_ptr, _section)
#define bfd_section_vma_wrapper(_ptr, _section) bfd_section_vma(_ptr, _section)
#else
// works for 2.34
#define bfd_get_section_flags(_unused, _section) bfd_section_flags(_section)
#define bfd_section_size_wrapper(_unused, _section) bfd_section_size(_section)
#define bfd_section_vma_wrapper(_unused, _section) bfd_section_vma(_section)
#endif
#include "binfile.h" #include "binfile.h"
#include "process.h" #include "process.h"
@ -106,10 +92,10 @@ static void find_address_in_section(bfd *abfd, asection *section, void *data __a
if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0) if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
return; return;
vma = bfd_section_vma_wrapper(abfd, section); vma = bfd_get_section_vma(abfd, section);
if (psi->pc < vma) if (psi->pc < vma)
return; return;
size = bfd_section_size_wrapper(abfd, section); size = bfd_section_size(abfd, section);
if (psi->pc >= vma + size) if (psi->pc >= vma + size)
return; return;
@ -165,7 +151,7 @@ struct rb_sym *bin_file_lookup(struct bin_file *binfile, bfd_vma addr, unsigned
if (!name || !*name) if (!name || !*name)
name = "?"; name = "?";
else { else {
alloc = bfd_demangle(binfile->abfd, name, DMGL_ANSI | DMGL_PARAMS | DMGL_RET_DROP | DMGL_AUTO); alloc = bfd_demangle(binfile->abfd, name, DMGL_TYPES | DMGL_VERBOSE | DMGL_ANSI | DMGL_PARAMS);
if (alloc) if (alloc)
name = alloc; name = alloc;
} }
@ -303,9 +289,10 @@ void bin_file_sym_put(struct rb_sym *sym)
if (!--sym->refcnt) { if (!--sym->refcnt) {
free(sym->sym); free(sym->sym);
if (binfile) if (!binfile)
rb_erase(&sym->node, &binfile->sym_table); return;
free(sym);
rb_erase(&sym->node, &binfile->sym_table);
} }
bin_file_put(binfile); bin_file_put(binfile);
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -364,10 +364,8 @@ static void client_remove_process(struct process *process)
{ {
process = pid_rb_delete(&pid_table, process->pid); process = pid_rb_delete(&pid_table, process->pid);
if (process) { if (process)
process_reset(process);
free(process); free(process);
}
} }
@ -489,15 +487,14 @@ static int client_func(void)
process_about_exit(process); process_about_exit(process);
break; break;
case MT_EXIT: case MT_EXIT:
if (process_exit(process)) process_exit(process);
client_remove_process(process);
break; break;
case MT_NOFOLLOW: case MT_NOFOLLOW:
process_reset(process);
client_remove_process(process); client_remove_process(process);
break; break;
case MT_SCAN: case MT_SCAN:
if (process_scan(process, payload, mt_msg.payload_len)) process_scan(process, payload, mt_msg.payload_len);
client_remove_process(process);
break; break;
case MT_ADD_MAP: case MT_ADD_MAP:
process_add_map(process, payload, mt_msg.payload_len); process_add_map(process, payload, mt_msg.payload_len);
@ -506,8 +503,7 @@ static int client_func(void)
process_del_map(process, payload, mt_msg.payload_len); process_del_map(process, payload, mt_msg.payload_len);
break; break;
case MT_DETACH: case MT_DETACH:
if (process_detach(process)) process_detach(process);
client_remove_process(process);
break; break;
default: default:
fatal("protocol violation 0x%08x", mt_msg.operation); fatal("protocol violation 0x%08x", mt_msg.operation);
@ -663,10 +659,8 @@ static void signal_exit(int sig)
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN); signal(SIGTERM, SIG_IGN);
#pragma GCC diagnostic push if (write(pipefd[1], &signum, 1) == -1)
#pragma GCC diagnostic ignored "-Wunused-result" ;
write(pipefd[1], &signum, 1);
#pragma GCC diagnostic pop
} }
static int scan_process(struct process *process) static int scan_process(struct process *process)
@ -767,8 +761,6 @@ int client_start(void)
void *client_thread(void *unused) void *client_thread(void *unused)
{ {
(void)unused;
if (options.interactive) { if (options.interactive) {
ioevent_add_input(client_fd, client_func); ioevent_add_input(client_fd, client_func);
@ -832,7 +824,6 @@ int client_stop(void)
{ {
if (thread) { if (thread) {
thread_join(thread); thread_join(thread);
free(thread);
thread = NULL; thread = NULL;
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -92,7 +92,8 @@ struct realloc_entry {
unsigned long addr; unsigned long addr;
unsigned long size; unsigned long size;
unsigned long flags; unsigned long flags;
struct rb_stack *stack_node; struct rb_stack *stack;
enum mt_operation operation;
}; };
struct regex_list { struct regex_list {
@ -423,7 +424,6 @@ static void stack_put(struct rb_stack *stack_node)
for(i = 0; i < stack->entries; ++i) for(i = 0; i < stack->entries; ++i)
bin_file_sym_put(stack->syms[i]); bin_file_sym_put(stack->syms[i]);
free(stack->addrs);
free(stack->syms); free(stack->syms);
} }
free(stack); free(stack);
@ -479,7 +479,7 @@ static struct rb_stack *stack_clone(struct process *process, struct rb_stack *st
return this; return this;
} }
static struct rb_stack *stack_add(struct process *process, void *addrs, uint32_t stack_size, enum mt_operation operation) static struct rb_stack *stack_add(struct process *process, unsigned int pid, void *addrs, uint32_t stack_size, enum mt_operation operation)
{ {
struct rb_root *root = &process->stack_table; struct rb_root *root = &process->stack_table;
struct rb_node **new = &(root->rb_node), *parent = NULL; struct rb_node **new = &(root->rb_node), *parent = NULL;
@ -604,7 +604,7 @@ static struct rb_block *process_rb_search_range(struct rb_root *root, unsigned l
while (node) { while (node) {
struct rb_block *this = container_of(node, struct rb_block, node); struct rb_block *this = container_of(node, struct rb_block, node);
if ((this->addr <= addr) && (this->addr + this->size > addr)) if ((addr <= this->addr) && (addr + size > this->addr))
return this; return this;
if (addr < this->addr) if (addr < this->addr)
@ -775,8 +775,6 @@ void process_del_map(struct process *process, void *payload, uint32_t payload_le
uint64_t size = process->val64(mt_map->size); uint64_t size = process->val64(mt_map->size);
struct list_head *it; struct list_head *it;
(void)payload_len;
list_for_each(it, &process->map_list) { list_for_each(it, &process->map_list) {
struct map *map = container_of(it, struct map, list); struct map *map = container_of(it, struct map, list);
@ -814,8 +812,8 @@ static void process_init(struct process *process, unsigned int swap_endian, unsi
static void realloc_del(struct realloc_entry *re) static void realloc_del(struct realloc_entry *re)
{ {
if (re->stack_node) if (re->stack)
stack_put(re->stack_node); stack_put(re->stack);
list_del(&re->list); list_del(&re->list);
free(re); free(re);
} }
@ -1035,7 +1033,7 @@ static int sort_total(const struct rb_stack **p, const struct rb_stack **q)
static void _process_dump(struct process *process, int (*sortby)(const struct rb_stack **, const struct rb_stack **), int (*skipfunc)(struct rb_stack *), FILE *file, int lflag) static void _process_dump(struct process *process, int (*sortby)(const struct rb_stack **, const struct rb_stack **), int (*skipfunc)(struct rb_stack *), FILE *file, int lflag)
{ {
struct rb_stack **arr = NULL; struct rb_stack **arr;
unsigned long i; unsigned long i;
void *data; void *data;
unsigned long stack_trees = process->stack_trees; unsigned long stack_trees = process->stack_trees;
@ -1045,12 +1043,9 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
if (dump_init(file) == -1) if (dump_init(file) == -1)
return; return;
if (!stack_trees)
goto skip;
arr = malloc(sizeof(struct rb_stack *) * stack_trees); arr = malloc(sizeof(struct rb_stack *) * stack_trees);
if (!arr) if (!arr)
goto skip; return;
for(i = 0, data = rb_first(&process->stack_table); data; data = rb_next(data)) { for(i = 0, data = rb_first(&process->stack_table); data; data = rb_next(data)) {
struct rb_stack *stack_node = container_of(data, struct rb_stack, node); struct rb_stack *stack_node = container_of(data, struct rb_stack, node);
@ -1063,6 +1058,9 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
dump_printf("Process dump %d %s\n", process->pid, process->filename ? process->filename : "<unknown>"); dump_printf("Process dump %d %s\n", process->pid, process->filename ? process->filename : "<unknown>");
if (!stack_trees)
goto skip;
qsort(arr, stack_trees, sizeof(struct rb_stack *), (void *)sortby); qsort(arr, stack_trees, sizeof(struct rb_stack *), (void *)sortby);
if (file == stderr) { if (file == stderr) {
@ -1146,8 +1144,6 @@ static void process_dump(struct process *process, int (*sortby)(const struct rb_
static int skip_none(struct rb_stack *stack) static int skip_none(struct rb_stack *stack)
{ {
(void)stack;
return 0; return 0;
} }
@ -1211,7 +1207,7 @@ void process_dump_stacks(struct process *process, const char *outfile, int lflag
process_dump(process, sort_allocations, skip_none, outfile, lflag); process_dump(process, sort_allocations, skip_none, outfile, lflag);
} }
int process_scan(struct process *process, void *leaks, uint32_t payload_len) void *process_scan(struct process *process, void *leaks, uint32_t payload_len)
{ {
unsigned int new = 0; unsigned int new = 0;
unsigned long n = payload_len / process->ptr_size; unsigned long n = payload_len / process->ptr_size;
@ -1245,10 +1241,8 @@ int process_scan(struct process *process, void *leaks, uint32_t payload_len)
for(i = 0; i < new; ++i) { for(i = 0; i < new; ++i) {
struct rb_block *block = process_rb_search(&process->block_table, process->get_ulong(new_leaks)); struct rb_block *block = process_rb_search(&process->block_table, process->get_ulong(new_leaks));
if (options.verbose > 1) { if (dump_printf(" leaked at 0x%08lx (%lu bytes)\n", (unsigned long)block->addr, (unsigned long)block->size) == -1)
if (dump_printf(" leaked at 0x%08lx (%lu bytes)\n", (unsigned long)block->addr, (unsigned long)block->size) == -1) break;
break;
}
new_leaks += process->ptr_size; new_leaks += process->ptr_size;
} }
@ -1256,12 +1250,10 @@ int process_scan(struct process *process, void *leaks, uint32_t payload_len)
dump_printf("leaks total: %lu\n", process->leaks); dump_printf("leaks total: %lu\n", process->leaks);
dump_flush(); dump_flush();
if (!options.interactive) { if (!options.interactive)
process_dump_sortby(process); process_dump_sortby(process);
return 1;
}
return 0; return leaks;
} }
static inline unsigned long roundup_mask(unsigned long val, unsigned long mask) static inline unsigned long roundup_mask(unsigned long val, unsigned long mask)
@ -1298,32 +1290,20 @@ void process_munmap(struct process *process, struct mt_msg *mt_msg, void *payloa
do { do {
block = process_rb_search_range(&process->block_table, ptr, size); block = process_rb_search_range(&process->block_table, ptr, size);
if (!block)
break;
if (block && !is_mmap(block->stack_node->stack->operation)) { if (!is_mmap(block->stack_node->stack->operation)) {
// ignore blocks not mmap'ed if (unlikely(options.kill)) {
block = NULL; fprintf(stderr, ">>> block missmatch pid:%d MAP<>MALLOC %#lx\n", process->pid, ptr);
abort();
}
break;
} }
if (!block) {
// printf("## no block found for %lx, %ld. Trying next page\n", ptr, size);
// it is legal to unmap arbitrary addresses, so ptr might be actually before the mmap and it might span muplitple mmaps areas.
// so we'll might need to search our blocks.
// eg this is legal: void* p=mmap(0,512*1024, PROT_WRITE|PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); munmap(p+4096,4096); munmap(p-4096, 512*1024+4096);
// FIXME pagesize is hardcoded as 4096 bytes, which should be safe (AFAIK 4k is the minimum "out there".) A more efficient way would be to transmit
// the target's PAGE_SIZE on startup.
if (size > 4096) {
size -= 4096;
ptr += 4096;
continue;
}
else {
break;
}
}
// ptr in block -- this is already checked.
if (block->addr >= ptr) { if (block->addr >= ptr) {
unsigned long off = block->addr - ptr; unsigned off = block->addr - ptr;
size -= off; size -= off;
ptr += off; ptr += off;
@ -1343,32 +1323,33 @@ void process_munmap(struct process *process, struct mt_msg *mt_msg, void *payloa
process_rb_delete_block(process, block); process_rb_delete_block(process, block);
} }
else { else {
unsigned long off = ptr - block->addr; unsigned off = ptr - block->addr;
if (off + size < block->size) { if (off + size < block->size) {
unsigned long new_addr = block->addr + (off + size); unsigned long new_addr = block->addr + (off + size);
unsigned long new_size = block->size - (off + size); unsigned long new_size = block->size - (off + size);
process_release_mem(process, block, block->size - off); process_release_mem(process, block, block->size - off - new_size);
block->size = off; block->size = off;
if (process_rb_insert_block(process, new_addr, new_size, block->stack_node, 0, mt_msg->operation)) if (process_rb_insert_block(process, new_addr, new_size, block->stack_node, 0, mt_msg->operation))
break; break;
process->n_allocations++;
process->total_allocations++; process->total_allocations++;
process->bytes_used += new_size; process->bytes_used += new_size;
break; break;
} }
else {
// freeing a chunk at the end of the mmap block.
size_t amount_freed = block->size - off;
process_release_mem(process, block, amount_freed);
block->size -= amount_freed; process_release_mem(process, block, off);
size -= amount_freed ;
ptr += amount_freed; block->addr += off;
} block->size -= off;
size -= block->size;
ptr += block->size;
} }
} while(size); } while(size);
} }
@ -1402,22 +1383,6 @@ static int is_sane(struct rb_block *block, enum mt_operation op)
return 1; return 1;
} }
static void realloc_add(struct process *process, unsigned long pid, unsigned long addr, unsigned long size, unsigned long flags, struct rb_stack *stack_node)
{
struct realloc_entry *re = malloc(sizeof(*re));
re->addr = addr;
re->size = size;
re->flags = flags;
re->pid = pid;
re->stack_node = stack_node;
if (re->stack_node)
stack_get(re->stack_node);
list_add_tail(&re->list, &process->realloc_list);
}
void process_free(struct process *process, struct mt_msg *mt_msg, void *payload) void process_free(struct process *process, struct mt_msg *mt_msg, void *payload)
{ {
struct rb_block *block = NULL; struct rb_block *block = NULL;
@ -1465,15 +1430,27 @@ void process_free(struct process *process, struct mt_msg *mt_msg, void *payload)
if (stack_size) { if (stack_size) {
if (!is_sane(block, mt_msg->operation)) { if (!is_sane(block, mt_msg->operation)) {
struct rb_stack *stack = stack_add(process, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, process->pid, stack_data, stack_size, mt_msg->operation);
stack->n_mismatched++; stack->n_mismatched++;
stack->tsc = process->tsc++; stack->tsc = process->tsc++;
} }
} }
if (mt_msg->operation == MT_REALLOC_ENTER) if (mt_msg->operation == MT_REALLOC_ENTER) {
realloc_add(process, pid, block->addr, block->size, block->flags, block->stack_node); struct realloc_entry *re = malloc(sizeof(*re));
re->addr = block->addr;
re->size = block->size;
re->flags = block->flags;
re->operation = block->stack_node->stack->operation;
re->pid = pid;
re->stack = block->stack_node;
stack_get(re->stack);
list_add_tail(&re->list, &process->realloc_list);
}
process_rb_delete_block(process, block); process_rb_delete_block(process, block);
} }
@ -1485,26 +1462,21 @@ void process_free(struct process *process, struct mt_msg *mt_msg, void *payload)
} }
if (stack_size) { if (stack_size) {
struct rb_stack *stack = stack_add(process, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, process->pid, stack_data, stack_size, mt_msg->operation);
stack->n_badfree++; stack->n_badfree++;
stack->tsc = process->tsc++; stack->tsc = process->tsc++;
} }
} }
if (mt_msg->operation == MT_REALLOC_ENTER)
realloc_add(process, pid, 0, 0, 0, NULL);
} }
} }
void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *payload) void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *payload)
{ {
unsigned long ptr; unsigned long ptr;
unsigned long pid; unsigned int pid;
struct list_head *it; struct list_head *it;
(void)mt_msg;
if (!process->tracing) if (!process->tracing)
return; return;
@ -1528,7 +1500,7 @@ void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *
if (re->pid == pid) { if (re->pid == pid) {
if (!ptr && re->addr) if (!ptr && re->addr)
process_rb_insert_block(process, re->addr, re->size, re->stack_node, re->flags, re->stack_node->stack->operation); process_rb_insert_block(process, re->addr, re->size, re->stack, re->flags, re->operation);
realloc_del(re); realloc_del(re);
return; return;
@ -1536,7 +1508,7 @@ void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *
} }
if (unlikely(options.kill)) { if (unlikely(options.kill)) {
fprintf(stderr, ">>> unexpected realloc done pid: %lu ptr: %#lx\n", pid, ptr); fprintf(stderr, ">>> unexpected realloc done pid: %u\n", pid);
abort(); abort();
} }
return; return;
@ -1590,7 +1562,7 @@ void process_alloc(struct process *process, struct mt_msg *mt_msg, void *payload
process_rb_delete_block(process, block); process_rb_delete_block(process, block);
} }
struct rb_stack *stack = stack_add(process, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, process->pid, stack_data, stack_size, mt_msg->operation);
if (process_rb_insert_block(process, ptr, size, stack, 0, mt_msg->operation)) { if (process_rb_insert_block(process, ptr, size, stack, 0, mt_msg->operation)) {
fprintf(stderr, "process_rb_insert_block failed\n"); fprintf(stderr, "process_rb_insert_block failed\n");
@ -1664,17 +1636,14 @@ void process_dump_sortby(struct process *process)
} }
} }
int process_exit(struct process *process) void process_exit(struct process *process)
{ {
process_set_status(process, MT_PROCESS_EXIT); process_set_status(process, MT_PROCESS_EXIT);
if (!options.interactive) { if (!options.interactive)
process_dump_sortby(process); process_dump_sortby(process);
return 1; else
} fprintf(stderr, "+++ process %d exited +++\n", process->pid);
fprintf(stderr, "+++ process %d exited\n", process->pid);
return 0;
} }
void process_about_exit(struct process *process) void process_about_exit(struct process *process)
@ -1687,25 +1656,17 @@ void process_about_exit(struct process *process)
client_send_msg(process, MT_ABOUT_EXIT, NULL, 0); client_send_msg(process, MT_ABOUT_EXIT, NULL, 0);
} }
int process_detach(struct process *process) void process_detach(struct process *process)
{ {
int ret = 0;
process_set_status(process, MT_PROCESS_DETACH); process_set_status(process, MT_PROCESS_DETACH);
if (options.auto_scan) { if (options.auto_scan)
process_leaks_scan(process, SCAN_ALL); process_leaks_scan(process, SCAN_ALL);
} else
else { if (!options.interactive)
if (!options.interactive) { process_dump_sortby(process);
process_dump_sortby(process);
ret = 1;
}
}
client_send_msg(process, MT_DETACH, NULL, 0); client_send_msg(process, MT_DETACH, NULL, 0);
return ret;
} }
void process_set_status(struct process *process, enum process_status status) void process_set_status(struct process *process, enum process_status status)

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -90,15 +90,15 @@ void process_set_status(struct process *process, enum process_status status);
void process_start_input(struct process *process); void process_start_input(struct process *process);
void process_stop_input(struct process *process); void process_stop_input(struct process *process);
void process_about_exit(struct process *process); void process_about_exit(struct process *process);
int process_exit(struct process *process); void process_exit(struct process *process);
void process_status(struct process *process); void process_status(struct process *process);
int process_scan(struct process *curr, void *leaks, uint32_t payload_len); void *process_scan(struct process *curr, void *leaks, uint32_t payload_len);
void process_alloc(struct process *process, struct mt_msg *msg, void *payload); void process_alloc(struct process *process, struct mt_msg *msg, void *payload);
void process_free(struct process *process, struct mt_msg *msg, void *payload); void process_free(struct process *process, struct mt_msg *msg, void *payload);
void process_munmap(struct process *process, struct mt_msg *msg, void *payload); void process_munmap(struct process *process, struct mt_msg *msg, void *payload);
void process_add_map(struct process *process, void *payload, uint32_t payload_len); void process_add_map(struct process *process, void *payload, uint32_t payload_len);
void process_del_map(struct process *process, void *payload, uint32_t payload_len); void process_del_map(struct process *process, void *payload, uint32_t payload_len);
int process_detach(struct process *process); void process_detach(struct process *process);
void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *payload); void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *payload);
unsigned long process_leaks_scan(struct process *process, int mode); unsigned long process_leaks_scan(struct process *process, int mode);

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -90,35 +90,35 @@ static const char *outfile;
static int quit; static int quit;
static struct cmd_opt dump_opts[] = { static struct cmd_opt dump_opts[] = {
{ "allocations", 2, process_dump_sort_allocations, "sort by number of open allocations", NULL, NULL }, { "allocations", 2, process_dump_sort_allocations, "sort by number of open allocations" },
{ "average", 2, process_dump_sort_average, "sort by average allocation of bytes (usage / allocations)", NULL, NULL }, { "average", 2, process_dump_sort_average, "sort by average allocation of bytes (usage / allocations)" },
{ "badfree", 1, process_dump_sort_badfree, "sort by number of badfree releases", NULL, NULL }, { "badfree", 1, process_dump_sort_badfree, "sort by number of badfree releases" },
{ "bytes-leaked", 1, process_dump_sort_bytes_leaked, "sort by number of leaked bytes", NULL, NULL }, { "bytes-leaked", 1, process_dump_sort_bytes_leaked, "sort by number of leaked bytes" },
{ "leaks", 1, process_dump_sort_leaks, "sort by number of detected leaks", NULL, NULL }, { "leaks", 1, process_dump_sort_leaks, "sort by number of detected leaks" },
{ "mismatched", 1, process_dump_sort_mismatched, "sort by number of mismatched releases", NULL, NULL }, { "mismatched", 1, process_dump_sort_mismatched, "sort by number of mismatched releases" },
{ "stacks", 1, process_dump_stacks, "dump all stack sort by number of total allocations", NULL, NULL }, { "stacks", 1, process_dump_stacks, "dump all stack sort by number of total allocations" },
{ "total", 2, process_dump_sort_total, "sort by number of total allocations", NULL, NULL }, { "total", 2, process_dump_sort_total, "sort by number of total allocations" },
{ "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter", NULL, NULL }, { "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter" },
{ "usage", 1, process_dump_sort_usage, "sort by number of bytes", NULL, NULL }, { "usage", 1, process_dump_sort_usage, "sort by number of bytes" },
{ NULL, 0, NULL, "\n use > to dump the output into a file", NULL, NULL }, { NULL, 0, NULL, "\n use > to dump the output into a file" },
}; };
static struct cmd_opt set_opts[] = { static struct cmd_opt set_opts[] = {
{ "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries", NULL, NULL }, { "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries" },
{ "depth", 1, do_set_depth, "set backtrace depth", NULL, NULL }, { "depth", 1, do_set_depth, "set backtrace depth" },
{ }, { },
}; };
static struct cmd_opt show_opts[] = { static struct cmd_opt show_opts[] = {
{ "info", 1, do_show_info, "show client settings", NULL, NULL }, { "info", 1, do_show_info, "show client settings" },
{ "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries", NULL, NULL }, { "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries" },
{ }, { },
}; };
static struct cmd_opt scan_opts[] = { static struct cmd_opt scan_opts[] = {
{ "all", 1, (void *)SCAN_ALL, "scan all memory blocks", NULL, NULL }, { "all", 1, (void *)SCAN_ALL, "scan all memory blocks" },
{ "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations", NULL, NULL }, { "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations" },
{ "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan", NULL, NULL }, { "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan" },
{ }, { },
}; };
@ -144,24 +144,21 @@ static struct cmd_opt cmds[] = {
1, 1,
do_proclist, do_proclist,
"list processes", "list processes",
"", ""
NULL
}, },
{ {
quit_str, quit_str,
1, 1,
do_quit, do_quit,
"exit the program", "exit the program",
"", ""
NULL
}, },
{ {
reset_str, reset_str,
1, 1,
do_reset, do_reset,
"reset all current memory allocation", "reset all current memory allocation",
"[<pid>]", "[<pid>]"
NULL
}, },
{ {
scan_str, scan_str,
@ -192,24 +189,21 @@ static struct cmd_opt cmds[] = {
4, 4,
do_start, do_start,
"start allocation tracing", "start allocation tracing",
"", ""
NULL
}, },
{ {
status_str, status_str,
4, 4,
do_status, do_status,
"show allocation status", "show allocation status",
"[<pid>]", "[<pid>]"
NULL
}, },
{ {
stop_str, stop_str,
3, 3,
do_stop, do_stop,
"stop allocation tracing", "stop allocation tracing",
"", ""
NULL
}, },
{ }, { },
}; };
@ -353,8 +347,9 @@ static void readline_handler(char *line)
char *linedup; char *linedup;
char *s; char *s;
linedup = alloca(strlen(line) + 1); linedup = strdup(line);
strcpy(linedup, line); if (!linedup)
goto finish;
argv = malloc(argv_size * sizeof(*argv)); argv = malloc(argv_size * sizeof(*argv));
if (!argv) if (!argv)
@ -406,7 +401,7 @@ static void readline_handler(char *line)
s += n + 1; s += n + 1;
} }
if (!i) if (!i)
goto finish; return;
argc = i; argc = i;
argv[i++] = NULL; argv[i++] = NULL;
@ -444,6 +439,7 @@ static void readline_handler(char *line)
printf("unknown command '%s'\n", argv[0]); printf("unknown command '%s'\n", argv[0]);
finish: finish:
free(argv); free(argv);
free(linedup);
if (quit) if (quit)
rl_callback_handler_remove(); rl_callback_handler_remove();
@ -517,8 +513,6 @@ static int do_set_depth(struct cmd_opt *cmd, struct cmd_opt *opt, int argc, cons
static int do_show_info(struct cmd_opt *cmd, struct cmd_opt *opt, int argc, const char *argv[]) static int do_show_info(struct cmd_opt *cmd, struct cmd_opt *opt, int argc, const char *argv[])
{ {
(void)argv;
if (argc > 2) { if (argc > 2) {
fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name); fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name);
return -1; return -1;
@ -534,8 +528,6 @@ static int do_show_searchpath(struct cmd_opt *cmd, struct cmd_opt *opt, int argc
{ {
struct opt_b_t *p = options.opt_b; struct opt_b_t *p = options.opt_b;
(void)argv;
if (argc > 3) { if (argc > 3) {
fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name); fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name);
return -1; return -1;
@ -669,9 +661,6 @@ static int show_process(struct process *process)
static int do_proclist(struct cmd_opt *cmd, int argc, const char *argv[]) static int do_proclist(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
(void)cmd;
(void)argv;
if (argc > 1) { if (argc > 1) {
fprintf(stderr, "%s: expect no arguments\n", proclist_str); fprintf(stderr, "%s: expect no arguments\n", proclist_str);
return -1; return -1;
@ -685,10 +674,6 @@ static int do_proclist(struct cmd_opt *cmd, int argc, const char *argv[])
static int do_quit(struct cmd_opt *cmd, int argc, const char *argv[]) static int do_quit(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
(void)cmd;
(void)argc;
(void)argv;
quit = 1; quit = 1;
return 0; return 0;
@ -698,9 +683,6 @@ static int do_reset(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
struct process *process; struct process *process;
(void)cmd;
(void)argc;
process = get_process(argv[1]); process = get_process(argv[1]);
if (!process) if (!process)
return -1; return -1;
@ -720,8 +702,6 @@ static int do_scan(struct cmd_opt *cmd, int argc, const char *argv[])
unsigned int i; unsigned int i;
int mode; int mode;
(void)argc;
if (!client_connected()) if (!client_connected())
return -1; return -1;
@ -818,9 +798,6 @@ static int do_start(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
struct process *process; struct process *process;
(void)cmd;
(void)argc;
if (!client_connected()) if (!client_connected())
return -1; return -1;
@ -842,9 +819,6 @@ static int do_status(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
struct process *process; struct process *process;
(void)cmd;
(void)argc;
process = get_process(argv[1]); process = get_process(argv[1]);
if (!process) if (!process)
return -1; return -1;
@ -858,9 +832,6 @@ static int do_stop(struct cmd_opt *cmd, int argc, const char *argv[])
{ {
struct process *process; struct process *process;
(void)cmd;
(void)argc;
if (!client_connected()) if (!client_connected())
return -1; return -1;
@ -917,10 +888,5 @@ void readline_exit(void)
{ {
if (!quit) if (!quit)
rl_callback_handler_remove(); rl_callback_handler_remove();
#if (RL_VERSION_MAJOR<=5 || (RL_VERSION_MAJOR==6 && RL_VERSION_MINOR<=3))
clear_history();
#else
rl_clear_history();
#endif
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,13 +1,214 @@
#define PACKAGE_VERSION "@MT_VERSION_STRING@" /* config.h.in. Generated from configure.ac by autoheader. */
#ifndef HAVE_PROCESS_VM_READV /* debugging */
#cmakedefine HAVE_PROCESS_VM_READV #undef DEBUG
/* disable client */
#undef DISABLE_CLIENT
/* elf_hash() takes char* (as opposed to unsigned char *) */
#undef ELF_HASH_TAKES_CHARP
/* Define to 1 if you have the `alarm' function. */
#undef HAVE_ALARM
/* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT
/* Define to 1 if you have the <bfd.h> header file. */
#undef HAVE_BFD_H
/* Define to 1 if you have the `clock_gettime' function. */
#undef HAVE_CLOCK_GETTIME
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* we have read mmap support */
#undef HAVE_ELF_C_READ_MMAP
/* Define to 1 if you have the <elf.h> header file. */
#undef HAVE_ELF_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the <gelf.h> header file. */
#undef HAVE_GELF_H
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `bfd' library (-lbfd). */
#undef HAVE_LIBBFD
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
/* Define to 1 if you have the `elf' library (-lelf). */
#undef HAVE_LIBELF
/* Define to 1 if you have the `pthread' library (-lpthread). */
#undef HAVE_LIBPTHREAD
/* Define to 1 if you have the `readline' library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the `rt' library (-lrt). */
#undef HAVE_LIBRT
/* Define to 1 if you have the `selinux' library (-lselinux). */
#undef HAVE_LIBSELINUX
/* Define to 1 if you have the `termcap' library (-ltermcap). */
#undef HAVE_LIBTERMCAP
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the `mkdir' function. */
#undef HAVE_MKDIR
/* Define to 1 if you have the `process_vm_readv' function. */
#undef HAVE_PROCESS_VM_READV
/* Define to 1 if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H
/* Define to 1 if you have the <readline/readline.h> header file. */
#undef HAVE_READLINE_READLINE_H
/* Define to 1 if you have the `rmdir' function. */
#undef HAVE_RMDIR
/* Define to 1 if you have the <selinux/selinux.h> header file. */
#undef HAVE_SELINUX_SELINUX_H
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strchr' function. */
#undef HAVE_STRCHR
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `strtoul' function. */
#undef HAVE_STRTOUL
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif #endif
#ifndef HAVE_LIBSELINUX /* Define to `int' if <sys/types.h> does not define. */
#cmakedefine HAVE_LIBSELINUX #undef pid_t
#endif
#ifndef DISABLE_CLIENT /* Define to `unsigned int' if <sys/types.h> does not define. */
#cmakedefine DISABLE_CLIENT #undef size_t
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork

View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Attempt to guess a canonical system name. # Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc. # Copyright 1992-2016 Free Software Foundation, Inc.
timestamp='2015-07-03' timestamp='2016-04-02'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -27,7 +27,7 @@ timestamp='2015-07-03'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
# #
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
# #
# Please send patches to <config-patches@gnu.org>. # Please send patches to <config-patches@gnu.org>.
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp) GNU config.guess ($timestamp)
Originally written by Per Bothner. Originally written by Per Bothner.
Copyright 1992-2015 Free Software Foundation, Inc. Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -237,6 +237,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;; exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*) *:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;; exit ;;
@ -249,6 +253,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:MirBSD:*:*) *:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;; exit ;;
*:Sortix:*:*)
echo ${UNAME_MACHINE}-unknown-sortix
exit ;;
alpha:OSF1:*:*) alpha:OSF1:*:*)
case $UNAME_RELEASE in case $UNAME_RELEASE in
*4.0) *4.0)
@ -265,42 +272,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in case "$ALPHA_CPU_TYPE" in
"EV4 (21064)") "EV4 (21064)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"EV4.5 (21064)") "EV4.5 (21064)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)") "LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;; UNAME_MACHINE=alpha ;;
"EV5 (21164)") "EV5 (21164)")
UNAME_MACHINE="alphaev5" ;; UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)") "EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;; UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)") "EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;; UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)") "EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;; UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)") "EV6 (21264)")
UNAME_MACHINE="alphaev6" ;; UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)") "EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;; UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)") "EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)") "EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)") "EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;; UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)") "EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;; UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)") "EV7 (21364)")
UNAME_MACHINE="alphaev7" ;; UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)") "EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;; UNAME_MACHINE=alphaev79 ;;
esac esac
# A Pn.n version is a patched version. # A Pn.n version is a patched version.
# A Vn.n version is a released version. # A Vn.n version is a released version.
# A Tn.n version is a released field test version. # A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel. # A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r. # 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code. # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$? exitcode=$?
trap '' 0 trap '' 0
@ -373,16 +380,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;; exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build eval $set_cc_for_build
SUN_ARCH="i386" SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects. # If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers. # This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null grep IS_64BIT_ARCH >/dev/null
then then
SUN_ARCH="x86_64" SUN_ARCH=x86_64
fi fi
fi fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@ -407,7 +414,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;; exit ;;
sun*:*:4.2BSD:*) sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in case "`/bin/arch`" in
sun3) sun3)
echo m68k-sun-sunos${UNAME_RELEASE} echo m68k-sun-sunos${UNAME_RELEASE}
@ -632,13 +639,13 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0 532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;; 32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH="hppa2.0w" ;; 64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;; esac ;;
esac esac
fi fi
@ -677,11 +684,11 @@ EOF
exit (0); exit (0);
} }
EOF EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;; fi ;;
esac esac
if [ ${HP_ARCH} = "hppa2.0w" ] if [ ${HP_ARCH} = hppa2.0w ]
then then
eval $set_cc_for_build eval $set_cc_for_build
@ -694,12 +701,12 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23 # => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__ grep -q __LP64__
then then
HP_ARCH="hppa2.0w" HP_ARCH=hppa2.0w
else else
HP_ARCH="hppa64" HP_ARCH=hppa64
fi fi
fi fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV} echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@ -804,14 +811,14 @@ EOF
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;; exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
5000:UNIX_System_V:4.*:*) 5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;; exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@ -893,7 +900,7 @@ EOF
exit ;; exit ;;
*:GNU/*:*:*) *:GNU/*:*:*)
# other systems with GNU libc and userland # other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;; exit ;;
i*86:Minix:*:*) i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix echo ${UNAME_MACHINE}-pc-minix
@ -916,7 +923,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;; EV68*) UNAME_MACHINE=alphaev68 ;;
esac esac
objdump --private-headers /bin/sh | grep -q ld.so.1 objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
arc:Linux:*:* | arceb:Linux:*:*) arc:Linux:*:* | arceb:Linux:*:*)
@ -962,6 +969,9 @@ EOF
ia64:Linux:*:*) ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
k1om:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*) m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;; exit ;;
@ -1128,7 +1138,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about # uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586. # the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub # Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build. # this is a cross-build.
echo i586-pc-msdosdjgpp echo i586-pc-msdosdjgpp
exit ;; exit ;;
@ -1277,6 +1287,9 @@ EOF
SX-8R:SUPER-UX:*:*) SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE} echo sx8r-nec-superux${UNAME_RELEASE}
exit ;; exit ;;
SX-ACE:SUPER-UX:*:*)
echo sxace-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*) Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE} echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;; exit ;;
@ -1290,9 +1303,9 @@ EOF
UNAME_PROCESSOR=powerpc UNAME_PROCESSOR=powerpc
fi fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null grep IS_64BIT_ARCH >/dev/null
then then
case $UNAME_PROCESSOR in case $UNAME_PROCESSOR in
@ -1314,7 +1327,7 @@ EOF
exit ;; exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*) *:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p` UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386 UNAME_PROCESSOR=i386
UNAME_MACHINE=pc UNAME_MACHINE=pc
fi fi
@ -1345,7 +1358,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386 # "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86 # is converted to i386 for consistency with other x86
# operating systems. # operating systems.
if test "$cputype" = "386"; then if test "$cputype" = 386; then
UNAME_MACHINE=i386 UNAME_MACHINE=i386
else else
UNAME_MACHINE="$cputype" UNAME_MACHINE="$cputype"
@ -1387,7 +1400,7 @@ EOF
echo i386-pc-xenix echo i386-pc-xenix
exit ;; exit ;;
i*86:skyos:*:*) i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;; exit ;;
i*86:rdos:*:*) i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos echo ${UNAME_MACHINE}-pc-rdos
@ -1398,6 +1411,9 @@ EOF
x86_64:VMkernel:*:*) x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx echo ${UNAME_MACHINE}-unknown-esx
exit ;; exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
esac esac
cat >&2 <<EOF cat >&2 <<EOF
@ -1407,9 +1423,9 @@ This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you the operating system you are using. It is advised that you
download the most up to date version of the config scripts from download the most up to date version of the config scripts from
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If the version you run ($0) is already up to date, please If the version you run ($0) is already up to date, please
send the following data and any information you think might be send the following data and any information you think might be

View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc. # Copyright 1992-2016 Free Software Foundation, Inc.
timestamp='2015-07-28' timestamp='2016-03-30'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -33,7 +33,7 @@ timestamp='2015-07-28'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
@ -53,8 +53,7 @@ timestamp='2015-07-28'
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
$0 [OPTION] ALIAS
Canonicalize a configuration name. Canonicalize a configuration name.
@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2015 Free Software Foundation, Inc. Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -306,7 +305,7 @@ case $basic_machine in
| riscv32 | riscv64 \ | riscv32 | riscv64 \
| rl78 | rx \ | rl78 | rx \
| score \ | score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \ | sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@ -521,7 +520,7 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
os=-aros os=-aros
;; ;;
asmjs) asmjs)
basic_machine=asmjs-unknown basic_machine=asmjs-unknown
;; ;;
aux) aux)
@ -1397,11 +1396,11 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* \ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
@ -1417,7 +1416,8 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1549,6 +1549,8 @@ case $os in
;; ;;
-nacl*) -nacl*)
;; ;;
-ios)
;;
-none) -none)
;; ;;
*) *)

View File

@ -64,7 +64,7 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir. # libraries, which are installed to $pkgauxdir.
# Set a version string for this script. # Set a version string for this script.
scriptversion=2015-01-20.17; # UTC scriptversion=2015-10-04.22; # UTC
# General shell script boiler plate, and helper functions. # General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
@ -1091,6 +1091,57 @@ func_relative_path ()
} }
# func_quote ARG
# --------------
# Aesthetically quote one ARG, store the result into $func_quote_result. Note
# that we keep attention to performance here (so far O(N) complexity as long as
# func_append is O(1)).
func_quote ()
{
$debug_cmd
func_quote_result=$1
case $func_quote_result in
*[\\\`\"\$]*)
case $func_quote_result in
*[\[\*\?]*)
func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"`
return 0
;;
esac
func_quote_old_IFS=$IFS
for _G_char in '\' '`' '"' '$'
do
# STATE($1) PREV($2) SEPARATOR($3)
set start "" ""
func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy
IFS=$_G_char
for _G_part in $func_quote_result
do
case $1 in
quote)
func_append func_quote_result "$3$2"
set quote "$_G_part" "\\$_G_char"
;;
start)
set first "" ""
func_quote_result=
;;
first)
set quote "$_G_part" ""
;;
esac
done
IFS=$func_quote_old_IFS
done
;;
*) ;;
esac
}
# func_quote_for_eval ARG... # func_quote_for_eval ARG...
# -------------------------- # --------------------------
# Aesthetically quote ARGs to be evaled later. # Aesthetically quote ARGs to be evaled later.
@ -1107,12 +1158,8 @@ func_quote_for_eval ()
func_quote_for_eval_unquoted_result= func_quote_for_eval_unquoted_result=
func_quote_for_eval_result= func_quote_for_eval_result=
while test 0 -lt $#; do while test 0 -lt $#; do
case $1 in func_quote "$1"
*[\\\`\"\$]*) _G_unquoted_arg=$func_quote_result
_G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
*)
_G_unquoted_arg=$1 ;;
esac
if test -n "$func_quote_for_eval_unquoted_result"; then if test -n "$func_quote_for_eval_unquoted_result"; then
func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
else else
@ -5258,7 +5305,8 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\"" file=\"\$0\""
qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` func_quote "$ECHO"
qECHO=$func_quote_result
$ECHO "\ $ECHO "\
# A function that is used when there is no print builtin or printf. # A function that is used when there is no print builtin or printf.
@ -7272,12 +7320,14 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection # -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support # --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
# -fuse-ld=* Linker select flags for GCC # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang # -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
# -fuse-ld=* Linker select flags for GCC
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
-fuse-ld=*) -specs=*|-fsanitize=*|-fuse-ld=*)
func_quote_for_eval "$arg" func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result arg=$func_quote_for_eval_result
func_append compile_command " $arg" func_append compile_command " $arg"
@ -10508,8 +10558,8 @@ EOF
relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi fi
done done
relink_command="(cd `pwd`; $relink_command)" func_quote "(cd `pwd`; $relink_command)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` relink_command=$func_quote_result
fi fi
# Only actually do things if not in dry run mode. # Only actually do things if not in dry run mode.
@ -10755,7 +10805,8 @@ EOF
done done
# Quote the link command for shipping. # Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` func_quote "$relink_command"
relink_command=$func_quote_result
if test yes = "$hardcode_automatic"; then if test yes = "$hardcode_automatic"; then
relink_command= relink_command=
fi fi

15652
configure vendored Executable file

File diff suppressed because it is too large Load Diff

287
configure.ac Normal file
View File

@ -0,0 +1,287 @@
# -*- Autoconf -*-
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
# Copyright (C) 2010,2013 Petr Machata, Red Hat Inc.
# Copyright (C) 2010,2011 Joe Damato
# Copyright (C) 2010 Marc Kleine-Budde
# Copyright (C) 2010 Zachary T Welch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.65)
AC_INIT([mtrace-ng],[0.6],[stefani@seibold.net])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR(main.c)
AC_CONFIG_MACRO_DIR([config/m4])
AC_CONFIG_AUX_DIR([config/autoconf])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
case "${host_os}" in
linux-gnu*) HOST_OS="linux-gnu" ;;
linux-uclibc*) HOST_OS="linux-gnu" ;;
*) AC_MSG_ERROR([unkown host-os ${host_os}]) ;;
esac
AC_SUBST(HOST_OS)
case "${host_cpu}" in
arm*|sa110) HOST_CPU="arm" ;;
cris*) HOST_CPU="cris" ;;
mips*) HOST_CPU="mips" ;;
powerpc|powerpc64) HOST_CPU="ppc" ;;
sun4u|sparc64) HOST_CPU="sparc" ;;
s390x) HOST_CPU="s390" ;;
i?86|x86_64) HOST_CPU="x86" ;;
*) HOST_CPU="${host_cpu}" ;;
esac
AC_SUBST(HOST_CPU)
# Checks for programs.
AC_PROG_CC
LT_INIT
# libtool-2: LT_INIT()
AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2])
AM_MAINTAINER_MODE
AC_MSG_CHECKING([whether to disable client support])
AC_ARG_ENABLE(client,
AC_MSG_WARN( hallo)
AS_HELP_STRING([--disable-client], [disable client @<:@default=no@:>@]),
[case "$enableval" in
n | no) CONFIG_DISABLE_CLIENT=yes ;;
*) CONFIG_DISABLE_CLIENT=no ;;
esac],
[CONFIG_DISABLE_CLIENT=no])
AC_MSG_RESULT([${CONFIG_DISABLE_CLIENT}])
if test "${CONFIG_DISABLE_CLIENT}" = "yes"; then
AC_DEFINE(DISABLE_CLIENT, 1, [disable client])
fi
AM_CONDITIONAL(DISABLE_CLIENT, [test "${CONFIG_DISABLE_CLIENT}" = "yes"])
AC_ARG_WITH([libelf],
AS_HELP_STRING([--with-libelf], [Prefix of libelf headers/library]),
[case "${withval}" in
(no)
AC_MSG_ERROR([*** libelf is a required dependency])
;;
(yes)
AC_MSG_ERROR([*** --with-libelf requires you to specify a path])
;;
(*)
AM_CPPFLAGS="${AM_CPPFLAGS} -I${withval}/include"
AM_LDFLAGS="${AM_LDFLAGS} -L${withval}/lib"
libelf_LD_LIBRARY_PATH="${withval}/lib"
;;
esac],[])
# Checks for libraries.
saved_CPPFLAGS="${CPPFLAGS}"
saved_LDFLAGS="${LDFLAGS}"
CPPFLAGS="${CPPFLAGS} ${AM_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${AM_LDFLAGS}"
# libelf
AC_CHECK_HEADERS([elf.h gelf.h],,
[AC_MSG_ERROR([*** elf.h or gelf.h not found on your system])]
)
AC_CHECK_LIB([elf], [elf_begin],,
[AC_MSG_ERROR([*** libelf not found on your system])]
)
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
# libreadline
if test "${CONFIG_DISABLE_CLIENT}" != "yes"; then
AC_CHECK_HEADERS([readline/readline.h],,
[AC_MSG_ERROR([*** readline.h not found on your system])]
)
AC_CHECK_LIB([readline], [rl_callback_read_char],,
[AC_MSG_ERROR([*** libreadline not found on your system])]
)
fi
# libbfd
if test "${CONFIG_DISABLE_CLIENT}" != "yes"; then
AC_CHECK_HEADERS([bfd.h],,
[AC_MSG_ERROR([*** bfd.h not found on your system])]
)
AC_CHECK_LIB([bfd], [bfd_openr],,
[AC_MSG_ERROR([*** libbfd not found on your system])]
)
fi
# libpthread
AC_CHECK_HEADERS([pthread.h],,
[AC_MSG_ERROR([*** pthread.h not found on your system])]
)
AC_CHECK_LIB([pthread], [pthread_create],,
[AC_MSG_ERROR([*** libpthread not found on your system])]
)
# libdl
AC_CHECK_HEADERS([dlfcn.h],,
[AC_MSG_ERROR([*** dlfcn.h not found on your system])]
)
AC_CHECK_LIB([dl], [dladdr],,
[AC_MSG_ERROR([*** libdl not found on your system])]
)
# libtermcap
#AC_CHECK_HEADERS([termcap.h],,
# [AC_MSG_ERROR([*** termcap.h not found on your system])]
#)
AC_CHECK_LIB([termcap], [tgetflag],,
)
dnl Check security_get_boolean_active availability.
AC_CHECK_HEADERS(selinux/selinux.h)
AC_CHECK_LIB(selinux, security_get_boolean_active)
saved_CPPFLAGS="${CPPFLAGS}"
saved_LDFLAGS="${LDFLAGS}"
CPPFLAGS="${CPPFLAGS} ${AM_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${AM_LDFLAGS}"
# HAVE_ELF_C_READ_MMAP
AC_MSG_CHECKING([whether elf_begin accepts ELF_C_READ_MMAP])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <gelf.h>]], [[
int main () {
Elf *elf = elf_begin(4, ELF_C_READ_MMAP, 0);
return 0;
}
]])],[
AC_DEFINE([HAVE_ELF_C_READ_MMAP], [1], [we have read mmap support])
AC_MSG_RESULT([yes])],[
AC_MSG_RESULT([no])])
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
saved_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -Wall -Werror"
AC_MSG_CHECKING([whether elf_hash takes a char* argument])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libelf.h>]], [[
(void) elf_hash("name");
]])],
[AC_DEFINE([ELF_HASH_TAKES_CHARP], [1],
[elf_hash() takes char* (as opposed to unsigned char *)])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
CFLAGS="${saved_CFLAGS}"
CPPFLAGS="${saved_CPPFLAGS}"
LDFLAGS="${saved_LDFLAGS}"
AM_CPPFLAGS=" \
${AM_CPPFLAGS} \
-I\$(top_srcdir)/client \
-I\$(top_srcdir)/sysdeps/${HOST_OS}/${HOST_CPU} \
-I\$(top_srcdir)/sysdeps/${HOST_OS} \
-I\$(top_srcdir)/sysdeps \
-I\$(top_srcdir) \
"
# Checks for header files.
AC_CHECK_HEADERS([ \
fcntl.h \
limits.h \
stddef.h \
stdint.h \
stdlib.h \
string.h \
sys/ioctl.h \
sys/param.h \
sys/time.h \
unistd.h \
])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_SIZEOF([long])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_CHECK_FUNCS([ \
alarm \
atexit \
getcwd \
gettimeofday \
clock_gettime \
memset \
mkdir \
rmdir \
strchr \
strdup \
strerror \
strtol \
strtoul \
process_vm_readv \
])
AC_CHECK_LIB([rt], [clock_gettime],,
[AC_MSG_ERROR([*** librt not found on your system])]
)
#
# Debugging
#
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=no@:>@]),
[case "$enableval" in
y | yes) CONFIG_DEBUG=yes ;;
*) CONFIG_DEBUG=no ;;
esac],
[CONFIG_DEBUG=no])
AC_MSG_RESULT([${CONFIG_DEBUG}])
if test "${CONFIG_DEBUG}" = "yes"; then
AC_DEFINE(DEBUG, 1, [debugging])
else
AM_CFLAGS="${AM_CFLAGS} -DNDEBUG"
fi
# Ignore the compiler's warnings at your own risk.
AM_CFLAGS="${AM_CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security -rdynamic"
AC_ARG_ENABLE([werror],
AS_HELP_STRING([--disable-werror], [disable use of -Werror]),
[enable_werror=$enableval], [enable_werror=yes])
if test x$enable_werror = xyes; then
AM_CFLAGS="${AM_CFLAGS} -Werror"
fi
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(AM_CFLAGS)
AC_SUBST(AM_LDFLAGS)
AC_SUBST(libelf_LD_LIBRARY_PATH)
AC_CONFIG_FILES([
Makefile
client/Makefile
sysdeps/Makefile
sysdeps/linux-gnu/Makefile
sysdeps/linux-gnu/x86/Makefile
sysdeps/linux-gnu/ppc/Makefile
sysdeps/linux-gnu/arm/Makefile
])
AC_OUTPUT

2
debian/control vendored
View File

@ -2,7 +2,7 @@ Source: mtrace-ng
Section: utils Section: utils
Priority: optional Priority: optional
Maintainer: Package Maintainers <Package-Maintainers@debian.com> Maintainer: Package Maintainers <Package-Maintainers@debian.com>
Build-Depends: debhelper (>= 8.0.0), autotools-dev, binutils-dev, libreadline6-dev, libselinux1-dev, libtinfo-dev, libelf-dev, zlib1g-dev, libncurses5-dev, libiberty-dev Build-Depends: debhelper (>= 8.0.0), autotools-dev, binutils-dev, libreadline6-dev, libselinux1-dev, libtinfo-dev, libelfg0-dev
Standards-Version: 3.9.4 Standards-Version: 3.9.4
Vcs-Git: https://github.com/sstefani/mtrace.git Vcs-Git: https://github.com/sstefani/mtrace.git

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -47,8 +47,6 @@ void _debug(int level, const char *file, const char *function, int line, const c
va_end(args); va_end(args);
fprintf(stderr, "DEBUG: %s():%s@%d - %s\n", function, file, line, buf); fprintf(stderr, "DEBUG: %s():%s@%d - %s\n", function, file, line, buf);
free(buf);
} }
#endif #endif

18
debug.h
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -28,11 +29,11 @@
/* debug levels: /* debug levels:
*/ */
enum { enum {
DEBUG_TRACE = 1, DEBUG_EVENT_HANDLER = 01,
DEBUG_DWARF = 2, DEBUG_DWARF = 02,
DEBUG_EVENT = 4, DEBUG_EVENT = 010,
DEBUG_PROCESS = 8, DEBUG_PROCESS = 020,
DEBUG_FUNCTION = 16, DEBUG_FUNCTION = 040
}; };
#ifdef DEBUG #ifdef DEBUG
@ -40,11 +41,6 @@ void _debug(int level, const char *file, const char *function, int line, const c
#else #else
static inline void _debug(int level, const char *file, const char *function, int line, const char *fmt, ...) static inline void _debug(int level, const char *file, const char *function, int line, const char *fmt, ...)
{ {
(void)level;
(void)file;
(void)function;
(void)line;
(void)fmt;
} }
#endif #endif

3
dict.c
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

3
dict.h
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

120
dwarf.c
View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the libunwind source * This file is based on the libunwind source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
@ -463,7 +463,7 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
{ {
struct dwarf_addr_space *indirect_as = as; struct dwarf_addr_space *indirect_as = as;
arch_addr_t val, initial_addr = *addr; arch_addr_t val, initial_addr = *addr;
arch_addr_t gp = as->cursor.libref->pltgot; arch_addr_t gp = as->cursor.libref->gp;
int is_64bit = as->is_64bit; int is_64bit = as->is_64bit;
void *tmp_ptr; void *tmp_ptr;
int ret; int ret;
@ -477,6 +477,16 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
arch_addr_t addr; arch_addr_t addr;
} tmp; } tmp;
#ifdef DEBUG
struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref;
if (*addr < ARCH_ADDR_T(libref->image_addr))
fatal("invalid access mem: addr %#lx < %p", *addr, libref->image_addr);
if (*addr >= ARCH_ADDR_T(libref->image_addr + libref->load_size))
fatal("invalid access mem: addr %#lx >= %p", *addr, libref->image_addr + libref->load_size);
#endif
memset(&tmp, 0, sizeof(tmp)); memset(&tmp, 0, sizeof(tmp));
if (valp) if (valp)
@ -611,15 +621,6 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
static inline int dwarf_read_encoded_pointer_local(struct dwarf_addr_space *as, arch_addr_t *addr, unsigned char encoding, arch_addr_t *valp, arch_addr_t start_ip) static inline int dwarf_read_encoded_pointer_local(struct dwarf_addr_space *as, arch_addr_t *addr, unsigned char encoding, arch_addr_t *valp, arch_addr_t start_ip)
{ {
#ifdef DEBUG
struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref;
if (*addr < ARCH_ADDR_T(libref->mmap_addr))
fatal("invalid access mem: addr %#lx < %p", *addr, libref->mmap_addr);
if (*addr >= ARCH_ADDR_T(libref->mmap_addr + libref->mmap_size))
fatal("invalid access mem: addr %#lx >= %p", *addr, libref->mmap_addr + libref->mmap_size);
#endif
return dwarf_read_encoded_pointer(as, 1, addr, encoding, valp, start_ip); return dwarf_read_encoded_pointer(as, 1, addr, encoding, valp, start_ip);
} }
@ -686,7 +687,7 @@ static int parse_cie(struct dwarf_addr_space *as, arch_addr_t addr, struct dwarf
return ret; return ret;
if (version != DWARF_CIE_VERSION && version != DWARF_CIE_VERSION_GCC) { if (version != DWARF_CIE_VERSION && version != DWARF_CIE_VERSION_GCC) {
debug(DEBUG_DWARF, "Got CIE version %u, expected version " STR(DWARF_CIE_VERSION) " or " STR(DWARF_CIE_VERSION_GCC), version); debug(DEBUG_DWARF, "Got CIE version %u, expected version " STR(DWARF_CIE_VERSION) "or" STR(DWARF_CIE_VERSION_GCC), version);
return -DWARF_EBADVERSION; return -DWARF_EBADVERSION;
} }
@ -870,16 +871,20 @@ static int dwarf_extract_cfi_from_fde(struct dwarf_addr_space *as, void *addrp)
return 0; return 0;
} }
static inline int lib_addr_match(struct libref *libref, arch_addr_t ip)
{
return ip >= libref->load_addr && ip < libref->load_addr + libref->load_size;
}
int dwarf_locate_map(struct dwarf_addr_space *as, arch_addr_t ip) int dwarf_locate_map(struct dwarf_addr_space *as, arch_addr_t ip)
{ {
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref;
if (c->use_prev_instr) if (c->use_prev_instr)
ip -= 1; ip -= 1;
if (likely(c->libref)) { if (likely(c->libref)) {
if (ip >= libref->txt_vaddr && ip < libref->txt_vaddr + libref->txt_size) if (lib_addr_match(c->libref, ip))
return 0; return 0;
} }
@ -890,16 +895,16 @@ int dwarf_locate_map(struct dwarf_addr_space *as, arch_addr_t ip)
return 0; return 0;
} }
static const struct table_entry *lookup(const struct table_entry *table, size_t fde_count, int32_t rel_ip) static const struct table_entry *lookup(const struct table_entry *table, size_t table_len, int32_t rel_ip)
{ {
const struct table_entry *e, *f; const struct table_entry *e, *f;
unsigned long lo, hi; unsigned long lo, hi;
if (!fde_count) if (!table_len)
return NULL; return NULL;
lo = 0; lo = 0;
hi = fde_count; hi = table_len;
f = NULL; f = NULL;
do { do {
unsigned long mid = (lo + hi) / 2; unsigned long mid = (lo + hi) / 2;
@ -917,7 +922,7 @@ static const struct table_entry *lookup(const struct table_entry *table, size_t
return f; return f;
} }
static int dwarf_search_unwind_table(struct dwarf_addr_space *as, arch_addr_t ip, void *fde_tab, unsigned long fde_count) static int dwarf_search_unwind_table(struct dwarf_addr_space *as, arch_addr_t ip, void *table_data, unsigned long table_len)
{ {
const struct table_entry *e; const struct table_entry *e;
void *fde_addr; void *fde_addr;
@ -925,19 +930,20 @@ static int dwarf_search_unwind_table(struct dwarf_addr_space *as, arch_addr_t ip
struct dwarf_cie_info *dci = &as->cursor.dci; struct dwarf_cie_info *dci = &as->cursor.dci;
struct libref *libref = as->cursor.libref; struct libref *libref = as->cursor.libref;
e = lookup(fde_tab, fde_count, ip - libref->eh_hdr_vaddr); e = lookup(table_data, table_len, ip - libref->load_addr - libref->seg_offset);
if (unlikely(!e)) { if (unlikely(!e)) {
/* IP is inside this table's range, but there is no explicit unwind info. */ /* IP is inside this table's range, but there is no explicit unwind info. */
debug(DEBUG_DWARF, "no unwind info found for IP %#lx", ip); debug(DEBUG_DWARF, "no unwind info found for IP %#lx", ip);
return -DWARF_ENOINFO; return -DWARF_ENOINFO;
} }
fde_addr = libref->mmap_addr + e->fde_offset + libref->eh_hdr_offset; fde_addr = libref->image_addr - libref->load_offset + e->fde_offset + libref->seg_offset;
if (unlikely((ret = dwarf_extract_cfi_from_fde(as, fde_addr)) < 0)) if (unlikely((ret = dwarf_extract_cfi_from_fde(as, fde_addr)) < 0))
return ret; return ret;
dci->start_ip = dci->start_ip - (arch_addr_t)libref->mmap_addr + libref->txt_vaddr; dci->start_ip -= ARCH_ADDR_T(libref->image_addr) - libref->load_addr;
if (!as->is_64bit) if (!as->is_64bit)
dci->start_ip &= 0xffffffff; dci->start_ip &= 0xffffffff;
@ -968,18 +974,18 @@ static int dwarf_access_reg(struct dwarf_addr_space *as, unsigned int reg, arch_
int dwarf_get(struct dwarf_addr_space *as, struct dwarf_loc loc, arch_addr_t *valp) int dwarf_get(struct dwarf_addr_space *as, struct dwarf_loc loc, arch_addr_t *valp)
{ {
arch_addr_t addr = DWARF_GET_LOC(loc); arch_addr_t val = DWARF_GET_LOC(loc);
if (DWARF_IS_REG_LOC(loc)) if (DWARF_IS_REG_LOC(loc))
return dwarf_access_reg(as, addr, valp); return dwarf_access_reg(as, val, valp);
if (!as->is_64bit) if (!as->is_64bit)
addr &= 0xffffffff; val &= 0xffffffff;
if (DWARF_IS_MEM_LOC(loc)) if (DWARF_IS_MEM_LOC(loc))
return dwarf_readw(as, &addr, valp, as->is_64bit); return dwarf_readw(as, &val, valp, as->is_64bit);
*valp = addr; *valp = val;
return 0; return 0;
} }
@ -1048,9 +1054,10 @@ static int run_cfi_program(struct dwarf_addr_space *as, struct dwarf_reg_state *
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct dwarf_cie_info *dci = &c->dci; struct dwarf_cie_info *dci = &c->dci;
unsigned int num_regs = as->num_regs; unsigned int num_regs = as->num_regs;
unsigned int reg_stack_ptr = 0; struct dwarf_reg_stack {
unsigned int reg_stack_entry_len = regs_size(as); struct dwarf_reg_stack *next; /* for reg state stack */
unsigned char reg_stack[16 * reg_stack_entry_len]; struct dwarf_reg_state store;
} *rs_stack = NULL, *rs_tmp;
curr_ip = dci->start_ip; curr_ip = dci->start_ip;
@ -1159,22 +1166,21 @@ static int run_cfi_program(struct dwarf_addr_space *as, struct dwarf_reg_state *
set_reg(rs_current, regnum, DWARF_WHERE_REG, n); set_reg(rs_current, regnum, DWARF_WHERE_REG, n);
break; break;
case DW_CFA_remember_state: case DW_CFA_remember_state:
if (unlikely(sizeof(reg_stack) - reg_stack_ptr < reg_stack_entry_len)) { rs_tmp = malloc(regs_size(as));
debug(DEBUG_DWARF, "register-state stack overflow"); memcpy(&rs_tmp->store, rs_current, regs_size(as));
ret = -DWARF_EINVAL; rs_tmp->next = rs_stack;
goto fail; rs_stack = rs_tmp;
}
memcpy(reg_stack + reg_stack_ptr, rs_current, reg_stack_entry_len);
reg_stack_ptr += reg_stack_entry_len;
break; break;
case DW_CFA_restore_state: case DW_CFA_restore_state:
if (unlikely(!reg_stack_ptr)) { if (unlikely(!rs_stack)) {
debug(DEBUG_DWARF, "register-state stack underflow"); debug(DEBUG_DWARF, "register-state stack underflow");
ret = -DWARF_EINVAL; ret = -DWARF_EINVAL;
goto fail; goto fail;
} }
reg_stack_ptr -= reg_stack_entry_len; rs_tmp = rs_stack;
memcpy(rs_current, reg_stack + reg_stack_ptr, reg_stack_entry_len); memcpy(rs_current, &rs_tmp->store, regs_size(as));
rs_stack = rs_tmp->next;
free(rs_tmp);
break; break;
case DW_CFA_def_cfa: case DW_CFA_def_cfa:
if ((unlikely((ret = read_regnum(num_regs, addr, &regnum)) < 0) if ((unlikely((ret = read_regnum(num_regs, addr, &regnum)) < 0)
@ -1263,6 +1269,12 @@ static int run_cfi_program(struct dwarf_addr_space *as, struct dwarf_reg_state *
ret = 0; ret = 0;
fail: fail:
/* Free the register-state stack, if not empty already. */
while (rs_stack) {
rs_tmp = rs_stack;
rs_stack = rs_stack->next;
free(rs_tmp);
}
return ret; return ret;
} }
@ -1796,7 +1808,7 @@ static int fetch_proc_info(struct dwarf_addr_space *as, arch_addr_t ip)
struct libref *libref = c->libref; struct libref *libref = c->libref;
int ret; int ret;
ret = dwarf_search_unwind_table(as, ip, libref->fde_tab, libref->fde_count); ret = dwarf_search_unwind_table(as, ip, libref->table_data, libref->table_len);
if (ret < 0) if (ret < 0)
return ret; return ret;
@ -1930,6 +1942,8 @@ fail:
c->ip = ip; c->ip = ip;
if (ret == -DWARF_ENOINFO) { if (ret == -DWARF_ENOINFO) {
debug(DEBUG_DWARF, "try arch specific step");
ret = dwarf_arch_step(as); ret = dwarf_arch_step(as);
if (!ret) { if (!ret) {
if (dwarf_locate_map(as, c->ip) < 0) if (dwarf_locate_map(as, c->ip) < 0)
@ -1974,8 +1988,7 @@ fail:
break; break;
} }
#endif #endif
if (ret != -DWARF_ENOINFO && ret != -DWARF_EBADFRAME) debug(DEBUG_DWARF, "error %d", ret);
debug(DEBUG_DWARF, "error %d", ret);
c->valid = 0; c->valid = 0;
} }
@ -1983,14 +1996,11 @@ fail:
return ret; return ret;
} }
int dwarf_get_unwind_table(struct task *task, struct libref *libref) int dwarf_get_unwind_table(struct task *task, struct libref *libref, struct dwarf_eh_frame_hdr *hdr)
{ {
arch_addr_t addr; arch_addr_t addr, fde_count;
arch_addr_t fde_count = 0;
arch_addr_t eh_frame = 0;
int ret; int ret;
struct dwarf_addr_space tmp_as; struct dwarf_addr_space tmp_as;
struct dwarf_eh_frame_hdr *hdr = (struct dwarf_eh_frame_hdr *)(libref->mmap_addr + libref->eh_hdr_offset);
memset(&tmp_as, 0, sizeof(tmp_as)); memset(&tmp_as, 0, sizeof(tmp_as));
@ -2000,32 +2010,26 @@ int dwarf_get_unwind_table(struct task *task, struct libref *libref)
if (hdr->version != DW_EH_VERSION) { if (hdr->version != DW_EH_VERSION) {
debug(DEBUG_DWARF, "exception table has unexpected version %d", hdr->version); debug(DEBUG_DWARF, "exception table has unexpected version %d", hdr->version);
abort();
return -DWARF_ENOINFO; return -DWARF_ENOINFO;
} }
addr = ARCH_ADDR_T(hdr + 1); addr = ARCH_ADDR_T(hdr + 1);
/* read eh_frame_ptr: */ /* (Optionally) read eh_frame_ptr: */
if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, &eh_frame, 0)) < 0) { if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, NULL, 0)) < 0)
abort();
return -DWARF_ENOINFO; return -DWARF_ENOINFO;
}
/* (Optionally) read fde_count: */ /* (Optionally) read fde_count: */
if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->fde_count_enc, &fde_count, 0)) < 0) { if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->fde_count_enc, &fde_count, 0)) < 0)
abort();
return -DWARF_ENOINFO; return -DWARF_ENOINFO;
}
if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) { if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
debug(DEBUG_DWARF, "unsupported unwind table encoding."); debug(DEBUG_DWARF, "unsupported unwind table encoding.");
abort();
return -DWARF_EINVAL; return -DWARF_EINVAL;
} }
libref->fde_tab = (void *)addr; libref->table_data = (void *)addr;
libref->fde_count = fde_count; libref->table_len = fde_count;
return 0; return 0;
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the libunwind source * This file is based on the libunwind source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
@ -58,7 +58,7 @@
#define DWARF_EINVAL 4 /* unsupported operation or bad value */ #define DWARF_EINVAL 4 /* unsupported operation or bad value */
#define DWARF_EBADVERSION 5 /* unwind info has unsupported version */ #define DWARF_EBADVERSION 5 /* unwind info has unsupported version */
#define DWARF_ENOINFO 6 /* no unwind info found */ #define DWARF_ENOINFO 6 /* no unwind info found */
#define DWARF_STOPUNWIND 7 #define DWARF_STOPUNWIND 7 /* no unwind info found */
struct dwarf_cie_info { struct dwarf_cie_info {
arch_addr_t start_ip; /* first IP covered by this procedure */ arch_addr_t start_ip; /* first IP covered by this procedure */
@ -115,7 +115,7 @@ int dwarf_locate_map(struct dwarf_addr_space *as, arch_addr_t ip);
int dwarf_get(struct dwarf_addr_space *as, struct dwarf_loc loc, arch_addr_t *valp); int dwarf_get(struct dwarf_addr_space *as, struct dwarf_loc loc, arch_addr_t *valp);
int dwarf_get_unwind_table(struct task *task, struct libref *libref); int dwarf_get_unwind_table(struct task *task, struct libref *libref, struct dwarf_eh_frame_hdr *hdr);
int dwarf_arch_init(struct dwarf_addr_space *as); int dwarf_arch_init(struct dwarf_addr_space *as);
int dwarf_arch_init_unwind(struct dwarf_addr_space *as); int dwarf_arch_init_unwind(struct dwarf_addr_space *as);

282
event.c
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -52,16 +53,10 @@
#include "timer.h" #include "timer.h"
#include "trace.h" #include "trace.h"
#define RET_DELETED 1
#define RET_DEFERED 2
static LIST_HEAD(event_head); static LIST_HEAD(event_head);
void queue_event(struct task *task) void queue_event(struct task *task)
{ {
assert(task->event.type != EVENT_NONE);
assert(task->stopped);
if (task) { if (task) {
if (task->event.type != EVENT_NONE) if (task->event.type != EVENT_NONE)
list_add_tail(&task->event.list, &event_head); list_add_tail(&task->event.list, &event_head);
@ -93,37 +88,42 @@ void init_event(struct task *task)
INIT_LIST_HEAD(&task->event.list); INIT_LIST_HEAD(&task->event.list);
} }
static const char * get_clone_type(enum event_type type) static void show_clone(struct task *task, enum event_type type)
{ {
const char *str;
switch(type) { switch(type) {
case EVENT_FORK: case EVENT_FORK:
return "fork"; str = "fork";
break;
case EVENT_VFORK: case EVENT_VFORK:
return "vfork"; str = "vfork";
break;
case EVENT_CLONE: case EVENT_CLONE:
return "clone"; str = "clone";
break;
default: default:
str = "?";
break; break;
} }
return "?"; fprintf(stderr, "+++ process pid=%d %s (newpid=%d) +++\n", task->pid, str, task->event.e_un.newpid);
} }
static int do_clone(struct task *task, struct task *newtask) static void handle_clone(struct task *task, enum event_type type)
{ {
debug(DEBUG_EVENT, "+++ process %s pid=%d, newpid=%d", get_clone_type(task->event.type), task->pid, newtask->pid); struct task *newtask;
int newpid = task->event.e_un.newpid;
debug(DEBUG_FUNCTION, "pid=%d, newpid=%d", task->pid, newpid);
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process %s pid=%d, newpid=%d\n", get_clone_type(task->event.type), task->pid, newtask->pid); show_clone(task, type);
assert(task->stopped); continue_task(task, 0);
assert(newtask->stopped);
assert(newtask->is_new);
if (unlikely(options.verbose && newtask->event.type != EVENT_NEW)) newtask = pid2task(newpid);
fprintf(stderr, "!!!task new unexpected event for pid=%d: %d\n", newtask->pid, newtask->event.type); if (!newtask)
else goto fail;
if (unlikely(options.verbose && newtask->event.e_un.signum))
fprintf(stderr, "!!!task new unexpected signal for pid=%d: %d\n", newtask->pid, newtask->event.e_un.signum);
if (newtask->leader == newtask) { if (newtask->leader == newtask) {
if (task_fork(task, newtask) < 0) if (task_fork(task, newtask) < 0)
@ -131,7 +131,7 @@ static int do_clone(struct task *task, struct task *newtask)
if (!options.follow) { if (!options.follow) {
remove_proc(newtask); remove_proc(newtask);
return RET_DELETED; return;
} }
report_fork(newtask, task); report_fork(newtask, task);
@ -141,130 +141,77 @@ static int do_clone(struct task *task, struct task *newtask)
goto fail; goto fail;
} }
newtask->is_new = 0; continue_task(newtask, newtask->event.e_un.signum);
return continue_task(newtask, 0);
return;
fail: fail:
fprintf(stderr, "Error during clone of pid=%d - This process won't be traced!\n", newtask->pid); fprintf(stderr,
return -1; "Error during init of tracing process %d\n"
"This process won't be traced.\n",
newpid
);
} }
static int do_clone_cb(struct task *newtask, void *data) static void handle_signal(struct task *task)
{ {
int ret;
struct task *task = data;
debug(DEBUG_EVENT, "+++ process do clone cb pid=%d, newpid=%d", task->pid, newtask->pid);
ret = do_clone(task, newtask);
continue_task(task, 0);
return ret;
}
static int handle_child(struct task *task)
{
struct task *newtask;
int newpid = task->event.e_un.newpid;
debug(DEBUG_EVENT, "+++ process child pid=%d, newpid=%d", task->pid, newpid);
newtask = pid2task(newpid);
assert(newtask != NULL);
if (!newtask->stopped) {
debug(DEBUG_EVENT, "+++ process defer child pid=%d, newpid=%d", task->pid, newpid);
newtask->defer_func = do_clone_cb;
newtask->defer_data = task;
return RET_DEFERED;
}
do_clone(task, newtask);
return continue_task(task, 0);
}
static int handle_signal(struct task *task)
{
debug(DEBUG_EVENT, "+++ process signal pid=%d, event signal %d", task->pid, task->event.e_un.signum);
if (unlikely(options.verbose > 1)) { if (unlikely(options.verbose > 1)) {
if (task->event.e_un.signum) if (task->event.e_un.signum && (task->event.e_un.signum != SIGSTOP || !task->was_stopped))
fprintf(stderr, "+++ process pid=%d signal %d: %s\n", task->pid, task->event.e_un.signum, strsignal(task->event.e_un.signum)); fprintf(stderr, "+++ process pid=%d signal %d: %s +++\n", task->pid, task->event.e_un.signum, strsignal(task->event.e_un.signum));
} }
return continue_task(task, task->event.e_un.signum); continue_task(task, task->event.e_un.signum);
} }
static void show_exit(struct task *task) static void show_exit(struct task *task)
{ {
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process pid=%d exited (status=%d)\n", task->pid, task->event.e_un.ret_val); fprintf(stderr, "+++ process pid=%d exited (status=%d) +++\n", task->pid, task->event.e_un.ret_val);
} }
static int handle_new(struct task *task) static void handle_about_exit(struct task *task)
{ {
debug(DEBUG_EVENT, "+++ process new pid=%d, event signal %d", task->pid, task->event.e_un.signum);
assert(task->is_new);
if (unlikely(options.verbose && task->event.e_un.signum))
fprintf(stderr, "!!!task unexpected signal for pid=%d: %d\n", task->pid, task->event.e_un.signum);
task->is_new = 0;
return continue_task(task, task->event.e_un.signum);
}
static int handle_about_exit(struct task *task)
{
debug(DEBUG_EVENT, "+++ process pid=%d about exit", task->pid);
if (task->leader == task) { if (task->leader == task) {
if (!options.logfile && report_about_exit(task) != -1) { if (!options.logfile && report_about_exit(task) != -1) {
task->about_exit = 1; task->about_exit = 1;
return 0; return;
} }
} }
return continue_task(task, 0); continue_task(task, 0);
} }
static int handle_exit(struct task *task) static void handle_exit(struct task *task)
{ {
debug(DEBUG_EVENT, "+++ process pid=%d exited (status=%d)", task->pid, task->event.e_un.ret_val);
show_exit(task); show_exit(task);
if (task->leader == task) { if (task->leader == task) {
report_exit(task); report_exit(task);
untrace_proc(task); remove_proc(task);
} }
else { else {
remove_task(task); remove_task(task);
} }
return RET_DELETED;
} }
static int handle_exit_signal(struct task *task) static void handle_exit_signal(struct task *task)
{ {
debug(DEBUG_EVENT, "+++ process pid=%d killed by signal %s (%d)", task->pid, strsignal(task->event.e_un.signum), task->event.e_un.signum);
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process pid=%d killed by signal %s (%d)\n", task->pid, strsignal(task->event.e_un.signum), task->event.e_un.signum); fprintf(stderr, "+++ process pid=%d killed by signal %s (%d) +++\n", task->pid, strsignal(task->event.e_un.signum), task->event.e_un.signum);
if (task->leader == task) { if (task->leader == task) {
report_exit(task); report_exit(task);
untrace_proc(task); remove_proc(task);
} }
else { else {
remove_task(task); remove_task(task);
} }
return RET_DELETED;
} }
static int handle_exec(struct task *task) static void handle_exec(struct task *task)
{ {
debug(DEBUG_EVENT, "+++ process pid=%d exec", task->pid); debug(DEBUG_FUNCTION, "pid=%d", task->pid);
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process pid=%d exec\n", task->pid); fprintf(stderr, "+++ process pid=%d exec (%s) +++\n", task->pid, library_execname(task));
if (!options.follow_exec) if (!options.follow_exec)
goto nofollow; goto nofollow;
@ -274,20 +221,18 @@ static int handle_exec(struct task *task)
goto untrace; goto untrace;
} }
return continue_task(task, 0); continue_task(task, 0);
return;
nofollow: nofollow:
report_nofollow(task); report_nofollow(task);
untrace: untrace:
untrace_proc(task); remove_proc(task);
return RET_DELETED;
} }
static int handle_call_after(struct task *task, struct breakpoint *bp) static int handle_call_after(struct task *task, struct breakpoint *bp)
{ {
struct timespec start; struct timespec start;
(void)bp;
if (!task->breakpoint) if (!task->breakpoint)
return 0; return 0;
@ -310,42 +255,16 @@ static int handle_call_after(struct task *task, struct breakpoint *bp)
return 0; return 0;
} }
static int handle_breakpoint(struct task *task) static void handle_breakpoint(struct task *task)
{ {
struct breakpoint *bp = task->event.e_un.breakpoint; struct breakpoint *bp = task->event.e_un.breakpoint;
unsigned int hw = bp->hw; unsigned int hw = bp->hw;
debug(DEBUG_EVENT, "+++ process pid=%d breakpoint addr=%#lx", task->pid, bp->addr); debug(DEBUG_FUNCTION, "pid=%d, addr=%#lx", task->pid, bp->addr);
assert(task->stopped);
if (unlikely(options.verbose > 1)) if (unlikely(options.verbose > 1))
set_timer(&task->halt_time, hw ? &hw_bp_time : &sw_bp_time); set_timer(&task->halt_time, hw ? &hw_bp_time : &sw_bp_time);
if (unlikely(options.verbose))
++bp->count;
if (unlikely(task->skip_bp)) {
struct breakpoint *skip_bp = task->skip_bp;
task->skip_bp = NULL;
breakpoint_put(skip_bp);
if (likely(skip_bp == bp)) {
skip_breakpoint(task, bp);
goto end;
}
if (unlikely(options.verbose))
fprintf(stderr, "!!!unhandled skip breakpoint for pid=%d\n", task->pid);
}
if (unlikely(bp->deleted)) {
continue_task(task, 0);
goto end;
}
#if HW_BREAKPOINTS > 1 #if HW_BREAKPOINTS > 1
if (bp->type >= BP_HW) { if (bp->type >= BP_HW) {
if (unlikely(++bp->hwcnt >= (BP_REORDER_THRESHOLD << hw))) { if (unlikely(++bp->hwcnt >= (BP_REORDER_THRESHOLD << hw))) {
@ -362,7 +281,28 @@ static int handle_breakpoint(struct task *task)
} }
#endif #endif
if (bp->on_hit && bp->on_hit(task, bp)) { if (unlikely(options.verbose))
++bp->count;
if (unlikely(task->skip_bp)) {
struct breakpoint *skip_bp = task->skip_bp;
task->skip_bp = NULL;
breakpoint_put(skip_bp);
if (likely(skip_bp == bp)) {
skip_breakpoint(task, bp);
goto end;
}
}
if (unlikely(bp->deleted)) {
continue_task(task, 0);
goto end;
}
if (unlikely(breakpoint_on_hit(task, bp))) {
continue_task(task, 0); continue_task(task, 0);
goto end; goto end;
} }
@ -396,85 +336,65 @@ static int handle_breakpoint(struct task *task)
} }
} }
if (task->bp_skipped) if (task->stopped)
task->bp_skipped = 0;
else
skip_breakpoint(task, bp); skip_breakpoint(task, bp);
end: end:
breakpoint_put(bp); breakpoint_put(bp);
return 0;
} }
int handle_event(struct task *task) int handle_event(void)
{ {
int ret; struct task *task = next_event();
if (!task) if (!task)
return 0; return 0;
debug(DEBUG_EVENT, "+++ process pid=%d event: %d", task->pid, task->event.type);
assert(task->stopped);
if (task->defer_func) {
ret = task->defer_func(task, task->defer_data);
if (ret == RET_DELETED)
return 1;
task->defer_func = NULL;
task->defer_data = NULL;
goto out2;
}
struct event *event = &task->event; struct event *event = &task->event;
enum event_type type = event->type; enum event_type type = event->type;
event->type = EVENT_NONE;
debug(DEBUG_FUNCTION, "pid=%d, type=%d", task->pid, event->type);
switch (type) { switch (type) {
case EVENT_NONE: case EVENT_NONE:
ret = continue_task(task, task->event.e_un.signum); debug(DEBUG_EVENT_HANDLER, "pid=%d, event none", task->pid);
break; break;
case EVENT_SIGNAL: case EVENT_SIGNAL:
ret = handle_signal(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event signal %d", task->pid, event->e_un.signum);
handle_signal(task);
break; break;
case EVENT_ABOUT_EXIT: case EVENT_ABOUT_EXIT:
ret = handle_about_exit(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit %d", task->pid, event->e_un.ret_val);
goto out1; handle_about_exit(task);
break;
case EVENT_EXIT: case EVENT_EXIT:
ret = handle_exit(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit %d", task->pid, event->e_un.ret_val);
handle_exit(task);
break; break;
case EVENT_EXIT_SIGNAL: case EVENT_EXIT_SIGNAL:
ret = handle_exit_signal(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit signal %d", task->pid, event->e_un.signum);
handle_exit_signal(task);
break; break;
case EVENT_FORK: case EVENT_FORK:
case EVENT_VFORK: case EVENT_VFORK:
case EVENT_CLONE: case EVENT_CLONE:
ret = handle_child(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event clone (%u)", task->pid, event->e_un.newpid);
handle_clone(task, type);
break; break;
case EVENT_EXEC: case EVENT_EXEC:
ret = handle_exec(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event exec()", task->pid);
handle_exec(task);
break; break;
case EVENT_BREAKPOINT: case EVENT_BREAKPOINT:
ret = handle_breakpoint(task); debug(DEBUG_EVENT_HANDLER, "pid=%d, event breakpoint %#lx", task->pid, event->e_un.breakpoint->addr);
goto out2; handle_breakpoint(task);
case EVENT_NEW:
ret = handle_new(task);
break; break;
default: default:
fprintf(stderr, "fatal error, unknown event %d\n", type); fprintf(stderr, "Error! unknown event?\n");
abort(); return -1;
} }
if (ret == RET_DELETED) return 1;
return 1;
if (ret != RET_DEFERED) {
assert(task->event.type == EVENT_NONE);
assert(task->stopped == 0);
}
out2:
assert(task->is_new == 0);
out1:
return (ret < 0) ? ret : 0;
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -36,8 +36,7 @@ enum event_type {
EVENT_CLONE, EVENT_CLONE,
EVENT_VFORK, EVENT_VFORK,
EVENT_EXEC, EVENT_EXEC,
EVENT_BREAKPOINT, EVENT_BREAKPOINT
EVENT_NEW,
}; };
struct event { struct event {
@ -55,7 +54,7 @@ void init_event(struct task *task);
void remove_event(struct task *task); void remove_event(struct task *task);
struct task *next_event(void); struct task *next_event(void);
void queue_event(struct task *task); void queue_event(struct task *task);
int handle_event(struct task *task); int handle_event(void);
#endif #endif

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -66,8 +67,8 @@ void libref_delete(struct libref *libref)
free(sym); free(sym);
} }
if (libref->mmap_addr) if (libref->image_addr)
munmap(libref->mmap_addr, libref->txt_size); munmap(libref->image_addr, libref->load_size);
free((void *)libref->filename); free((void *)libref->filename);
free(libref); free(libref);
@ -149,14 +150,14 @@ struct library_symbol *library_find_symbol(struct libref *libref, arch_addr_t ad
return NULL; return NULL;
} }
struct library *library_find_by_dyn(struct list_head *list, arch_addr_t dyn) struct library *library_find_with_key(struct list_head *list, arch_addr_t key)
{ {
struct list_head *it; struct list_head *it;
list_for_each(it, list) { list_for_each(it, list) {
struct library *lib = container_of(it, struct library, list); struct library *lib = container_of(it, struct library, list);
if (lib->libref->dyn == dyn) if (lib->libref->key == key)
return lib; return lib;
} }
return NULL; return NULL;
@ -170,10 +171,10 @@ void library_delete_list(struct task *leader, struct list_head *list)
struct library *lib = container_of(it, struct library, list); struct library *lib = container_of(it, struct library, list);
struct libref *libref = lib->libref; struct libref *libref = lib->libref;
debug(DEBUG_FUNCTION, "%s@%#lx pid=%d ", libref->filename, libref->dyn, leader->pid); debug(DEBUG_FUNCTION, "%s@%#lx", libref->filename, libref->base);
if (unlikely(options.verbose > 1)) if (unlikely(options.verbose > 1))
fprintf(stderr, "+++ library del pid=%d %s@%#lx %#lx-%#lx\n", leader->pid, libref->filename, libref->dyn, libref->txt_vaddr, libref->txt_vaddr + libref->txt_size); fprintf(stderr, "+++ library del pid=%d %s@%#lx %#lx-%#lx +++\n", leader->pid, libref->filename, libref->base, libref->load_addr, libref->load_addr + libref->load_size);
library_delete(leader, lib); library_delete(leader, lib);
} }
@ -210,6 +211,11 @@ static void library_each_symbol(struct libref *libref, void (*cb)(struct library
} }
} }
static inline int lib_addr_match(struct libref *libref, arch_addr_t addr)
{
return addr >= libref->load_addr && addr < libref->load_addr + libref->load_size;
}
struct libref *addr2libref(struct task *leader, arch_addr_t addr) struct libref *addr2libref(struct task *leader, arch_addr_t addr)
{ {
struct rb_node **new = &(leader->libraries_tree.rb_node); struct rb_node **new = &(leader->libraries_tree.rb_node);
@ -218,10 +224,10 @@ struct libref *addr2libref(struct task *leader, arch_addr_t addr)
while (*new) { while (*new) {
struct libref *this = container_of(*new, struct library, rb_node)->libref; struct libref *this = container_of(*new, struct library, rb_node)->libref;
if (addr >= this->txt_vaddr && addr < this->txt_vaddr + this->txt_size) if (lib_addr_match(this, addr))
return this; return this;
if (this->txt_vaddr < addr) if (this->load_addr < addr)
new = &((*new)->rb_left); new = &((*new)->rb_left);
else else
new = &((*new)->rb_right); new = &((*new)->rb_right);
@ -240,7 +246,7 @@ static void insert_lib(struct task *leader, struct library *lib)
parent = *new; parent = *new;
if (this->libref->txt_vaddr < lib->libref->txt_vaddr) if (this->libref->load_addr < lib->libref->load_addr)
new = &((*new)->rb_left); new = &((*new)->rb_left);
else else
new = &((*new)->rb_right); new = &((*new)->rb_right);
@ -253,7 +259,7 @@ static void insert_lib(struct task *leader, struct library *lib)
static struct library *_library_add(struct task *leader, struct libref *libref) static struct library *_library_add(struct task *leader, struct libref *libref)
{ {
debug(DEBUG_PROCESS, "%s@%#lx to pid=%d", libref->filename, libref->dyn, leader->pid); debug(DEBUG_PROCESS, "%s@%#lx to pid=%d", libref->filename, libref->base, leader->pid);
assert(leader->leader == leader); assert(leader->leader == leader);
@ -268,7 +274,7 @@ static struct library *_library_add(struct task *leader, struct libref *libref)
insert_lib(leader, lib); insert_lib(leader, lib);
if (unlikely(options.verbose > 1)) if (unlikely(options.verbose > 1))
fprintf(stderr, "+++ library add pid=%d %s@%#lx %#lx-%#lx\n", leader->pid, libref->filename, libref->dyn, libref->txt_vaddr, libref->txt_vaddr + libref->txt_size); fprintf(stderr, "+++ library add pid=%d %s@%#lx %#lx-%#lx +++\n", leader->pid, libref->filename, libref->base, libref->load_addr, libref->load_addr + libref->load_size);
return lib; return lib;
} }

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -43,11 +44,12 @@ struct library_symbol {
}; };
struct libref { struct libref {
/* Unique dynamic entry address */ /* Unique key. Two library objects are considered equal, if
arch_addr_t dyn; * they have the same key. */
arch_addr_t key;
/* base address assign by the loader */ /* Address where the library is mapped. */
unsigned long bias; arch_addr_t base;
/* Absolute address of the entry point. Useful for main /* Absolute address of the entry point. Useful for main
* binary, though I suppose the value might be useful for the * binary, though I suppose the value might be useful for the
@ -58,21 +60,19 @@ struct libref {
const char *filename; const char *filename;
/* executable segment */ /* executable segment */
unsigned long txt_vaddr; unsigned long load_offset;
unsigned long txt_size; unsigned long load_addr;
unsigned long txt_offset; unsigned long load_size;
unsigned long bias;
/* mapped image */ /* mapped image */
void *mmap_addr; void *image_addr;
unsigned long mmap_offset;
unsigned long mmap_size;
/* global-pointer */ /* global-pointer */
arch_addr_t pltgot; arch_addr_t gp;
unsigned long eh_hdr_offset; unsigned long seg_offset;
unsigned long eh_hdr_vaddr; void *table_data;
void *fde_tab; unsigned long table_len;
unsigned long fde_count;
unsigned int type; unsigned int type;
#ifdef __arm__ #ifdef __arm__
@ -122,8 +122,8 @@ const char *library_execname(struct task *leader);
/* Iterate through list of symbols of library. */ /* Iterate through list of symbols of library. */
struct library_symbol *library_find_symbol(struct libref *libref, arch_addr_t addr); struct library_symbol *library_find_symbol(struct libref *libref, arch_addr_t addr);
/* find a library with a given dynamic entry address */ /* find a library with a given key */
struct library *library_find_by_dyn(struct list_head *list, arch_addr_t dyn); struct library *library_find_with_key(struct list_head *list, arch_addr_t key);
/* create a library reference. */ /* create a library reference. */
struct libref *libref_new(unsigned int type); struct libref *libref_new(unsigned int type);

26
list.h
View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on linux kernel list.h * This file is based on linux kernel list.h
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
@ -55,39 +55,41 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
* This is only for internal list manipulation where we know * This is only for internal list manipulation where we know
* the prev/next entries already! * the prev/next entries already!
*/ */
static inline void __list_add(struct list_head *elem, struct list_head *prev, struct list_head *next) static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{ {
next->prev = elem; next->prev = new;
elem->next = next; new->next = next;
elem->prev = prev; new->prev = prev;
prev->next = elem; prev->next = new;
} }
/** /**
* list_add - add a new entry * list_add - add a new entry
* @elem: new entry to be added * @new: new entry to be added
* @head: list head to add it after * @head: list head to add it after
* *
* Insert a new entry after the specified head. * Insert a new entry after the specified head.
* This is good for implementing stacks. * This is good for implementing stacks.
*/ */
static inline void list_add(struct list_head *elem, struct list_head *head) static inline void list_add(struct list_head *new, struct list_head *head)
{ {
__list_add(elem, head, head->next); __list_add(new, head, head->next);
} }
/** /**
* list_add_tail - add a new entry * list_add_tail - add a new entry
* @elem: new entry to be added * @new: new entry to be added
* @head: list head to add it before * @head: list head to add it before
* *
* Insert a new entry before the specified head. * Insert a new entry before the specified head.
* This is useful for implementing queues. * This is useful for implementing queues.
*/ */
static inline void list_add_tail(struct list_head *elem, struct list_head *head) static inline void list_add_tail(struct list_head *new, struct list_head *head)
{ {
__list_add(elem, head->prev, head); __list_add(new, head->prev, head);
} }
/* /*

29
main.c
View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -39,9 +39,7 @@
#include "backend.h" #include "backend.h"
#include "breakpoint.h" #include "breakpoint.h"
#include "common.h" #include "common.h"
#ifndef DISABLE_CLIENT
#include "client.h" #include "client.h"
#endif
#include "debug.h" #include "debug.h"
#include "options.h" #include "options.h"
#include "library.h" #include "library.h"
@ -61,8 +59,6 @@ struct mt_timer report_in_time;
struct mt_timer report_out_time; struct mt_timer report_out_time;
struct mt_timer skip_bp_time; struct mt_timer skip_bp_time;
pid_t mtrace_pid;
static int do_exit; static int do_exit;
void mtrace_request_exit(void) void mtrace_request_exit(void)
@ -71,7 +67,7 @@ void mtrace_request_exit(void)
return; return;
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ request exit\n"); fprintf(stderr, "+++ request exit +++\n");
do_exit = 1; do_exit = 1;
wait_event_wakeup(); wait_event_wakeup();
@ -112,8 +108,6 @@ static void mtrace_init(char **cmd_args)
{ {
struct opt_p_t *opt_p_tmp; struct opt_p_t *opt_p_tmp;
mtrace_pid = getpid();
if (options.command) { if (options.command) {
struct task *task = task_create(cmd_args); struct task *task = task_create(cmd_args);
@ -121,7 +115,7 @@ static void mtrace_init(char **cmd_args)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process pid=%d created (%s)\n", task->pid, library_execname(task)); fprintf(stderr, "+++ process pid=%d created (%s) +++\n", task->pid, library_execname(task));
} }
for(opt_p_tmp = options.opt_p; opt_p_tmp; opt_p_tmp = opt_p_tmp->next) for(opt_p_tmp = options.opt_p; opt_p_tmp; opt_p_tmp = opt_p_tmp->next)
@ -130,17 +124,12 @@ static void mtrace_init(char **cmd_args)
static void mtrace_main(void) static void mtrace_main(void)
{ {
struct task *task;
while(!do_exit) { while(!do_exit) {
if (task_list_empty()) if (task_list_empty())
break; break;
task = next_event(); if (handle_event() == -1)
if (task) { break;
if (handle_event(task) == -1)
break;
}
if (server_poll() == -1) if (server_poll() == -1)
break; break;
@ -151,6 +140,8 @@ int main(int argc, char *argv[])
{ {
char **cmd_args = process_options(argc, argv); char **cmd_args = process_options(argc, argv);
init_pid_hash();
if (options.trace) { if (options.trace) {
if (options.logfile) { if (options.logfile) {
if (server_logfile() == -1) if (server_logfile() == -1)
@ -162,7 +153,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
else { else {
#ifdef DISABLE_CLIENT #if DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n"); fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#else #else
@ -177,7 +168,7 @@ int main(int argc, char *argv[])
} }
} }
else { else {
#ifdef DISABLE_CLIENT #if DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n"); fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#else #else
@ -202,7 +193,7 @@ int main(int argc, char *argv[])
report_info(0); report_info(0);
report_disconnect(); report_disconnect();
#ifndef DISABLE_CLIENT #if !DISABLE_CLIENT
client_stop(); client_stop();
#endif #endif
server_stop(); server_stop();

5
main.h
View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -23,8 +23,6 @@
#ifndef _INC_MAIN_H #ifndef _INC_MAIN_H
#define _INC_MAIN_H #define _INC_MAIN_H
#include <sys/types.h>
#include "timer.h" #include "timer.h"
void mtrace_request_exit(void); void mtrace_request_exit(void);
@ -38,6 +36,5 @@ struct mt_timer report_in_time;
struct mt_timer report_out_time; struct mt_timer report_out_time;
struct mt_timer skip_bp_time; struct mt_timer skip_bp_time;
pid_t mtrace_pid;
#endif #endif

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -31,7 +31,7 @@
#define IS64BIT 0 #define IS64BIT 0
#endif #endif
#define MEMTRACE_SI_VERSION 9 #define MEMTRACE_SI_VERSION 8
#define MEMTRACE_SI_FORK 1 #define MEMTRACE_SI_FORK 1
#define MEMTRACE_SI_EXEC 2 #define MEMTRACE_SI_EXEC 2
@ -100,7 +100,6 @@ struct __attribute__((packed)) mt_pid_payload {
struct __attribute__((packed)) mt_scan_payload { struct __attribute__((packed)) mt_scan_payload {
uint32_t ptr_size; uint32_t ptr_size;
uint32_t pad; // for 64 bit alignment
uint64_t mask; uint64_t mask;
char data[0]; char data[0];
}; };

159
mtelf.c
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -47,34 +48,6 @@
#include "common.h" #include "common.h"
#include "report.h" #include "report.h"
#define PAGESIZE 4096
#define PAGEALIGN (PAGESIZE - 1)
struct mt_elf {
int fd;
const char *filename;
Elf *elf;
unsigned long loadbase;
unsigned long loadsize;
unsigned long vstart;
GElf_Ehdr ehdr;
Elf_Data *dynsym;
size_t dynsym_count;
const char *dynstr;
Elf_Data *symtab;
const char *strtab;
size_t symtab_count;
GElf_Addr bias;
GElf_Addr entry_addr;
GElf_Addr base_addr;
GElf_Addr interp;
GElf_Phdr txt_hdr;
GElf_Phdr eh_hdr;
GElf_Addr dyn;
GElf_Phdr exidx_hdr;
GElf_Addr pltgot;
};
static int open_elf(struct mt_elf *mte, struct task *task, const char *filename) static int open_elf(struct mt_elf *mte, struct task *task, const char *filename)
{ {
char *cwd; char *cwd;
@ -244,47 +217,50 @@ static int populate_symtab(struct mt_elf *mte, struct libref *libref)
return populate_this_symtab(mte, libref, mte->dynsym, mte->dynstr, mte->dynsym_count); return populate_this_symtab(mte, libref, mte->dynsym, mte->dynstr, mte->dynsym_count);
} }
static inline int elf_map_image(struct mt_elf *mte, void **mmap_addr) static inline int elf_map_image(struct mt_elf *mte, void **image_addr)
{ {
void *addr; void *addr;
volatile char *p;
addr = mmap(NULL, mte->loadsize, PROT_READ, MAP_PRIVATE, mte->fd, mte->loadbase); addr = mmap(NULL, mte->txt_hdr.p_filesz, PROT_READ, MAP_PRIVATE, mte->fd, mte->txt_hdr.p_offset);
if (addr == MAP_FAILED) { if (addr == MAP_FAILED) {
fprintf(stderr, "mmap failed\n"); fprintf(stderr, "mmap failed\n");
return -1; return -1;
} }
*mmap_addr = addr; *image_addr = addr;
/* prefetch */
for(p = addr; (void *)p <= addr + mte->txt_hdr.p_filesz; p += PAGE_SIZE)
*p;
return 0; return 0;
} }
static int elf_lib_init(struct mt_elf *mte, struct task *task, struct libref *libref) static int elf_lib_init(struct mt_elf *mte, struct task *task, struct libref *libref)
{ {
if (elf_map_image(mte, &libref->mmap_addr)) if (elf_map_image(mte, &libref->image_addr))
return -1; return -1;
libref->base = ARCH_ADDR_T(mte->base_addr);
libref->entry = ARCH_ADDR_T(mte->entry_addr); libref->entry = ARCH_ADDR_T(mte->entry_addr);
libref->mmap_offset = mte->loadbase; libref->load_offset = mte->txt_hdr.p_offset;
libref->mmap_size = mte->loadsize; libref->load_addr = mte->txt_hdr.p_vaddr + mte->bias;
libref->txt_vaddr = mte->txt_hdr.p_vaddr - mte->vstart + mte->bias; libref->load_size = mte->txt_hdr.p_filesz;
libref->txt_size = mte->txt_hdr.p_filesz;
libref->txt_offset = mte->txt_hdr.p_offset - mte->loadbase;
libref->bias = mte->bias; libref->bias = mte->bias;
libref->eh_hdr_offset = mte->eh_hdr.p_offset - mte->loadbase; libref->seg_offset = mte->eh_hdr.p_offset;
libref->eh_hdr_vaddr = mte->eh_hdr.p_vaddr - mte->vstart + mte->bias; libref->gp = mte->pltgot;
libref->pltgot = mte->pltgot - mte->vstart + mte->bias; libref->key = mte->dyn;
libref->dyn = mte->dyn - mte->vstart + mte->bias;
#ifdef __arm__ #ifdef __arm__
if (mte->exidx_hdr.p_filesz) { if (mte->exidx_hdr.p_filesz) {
libref->exidx_data = libref->mmap_addr + mte->exidx_hdr.p_offset - mte->loadbase; libref->exidx_data = libref->image_addr + mte->exidx_hdr.p_offset;
libref->exidx_len = mte->exidx_hdr.p_filesz; libref->exidx_len = mte->exidx_hdr.p_memsz;
} }
#endif #endif
if (mte->eh_hdr.p_filesz && mte->dyn) { if (mte->eh_hdr.p_filesz && mte->dyn_addr) {
if (dwarf_get_unwind_table(task, libref) < 0) if (dwarf_get_unwind_table(task, libref, (struct dwarf_eh_frame_hdr *)(libref->image_addr - libref->load_offset + mte->eh_hdr.p_offset)) < 0)
return -1; return -1;
} }
@ -299,20 +275,11 @@ static void close_elf(struct mt_elf *mte)
if (mte->fd != -1) { if (mte->fd != -1) {
elf_end(mte->elf); elf_end(mte->elf);
close(mte->fd); close(mte->fd);
mte->fd = -1;
mte->filename = NULL;
} }
} }
static int elf_read(struct mt_elf *mte, struct task *task, const char *filename) static int elf_read(struct mt_elf *mte, struct task *task, const char *filename, GElf_Addr bias)
{ {
unsigned long loadsize = 0;
unsigned long loadbase = ~0;
unsigned long align;
unsigned long vstart;
unsigned int loadsegs = 0;
debug(DEBUG_FUNCTION, "filename=%s", filename); debug(DEBUG_FUNCTION, "filename=%s", filename);
if (open_elf(mte, task, filename) < 0) if (open_elf(mte, task, filename) < 0)
@ -326,28 +293,14 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename)
memset(&mte->exidx_hdr, 0, sizeof(mte->exidx_hdr)); memset(&mte->exidx_hdr, 0, sizeof(mte->exidx_hdr));
for (i = 0; gelf_getphdr(mte->elf, i, &phdr) != NULL; ++i) { for (i = 0; gelf_getphdr(mte->elf, i, &phdr) != NULL; ++i) {
switch (phdr.p_type) { switch (phdr.p_type) {
case PT_LOAD: case PT_LOAD:
loadsegs++; if (!mte->base_addr || mte->base_addr > phdr.p_vaddr + bias)
mte->base_addr = phdr.p_vaddr + bias;
align = phdr.p_align;
if (align)
align -= 1;
vstart = phdr.p_vaddr & ~align;
if (mte->vstart > vstart)
mte->vstart = vstart;
if (loadbase > phdr.p_offset)
loadbase = phdr.p_offset;
if (loadsize < phdr.p_offset + phdr.p_filesz)
loadsize = phdr.p_offset + phdr.p_filesz;
if ((phdr.p_flags & (PF_X | PF_W)) == PF_X) if ((phdr.p_flags & (PF_X | PF_W)) == PF_X)
mte->txt_hdr = phdr; mte->txt_hdr = phdr;
break; break;
case PT_GNU_EH_FRAME: case PT_GNU_EH_FRAME:
mte->eh_hdr = phdr; mte->eh_hdr = phdr;
@ -358,28 +311,25 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename)
break; break;
#endif #endif
case PT_INTERP: case PT_INTERP:
mte->interp = phdr.p_vaddr; mte->interp = phdr.p_vaddr + bias;
break; break;
case PT_DYNAMIC: case PT_DYNAMIC:
mte->dyn = phdr.p_vaddr; mte->dyn = phdr.p_vaddr + bias;
break; break;
default: default:
break; break;
} }
} }
if (!loadsegs) { if (!mte->base_addr) {
fprintf(stderr, "No loadable segemnts in %s\n", filename); fprintf(stderr, "Couldn't determine base address of %s\n", filename);
return -1; return -1;
} }
mte->loadbase = loadbase & ~PAGEALIGN; debug(DEBUG_FUNCTION, "filename=`%s' load_offset=%#llx addr=%#llx size=%#llx",
mte->loadsize = (loadsize + (loadbase - mte->loadbase) + PAGEALIGN) & ~PAGEALIGN;
debug(DEBUG_FUNCTION, "filename=`%s' text offset=%#llx addr=%#llx size=%#llx",
filename, filename,
(unsigned long long)mte->txt_hdr.p_offset, (unsigned long long)mte->txt_hdr.p_offset,
(unsigned long long)mte->txt_hdr.p_vaddr, (unsigned long long)mte->txt_hdr.p_vaddr + bias,
(unsigned long long)mte->txt_hdr.p_filesz); (unsigned long long)mte->txt_hdr.p_filesz);
for (i = 1; i < mte->ehdr.e_shnum; ++i) { for (i = 1; i < mte->ehdr.e_shnum; ++i) {
@ -420,9 +370,16 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename)
break; break;
} }
} }
mte->dyn_addr = shdr.sh_addr + bias;
} }
} }
if (!mte->dyn_addr) {
fprintf(stderr, "Couldn't find .dynamic section \"%s\"\n", filename);
return -1;
}
if (!mte->dynsym || !mte->dynstr) { if (!mte->dynsym || !mte->dynstr) {
fprintf(stderr, "Couldn't find .dynsym or .dynstr in \"%s\"\n", filename); fprintf(stderr, "Couldn't find .dynsym or .dynstr in \"%s\"\n", filename);
return -1; return -1;
@ -438,11 +395,11 @@ int elf_read_library(struct task *task, struct libref *libref, const char *filen
libref_set_filename(libref, filename); libref_set_filename(libref, filename);
if (elf_read(&mte, task, filename) == -1) if (elf_read(&mte, task, filename, bias) == -1)
return -1; return -1;
mte.bias = bias; mte.bias = bias;
mte.entry_addr = mte.ehdr.e_entry - mte.vstart + bias; mte.entry_addr = mte.ehdr.e_entry + bias;
ret = elf_lib_init(&mte, task, libref); ret = elf_lib_init(&mte, task, libref);
@ -517,7 +474,7 @@ static int entry_breakpoint_on_hit(struct task *task, struct breakpoint *a)
return 1; return 1;
} }
struct libref *elf_read_main_binary(struct task *task, int was_attached) struct libref *elf_read_main_binary(struct task *task)
{ {
char fname[PATH_MAX]; char fname[PATH_MAX];
int ret; int ret;
@ -541,11 +498,9 @@ struct libref *elf_read_main_binary(struct task *task, int was_attached)
fname[ret] = 0; fname[ret] = 0;
free(filename);
libref_set_filename(libref, fname); libref_set_filename(libref, fname);
if (elf_read(&mte, task, fname) == -1) if (elf_read(&mte, task, filename, 0) == -1)
goto fail3; goto fail3;
task->is_64bit = is_64bit(&mte); task->is_64bit = is_64bit(&mte);
@ -555,15 +510,17 @@ struct libref *elf_read_main_binary(struct task *task, int was_attached)
goto fail3; goto fail3;
} }
mte.bias = entry - mte.ehdr.e_entry - mte.vstart; free(filename);
mte.entry_addr = entry;
mte.bias = (GElf_Addr) (uintptr_t) entry - mte.ehdr.e_entry;
mte.entry_addr = (GElf_Addr) (uintptr_t) entry;
if (elf_lib_init(&mte, task, libref)) if (elf_lib_init(&mte, task, libref))
goto fail3; goto fail3;
close_elf(&mte); close_elf(&mte);
report_attach(task, was_attached); report_attach(task);
library_add(task, libref); library_add(task, libref);
@ -572,12 +529,9 @@ struct libref *elf_read_main_binary(struct task *task, int was_attached)
struct mt_elf mte_ld = { }; struct mt_elf mte_ld = { };
if (copy_str_from_proc(task, ARCH_ADDR_T(mte.bias + mte.interp - mte.vstart), fname, sizeof(fname)) == -1) { copy_str_from_proc(task, ARCH_ADDR_T(mte.interp), fname, sizeof(fname));
fprintf(stderr, "fatal error: cannot get loader name for pid=%d\n", task->pid);
abort();
}
if (!elf_read(&mte_ld, task, fname)) { if (!elf_read(&mte_ld, task, fname, (GElf_Addr)base)) {
struct libref *libref; struct libref *libref;
libref = libref_new(LIBTYPE_LOADER); libref = libref_new(LIBTYPE_LOADER);
@ -586,14 +540,14 @@ struct libref *elf_read_main_binary(struct task *task, int was_attached)
libref_set_filename(libref, fname); libref_set_filename(libref, fname);
mte_ld.bias = base; mte_ld.bias = (GElf_Addr)base;
mte_ld.entry_addr = base + mte_ld.ehdr.e_entry - mte.vstart; mte_ld.entry_addr = mte_ld.ehdr.e_entry + (GElf_Addr)base;
ret = elf_lib_init(&mte_ld, task, libref); ret = elf_lib_init(&mte_ld, task, libref);
if (!ret) { if (!ret) {
library_add(task, libref); library_add(task, libref);
if (linkmap_init(task, ARCH_ADDR_T(mte.bias + mte.dyn - mte.vstart))) { if (linkmap_init(task, ARCH_ADDR_T(mte.dyn_addr))) {
arch_addr_t addr = find_solib_break(&mte_ld); arch_addr_t addr = find_solib_break(&mte_ld);
if (!addr) if (!addr)
addr = ARCH_ADDR_T(entry); addr = ARCH_ADDR_T(entry);
@ -608,7 +562,7 @@ struct libref *elf_read_main_binary(struct task *task, int was_attached)
else { else {
entry_bp->breakpoint.on_hit = entry_breakpoint_on_hit; entry_bp->breakpoint.on_hit = entry_breakpoint_on_hit;
entry_bp->breakpoint.locked = 1; entry_bp->breakpoint.locked = 1;
entry_bp->dyn_addr = ARCH_ADDR_T(mte.bias + mte.dyn - mte.vstart); entry_bp->dyn_addr = ARCH_ADDR_T(mte.dyn_addr);
breakpoint_enable(task, &entry_bp->breakpoint); breakpoint_enable(task, &entry_bp->breakpoint);
} }
@ -644,8 +598,3 @@ fail1:
return libref; return libref;
} }
int mte_cmp_machine(struct mt_elf *mte, Elf64_Half type)
{
return mte->ehdr.e_machine == type;
}

35
mtelf.h
View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -29,12 +30,38 @@
#include "forward.h" #include "forward.h"
#include "sysdep.h" #include "sysdep.h"
struct mt_elf {
int fd;
const char *filename;
Elf *elf;
GElf_Ehdr ehdr;
Elf_Data *dynsym;
size_t dynsym_count;
const char *dynstr;
Elf_Data *symtab;
const char *strtab;
size_t symtab_count;
GElf_Addr dyn_addr;
GElf_Addr bias;
GElf_Addr entry_addr;
GElf_Addr base_addr;
GElf_Addr interp;
GElf_Phdr txt_hdr;
GElf_Phdr eh_hdr;
GElf_Addr dyn;
GElf_Phdr exidx_hdr;
GElf_Addr pltgot;
};
struct elf_image {
void *addr; /* pointer to mmap'd image */
size_t size; /* (file-) size of the image */
};
int elf_read_library(struct task *task, struct libref *libref, const char *filename, GElf_Addr bias); int elf_read_library(struct task *task, struct libref *libref, const char *filename, GElf_Addr bias);
/* Create a library object representing the main binary. */ /* Create a library object representing the main binary. */
struct libref *elf_read_main_binary(struct task *task, int was_attached); struct libref *elf_read_main_binary(struct task *task);
int mte_cmp_machine(struct mt_elf *mte, Elf64_Half type);
#endif #endif

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -38,7 +39,6 @@
#include <pwd.h> #include <pwd.h>
#include "common.h" #include "common.h"
#include "debug.h"
#include "options.h" #include "options.h"
#ifndef SYSCONFDIR #ifndef SYSCONFDIR
@ -119,15 +119,14 @@ static void usage(void)
#ifdef DEBUG #ifdef DEBUG
static void usage_debug(void) static void usage_debug(void)
{ {
fprintf(stdout, "%s debugging option, --debug=<num> or -D<num>:\n", progname); fprintf(stdout, "%s debugging option, --debug=<octal> or -D<octal>:\n", progname);
fprintf(stdout, fprintf(stdout,
"\n" "\n"
" number description\n" " number ref. in source description\n"
" 1 ptrace events\n" " 1 general Generally helpful progress information\n"
" 2 dwarf issues\n" " 10 event Shows every event received by a traced process\n"
" 4 Shows every event received by a traced process\n" " 20 process Shows actions carried upon a traced processes\n"
" 8 Shows actions carried upon a traced processes\n" " 40 function Shows every entry to internal functions\n"
" 16 Shows every entry to internal functions\n"
"\n" "\n"
"Debugging options are mixed using bitwise-or.\n" "Debugging options are mixed using bitwise-or.\n"
"Note that the meanings and values are subject to change.\n" "Note that the meanings and values are subject to change.\n"
@ -172,11 +171,11 @@ static char *search_for_command(char *filename)
static int add_opt_F(char *filename) static int add_opt_F(char *filename)
{ {
struct opt_F_t *tmp = malloc(sizeof(*tmp));
if (access(filename, R_OK)) if (access(filename, R_OK))
return -1; return -1;
struct opt_F_t *tmp = malloc(sizeof(*tmp));
if (!tmp) { if (!tmp) {
fprintf(stderr, "%s\n", strerror(errno)); fprintf(stderr, "%s\n", strerror(errno));
exit(1); exit(1);
@ -410,9 +409,9 @@ char **process_options(int argc, char **argv)
usage_debug(); usage_debug();
exit(0); exit(0);
} }
options.debug = strtoul(optarg, &p, 0); options.debug = strtoul(optarg, &p, 8);
if (*p) { if (*p) {
fprintf(stderr, "%s: --debug requires an numeric argument\n", progname); fprintf(stderr, "%s: --debug requires an octal argument\n", progname);
err_usage(); err_usage();
} }
#endif #endif
@ -544,7 +543,7 @@ char **process_options(int argc, char **argv)
break; break;
case 'V': case 'V':
printf("mtrace-ng version " PACKAGE_VERSION ".\n" printf("mtrace-ng version " PACKAGE_VERSION ".\n"
"Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>.\n" "Copyright (C) 2016 Stefani Seibold <stefani@seibold.net>.\n"
"\n" "\n"
"This software was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.\n" "This software was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.\n"
"\n" "\n"

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -40,6 +41,8 @@
#define OPT_SORT_MISMATCHED 8 #define OPT_SORT_MISMATCHED 8
#define OPT_SORT_BADFREE 9 #define OPT_SORT_BADFREE 9
struct options_t options;
struct opt_p_t { struct opt_p_t {
pid_t pid; pid_t pid;
struct opt_p_t *next; struct opt_p_t *next;
@ -90,8 +93,6 @@ struct options_t {
int lflag; /* long dump */ int lflag; /* long dump */
}; };
extern struct options_t options;
char **process_options(int argc, char **argv); char **process_options(int argc, char **argv);
#endif #endif

View File

@ -1,6 +1,7 @@
/* /*
* Red Black Trees * Red Black Trees
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the linux kernel source * This file is based on the linux kernel source
* Copyright (C) 1999 Andrea Arcangeli <andrea@suse.de> * Copyright (C) 1999 Andrea Arcangeli <andrea@suse.de>
* Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org> * Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org>

View File

@ -1,6 +1,7 @@
/* /*
* Red Black Trees * Red Black Trees
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the linux kernel source * This file is based on the linux kernel source
* Copyright (C) 1999 Andrea Arcangeli <andrea@suse.de> * Copyright (C) 1999 Andrea Arcangeli <andrea@suse.de>
* *

162
report.c
View File

@ -2,7 +2,7 @@
* report events to client * report events to client
* *
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -73,6 +73,8 @@ static void report_alloc64(struct task *task, enum mt_operation op, unsigned lon
} }
} }
skip_breakpoint(task, task->event.e_un.breakpoint);
server_send_msg(op, task->leader->pid, alloc, sizeof(*alloc) + i * sizeof(uint64_t)); server_send_msg(op, task->leader->pid, alloc, sizeof(*alloc) + i * sizeof(uint64_t));
} }
@ -106,7 +108,6 @@ static void report_alloc32(struct task *task, enum mt_operation op, unsigned lon
} }
} }
task->bp_skipped = 1;
skip_breakpoint(task, task->event.e_un.breakpoint); skip_breakpoint(task, task->event.e_un.breakpoint);
server_send_msg(op, task->leader->pid, alloc, sizeof(*alloc) + i * sizeof(uint32_t)); server_send_msg(op, task->leader->pid, alloc, sizeof(*alloc) + i * sizeof(uint32_t));
@ -138,23 +139,6 @@ static void _report_malloc(struct task *task, struct library_symbol *libsym)
_report_alloc_op(task, libsym, MT_MALLOC); _report_alloc_op(task, libsym, MT_MALLOC);
} }
#if 0
static void _report_malloc1(struct task *task, struct library_symbol *libsym)
{
unsigned long ret = fetch_retval(task);
report_alloc(task, MT_MALLOC, ret, 1, options.bt_depth, libsym);
}
#endif
static void _report_reallocarray(struct task *task, struct library_symbol *libsym)
{
unsigned long size = fetch_param(task, 1) * fetch_param(task, 2);
unsigned long ret = fetch_retval(task);
report_alloc(task, MT_MALLOC, ret, size, options.bt_depth, libsym);
}
static void _report_new(struct task *task, struct library_symbol *libsym) static void _report_new(struct task *task, struct library_symbol *libsym)
{ {
_report_alloc_op(task, libsym, options.sanity ? MT_NEW : MT_MALLOC); _report_alloc_op(task, libsym, options.sanity ? MT_NEW : MT_MALLOC);
@ -189,35 +173,31 @@ static void report_delete_array(struct task *task, struct library_symbol *libsym
static void _report_realloc(struct task *task, struct library_symbol *libsym) static void _report_realloc(struct task *task, struct library_symbol *libsym)
{ {
unsigned long size = fetch_param(task, 1);
unsigned long ret = fetch_retval(task); unsigned long ret = fetch_retval(task);
if (!task->in_realloc) { if (ret) {
if (ret) unsigned long size = fetch_param(task, 1);
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
return;
}
task->in_realloc = 0;
if (ret)
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym); report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
if (task_is_64bit(task)) {
struct mt_alloc_payload_64 *alloc = alloca(sizeof(*alloc));
alloc->ptr = (uint64_t)ret;
alloc->size = (uint64_t)task->pid;
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc));
} }
else {
struct mt_alloc_payload_32 *alloc = alloca(sizeof(*alloc));
alloc->ptr = (uint32_t)ret; if (fetch_param(task, 0)) {
alloc->size = (uint32_t)task->pid; if (task_is_64bit(task)) {
struct mt_alloc_payload_64 *alloc = alloca(sizeof(*alloc));
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc)); alloc->ptr = (uint64_t)ret;
alloc->size = (uint64_t)task->pid;
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc));
}
else {
struct mt_alloc_payload_32 *alloc = alloca(sizeof(*alloc));
alloc->ptr = (uint32_t)ret;
alloc->size = (uint32_t)task->pid;
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc));
}
} }
} }
@ -225,12 +205,7 @@ static void report_realloc(struct task *task, struct library_symbol *libsym)
{ {
unsigned long addr = fetch_param(task, 0); unsigned long addr = fetch_param(task, 0);
assert(!task->in_realloc); report_alloc(task, MT_REALLOC_ENTER, addr, task->pid, options.sanity ? options.bt_depth : 0, libsym);
if (addr) {
task->in_realloc = 1;
report_alloc(task, MT_REALLOC_ENTER, addr, task->pid, options.sanity ? options.bt_depth : 0, libsym);
}
} }
static void _report_calloc(struct task *task, struct library_symbol *libsym) static void _report_calloc(struct task *task, struct library_symbol *libsym)
@ -241,9 +216,6 @@ static void _report_calloc(struct task *task, struct library_symbol *libsym)
report_alloc(task, MT_MALLOC, ret, size, options.bt_depth, libsym); report_alloc(task, MT_MALLOC, ret, size, options.bt_depth, libsym);
} }
static ssize_t arch_pagesize = -1;
static void _report_mmap(struct task *task, struct library_symbol *libsym) static void _report_mmap(struct task *task, struct library_symbol *libsym)
{ {
unsigned long ret = fetch_retval(task); unsigned long ret = fetch_retval(task);
@ -252,11 +224,6 @@ static void _report_mmap(struct task *task, struct library_symbol *libsym)
return; return;
unsigned long size = fetch_param(task, 1); unsigned long size = fetch_param(task, 1);
if (unlikely(arch_pagesize==-1)) arch_pagesize=getpagesize();
// fixup size, if size is not a multiple of the pagesize, we get the "partial" page too. -
if (size % arch_pagesize) {
size += arch_pagesize - size % arch_pagesize;
}
report_alloc(task, MT_MMAP, ret, size, options.bt_depth, libsym); report_alloc(task, MT_MMAP, ret, size, options.bt_depth, libsym);
} }
@ -285,34 +252,17 @@ static void _report_mmap64(struct task *task, struct library_symbol *libsym)
else else
size.l = fetch_param(task, 1); size.l = fetch_param(task, 1);
if (unlikely(arch_pagesize == -1)) arch_pagesize=getpagesize();
// fixup size, if size is not a multiple of the pagesize, we get the "partial" page too. -
if (size.l % arch_pagesize) {
size.l += arch_pagesize - size.l % arch_pagesize;
}
report_alloc(task, MT_MMAP64, ret, size.l, options.bt_depth, libsym); report_alloc(task, MT_MMAP64, ret, size.l, options.bt_depth, libsym);
} }
static void _report_munmap(struct task *task, struct library_symbol *libsym) static void report_munmap(struct task *task, struct library_symbol *libsym)
{ {
unsigned long addr = fetch_param(task, 0); unsigned long addr = fetch_param(task, 0);
unsigned long size = fetch_param(task, 1); unsigned long size = fetch_param(task, 1);
unsigned long ret = fetch_retval(task);
if(ret != 0 ) return;
if(unlikely(arch_pagesize==-1)) arch_pagesize=getpagesize();
// fixup size, if needed: all pages in [addr, addr+size] are unmapped -- see munmap(2)
if(size % arch_pagesize) {
size += arch_pagesize - size % arch_pagesize;
}
report_alloc(task, MT_MUNMAP, addr, size, 0, libsym); report_alloc(task, MT_MUNMAP, addr, size, 0, libsym);
} }
static void _report_memalign(struct task *task, struct library_symbol *libsym) static void _report_memalign(struct task *task, struct library_symbol *libsym)
{ {
unsigned long size = fetch_param(task, 1); unsigned long size = fetch_param(task, 1);
@ -369,20 +319,20 @@ static void _report_pvalloc(struct task *task, struct library_symbol *libsym)
return report_alloc(task, MT_PVALLOC, ret, size, options.bt_depth, libsym); return report_alloc(task, MT_PVALLOC, ret, size, options.bt_depth, libsym);
} }
static void _report_mremap(struct task *task, struct library_symbol *libsym) static void report_mremap(struct task *task, struct library_symbol *libsym)
{ {
unsigned long addr = fetch_param(task, 0); unsigned long addr = fetch_param(task, 0);
unsigned long oldsize = fetch_param(task, 1); unsigned long size = fetch_param(task, 1);
unsigned long newsize = fetch_param(task, 2); report_alloc(task, MT_MUNMAP, addr, size, 0, libsym);
}
static void _report_mremap(struct task *task, struct library_symbol *libsym)
{
unsigned long size = fetch_param(task, 2);
unsigned long ret = fetch_retval(task); unsigned long ret = fetch_retval(task);
if( (void*)ret != MAP_FAILED) { report_alloc(task, MT_MMAP, ret, size, options.bt_depth, libsym);
// mremap(2): if oldsize is zero and the mapping a shared mapping, a new mapping
// (Of the existing) will be created.
if (oldsize) report_alloc(task, MT_MUNMAP, addr, oldsize, 0, libsym);
report_alloc(task, MT_MMAP, ret, newsize, options.bt_depth, libsym);
}
} }
static const struct function flist[] = { static const struct function flist[] = {
@ -393,23 +343,13 @@ static const struct function flist[] = {
{ "posix_memalign", "posix_memalign", 0, NULL, _report_posix_memalign }, { "posix_memalign", "posix_memalign", 0, NULL, _report_posix_memalign },
{ "mmap", "mmap", 0, NULL, _report_mmap }, { "mmap", "mmap", 0, NULL, _report_mmap },
{ "mmap64", "mmap64", 1, NULL, _report_mmap64 }, { "mmap64", "mmap64", 1, NULL, _report_mmap64 },
{ "munmap", "munmap", 0, NULL, _report_munmap }, { "munmap", "munmap", 0, report_munmap, NULL },
{ "memalign", "memalign", 0, NULL, _report_memalign }, { "memalign", "memalign", 0, NULL, _report_memalign },
{ "aligned_alloc", "aligned_alloc", 1, NULL, _report_aligned_alloc }, { "aligned_alloc", "aligned_alloc", 1, NULL, _report_aligned_alloc },
{ "valloc", "valloc", 1, NULL, _report_valloc }, { "valloc", "valloc", 1, NULL, _report_valloc },
{ "pvalloc", "pvalloc", 1, NULL, _report_pvalloc }, { "pvalloc", "pvalloc", 1, NULL, _report_pvalloc },
{ "mremap", "mremap", 0, NULL, _report_mremap }, { "mremap", "mremap", 0, report_mremap, _report_mremap },
{ "cfree", "cfree", 1, report_free, NULL }, { "cfree", "cfree", 1, report_free, NULL },
{ "reallocarray", "reallocarray", 0, NULL, _report_reallocarray },
#if 0
{ "strdup", "strdup", 0, NULL, _report_malloc1 },
{ "strndup", "strndup", 0, NULL, _report_malloc1 },
{ "__strdup", "__strdup", 0, NULL, _report_malloc1 },
{ "__strndup", "__strndup", 0, NULL, _report_malloc1 },
{ "asprintf", "asprintf", 0, NULL, _report_malloc1 },
{ "vasprintf", "vasprintf", 0, NULL, _report_malloc1 },
{ "__asprintf", "__asprintf", 0, NULL, _report_malloc1 },
#endif
{ "new(unsigned int)", "_Znwj", 1, NULL, _report_new }, { "new(unsigned int)", "_Znwj", 1, NULL, _report_new },
{ "new[](unsigned int)", "_Znaj", 1, NULL, _report_new_array }, { "new[](unsigned int)", "_Znaj", 1, NULL, _report_new_array },
@ -421,32 +361,14 @@ static const struct function flist[] = {
{ "new(unsigned long, std::nothrow_t const&)", "_ZnwmRKSt9nothrow_t", 1, NULL, _report_new }, { "new(unsigned long, std::nothrow_t const&)", "_ZnwmRKSt9nothrow_t", 1, NULL, _report_new },
{ "new[](unsigned long, std::nothrow_t const&)", "_ZnamRKSt9nothrow_t", 1, NULL, _report_new_array }, { "new[](unsigned long, std::nothrow_t const&)", "_ZnamRKSt9nothrow_t", 1, NULL, _report_new_array },
{ "new(unsigned int, std::align_val_t, std::nothrow_t const&)", "_ZnwjSt11align_val_tRKSt9nothrow_t", 1, NULL, _report_new },
{ "new[](unsigned int, std::align_val_t, std::nothrow_t const&)", "_ZnajSt11align_val_tRKSt9nothrow_t", 1, NULL, _report_new_array },
{ "new(unsigned int, std::align_val_t)", "_ZnwjSt11align_val_t", 1, NULL, _report_new },
{ "new[](unsigned int, std::align_val_t)", "_ZnajSt11align_val_t", 1, NULL, _report_new_array },
{ "new(unsigned long, std::align_val_t, std::nothrow_t const&)", "_ZnwmSt11align_val_tRKSt9nothrow_t", 1, NULL, _report_new },
{ "new[](unsigned long, std::align_val_t, std::nothrow_t const&)", "_ZnamSt11align_val_tRKSt9nothrow_t", 1, NULL, _report_new_array },
{ "new(unsigned long, std::align_val_t)", "_ZnwmSt11align_val_t", 1, NULL, _report_new },
{ "new[](unsigned long, std::align_val_t)", "_ZnamSt11align_val_t", 1, NULL, _report_new_array },
{ "delete(void*)", "_ZdlPv", 1, report_delete, NULL }, { "delete(void*)", "_ZdlPv", 1, report_delete, NULL },
{ "delete[](void*)", "_ZdaPv", 1, report_delete_array, NULL }, { "delete[](void*)", "_ZdaPv", 1, report_delete_array, NULL },
{ "delete(void*, std::nothrow_t const&)", "_ZdlPvRKSt9nothrow_t", 1, report_delete, NULL }, { "delete(void*, std::nothrow_t const&)", "_ZdlPvRKSt9nothrow_t", 1, report_delete, NULL },
{ "delete[](void*, std::nothrow_t const&)", "_ZdaPvRKSt9nothrow_t", 1, report_delete_array, NULL }, { "delete[](void*, std::nothrow_t const&)", "_ZdaPvRKSt9nothrow_t", 1, report_delete_array, NULL },
{ "delete(void*, unsigned int)", "_ZdlPvj", 1, report_delete, NULL },
{ "delete[](void*, unsigned int)", "_ZdaPvj", 1, report_delete_array, NULL },
{ "delete(void*, unsigned long)", "_ZdlPvm", 1, report_delete, NULL }, { "delete(void*, unsigned long)", "_ZdlPvm", 1, report_delete, NULL },
{ "delete[](void*, unsigned long)", "_ZdaPvj", 1, report_delete_array, NULL },
{ "delete(void*, unsigned long)", "_ZdlPvj", 1, report_delete, NULL },
{ "delete[](void*, unsigned long)", "_ZdaPvm", 1, report_delete_array, NULL }, { "delete[](void*, unsigned long)", "_ZdaPvm", 1, report_delete_array, NULL },
{ "delete(void*, std::align_val_t)", "_ZdlPvSt11align_val_t", 1, report_delete, NULL },
{ "delete[](void*, std::align_val_t)", "_ZdaPvSt11align_val_t", 1, report_delete_array, NULL },
{ "delete(void*, std::align_val_t, std::nothrow_t const&)", "_ZdlPvSt11align_val_tRKSt9nothrow_t", 1, report_delete, NULL },
{ "delete[](void*, std::align_val_t, std::nothrow_t const&)", "_ZdaPvSt11align_val_tRKSt9nothrow_t", 1, report_delete_array, NULL },
{ "delete(void*, unsigned int, std::align_val_t)", "_ZdlPvjSt11align_val_t", 1, report_delete, NULL },
{ "delete[](void*, unsigned int, std::align_val_t)", "_ZdaPvjSt11align_val_t", 1, report_delete_array, NULL },
{ "delete(void*, unsigned long, std::align_val_t)", "_ZdlPvmSt11align_val_t", 1, report_delete, NULL },
{ "delete[](void*, unsigned long, std::align_val_t)", "_ZdaPvmSt11align_val_t", 1, report_delete_array, NULL },
}; };
const struct function *flist_matches_symbol(const char *sym_name) const struct function *flist_matches_symbol(const char *sym_name)
@ -469,9 +391,9 @@ int _report_map(struct task *task, struct library *lib, enum mt_operation op)
size_t len = strlen(libref->filename) + 1; size_t len = strlen(libref->filename) + 1;
struct mt_map_payload *payload = alloca(sizeof(struct mt_map_payload) + len); struct mt_map_payload *payload = alloca(sizeof(struct mt_map_payload) + len);
payload->addr = libref->txt_vaddr; payload->addr = libref->load_addr;
payload->offset = libref->txt_offset; payload->offset = libref->load_offset;
payload->size = libref->txt_size; payload->size = libref->load_size;
payload->bias = libref->bias; payload->bias = libref->bias;
memcpy(payload->filename, libref->filename, len); memcpy(payload->filename, libref->filename, len);
@ -544,9 +466,9 @@ int report_scan(pid_t pid, const void *data, unsigned int data_len)
return server_send_msg(MT_SCAN, pid, data, data_len); return server_send_msg(MT_SCAN, pid, data, data_len);
} }
int report_attach(struct task *task, int was_attached) int report_attach(struct task *task)
{ {
struct mt_attached_payload state = { .attached = !!was_attached }; struct mt_attached_payload state = { .attached = task->attached };
if (!server_connected()) if (!server_connected())
return -1; return -1;
@ -608,7 +530,7 @@ static void report_process(struct task *leader)
{ {
struct list_head *it; struct list_head *it;
report_attach(leader, 1); report_attach(leader);
list_for_each(it, &leader->libraries_list) { list_for_each(it, &leader->libraries_list) {
struct library *lib = container_of(it, struct library, list); struct library *lib = container_of(it, struct library, list);

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -23,8 +23,6 @@
#ifndef _INC_REPORT_H #ifndef _INC_REPORT_H
#define _INC_REPORT_H #define _INC_REPORT_H
#include <unistd.h>
#include "forward.h" #include "forward.h"
struct function { struct function {
@ -46,7 +44,7 @@ int report_add_map(struct task *task, struct library *lib);
int report_del_map(struct task *task, struct library *lib); int report_del_map(struct task *task, struct library *lib);
int report_info(int do_trace); int report_info(int do_trace);
int report_scan(pid_t pid, const void *data, unsigned int data_len); int report_scan(pid_t pid, const void *data, unsigned int data_len);
int report_attach(struct task *task, int was_attached); int report_attach(struct task *task);
int report_fork(struct task *task, struct task *ptask); int report_fork(struct task *task, struct task *ptask);
int report_exit(struct task *task); int report_exit(struct task *task);
int report_about_exit(struct task *task); int report_about_exit(struct task *task);

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -31,7 +31,6 @@
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#include <semaphore.h> #include <semaphore.h>
#include <netinet/tcp.h> #include <netinet/tcp.h>
#include <sys/uio.h>
#include "backend.h" #include "backend.h"
#include "breakpoint.h" #include "breakpoint.h"
@ -241,8 +240,6 @@ static void *server_listen_thread(void *ptr)
{ {
int ret; int ret;
(void)ptr;
for(;;) { for(;;) {
if (!server_connected()) { if (!server_connected()) {
thread_enable_cancel(); thread_enable_cancel();
@ -309,8 +306,6 @@ static void *server_pair_thread(void *ptr)
{ {
int ret; int ret;
(void)ptr;
for(;;) { for(;;) {
if (!server_connected()) if (!server_connected())
break; break;
@ -393,11 +388,8 @@ int server_stop(void)
if (listen_fd != -1) { if (listen_fd != -1) {
thread_cancel(thread); thread_cancel(thread);
if (thread) { if (thread)
thread_join(thread); thread_join(thread);
free(thread);
thread = NULL;
}
if (is_named(options.address)) if (is_named(options.address))
unlink(options.address); unlink(options.address);

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

29
sysdeps/Makefile.am Normal file
View File

@ -0,0 +1,29 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
DIST_SUBDIRS = \
linux-gnu
SUBDIRS = \
$(HOST_OS)
noinst_HEADERS = \
sysdep.h
MAINTAINERCLEANFILES = \
Makefile.in

656
sysdeps/Makefile.in Normal file
View File

@ -0,0 +1,656 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = sysdeps
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DIST_SUBDIRS = \
linux-gnu
SUBDIRS = \
$(HOST_OS)
noinst_HEADERS = \
sysdep.h
MAINTAINERCLEANFILES = \
Makefile.in
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sysdeps/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign sysdeps/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(HEADERS)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,43 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
DIST_SUBDIRS = x86 ppc arm
SUBDIRS = \
$(HOST_CPU)
noinst_LTLIBRARIES = \
../libos.la
___libos_la_SOURCES = \
ioevent.c \
trace.c \
os.c \
proc.c \
socket.c \
thread.c
___libos_la_LIBADD = \
libcpu.la
noinst_HEADERS = ioevent.h os.h socket.h
EXTRA_DIST =
MAINTAINERCLEANFILES = \
Makefile.in

View File

@ -0,0 +1,762 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = sysdeps/linux-gnu
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
___libos_la_DEPENDENCIES = libcpu.la
am____libos_la_OBJECTS = ioevent.lo trace.lo os.lo proc.lo socket.lo \
thread.lo
___libos_la_OBJECTS = $(am____libos_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__dirstamp = $(am__leading_dot)dirstamp
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/autoconf/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(___libos_la_SOURCES)
DIST_SOURCES = $(___libos_la_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
DIST_SUBDIRS = x86 ppc arm
SUBDIRS = \
$(HOST_CPU)
noinst_LTLIBRARIES = \
../libos.la
___libos_la_SOURCES = \
ioevent.c \
trace.c \
os.c \
proc.c \
socket.c \
thread.c
___libos_la_LIBADD = \
libcpu.la
noinst_HEADERS = ioevent.h os.h socket.h
EXTRA_DIST =
MAINTAINERCLEANFILES = \
Makefile.in
all: all-recursive
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sysdeps/linux-gnu/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign sysdeps/linux-gnu/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
../$(am__dirstamp):
@$(MKDIR_P) ..
@: > ../$(am__dirstamp)
../libos.la: $(___libos_la_OBJECTS) $(___libos_la_DEPENDENCIES) $(EXTRA____libos_la_DEPENDENCIES) ../$(am__dirstamp)
$(AM_V_CCLD)$(LINK) $(___libos_la_OBJECTS) $(___libos_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioevent.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trace.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf ../.libs ../_libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool \
clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -0,0 +1,31 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-arm.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in

View File

@ -0,0 +1,634 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = sysdeps/linux-gnu/arm
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
___libcpu_la_LIBADD =
am____libcpu_la_OBJECTS = dwarf-arm.lo regs.lo arch.lo
___libcpu_la_OBJECTS = $(am____libcpu_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__dirstamp = $(am__leading_dot)dirstamp
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/autoconf/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(___libcpu_la_SOURCES)
DIST_SOURCES = $(___libcpu_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-arm.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sysdeps/linux-gnu/arm/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign sysdeps/linux-gnu/arm/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
../$(am__dirstamp):
@$(MKDIR_P) ..
@: > ../$(am__dirstamp)
../libcpu.la: $(___libcpu_la_OBJECTS) $(___libcpu_la_DEPENDENCIES) $(EXTRA____libcpu_la_DEPENDENCIES) ../$(am__dirstamp)
$(AM_V_CCLD)$(LINK) $(___libcpu_la_OBJECTS) $(___libcpu_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf-arm.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regs.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf ../.libs ../_libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -47,7 +47,6 @@
int is_64bit(struct mt_elf *mte) int is_64bit(struct mt_elf *mte)
{ {
(void)(mte);
return 0; return 0;
} }
@ -691,7 +690,7 @@ int do_singlestep(struct task *task, struct breakpoint *bp)
bp1 = breakpoint_find(task, next_pcs[0]); bp1 = breakpoint_find(task, next_pcs[0]);
if (!bp1) { if (!bp1) {
bp1 = breakpoint_new(task, next_pcs[0], NULL, BP_SW); bp1 = breakpoint_new(task, next_pcs[0], NULL, SW_BP);
if (!bp1) if (!bp1)
return -1; return -1;
} }
@ -703,7 +702,7 @@ int do_singlestep(struct task *task, struct breakpoint *bp)
if (next_pcs[1]) { if (next_pcs[1]) {
bp2 = breakpoint_find(task, next_pcs[1]); bp2 = breakpoint_find(task, next_pcs[1]);
if (!bp2) { if (!bp2) {
bp2 = breakpoint_new(task, next_pcs[1], NULL, BP_SW); bp2 = breakpoint_new(task, next_pcs[1], NULL, SW_BP);
if (!bp2) if (!bp2)
return -1; return -1;
} }

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +0,0 @@
list(APPEND C_SRCS
sysdeps/${MT_OS}/${MT_CPU}/arch.c
sysdeps/${MT_OS}/${MT_CPU}/dwarf-arm.c
sysdeps/${MT_OS}/${MT_CPU}/regs.c
)

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -32,7 +33,7 @@
#include "common.h" #include "common.h"
#include "backend.h" #include "backend.h"
#include "debug.h" #include "debug.h"
#include "../../../dwarf.h" #include "dwarf.h"
#include "library.h" #include "library.h"
#include "task.h" #include "task.h"
@ -153,7 +154,6 @@ static int is_signal_frame(struct dwarf_cursor *c)
int dwarf_arch_map_reg(struct dwarf_addr_space *as, unsigned int reg) int dwarf_arch_map_reg(struct dwarf_addr_space *as, unsigned int reg)
{ {
(void)(as);
if (reg >= ARRAY_SIZE(dwarf_to_regnum_map)) if (reg >= ARRAY_SIZE(dwarf_to_regnum_map))
return -DWARF_EBADREG; return -DWARF_EBADREG;
@ -178,13 +178,11 @@ static inline int access_mem(struct dwarf_addr_space *as, arch_addr_t addr, void
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref; struct libref *libref = c->libref;
if (addr < ARCH_ADDR_T(libref->mmap_addr)) if (addr < ARCH_ADDR_T(libref->image_addr))
fatal("invalid access mem: addr %#lx < %p", addr, libref->mmap_addr); fatal("invalid access mem: addr %#lx < %p", addr, libref->image_addr);
if (addr >= ARCH_ADDR_T(libref->mmap_addr + libref->mmap_size)) if (addr >= ARCH_ADDR_T(libref->image_addr + libref->load_size))
fatal("invalid access mem: addr %#lx >= %p", addr, libref->mmap_addr + libref->mmap_size); fatal("invalid access mem: addr %#lx >= %p", addr, libref->image_addr + libref->load_size);
} }
#else
(void)(as);
#endif #endif
memcpy(valp, (void *)addr, size); memcpy(valp, (void *)addr, size);
@ -509,7 +507,7 @@ static unsigned long arm_search_unwind_table(struct dwarf_addr_space *as, arch_a
{ {
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref; struct libref *libref = c->libref;
unsigned long map_offset = (unsigned long)libref->mmap_addr + libref->mmap_offset - libref->txt_vaddr; unsigned long map_offset = (unsigned long)libref->image_addr + libref->load_offset - libref->load_addr;
unsigned long lo, hi, e, f; unsigned long lo, hi, e, f;
arch_addr_t val; arch_addr_t val;
@ -650,8 +648,6 @@ int dwarf_arch_step(struct dwarf_addr_space *as)
int dwarf_arch_check_call(struct dwarf_addr_space *as, arch_addr_t ip) int dwarf_arch_check_call(struct dwarf_addr_space *as, arch_addr_t ip)
{ {
(void)(as);
(void)(ip);
return 1; return 1;
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -44,7 +44,6 @@
#include <pwd.h> #include <pwd.h>
#include <grp.h> #include <grp.h>
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/sysmacros.h>
#include "backend.h" #include "backend.h"
#include "breakpoint.h" #include "breakpoint.h"
@ -63,9 +62,6 @@ struct map {
static void report_fault(int signo, siginfo_t* siginf, void* arg) static void report_fault(int signo, siginfo_t* siginf, void* arg)
{ {
(void)siginf;
(void)arg;
fprintf(stderr, "fault signal %d (%s)\n", signo, strsignal(signo)); fprintf(stderr, "fault signal %d (%s)\n", signo, strsignal(signo));
#ifndef DISABLE_CLIENT #ifndef DISABLE_CLIENT
@ -151,8 +147,6 @@ skip:
static void signal_exit(int sig) static void signal_exit(int sig)
{ {
(void)sig;
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN); signal(SIGTERM, SIG_IGN);
@ -256,9 +250,6 @@ void *mem_scan(struct task *task, struct mt_msg *cmd, void *payload, unsigned lo
unsigned long start; unsigned long start;
unsigned long end; unsigned long end;
if (unlikely(options.verbose))
fprintf(stderr, "+++ scan for memory leaks...\n");
if (!n) if (!n)
return NULL; return NULL;
@ -374,6 +365,28 @@ void change_uid(void)
} }
} }
ssize_t sock_fd_write(int sock, void *buf, ssize_t buflen, int fd)
{
ssize_t size;
struct msghdr msg;
struct iovec iov;
iov.iov_base = buf;
iov.iov_len = buflen;
msg.msg_name = NULL;
msg.msg_namelen = 0;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = NULL;
msg.msg_controllen = 0;
size = sendmsg(sock, &msg, MSG_DONTWAIT);
return size;
}
int os_init(void) int os_init(void)
{ {
struct sigaction act; struct sigaction act;

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -0,0 +1,31 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-ppc.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in

View File

@ -0,0 +1,634 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = sysdeps/linux-gnu/ppc
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
___libcpu_la_LIBADD =
am____libcpu_la_OBJECTS = dwarf-ppc.lo regs.lo arch.lo
___libcpu_la_OBJECTS = $(am____libcpu_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__dirstamp = $(am__leading_dot)dirstamp
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/autoconf/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(___libcpu_la_SOURCES)
DIST_SOURCES = $(___libcpu_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-ppc.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sysdeps/linux-gnu/ppc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign sysdeps/linux-gnu/ppc/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
../$(am__dirstamp):
@$(MKDIR_P) ..
@: > ../$(am__dirstamp)
../libcpu.la: $(___libcpu_la_OBJECTS) $(___libcpu_la_DEPENDENCIES) $(EXTRA____libcpu_la_DEPENDENCIES) ../$(am__dirstamp)
$(AM_V_CCLD)$(LINK) $(___libcpu_la_OBJECTS) $(___libcpu_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf-ppc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regs.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf ../.libs ../_libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -25,6 +25,6 @@
int is_64bit(struct mt_elf *mte) int is_64bit(struct mt_elf *mte)
{ {
return !mte_cmp_machine(mte, EM_PPC); return mte->ehdr.e_machine != EM_PPC;
} }

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +0,0 @@
list(APPEND C_SRCS
sysdeps/${MT_OS}/${MT_CPU}/arch.c
sysdeps/${MT_OS}/${MT_CPU}/dwarf-ppc.c
sysdeps/${MT_OS}/${MT_CPU}/regs.c
)

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -161,17 +162,17 @@ int process_tasks(pid_t pid, pid_t ** ret_tasks, size_t *ret_n)
return -1; return -1;
for(;;) { for(;;) {
struct dirent entry;
struct dirent *result; struct dirent *result;
errno = 0; if (readdir_r(d, &entry, &result) != 0) {
result = readdir(d); free(tasks);
return -1;
if (!result) {
if (errno)
goto fail;
break;
} }
if (result == NULL)
break;
if (result->d_type == DT_DIR && all_digits(result->d_name)) { if (result->d_type == DT_DIR && all_digits(result->d_name)) {
pid_t npid = atoi(result->d_name); pid_t npid = atoi(result->d_name);
@ -181,9 +182,10 @@ int process_tasks(pid_t pid, pid_t ** ret_tasks, size_t *ret_n)
alloc = n > 0 ? (2 * n) : 8; alloc = n > 0 ? (2 * n) : 8;
ntasks = realloc(tasks, sizeof(*tasks) * alloc); ntasks = realloc(tasks, sizeof(*tasks) * alloc);
if (!ntasks) if (!ntasks) {
goto fail; free(tasks);
return -1;
}
tasks = ntasks; tasks = ntasks;
} }
tasks[n++] = npid; tasks[n++] = npid;
@ -196,14 +198,6 @@ int process_tasks(pid_t pid, pid_t ** ret_tasks, size_t *ret_n)
*ret_n = n; *ret_n = n;
return 0; return 0;
fail:
free(tasks);
closedir(d);
*ret_tasks = NULL;
*ret_n = 0;
return -1;
} }
/* On native 64-bit system, we need to be careful when handling cross /* On native 64-bit system, we need to be careful when handling cross
@ -350,17 +344,29 @@ static int (*rdebug_fetcher(struct task *task))(struct task *, arch_addr_t, stru
return select_32_64(task, fetch_rd32, fetch_rd64); return select_32_64(task, fetch_rd32, fetch_rd64);
} }
#ifdef _LP64 static int fetch_auxv64_entry(int fd, Elf64_auxv_t *ret)
#define Elf_auxv_t Elf64_auxv_t
#else
#define Elf_auxv_t Elf32_auxv_t
#endif
static int fetch_auxv_entry(int fd, Elf_auxv_t *ret)
{ {
/* Reaching EOF is as much problem as not reading whole
* entry. */
return read(fd, ret, sizeof(*ret)) == sizeof(*ret) ? 0 : -1; return read(fd, ret, sizeof(*ret)) == sizeof(*ret) ? 0 : -1;
} }
static int fetch_auxv32_entry(int fd, Elf64_auxv_t *ret)
{
Elf32_auxv_t auxv;
if (read(fd, &auxv, sizeof(auxv)) != sizeof(auxv))
return -1;
ret->a_type = auxv.a_type;
ret->a_un.a_val = auxv.a_un.a_val;
return 0;
}
static int (*auxv_fetcher(struct task *task)) (int, Elf64_auxv_t *) {
return select_32_64(task, fetch_auxv32_entry, fetch_auxv64_entry);
}
static void linkmap_add(struct task *task, struct lt_r_debug_64 *dbg) static void linkmap_add(struct task *task, struct lt_r_debug_64 *dbg)
{ {
struct library *lib; struct library *lib;
@ -390,7 +396,7 @@ static void linkmap_add(struct task *task, struct lt_r_debug_64 *dbg)
} }
/* Do we have that library already? */ /* Do we have that library already? */
lib = library_find_by_dyn(&task->libraries_list, ARCH_ADDR_T(rlm.l_ld)); lib = library_find_with_key(&task->libraries_list, ARCH_ADDR_T(rlm.l_ld));
if (lib) if (lib)
continue; continue;
@ -456,7 +462,7 @@ static void linkmap_del(struct task *task, struct lt_r_debug_64 *dbg)
addr = ARCH_ADDR_T(rlm.l_next); addr = ARCH_ADDR_T(rlm.l_next);
lib = library_find_by_dyn(&tmp_list, ARCH_ADDR_T(rlm.l_ld)); lib = library_find_with_key(&tmp_list, ARCH_ADDR_T(rlm.l_ld));
if (lib) if (lib)
list_move_tail(&lib->list, &task->libraries_list); list_move_tail(&lib->list, &task->libraries_list);
} }
@ -483,8 +489,6 @@ static int rdebug_bp_on_hit(struct task *task, struct breakpoint *bp)
struct lt_r_debug_64 rdbg; struct lt_r_debug_64 rdbg;
struct task *leader = task->leader; struct task *leader = task->leader;
(void)bp;
debug(DEBUG_FUNCTION, "pid=%d", task->pid); debug(DEBUG_FUNCTION, "pid=%d", task->pid);
if (load_debug_struct(task, leader->os.debug_addr, &rdbg) < 0) if (load_debug_struct(task, leader->os.debug_addr, &rdbg) < 0)
@ -563,9 +567,8 @@ int process_get_entry(struct task *task, unsigned long *entryp, unsigned long *i
GElf_Addr at_bias = 0; GElf_Addr at_bias = 0;
while (1) { while (1) {
Elf_auxv_t entry = { }; Elf64_auxv_t entry = { };
if (auxv_fetcher(task)(fd, &entry) < 0)
if (fetch_auxv_entry(fd, &entry) < 0)
goto fail; goto fail;
if (entry.a_type == AT_NULL) if (entry.a_type == AT_NULL)
@ -578,6 +581,8 @@ int process_get_entry(struct task *task, unsigned long *entryp, unsigned long *i
case AT_ENTRY: case AT_ENTRY:
at_entry = entry.a_un.a_val; at_entry = entry.a_un.a_val;
break; break;
case AT_NULL:
break;
default: default:
break; break;
} }
@ -610,7 +615,6 @@ int os_task_init(struct task *task)
void os_task_destroy(struct task *task) void os_task_destroy(struct task *task)
{ {
(void)task;
} }
int os_task_clone(struct task *retp, struct task *task) int os_task_clone(struct task *retp, struct task *task)

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,14 +0,0 @@
list(APPEND C_SRCS
sysdeps/${MT_OS}/ioevent.c
sysdeps/${MT_OS}/os.c
sysdeps/${MT_OS}/proc.c
sysdeps/${MT_OS}/socket.c
sysdeps/${MT_OS}/thread.c
sysdeps/${MT_OS}/trace.c
)
include_directories("${PROJECT_SOURCE_DIR}/sysdeps/${MT_OS}")
include_directories("${PROJECT_SOURCE_DIR}/sysdeps/${MT_OS}/${MT_CPU}")
include(${CMAKE_SOURCE_DIR}/sysdeps/${MT_OS}/${MT_CPU}/cpu.cmake)

View File

@ -2,7 +2,7 @@
* phtread thread wrapper * phtread thread wrapper
* *
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -39,6 +39,10 @@
#include <sys/prctl.h> #include <sys/prctl.h>
#include <sys/uio.h> #include <sys/uio.h>
#ifdef HAVE_LIBSELINUX
#include <selinux/selinux.h>
#endif
#include "backend.h" #include "backend.h"
#include "breakpoint.h" #include "breakpoint.h"
#include "debug.h" #include "debug.h"
@ -52,48 +56,34 @@
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static volatile pid_t wakeup_pid = -1; static volatile pid_t wakeup_pid = -1;
static inline int task_kill(struct task *task, int sig) static int inline task_kill(struct task *task, int sig)
{ {
errno = 0; errno = 0;
return syscall(__NR_tgkill, task->leader->pid, task->pid, sig); return syscall(__NR_tgkill, task->leader->pid, task->pid, sig);
} }
static inline int wait_task(struct task *task, int *status)
{
int ret;
ret = TEMP_FAILURE_RETRY(waitpid(task ? task->pid : -1, status, __WALL));
if (ret == -1) {
if (unlikely(options.verbose && task))
fprintf(stderr, "!!!%s: waitpid pid=%d %s\n", __func__, task->pid, strerror(errno));
}
return ret;
}
static int trace_setup(struct task *task, int status, int signum) static int trace_setup(struct task *task, int status, int signum)
{ {
int sig; int stop_signal;
task->traced = 1;
task->stopped = 1;
task->leader->threads_stopped++;
task->event.type = EVENT_SIGNAL;
task->event.e_un.signum = 0;
if (!WIFSTOPPED(status)) { if (!WIFSTOPPED(status)) {
if (unlikely(options.verbose)) fprintf(stderr, "%s pid=%d not stopped\n", __FUNCTION__, task->pid);
fprintf(stderr, "!!!%s: pid=%d not stopped\n", __func__, task->pid);
return -1; return -1;
} }
task->attached = 1; stop_signal = WSTOPSIG(status);
task->stopped = 1;
task->leader->threads_stopped++;
task->event.type = EVENT_NEW;
task->event.e_un.signum = 0;
sig = WSTOPSIG(status); if (stop_signal != signum) {
task->event.e_un.signum = stop_signal;
if (sig != signum) { fprintf(stderr, "%s pid=%d unexpected trace signal (got:%d expected:%d)\n", __FUNCTION__, task->pid, stop_signal, signum);
task->event.e_un.signum = sig;
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: pid=%d unexpected trace signal (got:%d expected:%d)\n", __func__, task->pid, sig, signum);
return -1; return -1;
} }
@ -104,8 +94,10 @@ static int _trace_wait(struct task *task, int signum)
{ {
int status; int status;
if (unlikely(wait_task(task, &status) == -1)) if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) {
fprintf(stderr, "%s pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return -1; return -1;
}
if (WIFEXITED(status)) if (WIFEXITED(status))
return -1; return -1;
@ -115,35 +107,35 @@ static int _trace_wait(struct task *task, int signum)
int trace_wait(struct task *task) int trace_wait(struct task *task)
{ {
assert(task->attached == 0);
if (_trace_wait(task, SIGTRAP)) if (_trace_wait(task, SIGTRAP))
return -1; return -1;
queue_event(task);
return 0; return 0;
} }
static int child_event(struct task *task, enum event_type ev) static int child_event(struct task *task, enum event_type ev)
{ {
unsigned long data = 0; unsigned long data;
debug(DEBUG_TRACE, "child event %d pid=%d, newpid=%d", ev, task->pid, task->event.e_un.newpid); if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1)) {
debug(DEBUG_EVENT, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1)) return -1;
debug(DEBUG_TRACE, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno)); }
int pid = data; int pid = data;
if (!pid)
return -1;
if (!pid2task(pid)) { if (!pid2task(pid)) {
struct task *child = task_new(pid); struct task *child = task_new(pid);
if (unlikely(!child)) if (unlikely(!child))
return -1; return -1;
child->attached = 1; if (_trace_wait(child, SIGSTOP)) {
remove_task(child);
return -1;
}
} }
task->event.e_un.newpid = pid; task->event.e_un.newpid = pid;
@ -154,142 +146,110 @@ static int child_event(struct task *task, enum event_type ev)
static int _process_event(struct task *task, int status) static int _process_event(struct task *task, int status)
{ {
int sig = WSTOPSIG(status); int stop_signal;
task->stopped = 1;
assert(task->event.type == EVENT_NONE);
if (WIFSIGNALED(status)) { if (WIFSIGNALED(status)) {
debug(DEBUG_TRACE, "EXIT_SIGNAL: pid=%d, signum=%d", task->pid, task->event.e_un.signum);
task->event.type = EVENT_EXIT_SIGNAL; task->event.type = EVENT_EXIT_SIGNAL;
task->event.e_un.signum = WTERMSIG(status); task->event.e_un.signum = WTERMSIG(status);
debug(DEBUG_EVENT, "EXIT_SIGNAL: pid=%d, signum=%d", task->pid, task->event.e_un.signum);
return 0; return 0;
} }
if (WIFEXITED(status)) { if (WIFEXITED(status)) {
debug(DEBUG_TRACE, "EXIT: pid=%d, status=%d", task->pid, task->event.e_un.ret_val);
task->event.type = EVENT_EXIT; task->event.type = EVENT_EXIT;
task->event.e_un.ret_val = WEXITSTATUS(status); task->event.e_un.ret_val = WEXITSTATUS(status);
debug(DEBUG_EVENT, "EXIT: pid=%d, status=%d", task->pid, task->event.e_un.ret_val);
return 0; return 0;
} }
if (!WIFSTOPPED(status)) { if (!WIFSTOPPED(status)) {
if (unlikely(options.verbose)) /* should never happen */
fprintf(stderr, "!!!%s: not WIFSTOPPED pid=%d\n", __func__, task->pid); debug(DEBUG_EVENT, "NONE: pid=%d ???", task->pid);
return -1; return -1;
} }
if (unlikely(task->is_new)) {
if (sig == SIGSTOP && !(status >> 16)) {
task->event.type = EVENT_NEW;
task->event.e_un.signum = 0;
return 0;
}
if (!task->bad) {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: unexpected state for pid=%d, expected signal SIGSTOP (%d %d)\n", __func__, task->pid, sig, status >> 16);
task->bad = 1;
}
}
switch(status >> 16) { switch(status >> 16) {
case 0:
break;
case PTRACE_EVENT_VFORK: case PTRACE_EVENT_VFORK:
debug(DEBUG_TRACE, "VFORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid); if (child_event(task, EVENT_VFORK))
return child_event(task, EVENT_VFORK); return -1;
debug(DEBUG_EVENT, "VFORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
case PTRACE_EVENT_FORK: case PTRACE_EVENT_FORK:
debug(DEBUG_TRACE, "FORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid); if (child_event(task, EVENT_FORK))
return child_event(task, EVENT_FORK); return -1;
debug(DEBUG_EVENT, "FORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
case PTRACE_EVENT_CLONE: case PTRACE_EVENT_CLONE:
debug(DEBUG_TRACE, "CLONE: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid); if (child_event(task, EVENT_CLONE))
return child_event(task, EVENT_CLONE); return -1;
debug(DEBUG_EVENT, "CLONE: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
case PTRACE_EVENT_EXEC: case PTRACE_EVENT_EXEC:
task->event.type = EVENT_EXEC; task->event.type = EVENT_EXEC;
debug(DEBUG_TRACE, "EXEC: pid=%d", task->pid); debug(DEBUG_EVENT, "EXEC: pid=%d", task->pid);
return 0; return 0;
case PTRACE_EVENT_EXIT: case PTRACE_EVENT_EXIT:
{ {
unsigned long data = 0; unsigned long data;
debug(DEBUG_TRACE, "ABOUT_EXIT: pid=%d", task->pid);
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1))
debug(DEBUG_TRACE, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1)) {
debug(DEBUG_EVENT, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
return -1;
}
task->event.e_un.ret_val = WEXITSTATUS(data); task->event.e_un.ret_val = WEXITSTATUS(data);
task->event.type = EVENT_ABOUT_EXIT; task->event.type = EVENT_ABOUT_EXIT;
debug(DEBUG_EVENT, "ABOUT_EXIT: pid=%d", task->pid);
return 0; return 0;
} }
default: default:
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: PTRACE_EVENT_????? pid=%d %d\n", __func__, task->pid, status >> 16);
break; break;
} }
if (unlikely(options.verbose && !sig)) stop_signal = WSTOPSIG(status);
fprintf(stderr, "!!!%s: sig == 0 pid=%d\n", __func__, task->pid);
if (sig == SIGSTOP) {
siginfo_t siginfo;
if (unlikely(ptrace(PTRACE_GETSIGINFO, task->pid, 0, &siginfo) == -1))
sig = 0;
else {
if (likely(siginfo.si_pid == mtrace_pid))
sig = 0;
else {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: SIGSTOP pid=%d %d %d %d %d\n", __func__, task->pid, siginfo.si_signo, siginfo.si_errno, siginfo.si_code, siginfo.si_pid);
}
}
}
task->event.type = EVENT_SIGNAL; task->event.type = EVENT_SIGNAL;
task->event.e_un.signum = sig; task->event.e_un.signum = stop_signal;
debug(DEBUG_TRACE, "SIGNAL: pid=%d, signum=%d", task->pid, sig); debug(DEBUG_EVENT, "SIGNAL: pid=%d, signum=%d", task->pid, stop_signal);
return sig; return stop_signal;
} }
static struct task * process_event(struct task *task, int status) static void process_event(struct task *task, int status)
{ {
int stop_signal;
struct task *leader = task->leader; struct task *leader = task->leader;
struct breakpoint *bp = NULL; struct breakpoint *bp = NULL;
arch_addr_t ip; arch_addr_t ip;
int sig;
assert(task->stopped == 0);
assert(leader != NULL); assert(leader != NULL);
if (unlikely(options.verbose > 1)) if (unlikely(options.verbose > 1))
start_time(&task->halt_time); start_time(&task->halt_time);
task->stopped = 1;
leader->threads_stopped++; leader->threads_stopped++;
sig = _process_event(task, status); stop_signal = _process_event(task, status);
if (sig < 0) {
continue_task(task, 0);
return NULL;
}
if (task->event.type == EVENT_NONE) { if (stop_signal == -1) {
continue_task(task, task->event.e_un.signum); fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
return NULL;
}
if (unlikely(sig != SIGTRAP))
return task;
if (unlikely(fetch_context(task) == -1)) {
task->event.type = EVENT_NONE; task->event.type = EVENT_NONE;
continue_task(task, 0); continue_task(task, 0);
return NULL; return;
}
if (stop_signal == 0)
return;
if (unlikely(stop_signal != SIGTRAP))
return;
if (unlikely(fetch_context(task) == -1)) {
fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
task->event.type = EVENT_NONE;
continue_task(task, 0);
return;
} }
ip = get_instruction_pointer(task); ip = get_instruction_pointer(task);
@ -314,9 +274,10 @@ static struct task * process_event(struct task *task, int status)
{ {
bp = breakpoint_find(leader, ip - DECR_PC_AFTER_BREAK); bp = breakpoint_find(leader, ip - DECR_PC_AFTER_BREAK);
if (unlikely(!bp)) { if (unlikely(!bp)) {
if (unlikely(options.verbose)) fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid); // task->event.type = EVENT_NONE;
return task; // continue_task(task, 0);
return;
} }
#if HW_BREAKPOINTS > 0 #if HW_BREAKPOINTS > 0
assert(bp->type != BP_HW_SCRATCH); assert(bp->type != BP_HW_SCRATCH);
@ -334,14 +295,30 @@ static struct task * process_event(struct task *task, int status)
task->event.type = EVENT_BREAKPOINT; task->event.type = EVENT_BREAKPOINT;
task->event.e_un.breakpoint = breakpoint_get(bp); task->event.e_un.breakpoint = breakpoint_get(bp);
debug(DEBUG_TRACE, "BREAKPOINT: pid=%d, addr=%#lx", task->pid, task->event.e_un.breakpoint->addr); debug(DEBUG_EVENT, "BREAKPOINT: pid=%d, addr=%#lx", task->pid, task->event.e_un.breakpoint->addr);
return task; return;
}
static void trace_fail_warning(void)
{
#ifdef HAVE_LIBSELINUX
if (security_get_boolean_active("deny_ptrace") == 1)
fprintf(stderr,
"The SELinux boolean 'deny_ptrace' is enabled, which may prevent mtrace-ng\n"
"from tracing an other task. You can disable this process attach protection by\n"
"issuing 'setsebool deny_ptrace=0' in the superuser context.\n");
#else
fprintf(stderr,
"Could not trace! Maybe the SELinux boolean 'deny_ptrace' is enabled, which may\n"
"prevent mtrace-ng from tracing an other tasks. Try to disable this process attach\n"
"protection by issuing 'setsebool deny_ptrace=0' in the superuser context.\n");
#endif
} }
void trace_me(void) void trace_me(void)
{ {
debug(DEBUG_TRACE, "pid=%d", getpid()); debug(DEBUG_PROCESS, "pid=%d", getpid());
prctl(PR_SET_PDEATHSIG, SIGKILL); prctl(PR_SET_PDEATHSIG, SIGKILL);
@ -351,73 +328,72 @@ void trace_me(void)
} }
} }
static inline int chk_signal(struct task *task, int signum) static inline int fix_signal(struct task *task, int signum)
{ {
if (unlikely(options.verbose)) { if (signum == SIGSTOP && task->was_stopped) {
if (signum == SIGSTOP) task->was_stopped = 0;
fprintf(stderr, "!!!%s: SIGSTOP pid=%d\n", __func__, task->pid); signum = 0;
if (signum == SIGTRAP)
fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid);
} }
return signum; return signum;
} }
int untrace_task(struct task *task) int untrace_task(struct task *task, int signum)
{ {
int sig = 0; int ret = 0;
assert(task->stopped); assert(task->leader != NULL);
debug(DEBUG_PROCESS, "pid=%d", task->pid);
if (!task->stopped)
return 0;
if (unlikely(ptrace(PTRACE_SETOPTIONS, task->pid, 0, (void *)0) == -1)) { if (unlikely(ptrace(PTRACE_SETOPTIONS, task->pid, 0, (void *)0) == -1)) {
if (errno != ESRCH) if (errno != ESRCH)
fprintf(stderr, "PTRACE_SETOPTIONS pid=%d %s\n", task->pid, strerror(errno)); fprintf(stderr, "PTRACE_SETOPTIONS pid=%d %s\n", task->pid, strerror(errno));
return -1; ret = -1;
goto skip;
} }
if (task->event.type == EVENT_SIGNAL || task->event.type == EVENT_NONE) signum = fix_signal(task, signum);
sig = chk_signal(task, sig);
if (unlikely(ptrace(PTRACE_DETACH, task->pid, 0, sig) == -1)) { if (unlikely(ptrace(PTRACE_DETACH, task->pid, 0, signum) == -1)) {
if (errno != ESRCH) if (task->traced) {
fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno)); if (errno != ESRCH)
return -1; fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno));
ret = -1;
goto skip;
}
} }
// task_kill(task, SIGCONT); task_kill(task, SIGCONT);
return 0; skip:
} task->leader->threads_stopped--;
task->stopped = 0;
task->was_stopped = 0;
task->traced = 0;
void stop_task(struct task *task) return ret;
{
assert(task->attached);
assert(task->leader != NULL);
if (!task->stopped) {
int status;
task_kill(task, SIGSTOP);
if (wait_task(task, &status) != -1)
_process_event(task, status);
}
} }
int trace_attach(struct task *task) int trace_attach(struct task *task)
{ {
debug(DEBUG_TRACE, "pid=%d", task->pid); debug(DEBUG_PROCESS, "pid=%d", task->pid);
assert(task->attached == 0); assert(task->traced == 0);
if (unlikely(ptrace(PTRACE_ATTACH, task->pid, 0, 0) == -1)) { if (unlikely(ptrace(PTRACE_ATTACH, task->pid, 0, 0) == -1)) {
if (errno != ESRCH) if (errno != ESRCH)
fprintf(stderr, "PTRACE_ATTACH pid=%d %s\n", task->pid, strerror(errno)); fprintf(stderr, "PTRACE_ATTACH pid=%d %s\n", task->pid, strerror(errno));
trace_fail_warning();
return -1; return -1;
} }
if (_trace_wait(task, SIGSTOP)) if (_trace_wait(task, SIGSTOP))
return -1; return -1;
queue_event(task);
return 0; return 0;
} }
@ -425,7 +401,7 @@ int trace_set_options(struct task *task)
{ {
long options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACECLONE | PTRACE_O_TRACEEXEC | PTRACE_O_TRACEEXIT; long options = PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK | PTRACE_O_TRACECLONE | PTRACE_O_TRACEEXEC | PTRACE_O_TRACEEXIT;
debug(DEBUG_TRACE, "pid=%d", task->pid); debug(DEBUG_PROCESS, "pid=%d", task->pid);
if (unlikely(ptrace(PTRACE_SETOPTIONS, task->pid, 0, (void *)options) == -1)) { if (unlikely(ptrace(PTRACE_SETOPTIONS, task->pid, 0, (void *)options) == -1)) {
if (errno != ESRCH) if (errno != ESRCH)
@ -437,22 +413,15 @@ int trace_set_options(struct task *task)
int continue_task(struct task *task, int signum) int continue_task(struct task *task, int signum)
{ {
debug(DEBUG_TRACE, "continue task pid=%d", task->pid); debug(DEBUG_PROCESS, "pid=%d", task->pid);
assert(task->leader != NULL); assert(task->leader != NULL);
assert(task->stopped); assert(task->stopped);
if (unlikely(options.verbose && signum >= 0x80))
fprintf(stderr, "!!!%s: signum >= 0x80 pid=%d: %d\n", __func__, task->pid, signum);
task->leader->threads_stopped--; task->leader->threads_stopped--;
task->stopped = 0; task->stopped = 0;
task->event.type = EVENT_NONE;
if (unlikely(options.verbose && signum == SIGTRAP)) if (unlikely(ptrace(PTRACE_CONT, task->pid, 0, fix_signal(task, signum)) == -1)) {
fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid);
if (unlikely(ptrace(PTRACE_CONT, task->pid, 0, chk_signal(task, signum)) == -1)) {
if (errno != ESRCH) if (errno != ESRCH)
fprintf(stderr, "PTRACE_CONT pid=%d %s\n", task->pid, strerror(errno)); fprintf(stderr, "PTRACE_CONT pid=%d %s\n", task->pid, strerror(errno));
return -1; return -1;
@ -462,12 +431,10 @@ int continue_task(struct task *task, int signum)
static void do_stop_cb(struct task *task, void *data) static void do_stop_cb(struct task *task, void *data)
{ {
(void)data;
if (task->stopped) if (task->stopped)
return; return;
debug(DEBUG_TRACE, "task stop pid=%d", task->pid); task->was_stopped = 1;
task_kill(task, SIGSTOP); task_kill(task, SIGSTOP);
} }
@ -478,8 +445,6 @@ void stop_threads(struct task *task)
assert(task->leader != NULL); assert(task->leader != NULL);
debug(DEBUG_TRACE, "stop threads pid=%d", task->pid);
if (leader->threads != leader->threads_stopped) { if (leader->threads != leader->threads_stopped) {
struct timespec start; struct timespec start;
@ -488,13 +453,8 @@ void stop_threads(struct task *task)
each_task(leader, &do_stop_cb, NULL); each_task(leader, &do_stop_cb, NULL);
while(leader->threads != leader->threads_stopped) { while (leader->threads != leader->threads_stopped)
assert(leader->threads > leader->threads_stopped); queue_event(wait_event());
task = wait_event();
if (task)
queue_event(task);
}
if (unlikely(options.verbose > 1)) if (unlikely(options.verbose > 1))
set_timer(&start, &stop_time); set_timer(&start, &stop_time);
@ -504,63 +464,60 @@ void stop_threads(struct task *task)
int handle_singlestep(struct task *task, int (*singlestep)(struct task *task), struct breakpoint *bp) int handle_singlestep(struct task *task, int (*singlestep)(struct task *task), struct breakpoint *bp)
{ {
int status; int status;
int sig; int stop_signal;
unsigned long ip;
assert(task->stopped); for(;;) {
assert(task->skip_bp == NULL); if (unlikely(singlestep(task) == -1))
assert(bp->enabled == 0); return -1;
task->event.type = EVENT_NONE; if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) {
fprintf(stderr, "%s waitpid pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return 0;
}
if (unlikely(singlestep(task) == -1)) { stop_signal = _process_event(task, status);
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: single step failed pid=%d\n", __func__, task->pid); if (stop_signal == -1)
return -1; return 0;
ip = ptrace(PTRACE_PEEKUSER, task->pid, ip_reg_addr(), 0);
if (ip == (unsigned long)-1) {
fprintf(stderr, "%s ptrace get IP pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return 0;
}
if (ip != bp->addr) {
if (likely(stop_signal == SIGTRAP)) {
if (bp->break_insn) {
queue_event(task);
return 1;
}
return 0;
}
}
if (likely(!stop_signal)) {
queue_event(task);
return 1;
}
if (fix_signal(task, stop_signal) > 0) {
queue_event(task);
return 1;
}
if (ip != bp->addr)
return 0;
} }
if (unlikely(wait_task(task, &status) == -1))
return 0;
sig = _process_event(task, status);
if (sig == -1) {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: failed _process_event pid=%d\n", __func__, task->pid);
return 0;
}
assert(task->stopped);
assert(task->event.type != EVENT_NONE);
assert(task->event.type != EVENT_BREAKPOINT);
if (task->event.type != EVENT_SIGNAL) {
queue_event(task);
return 1;
}
if (sig != SIGTRAP) {
if (unlikely(options.verbose && sig == SIGSTOP))
fprintf(stderr, "!!!%s: SIGSTOP pid=%d\n", __func__, task->pid);
queue_event(task);
return 1;
}
if (bp->break_insn) {
queue_event(task);
return 0;
}
task->event.type = EVENT_BREAKPOINT;
task->event.e_un.breakpoint = bp;
return 0;
} }
#ifndef ARCH_SINGLESTEP #ifndef ARCH_SINGLESTEP
static int ptrace_singlestep(struct task *task) static int ptrace_singlestep(struct task *task)
{ {
if (unlikely(ptrace(PTRACE_SINGLESTEP, task->pid, 0, 0) == -1)) { if (unlikely(ptrace(PTRACE_SINGLESTEP, task->pid, 0, 0) == -1)) {
if (unlikely(options.verbose && errno != ESRCH)) if (errno != ESRCH)
fprintf(stderr, "!!!%s: PTRACE_SINGLESTEP pid=%d %s\n", __func__, task->pid, strerror(errno)); fprintf(stderr, "%s PTRACE_SINGLESTEP pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return -1; return -1;
} }
return 0; return 0;
@ -578,10 +535,14 @@ struct task *wait_event(void)
int status; int status;
int pid; int pid;
pid = wait_task(NULL, &status); pid = waitpid(-1, &status, __WALL);
if (unlikely(pid == -1)) { if (unlikely(pid == -1)) {
if (errno == ECHILD) if (errno != EINTR) {
debug(DEBUG_TRACE, "No more traced programs"); if (errno == ECHILD)
debug(DEBUG_EVENT, "No more traced programs");
else
fprintf(stderr, "%s waitpid %s\n", __FUNCTION__, strerror(errno));
}
return NULL; return NULL;
} }
@ -601,50 +562,12 @@ struct task *wait_event(void)
if (likely(task)) if (likely(task))
trace_setup(task, status, SIGSTOP); trace_setup(task, status, SIGSTOP);
return NULL; return NULL;
} }
if (unlikely(task->stopped)) { process_event(task, status);
if (WIFSIGNALED(status)) {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: exit signal for stopped pid=%d\n", __func__, task->pid);
task->event.type = EVENT_EXIT_SIGNAL;
task->event.e_un.signum = WTERMSIG(status);
return NULL;
}
if (WIFEXITED(status)) {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: exited process for stopped pid=%d\n", __func__, task->pid);
task->event.type = EVENT_EXIT;
task->event.e_un.ret_val = WEXITSTATUS(status);
return NULL;
}
if ((status >> 16) == PTRACE_EVENT_EXIT) {
unsigned long data = 0;
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: exit event for stopped pid=%d\n", __func__, task->pid);
debug(DEBUG_TRACE, "ABOUT_EXIT: pid=%d", task->pid);
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1))
debug(DEBUG_TRACE, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
task->event.e_un.ret_val = WEXITSTATUS(data);
task->event.type = EVENT_ABOUT_EXIT;
return NULL;
}
fprintf(stderr, "!!!%s: pid=%d already stopped (%u)\n", __func__, task->pid, task->event.type);
}
task = process_event(task, status);
if (task)
assert(task->stopped);
return task; return task;
} }
@ -699,8 +622,7 @@ ssize_t copy_from_proc(struct task *task, arch_addr_t addr, void *dst, size_t le
if (errno != EFAULT) { if (errno != EFAULT) {
if (errno != ENOSYS) { if (errno != ENOSYS) {
if (unlikely(options.verbose)) fprintf(stderr, "%s pid=%d process_vm_readv: %s\n", __FUNCTION__, task->pid, strerror(errno));
fprintf(stderr, "!!!%s: pid=%d process_vm_readv: %s\n", __func__, task->pid, strerror(errno));
return -1; return -1;
} }
@ -837,10 +759,10 @@ ssize_t copy_str_from_proc(struct task *task, arch_addr_t addr, char *dst, size_
errno = 0; errno = 0;
if (!len--) if (--len < 0)
return -1; return -1;
while(len) { while (len) {
a.a = ptrace(PTRACE_PEEKTEXT, task->pid, addr, 0); a.a = ptrace(PTRACE_PEEKTEXT, task->pid, addr, 0);
if (unlikely(a.a == -1 && errno)) { if (unlikely(a.a == -1 && errno)) {
if (num_bytes && errno == EIO) if (num_bytes && errno == EIO)

View File

@ -0,0 +1,31 @@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-x86.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in

View File

@ -0,0 +1,634 @@
# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# This file is part of mtrace-ng.
# Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
# 02110-1301 USA
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = sysdeps/linux-gnu/x86
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/config/m4/libtool.m4 \
$(top_srcdir)/config/m4/ltoptions.m4 \
$(top_srcdir)/config/m4/ltsugar.m4 \
$(top_srcdir)/config/m4/ltversion.m4 \
$(top_srcdir)/config/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
___libcpu_la_LIBADD =
am____libcpu_la_OBJECTS = dwarf-x86.lo regs.lo arch.lo
___libcpu_la_OBJECTS = $(am____libcpu_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__dirstamp = $(am__leading_dot)dirstamp
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/autoconf/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(___libcpu_la_SOURCES)
DIST_SOURCES = $(___libcpu_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in \
$(top_srcdir)/config/autoconf/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_CFLAGS = @AM_CFLAGS@
AM_CPPFLAGS = @AM_CPPFLAGS@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AM_LDFLAGS = @AM_LDFLAGS@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HOST_CPU = @HOST_CPU@
HOST_OS = @HOST_OS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libelf_LD_LIBRARY_PATH = @libelf_LD_LIBRARY_PATH@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = \
../libcpu.la
___libcpu_la_SOURCES = \
dwarf-x86.c \
regs.c \
arch.c
noinst_HEADERS = \
arch.h
MAINTAINERCLEANFILES = \
Makefile.in
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sysdeps/linux-gnu/x86/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign sysdeps/linux-gnu/x86/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
../$(am__dirstamp):
@$(MKDIR_P) ..
@: > ../$(am__dirstamp)
../libcpu.la: $(___libcpu_la_OBJECTS) $(___libcpu_la_DEPENDENCIES) $(EXTRA____libcpu_la_DEPENDENCIES) ../$(am__dirstamp)
$(AM_V_CCLD)$(LINK) $(___libcpu_la_OBJECTS) $(___libcpu_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arch.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dwarf-x86.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regs.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
-rm -rf ../.libs ../_libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(HEADERS)
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *
@ -106,17 +106,17 @@ static int set_breakpoint_mode(struct task *task, unsigned int n, int type, int
uint32_t mode; uint32_t mode;
uint32_t dr7, mask; uint32_t dr7, mask;
mask = (0b1111U << (16 + 4 * n)) | (0b11U << (2 * n)); mask = (0b1111 << (16 + 4 * n)) | (0b11 << (2 * n));
switch(type) { switch(type) {
case BP_X: case BP_X:
mode = 0b0000U; mode = 0b0000;
break; break;
case BP_W: case BP_W:
mode = 0b0001U; mode = 0b0001;
break; break;
case BP_RW: case BP_RW:
mode = 0b0011U; mode = 0b0011;
break; break;
default: default:
fprintf(stderr, "invalid hw breakpoint type\n"); fprintf(stderr, "invalid hw breakpoint type\n");
@ -125,16 +125,16 @@ static int set_breakpoint_mode(struct task *task, unsigned int n, int type, int
switch(len) { switch(len) {
case 1: case 1:
mode |= 0b0000U; mode |= 0b0000;
break; break;
case 2: case 2:
mode |= 0b0100U; mode |= 0b0100;
break; break;
case 4: case 4:
mode |= 0b1100U; mode |= 0b1100;
break; break;
case 8: case 8:
mode |= 0b1000U; mode |= 0b1000;
break; break;
} }
@ -143,19 +143,19 @@ static int set_breakpoint_mode(struct task *task, unsigned int n, int type, int
dr7 |= mode << (16 + 4 * n); dr7 |= mode << (16 + 4 * n);
if (local) { if (local) {
dr7 |= 0b01U << (2 * n); dr7 |= 0b01 << (2 * n);
dr7 |= 1 << 8; dr7 |= 1 << 8;
} }
else else
if (!(dr7 & 0b01010101U)) if (!(dr7 & 0b01010101))
dr7 &= ~(1 << 8); dr7 &= ~(1 << 8);
if (global) { if (global) {
dr7 |= 0b10U << (2 * n); dr7 |= 0b10 << (2 * n);
dr7 |= 1 << 9; dr7 |= 1 << 9;
} }
else else
if (!(dr7 & 0b10101010U)) if (!(dr7 & 0b10101010))
dr7 &= ~(1 << 9); dr7 &= ~(1 << 9);
return apply_hw_bp(task, dr7); return apply_hw_bp(task, dr7);
@ -183,14 +183,14 @@ int reset_hw_bp(struct task *task, unsigned int n)
{ {
uint32_t dr7, mask; uint32_t dr7, mask;
mask = (0b1111U << (16 + 4 * n)) | (0b11U << (2 * n)); mask = (0b1111 << (16 + 4 * n)) | (0b11 << (2 * n));
dr7 = task->arch.dr7 & ~mask; dr7 = task->arch.dr7 & ~mask;
if (!(dr7 & 0b01010101U)) if (!(dr7 & 0b01010101))
dr7 &= ~(1 << 8); dr7 &= ~(1 << 8);
if (!(dr7 & 0b10101010U)) if (!(dr7 & 0b10101010))
dr7 &= ~(1 << 9); dr7 &= ~(1 << 9);
return apply_hw_bp(task, dr7); return apply_hw_bp(task, dr7);
@ -203,14 +203,14 @@ int reset_all_hw_bp(struct task *task)
int is_64bit(struct mt_elf *mte) int is_64bit(struct mt_elf *mte)
{ {
return !mte_cmp_machine(mte, EM_386); return mte->ehdr.e_machine != EM_386;
} }
int arch_task_init(struct task *task) int arch_task_init(struct task *task)
{ {
unsigned int i; unsigned int i;
for(i = 0; i != HW_BREAKPOINTS; ++i) for(i = 0; i < HW_BREAKPOINTS; ++i)
task->arch.hw_bp[i] = 0; task->arch.hw_bp[i] = 0;
return _apply_hw_bp(task, 0); return _apply_hw_bp(task, 0);
@ -223,9 +223,6 @@ void arch_task_destroy(struct task *task)
int arch_task_clone(struct task *retp, struct task *task) int arch_task_clone(struct task *retp, struct task *task)
{ {
(void)retp;
(void)task;
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* *
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany. * This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
* *

View File

@ -1,6 +0,0 @@
list(APPEND C_SRCS
sysdeps/${MT_OS}/${MT_CPU}/arch.c
sysdeps/${MT_OS}/${MT_CPU}/dwarf-x86.c
sysdeps/${MT_OS}/${MT_CPU}/regs.c
)

Some files were not shown because too many files have changed in this diff Show More