Compare commits

...

52 Commits
v0.6 ... master

Author SHA1 Message Date
sstefani
237bf3aa60
Merge pull request #11 from coldtobi/bugfixes_mmap
Bugfixes mmap
2022-06-24 13:14:22 +02:00
Tobias Frost
003dd834fd Consistently use long for the pid. 2022-06-24 11:14:43 +02:00
Tobias Frost
3afc8f0a3f Fix process_munmap not handling munmap correctly.
munmap(2) will unmap any page "it touches", the parameters
given to it do not necessarily need to match the ones given to mmap(2).
It is legit to specify pages that are not mapped at all, ranges that
span multiple mappings, with or without holes…

Beside that, a logic error in calculating the size for
process_release_mem() is fixed in the case a munmap would split
a previous allocation in two maps.

Similar fix also for the case where the freed page is at the end
of the allocated area.
2022-06-24 10:55:50 +02:00
Tobias Frost
be3b4c22ae Fix logic error in process_rb_search_range()
The function would not properly check if addr is within the block
due to inversed logic in the comparasion.
2022-06-23 09:18:43 +02:00
Tobias Frost
871a79f35b mremap handling in case of error and creating a duplicate mapping.
- mremap can fail, in this case the old mapping is retained.
- mremap, when oldsize is 0, a new mapping is created without freeing
the old one.

See mremap(2) for details.
2022-06-22 15:17:48 +02:00
Tobias Frost
f090e95e83 munmap can fail.
According to munmap(2), the call can fail, e.g if the adress given is
not at a page boundary.
2022-06-22 15:15:14 +02:00
Tobias Frost
61a32cf95e Consider page size in report_mmap / report_unmap.
mmaps are full of quirks ;-)

- mmap(2) will always allocate whole memory pages, even if the
  caller only reuqests a partial page.
  This is considered by calculating the "real" size of the mmap.

- munmap(2) also operates on pages, unmapping every page it "touches.",
  so the size parameter is adjusted if needed.
2022-06-22 15:13:56 +02:00
sstefani
641f59f871
Merge pull request #10 from coldtobi/fix_dwarf_include_x86
Fix the same header confusion as for arm
2022-06-21 13:01:15 +02:00
Tobias Frost
aea870ce0d Fix the same header confusion as for arm, see PR #7 2022-06-21 12:58:09 +02:00
sstefani
4007678321
Merge pull request #9 from coldtobi/fix_libz_liberty_linkage
find_library(liberty)
2022-06-21 12:46:18 +02:00
Tobias Frost
ce552acad2 find_library(liberty) will also take care of the demangle header
so, CHECK_INCLUDE_FILES_ERROR(libiberty/demangle.h) is not needed and
actually fails to find the header if the header is in some non-standard
location. (e.g if it comes from a conan package)
2022-06-21 10:42:45 +02:00
sstefani
811a3b75e2
Merge pull request #8 from coldtobi/fix_older_gcc
Fix add_compile_options spelling.
2022-06-21 10:25:25 +02:00
Tobias Frost
fd12122c86 Fix add_compile_options spelling. 2022-06-13 09:48:17 +02:00
sstefani
a6feaf045a
Merge pull request #7 from coldtobi/fix_arm_compile_issues
Fix arm compile issues
2022-06-10 14:48:40 +02:00
sstefani
d5ba7df9ae
Merge pull request #6 from coldtobi/fix_older_gcc
Wimplicit_fallthrough requires gcc7 or newer, so only enable it there.
2022-06-10 14:48:03 +02:00
sstefani
cb502b8676
Merge pull request #5 from coldtobi/fix_4_ancient_readline
Use rl_clear_history only if available, fallback to clear_history if not
2022-06-10 14:47:39 +02:00
sstefani
521b1a2bca
Merge pull request #4 from coldtobi/update-bfd
Fix compilation issue with newer binutils
2022-06-10 14:47:25 +02:00
sstefani
7e789d5555
Merge pull request #3 from coldtobi/fix_disable_client
Fix compilation when DISABLED_CLIENT is engaged.
2022-06-10 14:47:00 +02:00
Tobias Frost
c39c76a284 More unused parameters fixed. 2022-06-10 14:23:32 +02:00
Tobias Frost
83f3e2b1be struct libref members have been renamed previously.
Do also in the arm specific code.
2022-06-10 14:06:33 +02:00
Tobias Frost
d103e4f4fb Fix include path for dwarf.h and add missing define
the compiler included system dwarf.h, not with the project one.

DWARF_STOPUNWIND was not defined in the project's dwarf.h
2022-06-10 13:43:14 +02:00
Tobias Frost
f6b3158574 SW_BP is not defined, it seems to be BP_SW
(at least that is what breakpoint.h has)
2022-06-10 13:27:15 +02:00
Tobias Frost
e49367d214 Fix unused parameter warning. 2022-06-10 13:12:42 +02:00
Tobias Frost
7d8fb9ec75 Wimplicit_fallthrough requires gcc7 or newer, so only enable it there.
Also disable -Werror, as this is a great annoyance and breaks the build
with (newer) gccs or when some hardening options are enabled.
2022-06-10 12:57:21 +02:00
Tobias Frost
5f0dd75c1f Use rl_clear_history only if available, fallback to clear_history if not.
For ancient readline (I'm stuck to it on my embedded target...),
rl_clear_history is not available, so using clear_history instead.
2022-06-10 12:25:25 +02:00
Tobias Frost
9fb6465fb8 Define "PACKAGE" to have bfd from binutils 2.31 happy.
bfd 2.31 checks for this define and #errors out if it is not there.
2022-06-10 09:44:16 +02:00
Tobias Frost
8f3f225afe Fix compilation when DISABLED_CLIENT is engaged. 2022-06-09 13:50:42 +02:00
Tobias Frost
c38415317c Fix compilation issue with newer binutils
- Fixes for binutuils 2.31 / 2.34
- Fix CMake fails to error out if libbfd is not found.
- Fix conditiopnal linking if libbfd is not available. (e.g for client mode)
2022-06-09 13:33:16 +02:00
Stefani Seibold
6f097d37e6 cleanup cmake 2018-05-07 22:33:29 +02:00
sstefani
c6c446f1c2
Merge pull request #2 from xmw/xenial
Minor fixes on Ubuntu 16.04 with newer gcc and old CMake.
2018-05-07 22:30:30 +02:00
Michael Weber
05427b0efb Disable unused return code warning for unreachable code. 2018-05-07 17:49:47 +02:00
Michael Weber
c97313611e update dependencies for ubuntu/xenial 2018-05-07 17:48:05 +02:00
Michael Weber
935c0cff36 Remove IPO disabled artefacts. 2018-05-07 17:47:46 +02:00
Stefani Seibold
42e3f9ad79 fix auxv parser 2018-04-25 17:36:14 +02:00
Stefani Seibold
badc8d24fd code cleanup 2018-04-18 12:47:43 +02:00
Stefani Seibold
31e24c9426 fix debug option 2018-04-18 08:48:20 +02:00
Stefani Seibold
ed95193efe fix help messages 2018-04-18 08:46:07 +02:00
Stefani Seibold
7970712f70 minor fixes 2018-04-18 08:43:17 +02:00
Stefani Seibold
da9ae73ea9 bump to new version 2018-04-17 18:01:57 +02:00
Stefani Seibold
ae7d7d5afb minor dwarf fix 2018-04-17 17:32:45 +02:00
Stefani Seibold
6ac727d143 minor dwarf improvments 2018-04-17 14:57:49 +02:00
Stefani Seibold
98a3c4a942 fix non debug build 2018-04-17 11:36:52 +02:00
Stefani Seibold
495a9d535d fix dwarf unwinding 2018-04-17 11:28:37 +02:00
Stefani Seibold
73a4eca5ce fix address spaces 2018-04-16 16:24:19 +02:00
Stefani Seibold
87f73f3220 fixes 2018-04-16 09:10:19 +02:00
Stefani Seibold
a6c7ba8fcc code cleanup 2018-04-12 13:03:16 +02:00
Stefani Seibold
dc6b85bd8b fix process attach 2018-04-12 11:14:11 +02:00
Stefani Seibold
b58a41680a fix copyright 2018-04-12 11:11:58 +02:00
Stefani Seibold
e1e243e25a various bug fixes 2018-04-12 11:00:20 +02:00
Stefani Seibold
0155d789b4 bump to version 0.8
tons of fixes. On the way to a final release 1.0
2018-04-06 22:10:20 +02:00
Stefani Seibold
4c5f0c20b4 fix echo_all_cmake_variable_values function
clean up the output
2017-12-19 11:18:31 +01:00
Stefani Seibold
4ce01bc3fe switch to cmake build system
kick out automake and use cmake instead
2017-12-19 11:13:07 +01:00
106 changed files with 1815 additions and 77592 deletions

165
CMakeLists.txt Normal file
View File

@ -0,0 +1,165 @@
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()

View File

@ -1,117 +0,0 @@
# 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)

File diff suppressed because it is too large Load Diff

131
Utilities.cmake Normal file
View File

@ -0,0 +1,131 @@
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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,733 +0,0 @@
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.5], [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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -56,8 +55,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 a task. */ /* stop tracing of a task. */
int untrace_task(struct task *task, int signum); int untrace_task(struct task *task);
/* 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,9 +0,0 @@
#!/bin/sh
make clean
make maintainer-clean
rm -rf config autom4te.cache
libtoolize -c
aclocal
autoheader
automake --add-missing -c
autoconf

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -70,28 +69,37 @@ 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, const struct breakpoint *bp) static void disable_sw_breakpoint(struct task *task, 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)
{ {
@ -109,6 +117,7 @@ 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;
@ -120,6 +129,8 @@ 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;
@ -185,13 +196,16 @@ void reorder_hw_bp(struct task *task)
} }
} }
if (!n) if (n < HW_BREAKPOINTS - 1) {
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 = (i < HW_BREAKPOINTS - 1) ? BP_REORDER_THRESHOLD >> (i + 4) : 0; bp_list[i]->hwcnt = 0;
if (n > HW_BREAKPOINTS - 1) if (n > HW_BREAKPOINTS - 1)
n = HW_BREAKPOINTS - 1; n = HW_BREAKPOINTS - 1;
@ -205,9 +219,11 @@ 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)
@ -231,6 +247,7 @@ 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;
@ -366,6 +383,7 @@ 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
@ -432,7 +450,6 @@ 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;
} }
} }
@ -467,7 +484,6 @@ void breakpoint_disable(struct task *task, struct breakpoint *bp)
} }
#endif #endif
disable_sw_breakpoint(task, bp); disable_sw_breakpoint(task, bp);
bp->enabled = 0;
} }
} }
@ -512,13 +528,11 @@ 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] count=%u was_hw=%u\n", "delete %s breakpoint %s:%s [%#lx]\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;
@ -529,6 +543,8 @@ 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;
@ -550,6 +566,8 @@ 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;
@ -567,7 +585,6 @@ 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)
@ -575,6 +592,8 @@ 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);
@ -595,6 +614,8 @@ 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);
@ -608,7 +629,30 @@ 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)
@ -616,6 +660,8 @@ 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;
} }
@ -624,7 +670,9 @@ 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;
} }
@ -643,6 +691,8 @@ 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;
@ -665,6 +715,7 @@ 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;
@ -695,7 +746,8 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
} }
else else
#endif #endif
memcpy(new_bp->orig_value, bp->orig_value, sizeof(bp->orig_value)); if (new_bp->sw)
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);
@ -732,6 +784,8 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -50,6 +49,7 @@ 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,9 +69,6 @@ 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);
@ -92,6 +89,7 @@ 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);
@ -105,10 +103,14 @@ 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
@ -120,10 +122,12 @@ 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

View File

@ -1,33 +0,0 @@
# 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

View File

@ -1,639 +0,0 @@
# 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +28,20 @@
#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"
@ -92,10 +106,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_get_section_vma(abfd, section); vma = bfd_section_vma_wrapper(abfd, section);
if (psi->pc < vma) if (psi->pc < vma)
return; return;
size = bfd_section_size(abfd, section); size = bfd_section_size_wrapper(abfd, section);
if (psi->pc >= vma + size) if (psi->pc >= vma + size)
return; return;
@ -151,7 +165,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_TYPES | DMGL_VERBOSE | DMGL_ANSI | DMGL_PARAMS); alloc = bfd_demangle(binfile->abfd, name, DMGL_ANSI | DMGL_PARAMS | DMGL_RET_DROP | DMGL_AUTO);
if (alloc) if (alloc)
name = alloc; name = alloc;
} }
@ -289,10 +303,9 @@ 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)
return; rb_erase(&sym->node, &binfile->sym_table);
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,8 +364,10 @@ 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);
}
} }
@ -487,14 +489,15 @@ static int client_func(void)
process_about_exit(process); process_about_exit(process);
break; break;
case MT_EXIT: case MT_EXIT:
process_exit(process); if (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:
process_scan(process, payload, mt_msg.payload_len); if (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);
@ -503,7 +506,8 @@ 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:
process_detach(process); if (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);
@ -659,8 +663,10 @@ static void signal_exit(int sig)
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN); signal(SIGTERM, SIG_IGN);
if (write(pipefd[1], &signum, 1) == -1) #pragma GCC diagnostic push
; #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)
@ -761,6 +767,8 @@ 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);
@ -824,6 +832,7 @@ 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,8 +92,7 @@ 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; struct rb_stack *stack_node;
enum mt_operation operation;
}; };
struct regex_list { struct regex_list {
@ -424,6 +423,7 @@ 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, unsigned int pid, void *addrs, uint32_t stack_size, enum mt_operation operation) static struct rb_stack *stack_add(struct process *process, 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 ((addr <= this->addr) && (addr + size > this->addr)) if ((this->addr <= addr) && (this->addr + this->size > addr))
return this; return this;
if (addr < this->addr) if (addr < this->addr)
@ -775,6 +775,8 @@ 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);
@ -812,8 +814,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) if (re->stack_node)
stack_put(re->stack); stack_put(re->stack_node);
list_del(&re->list); list_del(&re->list);
free(re); free(re);
} }
@ -1033,7 +1035,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; struct rb_stack **arr = NULL;
unsigned long i; unsigned long i;
void *data; void *data;
unsigned long stack_trees = process->stack_trees; unsigned long stack_trees = process->stack_trees;
@ -1043,9 +1045,12 @@ 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)
return; goto skip;
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);
@ -1058,9 +1063,6 @@ 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) {
@ -1144,6 +1146,8 @@ 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;
} }
@ -1207,7 +1211,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);
} }
void *process_scan(struct process *process, void *leaks, uint32_t payload_len) int 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;
@ -1241,8 +1245,10 @@ void *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 (dump_printf(" leaked at 0x%08lx (%lu bytes)\n", (unsigned long)block->addr, (unsigned long)block->size) == -1) if (options.verbose > 1) {
break; if (dump_printf(" leaked at 0x%08lx (%lu bytes)\n", (unsigned long)block->addr, (unsigned long)block->size) == -1)
break;
}
new_leaks += process->ptr_size; new_leaks += process->ptr_size;
} }
@ -1250,10 +1256,12 @@ void *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 leaks; return 0;
} }
static inline unsigned long roundup_mask(unsigned long val, unsigned long mask) static inline unsigned long roundup_mask(unsigned long val, unsigned long mask)
@ -1290,20 +1298,32 @@ 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 (!is_mmap(block->stack_node->stack->operation)) { if (block && !is_mmap(block->stack_node->stack->operation)) {
if (unlikely(options.kill)) { // ignore blocks not mmap'ed
fprintf(stderr, ">>> block missmatch pid:%d MAP<>MALLOC %#lx\n", process->pid, ptr); block = NULL;
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 off = block->addr - ptr; unsigned long off = block->addr - ptr;
size -= off; size -= off;
ptr += off; ptr += off;
@ -1323,33 +1343,32 @@ 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 off = ptr - block->addr; unsigned long 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 - new_size); process_release_mem(process, block, block->size - off);
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);
process_release_mem(process, block, off); block->size -= amount_freed;
size -= amount_freed ;
block->addr += off; ptr += amount_freed;
block->size -= off; }
size -= block->size;
ptr += block->size;
} }
} while(size); } while(size);
} }
@ -1383,6 +1402,22 @@ 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;
@ -1430,27 +1465,15 @@ 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, process->pid, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, 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)
struct realloc_entry *re = malloc(sizeof(*re)); realloc_add(process, pid, block->addr, block->size, block->flags, block->stack_node);
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);
} }
@ -1462,21 +1485,26 @@ 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, process->pid, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, 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 int pid; unsigned long pid;
struct list_head *it; struct list_head *it;
(void)mt_msg;
if (!process->tracing) if (!process->tracing)
return; return;
@ -1500,7 +1528,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, re->flags, re->operation); process_rb_insert_block(process, re->addr, re->size, re->stack_node, re->flags, re->stack_node->stack->operation);
realloc_del(re); realloc_del(re);
return; return;
@ -1508,7 +1536,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: %u\n", pid); fprintf(stderr, ">>> unexpected realloc done pid: %lu ptr: %#lx\n", pid, ptr);
abort(); abort();
} }
return; return;
@ -1562,7 +1590,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, process->pid, stack_data, stack_size, mt_msg->operation); struct rb_stack *stack = stack_add(process, 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");
@ -1636,14 +1664,17 @@ void process_dump_sortby(struct process *process)
} }
} }
void process_exit(struct process *process) int 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);
else return 1;
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)
@ -1656,17 +1687,25 @@ 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);
} }
void process_detach(struct process *process) int 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 }
if (!options.interactive) else {
process_dump_sortby(process); if (!options.interactive) {
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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);
void process_exit(struct process *process); int process_exit(struct process *process);
void process_status(struct process *process); void process_status(struct process *process);
void *process_scan(struct process *curr, void *leaks, uint32_t payload_len); int 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);
void process_detach(struct process *process); int 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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" }, { "allocations", 2, process_dump_sort_allocations, "sort by number of open allocations", NULL, NULL },
{ "average", 2, process_dump_sort_average, "sort by average allocation of bytes (usage / allocations)" }, { "average", 2, process_dump_sort_average, "sort by average allocation of bytes (usage / allocations)", NULL, NULL },
{ "badfree", 1, process_dump_sort_badfree, "sort by number of badfree releases" }, { "badfree", 1, process_dump_sort_badfree, "sort by number of badfree releases", NULL, NULL },
{ "bytes-leaked", 1, process_dump_sort_bytes_leaked, "sort by number of leaked bytes" }, { "bytes-leaked", 1, process_dump_sort_bytes_leaked, "sort by number of leaked bytes", NULL, NULL },
{ "leaks", 1, process_dump_sort_leaks, "sort by number of detected leaks" }, { "leaks", 1, process_dump_sort_leaks, "sort by number of detected leaks", NULL, NULL },
{ "mismatched", 1, process_dump_sort_mismatched, "sort by number of mismatched releases" }, { "mismatched", 1, process_dump_sort_mismatched, "sort by number of mismatched releases", NULL, NULL },
{ "stacks", 1, process_dump_stacks, "dump all stack sort by number of total allocations" }, { "stacks", 1, process_dump_stacks, "dump all stack sort by number of total allocations", NULL, NULL },
{ "total", 2, process_dump_sort_total, "sort by number of total allocations" }, { "total", 2, process_dump_sort_total, "sort by number of total allocations", NULL, NULL },
{ "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter" }, { "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter", NULL, NULL },
{ "usage", 1, process_dump_sort_usage, "sort by number of bytes" }, { "usage", 1, process_dump_sort_usage, "sort by number of bytes", NULL, NULL },
{ NULL, 0, NULL, "\n use > to dump the output into a file" }, { NULL, 0, NULL, "\n use > to dump the output into a file", NULL, NULL },
}; };
static struct cmd_opt set_opts[] = { static struct cmd_opt set_opts[] = {
{ "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries" }, { "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries", NULL, NULL },
{ "depth", 1, do_set_depth, "set backtrace depth" }, { "depth", 1, do_set_depth, "set backtrace depth", NULL, NULL },
{ }, { },
}; };
static struct cmd_opt show_opts[] = { static struct cmd_opt show_opts[] = {
{ "info", 1, do_show_info, "show client settings" }, { "info", 1, do_show_info, "show client settings", NULL, NULL },
{ "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries" }, { "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries", NULL, NULL },
{ }, { },
}; };
static struct cmd_opt scan_opts[] = { static struct cmd_opt scan_opts[] = {
{ "all", 1, (void *)SCAN_ALL, "scan all memory blocks" }, { "all", 1, (void *)SCAN_ALL, "scan all memory blocks", NULL, NULL },
{ "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations" }, { "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations", NULL, NULL },
{ "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan" }, { "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan", NULL, NULL },
{ }, { },
}; };
@ -144,21 +144,24 @@ 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,
@ -189,21 +192,24 @@ 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
}, },
{ }, { },
}; };
@ -347,9 +353,8 @@ static void readline_handler(char *line)
char *linedup; char *linedup;
char *s; char *s;
linedup = strdup(line); linedup = alloca(strlen(line) + 1);
if (!linedup) strcpy(linedup, line);
goto finish;
argv = malloc(argv_size * sizeof(*argv)); argv = malloc(argv_size * sizeof(*argv));
if (!argv) if (!argv)
@ -401,7 +406,7 @@ static void readline_handler(char *line)
s += n + 1; s += n + 1;
} }
if (!i) if (!i)
return; goto finish;
argc = i; argc = i;
argv[i++] = NULL; argv[i++] = NULL;
@ -439,7 +444,6 @@ 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();
@ -513,6 +517,8 @@ 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;
@ -528,6 +534,8 @@ 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;
@ -661,6 +669,9 @@ 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;
@ -674,6 +685,10 @@ 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;
@ -683,6 +698,9 @@ 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;
@ -702,6 +720,8 @@ 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;
@ -798,6 +818,9 @@ 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;
@ -819,6 +842,9 @@ 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;
@ -832,6 +858,9 @@ 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;
@ -888,5 +917,10 @@ 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,214 +1,13 @@
/* config.h.in. Generated from configure.ac by autoheader. */ #define PACKAGE_VERSION "@MT_VERSION_STRING@"
/* debugging */ #ifndef HAVE_PROCESS_VM_READV
#undef DEBUG #cmakedefine HAVE_PROCESS_VM_READV
/* 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
/* Define to `int' if <sys/types.h> does not define. */ #ifndef HAVE_LIBSELINUX
#undef pid_t #cmakedefine HAVE_LIBSELINUX
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */ #ifndef DISABLE_CLIENT
#undef size_t #cmakedefine DISABLE_CLIENT
#endif
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork

15652
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,287 +0,0 @@
# -*- 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.5],[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, libelfg0-dev Build-Depends: debhelper (>= 8.0.0), autotools-dev, binutils-dev, libreadline6-dev, libselinux1-dev, libtinfo-dev, libelf-dev, zlib1g-dev, libncurses5-dev, libiberty-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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +47,8 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,11 +28,11 @@
/* debug levels: /* debug levels:
*/ */
enum { enum {
DEBUG_EVENT_HANDLER = 01, DEBUG_TRACE = 1,
DEBUG_DWARF = 02, DEBUG_DWARF = 2,
DEBUG_EVENT = 010, DEBUG_EVENT = 4,
DEBUG_PROCESS = 020, DEBUG_PROCESS = 8,
DEBUG_FUNCTION = 040 DEBUG_FUNCTION = 16,
}; };
#ifdef DEBUG #ifdef DEBUG
@ -41,6 +40,11 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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->gp; arch_addr_t gp = as->cursor.libref->pltgot;
int is_64bit = as->is_64bit; int is_64bit = as->is_64bit;
void *tmp_ptr; void *tmp_ptr;
int ret; int ret;
@ -477,16 +477,6 @@ 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)
@ -621,6 +611,15 @@ 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);
} }
@ -687,7 +686,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;
} }
@ -871,20 +870,16 @@ 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 (lib_addr_match(c->libref, ip)) if (ip >= libref->txt_vaddr && ip < libref->txt_vaddr + libref->txt_size)
return 0; return 0;
} }
@ -895,16 +890,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 table_len, int32_t rel_ip) static const struct table_entry *lookup(const struct table_entry *table, size_t fde_count, 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 (!table_len) if (!fde_count)
return NULL; return NULL;
lo = 0; lo = 0;
hi = table_len; hi = fde_count;
f = NULL; f = NULL;
do { do {
unsigned long mid = (lo + hi) / 2; unsigned long mid = (lo + hi) / 2;
@ -922,7 +917,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 *table_data, unsigned long table_len) static int dwarf_search_unwind_table(struct dwarf_addr_space *as, arch_addr_t ip, void *fde_tab, unsigned long fde_count)
{ {
const struct table_entry *e; const struct table_entry *e;
void *fde_addr; void *fde_addr;
@ -930,20 +925,19 @@ 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(table_data, table_len, ip - libref->load_addr - libref->seg_offset); e = lookup(fde_tab, fde_count, ip - libref->eh_hdr_vaddr);
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->image_addr - libref->load_offset + e->fde_offset + libref->seg_offset; fde_addr = libref->mmap_addr + e->fde_offset + libref->eh_hdr_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 -= ARCH_ADDR_T(libref->image_addr) - libref->load_addr; dci->start_ip = dci->start_ip - (arch_addr_t)libref->mmap_addr + libref->txt_vaddr;
if (!as->is_64bit) if (!as->is_64bit)
dci->start_ip &= 0xffffffff; dci->start_ip &= 0xffffffff;
@ -974,18 +968,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 val = DWARF_GET_LOC(loc); arch_addr_t addr = DWARF_GET_LOC(loc);
if (DWARF_IS_REG_LOC(loc)) if (DWARF_IS_REG_LOC(loc))
return dwarf_access_reg(as, val, valp); return dwarf_access_reg(as, addr, valp);
if (!as->is_64bit) if (!as->is_64bit)
val &= 0xffffffff; addr &= 0xffffffff;
if (DWARF_IS_MEM_LOC(loc)) if (DWARF_IS_MEM_LOC(loc))
return dwarf_readw(as, &val, valp, as->is_64bit); return dwarf_readw(as, &addr, valp, as->is_64bit);
*valp = val; *valp = addr;
return 0; return 0;
} }
@ -1054,10 +1048,9 @@ 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;
struct dwarf_reg_stack { unsigned int reg_stack_ptr = 0;
struct dwarf_reg_stack *next; /* for reg state stack */ unsigned int reg_stack_entry_len = regs_size(as);
struct dwarf_reg_state store; unsigned char reg_stack[16 * reg_stack_entry_len];
} *rs_stack = NULL, *rs_tmp;
curr_ip = dci->start_ip; curr_ip = dci->start_ip;
@ -1166,21 +1159,22 @@ 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:
rs_tmp = malloc(regs_size(as)); if (unlikely(sizeof(reg_stack) - reg_stack_ptr < reg_stack_entry_len)) {
memcpy(&rs_tmp->store, rs_current, regs_size(as)); debug(DEBUG_DWARF, "register-state stack overflow");
rs_tmp->next = rs_stack; ret = -DWARF_EINVAL;
rs_stack = rs_tmp; goto fail;
}
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(!rs_stack)) { if (unlikely(!reg_stack_ptr)) {
debug(DEBUG_DWARF, "register-state stack underflow"); debug(DEBUG_DWARF, "register-state stack underflow");
ret = -DWARF_EINVAL; ret = -DWARF_EINVAL;
goto fail; goto fail;
} }
rs_tmp = rs_stack; reg_stack_ptr -= reg_stack_entry_len;
memcpy(rs_current, &rs_tmp->store, regs_size(as)); memcpy(rs_current, reg_stack + reg_stack_ptr, reg_stack_entry_len);
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)
@ -1269,12 +1263,6 @@ 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;
} }
@ -1808,7 +1796,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->table_data, libref->table_len); ret = dwarf_search_unwind_table(as, ip, libref->fde_tab, libref->fde_count);
if (ret < 0) if (ret < 0)
return ret; return ret;
@ -1942,8 +1930,6 @@ 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)
@ -1988,7 +1974,8 @@ fail:
break; break;
} }
#endif #endif
debug(DEBUG_DWARF, "error %d", ret); if (ret != -DWARF_ENOINFO && ret != -DWARF_EBADFRAME)
debug(DEBUG_DWARF, "error %d", ret);
c->valid = 0; c->valid = 0;
} }
@ -1996,11 +1983,14 @@ fail:
return ret; return ret;
} }
int dwarf_get_unwind_table(struct task *task, struct libref *libref, struct dwarf_eh_frame_hdr *hdr) int dwarf_get_unwind_table(struct task *task, struct libref *libref)
{ {
arch_addr_t addr, fde_count; arch_addr_t addr;
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));
@ -2010,26 +2000,32 @@ int dwarf_get_unwind_table(struct task *task, struct libref *libref, struct dwar
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);
/* (Optionally) read eh_frame_ptr: */ /* read eh_frame_ptr: */
if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, NULL, 0)) < 0) if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, &eh_frame, 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->table_data = (void *)addr; libref->fde_tab = (void *)addr;
libref->table_len = fde_count; libref->fde_count = 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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 /* no unwind info found */ #define DWARF_STOPUNWIND 7
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, struct dwarf_eh_frame_hdr *hdr); int dwarf_get_unwind_table(struct task *task, struct libref *libref);
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);

284
event.c
View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -53,10 +52,16 @@
#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);
@ -88,42 +93,37 @@ void init_event(struct task *task)
INIT_LIST_HEAD(&task->event.list); INIT_LIST_HEAD(&task->event.list);
} }
static void show_clone(struct task *task, enum event_type type) static const char * get_clone_type(enum event_type type)
{ {
const char *str;
switch(type) { switch(type) {
case EVENT_FORK: case EVENT_FORK:
str = "fork"; return "fork";
break;
case EVENT_VFORK: case EVENT_VFORK:
str = "vfork"; return "vfork";
break;
case EVENT_CLONE: case EVENT_CLONE:
str = "clone"; return "clone";
break;
default: default:
str = "?";
break; break;
} }
fprintf(stderr, "+++ process pid=%d %s (newpid=%d) +++\n", task->pid, str, task->event.e_un.newpid); return "?";
} }
static void handle_clone(struct task *task, enum event_type type) static int do_clone(struct task *task, struct task *newtask)
{ {
struct task *newtask; debug(DEBUG_EVENT, "+++ process %s pid=%d, newpid=%d", get_clone_type(task->event.type), task->pid, newtask->pid);
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))
show_clone(task, type); fprintf(stderr, "+++ process %s pid=%d, newpid=%d\n", get_clone_type(task->event.type), task->pid, newtask->pid);
continue_task(task, 0); assert(task->stopped);
assert(newtask->stopped);
assert(newtask->is_new);
newtask = pid2task(newpid); if (unlikely(options.verbose && newtask->event.type != EVENT_NEW))
if (!newtask) fprintf(stderr, "!!!task new unexpected event for pid=%d: %d\n", newtask->pid, newtask->event.type);
goto fail; else
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 void handle_clone(struct task *task, enum event_type type)
if (!options.follow) { if (!options.follow) {
remove_proc(newtask); remove_proc(newtask);
return; return RET_DELETED;
} }
report_fork(newtask, task); report_fork(newtask, task);
@ -141,77 +141,130 @@ static void handle_clone(struct task *task, enum event_type type)
goto fail; goto fail;
} }
continue_task(newtask, newtask->event.e_un.signum); newtask->is_new = 0;
return continue_task(newtask, 0);
return;
fail: fail:
fprintf(stderr, fprintf(stderr, "Error during clone of pid=%d - This process won't be traced!\n", newtask->pid);
"Error during init of tracing process %d\n" return -1;
"This process won't be traced.\n",
newpid
);
} }
static void handle_signal(struct task *task) static int do_clone_cb(struct task *newtask, void *data)
{ {
if (unlikely(options.verbose > 1)) { int ret;
if (task->event.e_un.signum && (task->event.e_un.signum != SIGSTOP || !task->was_stopped)) struct task *task = data;
fprintf(stderr, "+++ process pid=%d signal %d: %s +++\n", task->pid, task->event.e_un.signum, strsignal(task->event.e_un.signum));
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;
} }
continue_task(task, task->event.e_un.signum); 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 (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);
} }
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 void handle_about_exit(struct task *task) static int handle_new(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; return 0;
} }
} }
continue_task(task, 0); return continue_task(task, 0);
} }
static void handle_exit(struct task *task) static int 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);
remove_proc(task); untrace_proc(task);
} }
else { else {
remove_task(task); remove_task(task);
} }
return RET_DELETED;
} }
static void handle_exit_signal(struct task *task) static int 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);
remove_proc(task); untrace_proc(task);
} }
else { else {
remove_task(task); remove_task(task);
} }
return RET_DELETED;
} }
static void handle_exec(struct task *task) static int handle_exec(struct task *task)
{ {
debug(DEBUG_FUNCTION, "pid=%d", task->pid); debug(DEBUG_EVENT, "+++ process pid=%d exec", task->pid);
if (unlikely(options.verbose)) if (unlikely(options.verbose))
fprintf(stderr, "+++ process pid=%d exec (%s) +++\n", task->pid, library_execname(task)); fprintf(stderr, "+++ process pid=%d exec\n", task->pid);
if (!options.follow_exec) if (!options.follow_exec)
goto nofollow; goto nofollow;
@ -221,18 +274,20 @@ static void handle_exec(struct task *task)
goto untrace; goto untrace;
} }
continue_task(task, 0); return continue_task(task, 0);
return;
nofollow: nofollow:
report_nofollow(task); report_nofollow(task);
untrace: untrace:
remove_proc(task); untrace_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;
@ -255,16 +310,42 @@ static int handle_call_after(struct task *task, struct breakpoint *bp)
return 0; return 0;
} }
static void handle_breakpoint(struct task *task) static int 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_FUNCTION, "pid=%d, addr=%#lx", task->pid, bp->addr); debug(DEBUG_EVENT, "+++ process pid=%d breakpoint 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))) {
@ -281,28 +362,7 @@ static void handle_breakpoint(struct task *task)
} }
#endif #endif
if (unlikely(options.verbose)) if (bp->on_hit && bp->on_hit(task, bp)) {
++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;
} }
@ -336,65 +396,85 @@ static void handle_breakpoint(struct task *task)
} }
} }
if (task->stopped) if (task->bp_skipped)
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(void) int handle_event(struct task *task)
{ {
struct task *task = next_event(); int ret;
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:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event none", task->pid); ret = continue_task(task, task->event.e_un.signum);
break; break;
case EVENT_SIGNAL: case EVENT_SIGNAL:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event signal %d", task->pid, event->e_un.signum); ret = handle_signal(task);
handle_signal(task);
break; break;
case EVENT_ABOUT_EXIT: case EVENT_ABOUT_EXIT:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit %d", task->pid, event->e_un.ret_val); ret = handle_about_exit(task);
handle_about_exit(task); goto out1;
break;
case EVENT_EXIT: case EVENT_EXIT:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit %d", task->pid, event->e_un.ret_val); ret = handle_exit(task);
handle_exit(task);
break; break;
case EVENT_EXIT_SIGNAL: case EVENT_EXIT_SIGNAL:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event exit signal %d", task->pid, event->e_un.signum); ret = handle_exit_signal(task);
handle_exit_signal(task);
break; break;
case EVENT_FORK: case EVENT_FORK:
case EVENT_VFORK: case EVENT_VFORK:
case EVENT_CLONE: case EVENT_CLONE:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event clone (%u)", task->pid, event->e_un.newpid); ret = handle_child(task);
handle_clone(task, type);
break; break;
case EVENT_EXEC: case EVENT_EXEC:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event exec()", task->pid); ret = handle_exec(task);
handle_exec(task);
break; break;
case EVENT_BREAKPOINT: case EVENT_BREAKPOINT:
debug(DEBUG_EVENT_HANDLER, "pid=%d, event breakpoint %#lx", task->pid, event->e_un.breakpoint->addr); ret = handle_breakpoint(task);
handle_breakpoint(task); goto out2;
case EVENT_NEW:
ret = handle_new(task);
break; break;
default: default:
fprintf(stderr, "Error! unknown event?\n"); fprintf(stderr, "fatal error, unknown event %d\n", type);
return -1; abort();
} }
return 1; if (ret == RET_DELETED)
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +36,8 @@ 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 {
@ -54,7 +55,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(void); int handle_event(struct task *task);
#endif #endif

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -67,8 +66,8 @@ void libref_delete(struct libref *libref)
free(sym); free(sym);
} }
if (libref->image_addr) if (libref->mmap_addr)
munmap(libref->image_addr, libref->load_size); munmap(libref->mmap_addr, libref->txt_size);
free((void *)libref->filename); free((void *)libref->filename);
free(libref); free(libref);
@ -150,14 +149,14 @@ struct library_symbol *library_find_symbol(struct libref *libref, arch_addr_t ad
return NULL; return NULL;
} }
struct library *library_find_with_key(struct list_head *list, arch_addr_t key) struct library *library_find_by_dyn(struct list_head *list, arch_addr_t dyn)
{ {
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->key == key) if (lib->libref->dyn == dyn)
return lib; return lib;
} }
return NULL; return NULL;
@ -171,10 +170,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", libref->filename, libref->base); debug(DEBUG_FUNCTION, "%s@%#lx pid=%d ", libref->filename, libref->dyn, leader->pid);
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->base, libref->load_addr, libref->load_addr + libref->load_size); 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);
library_delete(leader, lib); library_delete(leader, lib);
} }
@ -211,11 +210,6 @@ 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);
@ -224,10 +218,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 (lib_addr_match(this, addr)) if (addr >= this->txt_vaddr && addr < this->txt_vaddr + this->txt_size)
return this; return this;
if (this->load_addr < addr) if (this->txt_vaddr < addr)
new = &((*new)->rb_left); new = &((*new)->rb_left);
else else
new = &((*new)->rb_right); new = &((*new)->rb_right);
@ -246,7 +240,7 @@ static void insert_lib(struct task *leader, struct library *lib)
parent = *new; parent = *new;
if (this->libref->load_addr < lib->libref->load_addr) if (this->libref->txt_vaddr < lib->libref->txt_vaddr)
new = &((*new)->rb_left); new = &((*new)->rb_left);
else else
new = &((*new)->rb_right); new = &((*new)->rb_right);
@ -259,7 +253,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->base, leader->pid); debug(DEBUG_PROCESS, "%s@%#lx to pid=%d", libref->filename, libref->dyn, leader->pid);
assert(leader->leader == leader); assert(leader->leader == leader);
@ -274,7 +268,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->base, libref->load_addr, libref->load_addr + libref->load_size); 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);
return lib; return lib;
} }

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -44,12 +43,11 @@ struct library_symbol {
}; };
struct libref { struct libref {
/* Unique key. Two library objects are considered equal, if /* Unique dynamic entry address */
* they have the same key. */ arch_addr_t dyn;
arch_addr_t key;
/* Address where the library is mapped. */ /* base address assign by the loader */
arch_addr_t base; unsigned long bias;
/* 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
@ -60,19 +58,21 @@ struct libref {
const char *filename; const char *filename;
/* executable segment */ /* executable segment */
unsigned long load_offset; unsigned long txt_vaddr;
unsigned long load_addr; unsigned long txt_size;
unsigned long load_size; unsigned long txt_offset;
unsigned long bias;
/* mapped image */ /* mapped image */
void *image_addr; void *mmap_addr;
unsigned long mmap_offset;
unsigned long mmap_size;
/* global-pointer */ /* global-pointer */
arch_addr_t gp; arch_addr_t pltgot;
unsigned long seg_offset; unsigned long eh_hdr_offset;
void *table_data; unsigned long eh_hdr_vaddr;
unsigned long table_len; void *fde_tab;
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 key */ /* find a library with a given dynamic entry address */
struct library *library_find_with_key(struct list_head *list, arch_addr_t key); struct library *library_find_by_dyn(struct list_head *list, arch_addr_t dyn);
/* 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,41 +55,39 @@ 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 *new, static inline void __list_add(struct list_head *elem, struct list_head *prev, struct list_head *next)
struct list_head *prev,
struct list_head *next)
{ {
next->prev = new; next->prev = elem;
new->next = next; elem->next = next;
new->prev = prev; elem->prev = prev;
prev->next = new; prev->next = elem;
} }
/** /**
* list_add - add a new entry * list_add - add a new entry
* @new: new entry to be added * @elem: 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 *new, struct list_head *head) static inline void list_add(struct list_head *elem, struct list_head *head)
{ {
__list_add(new, head, head->next); __list_add(elem, head, head->next);
} }
/** /**
* list_add_tail - add a new entry * list_add_tail - add a new entry
* @new: new entry to be added * @elem: 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 *new, struct list_head *head) static inline void list_add_tail(struct list_head *elem, struct list_head *head)
{ {
__list_add(new, head->prev, head); __list_add(elem, 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +39,9 @@
#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"
@ -59,6 +61,8 @@ 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)
@ -67,7 +71,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();
@ -108,6 +112,8 @@ 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);
@ -115,7 +121,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)
@ -124,12 +130,17 @@ 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;
if (handle_event() == -1) task = next_event();
break; if (task) {
if (handle_event(task) == -1)
break;
}
if (server_poll() == -1) if (server_poll() == -1)
break; break;
@ -140,8 +151,6 @@ 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)
@ -153,7 +162,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
else { else {
#if DISABLE_CLIENT #ifdef DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n"); fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#else #else
@ -168,7 +177,7 @@ int main(int argc, char *argv[])
} }
} }
else { else {
#if DISABLE_CLIENT #ifdef DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n"); fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
#else #else
@ -193,7 +202,7 @@ int main(int argc, char *argv[])
report_info(0); report_info(0);
report_disconnect(); report_disconnect();
#if !DISABLE_CLIENT #ifndef 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +23,8 @@
#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);
@ -36,5 +38,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;
#endif #endif

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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 8 #define MEMTRACE_SI_VERSION 9
#define MEMTRACE_SI_FORK 1 #define MEMTRACE_SI_FORK 1
#define MEMTRACE_SI_EXEC 2 #define MEMTRACE_SI_EXEC 2
@ -100,6 +100,7 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -48,6 +47,34 @@
#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;
@ -217,50 +244,47 @@ 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 **image_addr) static inline int elf_map_image(struct mt_elf *mte, void **mmap_addr)
{ {
void *addr; void *addr;
volatile char *p;
addr = mmap(NULL, mte->txt_hdr.p_filesz, PROT_READ, MAP_PRIVATE, mte->fd, mte->txt_hdr.p_offset); addr = mmap(NULL, mte->loadsize, PROT_READ, MAP_PRIVATE, mte->fd, mte->loadbase);
if (addr == MAP_FAILED) { if (addr == MAP_FAILED) {
fprintf(stderr, "mmap failed\n"); fprintf(stderr, "mmap failed\n");
return -1; return -1;
} }
*image_addr = addr; *mmap_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->image_addr)) if (elf_map_image(mte, &libref->mmap_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->load_offset = mte->txt_hdr.p_offset; libref->mmap_offset = mte->loadbase;
libref->load_addr = mte->txt_hdr.p_vaddr + mte->bias; libref->mmap_size = mte->loadsize;
libref->load_size = mte->txt_hdr.p_filesz; libref->txt_vaddr = mte->txt_hdr.p_vaddr - mte->vstart + mte->bias;
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->seg_offset = mte->eh_hdr.p_offset; libref->eh_hdr_offset = mte->eh_hdr.p_offset - mte->loadbase;
libref->gp = mte->pltgot; libref->eh_hdr_vaddr = mte->eh_hdr.p_vaddr - mte->vstart + mte->bias;
libref->key = mte->dyn; libref->pltgot = mte->pltgot - mte->vstart + mte->bias;
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->image_addr + mte->exidx_hdr.p_offset; libref->exidx_data = libref->mmap_addr + mte->exidx_hdr.p_offset - mte->loadbase;
libref->exidx_len = mte->exidx_hdr.p_memsz; libref->exidx_len = mte->exidx_hdr.p_filesz;
} }
#endif #endif
if (mte->eh_hdr.p_filesz && mte->dyn_addr) { if (mte->eh_hdr.p_filesz && mte->dyn) {
if (dwarf_get_unwind_table(task, libref, (struct dwarf_eh_frame_hdr *)(libref->image_addr - libref->load_offset + mte->eh_hdr.p_offset)) < 0) if (dwarf_get_unwind_table(task, libref) < 0)
return -1; return -1;
} }
@ -275,11 +299,20 @@ 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, GElf_Addr bias) static int elf_read(struct mt_elf *mte, struct task *task, const char *filename)
{ {
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)
@ -293,14 +326,28 @@ 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:
if (!mte->base_addr || mte->base_addr > phdr.p_vaddr + bias) loadsegs++;
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;
@ -311,25 +358,28 @@ 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 + bias; mte->interp = phdr.p_vaddr;
break; break;
case PT_DYNAMIC: case PT_DYNAMIC:
mte->dyn = phdr.p_vaddr + bias; mte->dyn = phdr.p_vaddr;
break; break;
default: default:
break; break;
} }
} }
if (!mte->base_addr) { if (!loadsegs) {
fprintf(stderr, "Couldn't determine base address of %s\n", filename); fprintf(stderr, "No loadable segemnts in %s\n", filename);
return -1; return -1;
} }
debug(DEBUG_FUNCTION, "filename=`%s' load_offset=%#llx addr=%#llx size=%#llx", mte->loadbase = loadbase & ~PAGEALIGN;
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 + bias, (unsigned long long)mte->txt_hdr.p_vaddr,
(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) {
@ -370,16 +420,9 @@ 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;
@ -395,11 +438,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, bias) == -1) if (elf_read(&mte, task, filename) == -1)
return -1; return -1;
mte.bias = bias; mte.bias = bias;
mte.entry_addr = mte.ehdr.e_entry + bias; mte.entry_addr = mte.ehdr.e_entry - mte.vstart + bias;
ret = elf_lib_init(&mte, task, libref); ret = elf_lib_init(&mte, task, libref);
@ -474,7 +517,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) struct libref *elf_read_main_binary(struct task *task, int was_attached)
{ {
char fname[PATH_MAX]; char fname[PATH_MAX];
int ret; int ret;
@ -498,9 +541,11 @@ struct libref *elf_read_main_binary(struct task *task)
fname[ret] = 0; fname[ret] = 0;
free(filename);
libref_set_filename(libref, fname); libref_set_filename(libref, fname);
if (elf_read(&mte, task, filename, 0) == -1) if (elf_read(&mte, task, fname) == -1)
goto fail3; goto fail3;
task->is_64bit = is_64bit(&mte); task->is_64bit = is_64bit(&mte);
@ -510,17 +555,15 @@ struct libref *elf_read_main_binary(struct task *task)
goto fail3; goto fail3;
} }
free(filename); mte.bias = entry - mte.ehdr.e_entry - mte.vstart;
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); report_attach(task, was_attached);
library_add(task, libref); library_add(task, libref);
@ -529,9 +572,12 @@ struct libref *elf_read_main_binary(struct task *task)
struct mt_elf mte_ld = { }; struct mt_elf mte_ld = { };
copy_str_from_proc(task, ARCH_ADDR_T(mte.interp), fname, sizeof(fname)); if (copy_str_from_proc(task, ARCH_ADDR_T(mte.bias + mte.interp - mte.vstart), fname, sizeof(fname)) == -1) {
fprintf(stderr, "fatal error: cannot get loader name for pid=%d\n", task->pid);
abort();
}
if (!elf_read(&mte_ld, task, fname, (GElf_Addr)base)) { if (!elf_read(&mte_ld, task, fname)) {
struct libref *libref; struct libref *libref;
libref = libref_new(LIBTYPE_LOADER); libref = libref_new(LIBTYPE_LOADER);
@ -540,14 +586,14 @@ struct libref *elf_read_main_binary(struct task *task)
libref_set_filename(libref, fname); libref_set_filename(libref, fname);
mte_ld.bias = (GElf_Addr)base; mte_ld.bias = base;
mte_ld.entry_addr = mte_ld.ehdr.e_entry + (GElf_Addr)base; mte_ld.entry_addr = base + mte_ld.ehdr.e_entry - mte.vstart;
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.dyn_addr))) { if (linkmap_init(task, ARCH_ADDR_T(mte.bias + mte.dyn - mte.vstart))) {
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);
@ -562,7 +608,7 @@ struct libref *elf_read_main_binary(struct task *task)
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.dyn_addr); entry_bp->dyn_addr = ARCH_ADDR_T(mte.bias + mte.dyn - mte.vstart);
breakpoint_enable(task, &entry_bp->breakpoint); breakpoint_enable(task, &entry_bp->breakpoint);
} }
@ -598,3 +644,8 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -30,38 +29,12 @@
#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); struct libref *elf_read_main_binary(struct task *task, int was_attached);
int mte_cmp_machine(struct mt_elf *mte, Elf64_Half type);
#endif #endif

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -39,6 +38,7 @@
#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,14 +119,15 @@ static void usage(void)
#ifdef DEBUG #ifdef DEBUG
static void usage_debug(void) static void usage_debug(void)
{ {
fprintf(stdout, "%s debugging option, --debug=<octal> or -D<octal>:\n", progname); fprintf(stdout, "%s debugging option, --debug=<num> or -D<num>:\n", progname);
fprintf(stdout, fprintf(stdout,
"\n" "\n"
" number ref. in source description\n" " number description\n"
" 1 general Generally helpful progress information\n" " 1 ptrace events\n"
" 10 event Shows every event received by a traced process\n" " 2 dwarf issues\n"
" 20 process Shows actions carried upon a traced processes\n" " 4 Shows every event received by a traced process\n"
" 40 function Shows every entry to internal functions\n" " 8 Shows actions carried upon a traced processes\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"
@ -171,11 +172,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);
@ -409,9 +410,9 @@ char **process_options(int argc, char **argv)
usage_debug(); usage_debug();
exit(0); exit(0);
} }
options.debug = strtoul(optarg, &p, 8); options.debug = strtoul(optarg, &p, 0);
if (*p) { if (*p) {
fprintf(stderr, "%s: --debug requires an octal argument\n", progname); fprintf(stderr, "%s: --debug requires an numeric argument\n", progname);
err_usage(); err_usage();
} }
#endif #endif
@ -543,7 +544,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) 2015 Stefani Seibold <stefani@seibold.net>.\n" "Copyright (C) 2018 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -41,8 +40,6 @@
#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;
@ -93,6 +90,8 @@ 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,7 +1,6 @@
/* /*
* 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,7 +1,6 @@
/* /*
* 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,8 +73,6 @@ 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));
} }
@ -108,6 +106,7 @@ 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));
@ -139,6 +138,23 @@ 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);
@ -173,31 +189,35 @@ 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 (ret) { if (!task->in_realloc) {
unsigned long size = fetch_param(task, 1); if (ret)
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym); return;
} }
if (fetch_param(task, 0)) { task->in_realloc = 0;
if (task_is_64bit(task)) {
struct mt_alloc_payload_64 *alloc = alloca(sizeof(*alloc));
alloc->ptr = (uint64_t)ret; if (ret)
alloc->size = (uint64_t)task->pid; report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc)); if (task_is_64bit(task)) {
} struct mt_alloc_payload_64 *alloc = alloca(sizeof(*alloc));
else {
struct mt_alloc_payload_32 *alloc = alloca(sizeof(*alloc));
alloc->ptr = (uint32_t)ret; alloc->ptr = (uint64_t)ret;
alloc->size = (uint32_t)task->pid; alloc->size = (uint64_t)task->pid;
server_send_msg(MT_REALLOC_DONE, task->leader->pid, alloc, sizeof(*alloc)); 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));
} }
} }
@ -205,7 +225,12 @@ 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);
report_alloc(task, MT_REALLOC_ENTER, addr, task->pid, options.sanity ? options.bt_depth : 0, libsym); assert(!task->in_realloc);
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)
@ -216,6 +241,9 @@ 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);
@ -224,6 +252,11 @@ 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);
} }
@ -252,17 +285,34 @@ 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);
@ -319,20 +369,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)
{
unsigned long addr = fetch_param(task, 0);
unsigned long size = fetch_param(task, 1);
report_alloc(task, MT_MUNMAP, addr, size, 0, 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 size = fetch_param(task, 2); unsigned long addr = fetch_param(task, 0);
unsigned long oldsize = fetch_param(task, 1);
unsigned long newsize = fetch_param(task, 2);
unsigned long ret = fetch_retval(task); unsigned long ret = fetch_retval(task);
report_alloc(task, MT_MMAP, ret, size, options.bt_depth, libsym); if( (void*)ret != MAP_FAILED) {
// 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[] = {
@ -343,13 +393,23 @@ 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, report_munmap, NULL }, { "munmap", "munmap", 0, NULL, _report_munmap },
{ "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, report_mremap, _report_mremap }, { "mremap", "mremap", 0, NULL, _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 },
@ -361,14 +421,32 @@ 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)
@ -391,9 +469,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->load_addr; payload->addr = libref->txt_vaddr;
payload->offset = libref->load_offset; payload->offset = libref->txt_offset;
payload->size = libref->load_size; payload->size = libref->txt_size;
payload->bias = libref->bias; payload->bias = libref->bias;
memcpy(payload->filename, libref->filename, len); memcpy(payload->filename, libref->filename, len);
@ -466,9 +544,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 report_attach(struct task *task, int was_attached)
{ {
struct mt_attached_payload state = { .attached = task->attached }; struct mt_attached_payload state = { .attached = !!was_attached };
if (!server_connected()) if (!server_connected())
return -1; return -1;
@ -530,7 +608,7 @@ static void report_process(struct task *leader)
{ {
struct list_head *it; struct list_head *it;
report_attach(leader); report_attach(leader, 1);
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +23,8 @@
#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 {
@ -44,7 +46,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 report_attach(struct task *task, int was_attached);
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +31,7 @@
#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"
@ -240,6 +241,8 @@ 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();
@ -306,6 +309,8 @@ static void *server_pair_thread(void *ptr)
{ {
int ret; int ret;
(void)ptr;
for(;;) { for(;;) {
if (!server_connected()) if (!server_connected())
break; break;
@ -388,8 +393,11 @@ 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,29 +0,0 @@
# 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

View File

@ -1,656 +0,0 @@
# 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

@ -1,43 +0,0 @@
# 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

@ -1,762 +0,0 @@
# 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

@ -1,31 +0,0 @@
# 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

@ -1,634 +0,0 @@
# 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +47,7 @@
int is_64bit(struct mt_elf *mte) int is_64bit(struct mt_elf *mte)
{ {
(void)(mte);
return 0; return 0;
} }
@ -690,7 +691,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, SW_BP); bp1 = breakpoint_new(task, next_pcs[0], NULL, BP_SW);
if (!bp1) if (!bp1)
return -1; return -1;
} }
@ -702,7 +703,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, SW_BP); bp2 = breakpoint_new(task, next_pcs[1], NULL, BP_SW);
if (!bp2) if (!bp2)
return -1; return -1;
} }

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 @@
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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -33,7 +32,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"
@ -154,6 +153,7 @@ 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,11 +178,13 @@ 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->image_addr)) if (addr < ARCH_ADDR_T(libref->mmap_addr))
fatal("invalid access mem: addr %#lx < %p", addr, libref->image_addr); fatal("invalid access mem: addr %#lx < %p", addr, libref->mmap_addr);
if (addr >= ARCH_ADDR_T(libref->image_addr + libref->load_size)) if (addr >= ARCH_ADDR_T(libref->mmap_addr + libref->mmap_size))
fatal("invalid access mem: addr %#lx >= %p", addr, libref->image_addr + libref->load_size); fatal("invalid access mem: addr %#lx >= %p", addr, libref->mmap_addr + libref->mmap_size);
} }
#else
(void)(as);
#endif #endif
memcpy(valp, (void *)addr, size); memcpy(valp, (void *)addr, size);
@ -507,7 +509,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->image_addr + libref->load_offset - libref->load_addr; unsigned long map_offset = (unsigned long)libref->mmap_addr + libref->mmap_offset - libref->txt_vaddr;
unsigned long lo, hi, e, f; unsigned long lo, hi, e, f;
arch_addr_t val; arch_addr_t val;
@ -648,6 +650,8 @@ 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 +44,7 @@
#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"
@ -62,6 +63,9 @@ 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
@ -147,6 +151,8 @@ 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);
@ -250,6 +256,9 @@ 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;
@ -365,28 +374,6 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,31 +0,0 @@
# 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

@ -1,634 +0,0 @@
# 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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->ehdr.e_machine != EM_PPC; return !mte_cmp_machine(mte, EM_PPC);
} }

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 @@
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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -162,16 +161,16 @@ 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;
if (readdir_r(d, &entry, &result) != 0) { errno = 0;
free(tasks); result = readdir(d);
return -1;
}
if (result == NULL) if (!result) {
if (errno)
goto fail;
break; 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);
@ -182,10 +181,9 @@ 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)
free(tasks); goto fail;
return -1;
}
tasks = ntasks; tasks = ntasks;
} }
tasks[n++] = npid; tasks[n++] = npid;
@ -198,6 +196,14 @@ 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
@ -344,29 +350,17 @@ 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);
} }
static int fetch_auxv64_entry(int fd, Elf64_auxv_t *ret) #ifdef _LP64
#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;
@ -396,7 +390,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_with_key(&task->libraries_list, ARCH_ADDR_T(rlm.l_ld)); lib = library_find_by_dyn(&task->libraries_list, ARCH_ADDR_T(rlm.l_ld));
if (lib) if (lib)
continue; continue;
@ -462,7 +456,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_with_key(&tmp_list, ARCH_ADDR_T(rlm.l_ld)); lib = library_find_by_dyn(&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);
} }
@ -489,6 +483,8 @@ 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)
@ -567,8 +563,9 @@ 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) {
Elf64_auxv_t entry = { }; Elf_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)
@ -581,8 +578,6 @@ 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;
} }
@ -615,6 +610,7 @@ 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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

@ -0,0 +1,14 @@
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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,10 +39,6 @@
#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"
@ -56,34 +52,48 @@
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 int inline task_kill(struct task *task, int sig) static inline int 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 stop_signal; int sig;
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)) {
fprintf(stderr, "%s pid=%d not stopped\n", __FUNCTION__, task->pid); if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: pid=%d not stopped\n", __func__, task->pid);
return -1; return -1;
} }
stop_signal = WSTOPSIG(status); task->attached = 1;
task->stopped = 1;
task->leader->threads_stopped++;
task->event.type = EVENT_NEW;
task->event.e_un.signum = 0;
if (stop_signal != signum) { sig = WSTOPSIG(status);
task->event.e_un.signum = stop_signal;
fprintf(stderr, "%s pid=%d unexpected trace signal (got:%d expected:%d)\n", __FUNCTION__, task->pid, stop_signal, signum); if (sig != 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;
} }
@ -94,10 +104,8 @@ static int _trace_wait(struct task *task, int signum)
{ {
int status; int status;
if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) { if (unlikely(wait_task(task, &status) == -1))
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;
@ -107,35 +115,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; unsigned long data = 0;
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1)) { debug(DEBUG_TRACE, "child event %d pid=%d, newpid=%d", ev, task->pid, task->event.e_un.newpid);
debug(DEBUG_EVENT, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
return -1; if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -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;
if (_trace_wait(child, SIGSTOP)) { child->attached = 1;
remove_task(child);
return -1;
}
} }
task->event.e_un.newpid = pid; task->event.e_un.newpid = pid;
@ -146,110 +154,142 @@ 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 stop_signal; int sig = WSTOPSIG(status);
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)) {
/* should never happen */ if (unlikely(options.verbose))
debug(DEBUG_EVENT, "NONE: pid=%d ???", task->pid); fprintf(stderr, "!!!%s: not WIFSTOPPED pid=%d\n", __func__, 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:
if (child_event(task, EVENT_VFORK)) debug(DEBUG_TRACE, "VFORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return -1; return child_event(task, EVENT_VFORK);
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:
if (child_event(task, EVENT_FORK)) debug(DEBUG_TRACE, "FORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return -1; return child_event(task, EVENT_FORK);
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:
if (child_event(task, EVENT_CLONE)) debug(DEBUG_TRACE, "CLONE: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return -1; return child_event(task, EVENT_CLONE);
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_EVENT, "EXEC: pid=%d", task->pid); debug(DEBUG_TRACE, "EXEC: pid=%d", task->pid);
return 0; return 0;
case PTRACE_EVENT_EXIT: case PTRACE_EVENT_EXIT:
{ {
unsigned long data; unsigned long data = 0;
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;
} }
stop_signal = WSTOPSIG(status); if (unlikely(options.verbose && !sig))
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 = stop_signal; task->event.e_un.signum = sig;
debug(DEBUG_EVENT, "SIGNAL: pid=%d, signum=%d", task->pid, stop_signal); debug(DEBUG_TRACE, "SIGNAL: pid=%d, signum=%d", task->pid, sig);
return stop_signal; return sig;
} }
static void process_event(struct task *task, int status) static struct task * 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++;
stop_signal = _process_event(task, status); sig = _process_event(task, status);
if (sig < 0) {
if (stop_signal == -1) {
fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
task->event.type = EVENT_NONE;
continue_task(task, 0); continue_task(task, 0);
return; return NULL;
} }
if (stop_signal == 0) if (task->event.type == EVENT_NONE) {
return; continue_task(task, task->event.e_un.signum);
return NULL;
}
if (unlikely(stop_signal != SIGTRAP)) if (unlikely(sig != SIGTRAP))
return; return task;
if (unlikely(fetch_context(task) == -1)) { if (unlikely(fetch_context(task) == -1)) {
fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
task->event.type = EVENT_NONE; task->event.type = EVENT_NONE;
continue_task(task, 0); continue_task(task, 0);
return; return NULL;
} }
ip = get_instruction_pointer(task); ip = get_instruction_pointer(task);
@ -274,10 +314,9 @@ fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
{ {
bp = breakpoint_find(leader, ip - DECR_PC_AFTER_BREAK); bp = breakpoint_find(leader, ip - DECR_PC_AFTER_BREAK);
if (unlikely(!bp)) { if (unlikely(!bp)) {
fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__); if (unlikely(options.verbose))
// task->event.type = EVENT_NONE; fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid);
// continue_task(task, 0); return task;
return;
} }
#if HW_BREAKPOINTS > 0 #if HW_BREAKPOINTS > 0
assert(bp->type != BP_HW_SCRATCH); assert(bp->type != BP_HW_SCRATCH);
@ -295,30 +334,14 @@ fprintf(stderr, "%s:%d\n", __FUNCTION__, __LINE__);
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_EVENT, "BREAKPOINT: pid=%d, addr=%#lx", task->pid, task->event.e_un.breakpoint->addr); debug(DEBUG_TRACE, "BREAKPOINT: pid=%d, addr=%#lx", task->pid, task->event.e_un.breakpoint->addr);
return; return task;
}
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_PROCESS, "pid=%d", getpid()); debug(DEBUG_TRACE, "pid=%d", getpid());
prctl(PR_SET_PDEATHSIG, SIGKILL); prctl(PR_SET_PDEATHSIG, SIGKILL);
@ -328,72 +351,73 @@ void trace_me(void)
} }
} }
static inline int fix_signal(struct task *task, int signum) static inline int chk_signal(struct task *task, int signum)
{ {
if (signum == SIGSTOP && task->was_stopped) { if (unlikely(options.verbose)) {
task->was_stopped = 0; if (signum == SIGSTOP)
signum = 0; fprintf(stderr, "!!!%s: SIGSTOP pid=%d\n", __func__, task->pid);
if (signum == SIGTRAP)
fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid);
} }
return signum; return signum;
} }
int untrace_task(struct task *task, int signum) int untrace_task(struct task *task)
{ {
int ret = 0; int sig = 0;
assert(task->leader != NULL); assert(task->stopped);
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));
ret = -1; return -1;
goto skip;
} }
signum = fix_signal(task, signum); if (task->event.type == EVENT_SIGNAL || task->event.type == EVENT_NONE)
sig = chk_signal(task, sig);
if (unlikely(ptrace(PTRACE_DETACH, task->pid, 0, signum) == -1)) { if (unlikely(ptrace(PTRACE_DETACH, task->pid, 0, sig) == -1)) {
if (task->traced) { if (errno != ESRCH)
if (errno != ESRCH) fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno));
fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno)); return -1;
ret = -1;
goto skip;
}
} }
task_kill(task, SIGCONT); // task_kill(task, SIGCONT);
skip: return 0;
task->leader->threads_stopped--; }
task->stopped = 0;
task->was_stopped = 0;
task->traced = 0;
return ret; void stop_task(struct task *task)
{
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_PROCESS, "pid=%d", task->pid); debug(DEBUG_TRACE, "pid=%d", task->pid);
assert(task->traced == 0); assert(task->attached == 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;
} }
@ -401,7 +425,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_PROCESS, "pid=%d", task->pid); debug(DEBUG_TRACE, "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)
@ -413,15 +437,22 @@ 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_PROCESS, "pid=%d", task->pid); debug(DEBUG_TRACE, "continue task 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(ptrace(PTRACE_CONT, task->pid, 0, fix_signal(task, signum)) == -1)) { if (unlikely(options.verbose && signum == SIGTRAP))
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;
@ -431,10 +462,12 @@ 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;
task->was_stopped = 1; debug(DEBUG_TRACE, "task stop pid=%d", task->pid);
task_kill(task, SIGSTOP); task_kill(task, SIGSTOP);
} }
@ -445,6 +478,8 @@ 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;
@ -453,8 +488,13 @@ 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) {
queue_event(wait_event()); assert(leader->threads > leader->threads_stopped);
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);
@ -464,60 +504,63 @@ 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 stop_signal; int sig;
unsigned long ip;
for(;;) { assert(task->stopped);
if (unlikely(singlestep(task) == -1)) assert(task->skip_bp == NULL);
return -1; assert(bp->enabled == 0);
if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) { task->event.type = EVENT_NONE;
fprintf(stderr, "%s waitpid pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return 0;
}
stop_signal = _process_event(task, status); if (unlikely(singlestep(task) == -1)) {
if (unlikely(options.verbose))
if (stop_signal == -1) fprintf(stderr, "!!!%s: single step failed pid=%d\n", __func__, task->pid);
return 0; return -1;
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 (errno != ESRCH) if (unlikely(options.verbose && errno != ESRCH))
fprintf(stderr, "%s PTRACE_SINGLESTEP pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno)); fprintf(stderr, "!!!%s: PTRACE_SINGLESTEP pid=%d %s\n", __func__, task->pid, strerror(errno));
return -1; return -1;
} }
return 0; return 0;
@ -535,14 +578,10 @@ struct task *wait_event(void)
int status; int status;
int pid; int pid;
pid = waitpid(-1, &status, __WALL); pid = wait_task(NULL, &status);
if (unlikely(pid == -1)) { if (unlikely(pid == -1)) {
if (errno != EINTR) { if (errno == ECHILD)
if (errno == ECHILD) debug(DEBUG_TRACE, "No more traced programs");
debug(DEBUG_EVENT, "No more traced programs");
else
fprintf(stderr, "%s waitpid %s\n", __FUNCTION__, strerror(errno));
}
return NULL; return NULL;
} }
@ -562,12 +601,50 @@ 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;
} }
process_event(task, status); if (unlikely(task->stopped)) {
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;
} }
@ -622,7 +699,8 @@ 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) {
fprintf(stderr, "%s pid=%d process_vm_readv: %s\n", __FUNCTION__, task->pid, strerror(errno)); if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: pid=%d process_vm_readv: %s\n", __func__, task->pid, strerror(errno));
return -1; return -1;
} }
@ -759,10 +837,10 @@ ssize_t copy_str_from_proc(struct task *task, arch_addr_t addr, char *dst, size_
errno = 0; errno = 0;
if (--len < 0) if (!len--)
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

@ -1,31 +0,0 @@
# 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

@ -1,634 +0,0 @@
# 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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 = (0b1111 << (16 + 4 * n)) | (0b11 << (2 * n)); mask = (0b1111U << (16 + 4 * n)) | (0b11U << (2 * n));
switch(type) { switch(type) {
case BP_X: case BP_X:
mode = 0b0000; mode = 0b0000U;
break; break;
case BP_W: case BP_W:
mode = 0b0001; mode = 0b0001U;
break; break;
case BP_RW: case BP_RW:
mode = 0b0011; mode = 0b0011U;
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 |= 0b0000; mode |= 0b0000U;
break; break;
case 2: case 2:
mode |= 0b0100; mode |= 0b0100U;
break; break;
case 4: case 4:
mode |= 0b1100; mode |= 0b1100U;
break; break;
case 8: case 8:
mode |= 0b1000; mode |= 0b1000U;
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 |= 0b01 << (2 * n); dr7 |= 0b01U << (2 * n);
dr7 |= 1 << 8; dr7 |= 1 << 8;
} }
else else
if (!(dr7 & 0b01010101)) if (!(dr7 & 0b01010101U))
dr7 &= ~(1 << 8); dr7 &= ~(1 << 8);
if (global) { if (global) {
dr7 |= 0b10 << (2 * n); dr7 |= 0b10U << (2 * n);
dr7 |= 1 << 9; dr7 |= 1 << 9;
} }
else else
if (!(dr7 & 0b10101010)) if (!(dr7 & 0b10101010U))
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 = (0b1111 << (16 + 4 * n)) | (0b11 << (2 * n)); mask = (0b1111U << (16 + 4 * n)) | (0b11U << (2 * n));
dr7 = task->arch.dr7 & ~mask; dr7 = task->arch.dr7 & ~mask;
if (!(dr7 & 0b01010101)) if (!(dr7 & 0b01010101U))
dr7 &= ~(1 << 8); dr7 &= ~(1 << 8);
if (!(dr7 & 0b10101010)) if (!(dr7 & 0b10101010U))
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->ehdr.e_machine != EM_386; return !mte_cmp_machine(mte, 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,6 +223,9 @@ 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,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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,6 @@
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
)

View File

@ -1,7 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *
@ -30,7 +29,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"
@ -137,6 +136,7 @@ static inline int is_signal_frame(struct dwarf_cursor *c)
static inline int is_plt_entry(struct dwarf_addr_space *as) static inline int is_plt_entry(struct dwarf_addr_space *as)
{ {
(void)as;
#if 0 #if 0
struct dwarf_cursor *c = &as->cursor; struct dwarf_cursor *c = &as->cursor;
uint8_t data[12]; uint8_t data[12];
@ -330,11 +330,11 @@ int dwarf_arch_check_call(struct dwarf_addr_space *as, arch_addr_t ip)
struct libref *libref = c->libref; struct libref *libref = c->libref;
for(p = call_op; p->len; ++p) { for(p = call_op; p->len; ++p) {
if (likely(ip - ARCH_ADDR_T(libref->load_addr) >= p->off)) { if (likely(ip - ARCH_ADDR_T(libref->txt_vaddr) >= p->off)) {
unsigned int i; unsigned int i;
unsigned char *addr = libref->image_addr + ip - p->off - libref->load_addr; unsigned char *addr = libref->mmap_addr + ip - p->off - libref->txt_vaddr;
for(i = 0; i < call_op[i].len; ++i) { for(i = 0; i < p->len; ++i) {
if (unlikely((addr[i] & p->mask[i]) != p->op[i])) if (unlikely((addr[i] & p->mask[i]) != p->op[i]))
break; break;
} }

View File

@ -1,6 +1,6 @@
/* /*
* This file is part of mtrace-ng. * This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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) 2015 Stefani Seibold <stefani@seibold.net> * Copyright (C) 2018 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.
* *

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