Compare commits

...

57 Commits
v0.5 ... 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
Stefani Seibold
3b7a0d0552 clean up, option for invalid free releases 2016-05-24 10:01:41 +02:00
Stefani Seibold
3e2980613c more accurate single step, prelink fixes, cleanup 2016-05-23 10:27:47 +02:00
Stefani Seibold
cf997a7dc9 accurate single step, c++ 11 support, optimizations 2016-05-22 09:50:18 +02:00
Stefani Seibold
e50dccecb3 fix realloc 2016-05-19 18:12:09 +02:00
Stefani Seibold
3f7f77d105 fixes for prelink 2016-05-19 13:24:15 +02:00
107 changed files with 2041 additions and 77715 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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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 */
void trace_me(void);
/* stop tracing a task. */
int untrace_task(struct task *task, int signum);
/* stop tracing of a task. */
int untrace_task(struct task *task);
/* Called when mtrace-ng needs to attach to task */
int trace_attach(struct task *task);
@ -75,15 +74,18 @@ arch_addr_t get_instruction_pointer(struct task *task);
void set_instruction_pointer(struct task *task, arch_addr_t addr);
/* do a single step */
int do_singlestep(struct task *task);
int do_singlestep(struct task *task, struct breakpoint *bp);
/* handle a single step event */
int handle_singlestep(struct task *task, int (*singlestep)(struct task *task));
int handle_singlestep(struct task *task, int (*singlestep)(struct task *task), struct breakpoint *bp);
/* Find and return caller address, i.e. the address where the current
* function returns. */
arch_addr_t get_return_addr(struct task *task);
/* get address of IP register */
unsigned int ip_reg_addr(void);
#if HW_BREAKPOINTS > 0
/* returns true if the hw breakpoint is pendig */
int get_hw_bp_state(struct task *task, unsigned int n);
@ -174,7 +176,7 @@ void wait_event_wakeup(void);
int is_64bit(struct mt_elf *mte);
/* change user id of a running process */
void change_uid(const char *command);
void change_uid(void);
#endif

View File

@ -1,6 +1,6 @@
/*
* 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.
*

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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -25,6 +24,7 @@
#include <assert.h>
#include <errno.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -69,25 +69,37 @@ static void enable_sw_breakpoint(struct task *task, struct breakpoint *bp)
{
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);
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->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);
assert(task->stopped);
assert(bp->sw);
assert(bp->hw == 0);
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)
{
@ -105,6 +117,7 @@ static void enable_hw_bp(struct task *task, struct breakpoint *bp)
assert(bp->type != BP_SW);
assert(bp->type < BP_HW || task->hw_bp[slot] == NULL);
assert(bp->sw == 0);
task->hw_bp[slot] = bp;
@ -116,6 +129,8 @@ static void disable_hw_bp(struct task *task, struct breakpoint *bp)
{
unsigned int slot = bp->hw_bp_slot;
assert(bp->sw == 0);
if (unlikely(!task->hw_bp[slot]))
return;
@ -181,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;
}
qsort(bp_list, n, sizeof(*bp_list), hw_bp_sort);
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)
n = HW_BREAKPOINTS - 1;
@ -201,9 +219,11 @@ void reorder_hw_bp(struct task *task)
assert((hw_bp_set & 1 << bp_list[i]->hw_bp_slot) == 0);
hw_bp_set |= 1 << bp_list[i]->hw_bp_slot;
continue;
}
else
*p++ = bp_list[i];
*p++ = bp_list[i];
}
if (p == bp_list)
@ -227,8 +247,10 @@ void reorder_hw_bp(struct task *task)
if (leader->hw_bp[i])
hw2sw_bp(leader, leader->hw_bp[i]);
bp->enabled = 1;
bp->hw_bp_slot = i;
bp->hw = 1;
bp->was_hw = 1;
each_task(leader, enable_hw_bp_cb, bp);
@ -259,6 +281,7 @@ static int insert_hw_bp_slot(struct task *task, struct breakpoint *bp)
bp->enabled = 1;
bp->hw_bp_slot = i;
bp->hw = 1;
bp->was_hw = 1;
each_task(leader, enable_hw_bp_cb, bp);
@ -290,6 +313,9 @@ void breakpoint_hw_destroy(struct task *task)
{
unsigned int i;
if (options.nohwbp)
return;
for(i = 0; i < HW_BREAKPOINTS; ++i)
task->hw_bp[i] = NULL;
@ -353,9 +379,11 @@ struct breakpoint *breakpoint_new_ext(struct task *task, arch_addr_t addr, struc
bp->enabled = 0;
bp->locked = 0;
bp->deleted = 0;
bp->break_insn = 0;
bp->ext = ext;
bp->refcnt = 1;
bp->count = 0;
bp->sw = 0;
#if HW_BREAKPOINTS > 1
bp->hwcnt = 0;
#endif
@ -373,12 +401,13 @@ struct breakpoint *breakpoint_new_ext(struct task *task, arch_addr_t addr, struc
case BP_AUTO:
case BP_HW:
#if HW_BREAKPOINTS > 1
list_add_tail(&bp->link_list, &leader->hw_bp_list);
list_add_tail(&bp->link_list, &leader->hw_bp_list);
leader->hw_bp_num++;
#endif
case BP_SW:
memset(bp->orig_value, 0, sizeof(bp->orig_value));
bp->hw = 0;
bp->was_hw = 0;
}
if (dict_add(leader->breakpoints, (unsigned long)addr, bp) < 0) {
@ -421,7 +450,6 @@ void breakpoint_enable(struct task *task, struct breakpoint *bp)
#endif
bp->hw = 0;
enable_sw_breakpoint(task, bp);
bp->enabled = 1;
}
}
@ -456,7 +484,6 @@ void breakpoint_disable(struct task *task, struct breakpoint *bp)
}
#endif
disable_sw_breakpoint(task, bp);
bp->enabled = 0;
}
}
@ -501,12 +528,11 @@ void breakpoint_delete(struct task *task, struct breakpoint *bp)
if (unlikely(options.verbose > 1 && bp->libsym)) {
fprintf(stderr,
"delete %s breakpoint %s:%s [%#lx] count=%u\n",
"delete %s breakpoint %s:%s [%#lx]\n",
bp->type == BP_SW ? "sw" : "hw",
bp->libsym->libref->filename,
bp->libsym->func->demangled_name,
bp->addr,
bp->count);
bp->addr);
}
bp->deleted = 1;
@ -517,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)
{
(void)key;
struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data;
@ -538,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)
{
(void)key;
struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data;
@ -555,7 +585,6 @@ void breakpoint_disable_all_nonlocked(struct task *leader)
if (leader->breakpoints)
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)
@ -563,6 +592,8 @@ static int enable_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);
breakpoint_enable(leader, bp);
@ -583,6 +614,8 @@ static int disable_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);
breakpoint_disable(leader, bp);
@ -596,7 +629,30 @@ void breakpoint_disable_all(struct task *leader)
if (leader->breakpoints)
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)
@ -604,6 +660,8 @@ static int destroy_breakpoint_cb(unsigned long key, const void *value, void *dat
struct breakpoint *bp = (struct breakpoint *)value;
struct task *leader = (struct task *)data;
(void)key;
breakpoint_delete(leader, bp);
return 0;
}
@ -612,7 +670,9 @@ void breakpoint_clear_all(struct task *leader)
{
if (leader->breakpoints) {
dict_apply_to_all(leader->breakpoints, &destroy_breakpoint_cb, leader);
#if HW_BREAKPOINTS > 0
assert(leader->hw_bp_num == 0);
#endif
dict_clear(leader->breakpoints);
leader->breakpoints = NULL;
}
@ -631,6 +691,8 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
struct task *new_task = (struct task *)data;
size_t ext = bp->ext;
(void)key;
if (bp->deleted)
return 0;
@ -653,6 +715,7 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
new_bp->enabled = bp->enabled;
new_bp->locked = bp->locked;
new_bp->hw = bp->hw;
new_bp->sw = bp->sw;
new_bp->type = bp->type;
new_bp->ext = ext;
new_bp->refcnt = 1;
@ -683,7 +746,8 @@ static int clone_single_cb(unsigned long key, const void *value, void *data)
}
else
#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)
memcpy((void *)new_bp + ext, (void *)bp + ext, ext);
@ -720,6 +784,8 @@ int breakpoint_put(struct breakpoint *bp)
if (--bp->refcnt)
return 0;
assert(bp->enabled == 0);
free(bp);
}
return 1;

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -50,7 +49,10 @@ struct breakpoint {
unsigned int enabled:1;
unsigned int locked:1;
unsigned int deleted:1;
unsigned int sw:1;
unsigned int hw:1;
unsigned int was_hw:1;
unsigned int break_insn:1;
union {
unsigned char orig_value[BREAKPOINT_LENGTH];
#if HW_BREAKPOINTS > 0
@ -67,9 +69,6 @@ struct breakpoint {
/* setup the basic breakpoint support for a given 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. */
struct breakpoint *breakpoint_new(struct task *task, arch_addr_t addr, struct library_symbol *libsym, int type);
@ -90,6 +89,7 @@ void breakpoint_disable(struct task *task, struct breakpoint *bp);
void breakpoint_enable_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_disable_all_nonlocked(struct task *leader);
void breakpoint_clear_all(struct task *leader);
@ -103,10 +103,14 @@ void disable_scratch_hw_bp(struct task *task, struct breakpoint *bp);
#else
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)
{
(void)task;
(void)bp;
}
#endif
@ -118,10 +122,12 @@ void breakpoint_hw_destroy(struct task *task);
#else
static inline void breakpoint_hw_clone(struct task *task)
{
(void)task;
}
static inline void breakpoint_hw_destroy(struct task *task)
{
(void)task;
}
#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.
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -26,6 +26,21 @@
#include <link.h>
#include <stdio.h>
#include <string.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 "process.h"
@ -91,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)
return;
vma = bfd_get_section_vma(abfd, section);
vma = bfd_section_vma_wrapper(abfd, section);
if (psi->pc < vma)
return;
size = bfd_section_size(abfd, section);
size = bfd_section_size_wrapper(abfd, section);
if (psi->pc >= vma + size)
return;
@ -150,7 +165,7 @@ struct rb_sym *bin_file_lookup(struct bin_file *binfile, bfd_vma addr, unsigned
if (!name || !*name)
name = "?";
else {
alloc = bfd_demangle(binfile->abfd, name, 27);
alloc = bfd_demangle(binfile->abfd, name, DMGL_ANSI | DMGL_PARAMS | DMGL_RET_DROP | DMGL_AUTO);
if (alloc)
name = alloc;
}
@ -288,10 +303,9 @@ void bin_file_sym_put(struct rb_sym *sym)
if (!--sym->refcnt) {
free(sym->sym);
if (!binfile)
return;
rb_erase(&sym->node, &binfile->sym_table);
if (binfile)
rb_erase(&sym->node, &binfile->sym_table);
free(sym);
}
bin_file_put(binfile);
}

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -202,7 +202,7 @@ static int parse_config(const char *filename)
char *p;
struct stat statbuf;
int fd;
fd = open(filename, O_RDONLY);
if (fd == -1)
fatal("could not open config file: `%s' (%s)", filename, strerror(errno));
@ -248,10 +248,10 @@ static struct process *pid_rb_delete(struct rb_root *root, unsigned int pid)
if (data) {
process = data->process;
rb_erase(&data->node, root);
free(data);
return process;
}
return NULL;
@ -364,8 +364,10 @@ static void client_remove_process(struct process *process)
{
process = pid_rb_delete(&pid_table, process->pid);
if (process)
if (process) {
process_reset(process);
free(process);
}
}
@ -487,14 +489,15 @@ static int client_func(void)
process_about_exit(process);
break;
case MT_EXIT:
process_exit(process);
if (process_exit(process))
client_remove_process(process);
break;
case MT_NOFOLLOW:
process_reset(process);
client_remove_process(process);
break;
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;
case MT_ADD_MAP:
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);
break;
case MT_DETACH:
process_detach(process);
if (process_detach(process))
client_remove_process(process);
break;
default:
fatal("protocol violation 0x%08x", mt_msg.operation);
@ -659,8 +663,10 @@ static void signal_exit(int sig)
signal(SIGINT, 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)
@ -761,6 +767,8 @@ int client_start(void)
void *client_thread(void *unused)
{
(void)unused;
if (options.interactive) {
ioevent_add_input(client_fd, client_func);
@ -807,7 +815,7 @@ int client_send_msg(struct process *process, enum mt_operation op, void *payload
ret = sock_send_msg(client_fd, process->val16(op), process->pid, payload, payload_len);
if (ret < 0)
if (ret < 0)
client_broken();
return ret;
}
@ -824,6 +832,7 @@ int client_stop(void)
{
if (thread) {
thread_join(thread);
free(thread);
thread = NULL;
}

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -112,7 +112,7 @@ static int dump_pager(void)
struct termios termios_old;
int len;
ioevent_func oldfunc;
len = printf("Press <space> for next line, q for quit and any other for next page\r") - 1;
fflush(stdout);
@ -194,7 +194,7 @@ static int dump_line(char *s, int n)
}
return 0;
}
int dump_printf(const char *fmt, ...)
{
char *str;

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -72,6 +72,7 @@ struct rb_stack {
unsigned long long bytes_leaked;
unsigned long long tsc;
unsigned long long n_mismatched;
unsigned long long n_badfree;
};
struct map {
@ -79,6 +80,7 @@ struct map {
unsigned long offset;
unsigned long addr;
unsigned long size;
unsigned long bias;
char *filename;
struct bin_file *binfile;
unsigned int ignore:1;
@ -90,8 +92,7 @@ struct realloc_entry {
unsigned long addr;
unsigned long size;
unsigned long flags;
struct rb_stack *stack;
enum mt_operation operation;
struct rb_stack *stack_node;
};
struct regex_list {
@ -347,7 +348,7 @@ static struct rb_sym *resolv_address(struct process *process, bfd_vma addr)
struct map *map = open_map(process, addr);
if (map) {
sym = bin_file_lookup(map->binfile, addr, map->addr);
sym = bin_file_lookup(map->binfile, addr, map->bias);
if (sym)
return sym;
}
@ -422,6 +423,7 @@ static void stack_put(struct rb_stack *stack_node)
for(i = 0; i < stack->entries; ++i)
bin_file_sym_put(stack->syms[i]);
free(stack->addrs);
free(stack->syms);
}
free(stack);
@ -459,6 +461,7 @@ static struct rb_stack *stack_clone(struct process *process, struct rb_stack *st
this->leaks = stack_node->leaks;
this->n_allocations = stack_node->n_allocations;
this->n_mismatched = stack_node->n_mismatched;
this->n_badfree = stack_node->n_badfree;
this->total_allocations = stack_node->total_allocations;
this->bytes_used = stack_node->bytes_used;
this->bytes_leaked = stack_node->bytes_leaked;
@ -476,7 +479,7 @@ static struct rb_stack *stack_clone(struct process *process, struct rb_stack *st
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_node **new = &(root->rb_node), *parent = NULL;
@ -526,6 +529,7 @@ static struct rb_stack *stack_add(struct process *process, unsigned int pid, voi
this->refcnt = 0;
this->n_allocations = 0;
this->n_mismatched = 0;
this->n_badfree = 0;
this->total_allocations = 0;
this->bytes_used = 0;
this->leaks = 0;
@ -600,7 +604,7 @@ static struct rb_block *process_rb_search_range(struct rb_root *root, unsigned l
while (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;
if (addr < this->addr)
@ -618,7 +622,7 @@ static struct rb_block *process_rb_search(struct rb_root *root, unsigned long ad
while (node) {
struct rb_block *this = container_of(node, struct rb_block, node);
if (addr >= this->addr && addr < this->addr + (this->size ? this->size : 1))
if (addr == this->addr)
return this;
if (addr < this->addr)
@ -629,23 +633,6 @@ static struct rb_block *process_rb_search(struct rb_root *root, unsigned long ad
return NULL;
}
static struct rb_block *process_rb_block(struct rb_root *root, unsigned long addr)
{
struct rb_node *node = root->rb_node;
while (node) {
struct rb_block *this = container_of(node, struct rb_block, node);
if (addr < this->addr)
node = node->rb_left;
else if (addr > this->addr)
node = node->rb_right;
else
return this;
}
return NULL;
}
static void process_release_mem(struct process *process, struct rb_block *block, unsigned int size)
{
if (block->flags & BLOCK_LEAKED) {
@ -693,10 +680,10 @@ static int process_rb_insert_block(struct process *process, unsigned long addr,
parent = *new;
if (addr <= this->addr && addr + n > this->addr) {
if ((addr <= this->addr) && (addr + n > this->addr)) {
process_dump_collision(process, this, addr, size, operation);
if (options.kill)
if (unlikely(options.kill))
abort();
}
@ -729,13 +716,14 @@ static int process_rb_insert_block(struct process *process, unsigned long addr,
return 0;
}
static struct map *_process_add_map(struct process *process, unsigned long addr, unsigned long offset, unsigned long size, const char *filename, size_t len, struct bin_file *binfile)
static struct map *_process_add_map(struct process *process, unsigned long addr, unsigned long offset, unsigned long size, unsigned long bias, const char *filename, size_t len, struct bin_file *binfile)
{
struct map *map = malloc(sizeof(*map));
map->addr = addr;
map->offset = offset;
map->size = size;
map->bias = bias;
map->filename = malloc(len + 1);
map->binfile = binfile;
map->ignore = 0;
@ -764,8 +752,9 @@ void process_add_map(struct process *process, void *payload, uint32_t payload_le
uint64_t addr = process->val64(mt_map->addr);
uint64_t offset = process->val64(mt_map->offset);
uint64_t size = process->val64(mt_map->size);
uint64_t bias = process->val64(mt_map->bias);
_process_add_map(process, addr, offset, size, mt_map->filename, payload_len - sizeof(*mt_map), NULL);
_process_add_map(process, addr, offset, size, bias, mt_map->filename, payload_len - sizeof(*mt_map), NULL);
}
static void _process_del_map(struct map *map)
@ -786,6 +775,8 @@ void process_del_map(struct process *process, void *payload, uint32_t payload_le
uint64_t size = process->val64(mt_map->size);
struct list_head *it;
(void)payload_len;
list_for_each(it, &process->map_list) {
struct map *map = container_of(it, struct map, list);
@ -823,7 +814,8 @@ static void process_init(struct process *process, unsigned int swap_endian, unsi
static void realloc_del(struct realloc_entry *re)
{
stack_put(re->stack);
if (re->stack_node)
stack_put(re->stack_node);
list_del(&re->list);
free(re);
}
@ -921,7 +913,7 @@ void process_duplicate(struct process *process, struct process *copy)
list_for_each(it, &copy->map_list) {
struct map *map = container_of(it, struct map, list);
_process_add_map(process, map->addr, map->offset, map->size, map->filename, strlen(map->filename), map->binfile);
_process_add_map(process, map->addr, map->offset, map->size, map->bias, map->filename, strlen(map->filename), map->binfile);
}
process->total_allocations = copy->total_allocations;
@ -937,7 +929,16 @@ static int sort_tsc(const struct rb_stack **p, const struct rb_stack **q)
return 0;
}
static int sort_mismatched(const struct rb_stack **p, const struct rb_stack **q)
static int _sort_badfree(const struct rb_stack **p, const struct rb_stack **q)
{
if ((*p)->n_badfree > (*q)->n_badfree)
return -1;
if ((*p)->n_badfree < (*q)->n_badfree)
return 1;
return 0;
}
static int _sort_mismatched(const struct rb_stack **p, const struct rb_stack **q)
{
if ((*p)->n_mismatched > (*q)->n_mismatched)
return -1;
@ -946,6 +947,26 @@ static int sort_mismatched(const struct rb_stack **p, const struct rb_stack **q)
return 0;
}
static int sort_badfree(const struct rb_stack **p, const struct rb_stack **q)
{
int ret;
ret = _sort_badfree(p, q);
if (ret)
return ret;
return _sort_mismatched(p, q);
}
static int sort_mismatched(const struct rb_stack **p, const struct rb_stack **q)
{
int ret;
ret = _sort_mismatched(p, q);
if (ret)
return ret;
return _sort_badfree(p, q);
}
static int sort_usage(const struct rb_stack **p, const struct rb_stack **q)
{
if ((*p)->bytes_used > (*q)->bytes_used)
@ -1014,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)
{
struct rb_stack **arr;
struct rb_stack **arr = NULL;
unsigned long i;
void *data;
unsigned long stack_trees = process->stack_trees;
@ -1024,9 +1045,12 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
if (dump_init(file) == -1)
return;
if (!stack_trees)
goto skip;
arr = malloc(sizeof(struct rb_stack *) * stack_trees);
if (!arr)
return;
goto skip;
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);
@ -1039,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>");
if (!stack_trees)
goto skip;
qsort(arr, stack_trees, sizeof(struct rb_stack *), (void *)sortby);
if (file == stderr) {
@ -1060,7 +1081,18 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
struct rb_stack *stack = arr[i];
if (!skipfunc(stack)) {
if (!stack->n_mismatched) {
if (stack->n_mismatched || stack->n_badfree) {
if (dump_printf(
"Stack (%s):\n"
" total number of mismatches: %llu\n"
" total number of bad free: %llu\n",
str_operation(stack->stack->operation),
stack->n_mismatched,
stack->n_badfree
) == -1)
break;
}
else {
if (dump_printf(
"Stack (%s):\n"
" bytes used: %llu\n"
@ -1078,15 +1110,6 @@ static void _process_dump(struct process *process, int (*sortby)(const struct rb
break;
}
}
else {
if (dump_printf(
"Stack (%s):\n"
" total number of mismatches: %llu\n",
str_operation(stack->stack->operation),
stack->n_mismatched
) == -1)
break;
}
if (dump_printf(" tsc: %llu\n", stack->tsc) == -1)
break;
@ -1123,6 +1146,8 @@ static void process_dump(struct process *process, int (*sortby)(const struct rb_
static int skip_none(struct rb_stack *stack)
{
(void)stack;
return 0;
}
@ -1131,11 +1156,6 @@ static int skip_zero_allocations(struct rb_stack *stack)
return !stack->n_allocations;
}
static int skip_non_mismatched(struct rb_stack *stack)
{
return !stack->n_mismatched;
}
static int skip_zero_leaks(struct rb_stack *stack)
{
return !stack->leaks;
@ -1178,7 +1198,12 @@ void process_dump_sort_tsc(struct process *process, const char *outfile, int lfl
void process_dump_sort_mismatched(struct process *process, const char *outfile, int lflag)
{
process_dump(process, sort_mismatched, skip_non_mismatched, outfile, lflag);
process_dump(process, sort_mismatched, skip_none, outfile, lflag);
}
void process_dump_sort_badfree(struct process *process, const char *outfile, int lflag)
{
process_dump(process, sort_badfree, skip_none, outfile, lflag);
}
void process_dump_stacks(struct process *process, const char *outfile, int lflag)
@ -1186,7 +1211,7 @@ void process_dump_stacks(struct process *process, const char *outfile, int 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 long n = payload_len / process->ptr_size;
@ -1194,7 +1219,7 @@ void *process_scan(struct process *process, void *leaks, uint32_t payload_len)
void *new_leaks = leaks;
for(i = 0; i < n; ++i) {
struct rb_block *block = process_rb_block(&process->block_table, process->get_ulong(leaks));
struct rb_block *block = process_rb_search(&process->block_table, process->get_ulong(leaks));
if (block && !(block->flags & BLOCK_LEAKED)) {
block->flags |= BLOCK_LEAKED;
@ -1218,10 +1243,12 @@ void *process_scan(struct process *process, void *leaks, uint32_t payload_len)
dump_printf(" leaked bytes: %llu\n", process->leaked_bytes);
for(i = 0; i < new; ++i) {
struct rb_block *block = process_rb_block(&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)
break;
if (options.verbose > 1) {
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;
}
@ -1229,10 +1256,12 @@ void *process_scan(struct process *process, void *leaks, uint32_t payload_len)
dump_printf("leaks total: %lu\n", process->leaks);
dump_flush();
if (!options.interactive)
if (!options.interactive) {
process_dump_sortby(process);
return 1;
}
return leaks;
return 0;
}
static inline unsigned long roundup_mask(unsigned long val, unsigned long mask)
@ -1269,20 +1298,32 @@ void process_munmap(struct process *process, struct mt_msg *mt_msg, void *payloa
do {
block = process_rb_search_range(&process->block_table, ptr, size);
if (!block)
break;
if (!is_mmap(block->stack_node->stack->operation)) {
fprintf(stderr, ">>> block missmatch pid:%d MAP<>MALLOC %#lx\n", process->pid, ptr);
if (options.kill)
abort();
break;
if (block && !is_mmap(block->stack_node->stack->operation)) {
// ignore blocks not mmap'ed
block = NULL;
}
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) {
unsigned off = block->addr - ptr;
unsigned long off = block->addr - ptr;
size -= off;
ptr += off;
@ -1302,33 +1343,32 @@ void process_munmap(struct process *process, struct mt_msg *mt_msg, void *payloa
process_rb_delete_block(process, block);
}
else {
unsigned off = ptr - block->addr;
unsigned long off = ptr - block->addr;
if (off + size < block->size) {
unsigned long new_addr = block->addr + (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;
if (process_rb_insert_block(process, new_addr, new_size, block->stack_node, 0, mt_msg->operation))
break;
process->n_allocations++;
process->total_allocations++;
process->bytes_used += new_size;
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->addr += off;
block->size -= off;
size -= block->size;
ptr += block->size;
block->size -= amount_freed;
size -= amount_freed ;
ptr += amount_freed;
}
}
} while(size);
}
@ -1362,6 +1402,22 @@ static int is_sane(struct rb_block *block, enum mt_operation op)
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)
{
struct rb_block *block = NULL;
@ -1395,43 +1451,29 @@ void process_free(struct process *process, struct mt_msg *mt_msg, void *payload)
debug(DEBUG_FUNCTION, "ptr=%#lx", ptr);
if (!ptr)
return;
block = process_rb_search(&process->block_table, ptr);
if (block) {
if (block->addr != ptr) {
fprintf(stderr, ">>> block invalid free %#lx pid:%d\n", ptr, process->pid);
if (options.kill)
abort();
}
if (is_mmap(block->stack_node->stack->operation)) {
fprintf(stderr, ">>> block missmatch pid:%d MAP<>MALLOC %#lx\n", process->pid, ptr);
if (options.kill)
if (unlikely(options.kill)) {
fprintf(stderr, ">>> block missmatch pid:%d MAP<>MALLOC %#lx\n", process->pid, ptr);
abort();
}
}
if (!is_sane(block, mt_msg->operation)) {
struct rb_stack *stack = stack_add(process, process->pid, stack_data, stack_size, mt_msg->operation);
if (stack_size) {
if (!is_sane(block, mt_msg->operation)) {
struct rb_stack *stack = stack_add(process, stack_data, stack_size, mt_msg->operation);
stack->n_mismatched++;
stack->tsc = process->tsc++;
stack->n_mismatched++;
stack->tsc = process->tsc++;
}
}
if (mt_msg->operation == MT_REALLOC_ENTER) {
struct realloc_entry *re = malloc(sizeof(*re));
re->addr = block->addr;
re->size = block->size;
re->flags = block->flags;
re->operation = block->stack_node->stack->operation;
re->pid = pid;
re->stack = block->stack_node;
stack_get(re->stack);
list_add_tail(&re->list, &process->realloc_list);
}
if (mt_msg->operation == MT_REALLOC_ENTER)
realloc_add(process, pid, block->addr, block->size, block->flags, block->stack_node);
process_rb_delete_block(process, block);
}
@ -1441,7 +1483,17 @@ void process_free(struct process *process, struct mt_msg *mt_msg, void *payload)
fprintf(stderr, ">>> block %#lx not found pid:%d\n", ptr, process->pid);
abort();
}
if (stack_size) {
struct rb_stack *stack = stack_add(process, stack_data, stack_size, mt_msg->operation);
stack->n_badfree++;
stack->tsc = process->tsc++;
}
}
if (mt_msg->operation == MT_REALLOC_ENTER)
realloc_add(process, pid, 0, 0, 0, NULL);
}
}
@ -1451,6 +1503,8 @@ void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *
unsigned long pid;
struct list_head *it;
(void)mt_msg;
if (!process->tracing)
return;
@ -1473,15 +1527,18 @@ void process_realloc_done(struct process *process, struct mt_msg *mt_msg, void *
struct realloc_entry *re = container_of(it, struct realloc_entry, list);
if (re->pid == pid) {
if (!ptr)
process_rb_insert_block(process, re->addr, re->size, re->stack, re->flags, re->operation);
if (!ptr && re->addr)
process_rb_insert_block(process, re->addr, re->size, re->stack_node, re->flags, re->stack_node->stack->operation);
realloc_del(re);
break;
return;
}
}
if (unlikely(options.kill)) {
fprintf(stderr, ">>> unexpected realloc done pid: %lu ptr: %#lx\n", pid, ptr);
abort();
}
return;
}
@ -1527,16 +1584,18 @@ void process_alloc(struct process *process, struct mt_msg *mt_msg, void *payload
process_dump_collision(process, block, ptr, size, mt_msg->operation);
if (options.kill)
if (unlikely(options.kill))
abort();
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");
return;
}
process->total_allocations++;
process->bytes_used += size;
@ -1594,7 +1653,10 @@ void process_dump_sortby(struct process *process)
_process_dump(process, sort_usage, skip_zero_allocations, options.output, options.lflag);
break;
case OPT_SORT_MISMATCHED:
_process_dump(process, sort_mismatched, skip_non_mismatched, options.output, options.lflag);
_process_dump(process, sort_mismatched, skip_none, options.output, options.lflag);
break;
case OPT_SORT_BADFREE:
_process_dump(process, sort_badfree, skip_none, options.output, options.lflag);
break;
default:
_process_dump(process, sort_allocations, skip_zero_allocations, options.output, options.lflag);
@ -1602,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);
if (!options.interactive)
if (!options.interactive) {
process_dump_sortby(process);
else
fprintf(stderr, "+++ process %d exited +++\n", process->pid);
return 1;
}
fprintf(stderr, "+++ process %d exited\n", process->pid);
return 0;
}
void process_about_exit(struct process *process)
@ -1622,17 +1687,25 @@ void process_about_exit(struct process *process)
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);
if (options.auto_scan)
if (options.auto_scan) {
process_leaks_scan(process, SCAN_ALL);
else
if (!options.interactive)
process_dump_sortby(process);
}
else {
if (!options.interactive) {
process_dump_sortby(process);
ret = 1;
}
}
client_send_msg(process, MT_DETACH, NULL, 0);
return ret;
}
void process_set_status(struct process *process, enum process_status status)
@ -1703,7 +1776,7 @@ struct block_helper {
unsigned long mask;
unsigned long fmask;
unsigned long fmode;
void * data;
void * data;
};
static void set_block(struct rb_block *block, void *data)

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -90,15 +90,15 @@ void process_set_status(struct process *process, enum process_status status);
void process_start_input(struct process *process);
void process_stop_input(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_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_free(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_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);
unsigned long process_leaks_scan(struct process *process, int mode);
@ -112,6 +112,7 @@ void process_dump_sort_allocations(struct process *process, const char *outfile,
void process_dump_sort_total(struct process *process, const char *outfile, int lflag);
void process_dump_sort_tsc(struct process *process, const char *outfile, int lflag);
void process_dump_sort_mismatched(struct process *process, const char *outfile, int lflag);
void process_dump_sort_badfree(struct process *process, const char *outfile, int lflag);
void process_dump_stacks(struct process *process, const char *outfile, int lflag);
void add_ignore_regex(regex_t *re);

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -90,34 +90,35 @@ static const char *outfile;
static int quit;
static struct cmd_opt dump_opts[] = {
{ "allocations", 2, process_dump_sort_allocations, "sort by number of open allocations" },
{ "average", 2, process_dump_sort_average, "sort by average allocation of bytes (usage / allocations)" },
{ "bytes-leaked", 1, process_dump_sort_bytes_leaked, "sort by number of leaked bytes" },
{ "leaks", 1, process_dump_sort_leaks, "sort by number of detected leaks" },
{ "mismatched", 1, process_dump_sort_mismatched, "sort by number of mismatched releases" },
{ "stacks", 1, process_dump_stacks, "dump all stack sort by number of total allocations" },
{ "total", 2, process_dump_sort_total, "sort by number of total allocations" },
{ "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter" },
{ "usage", 1, process_dump_sort_usage, "sort by number of bytes" },
{ NULL, 0, NULL, "\n use > to dump the output into a file" },
{ "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)", NULL, NULL },
{ "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", NULL, NULL },
{ "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", NULL, NULL },
{ "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", NULL, NULL },
{ "tsc", 2, process_dump_sort_tsc, "sort by time stamp counter", NULL, NULL },
{ "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, NULL },
};
static struct cmd_opt set_opts[] = {
{ "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries" },
{ "depth", 1, do_set_depth, "set backtrace depth" },
{ "searchpath", 1, do_set_searchpath, "set searchpath for binaries and libraries", NULL, NULL },
{ "depth", 1, do_set_depth, "set backtrace depth", NULL, NULL },
{ },
};
static struct cmd_opt show_opts[] = {
{ "info", 1, do_show_info, "show client settings" },
{ "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries" },
{ "info", 1, do_show_info, "show client settings", NULL, NULL },
{ "searchpath", 1, do_show_searchpath, "show searchpath for binaries and libraries", NULL, NULL },
{ },
};
static struct cmd_opt scan_opts[] = {
{ "all", 1, (void *)SCAN_ALL, "scan all memory blocks" },
{ "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations" },
{ "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan" },
{ "all", 1, (void *)SCAN_ALL, "scan all memory blocks", NULL, NULL },
{ "leak", 1, (void *)SCAN_LEAK, "scan only leaked allocations", NULL, NULL },
{ "new", 1, (void *)SCAN_NEW, "scan only allocations since last scan", NULL, NULL },
{ },
};
@ -143,21 +144,24 @@ static struct cmd_opt cmds[] = {
1,
do_proclist,
"list processes",
""
"",
NULL
},
{
quit_str,
1,
do_quit,
"exit the program",
""
"",
NULL
},
{
reset_str,
1,
do_reset,
"reset all current memory allocation",
"[<pid>]"
"[<pid>]",
NULL
},
{
scan_str,
@ -170,7 +174,7 @@ static struct cmd_opt cmds[] = {
{
set_str,
2,
do_set,
do_set,
"change settings",
"<option> [arg]",
set_opts
@ -178,7 +182,7 @@ static struct cmd_opt cmds[] = {
{
show_str,
2,
do_show,
do_show,
"show settings",
"<option> [arg]",
show_opts
@ -188,21 +192,24 @@ static struct cmd_opt cmds[] = {
4,
do_start,
"start allocation tracing",
""
"",
NULL
},
{
status_str,
4,
do_status,
"show allocation status",
"[<pid>]"
"[<pid>]",
NULL
},
{
stop_str,
3,
do_stop,
"stop allocation tracing",
""
"",
NULL
},
{ },
};
@ -346,9 +353,8 @@ static void readline_handler(char *line)
char *linedup;
char *s;
linedup = strdup(line);
if (!linedup)
goto finish;
linedup = alloca(strlen(line) + 1);
strcpy(linedup, line);
argv = malloc(argv_size * sizeof(*argv));
if (!argv)
@ -356,7 +362,7 @@ static void readline_handler(char *line)
s = linedup;
i = 0;
for(;;) {
s = skip_spaces(s);
if (!*s)
@ -400,7 +406,7 @@ static void readline_handler(char *line)
s += n + 1;
}
if (!i)
return;
goto finish;
argc = i;
argv[i++] = NULL;
@ -438,7 +444,6 @@ static void readline_handler(char *line)
printf("unknown command '%s'\n", argv[0]);
finish:
free(argv);
free(linedup);
if (quit)
rl_callback_handler_remove();
@ -512,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[])
{
(void)argv;
if (argc > 2) {
fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name);
return -1;
@ -527,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;
(void)argv;
if (argc > 3) {
fprintf(stderr, "%s: too many option argument for '%s'\n", cmd->name, opt->name);
return -1;
@ -616,7 +625,7 @@ static int do_help(struct cmd_opt *cmd, int argc, const char *argv[])
{
int i;
unsigned int len;
if (argc <= 1) {
for(i = 0; i != ARRAY_SIZE(cmds) - 1; ++i)
printf(" %s - %s\n", cmds[i].name, cmds[i].info);
@ -660,6 +669,9 @@ static int show_process(struct process *process)
static int do_proclist(struct cmd_opt *cmd, int argc, const char *argv[])
{
(void)cmd;
(void)argv;
if (argc > 1) {
fprintf(stderr, "%s: expect no arguments\n", proclist_str);
return -1;
@ -673,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[])
{
(void)cmd;
(void)argc;
(void)argv;
quit = 1;
return 0;
@ -682,6 +698,9 @@ static int do_reset(struct cmd_opt *cmd, int argc, const char *argv[])
{
struct process *process;
(void)cmd;
(void)argc;
process = get_process(argv[1]);
if (!process)
return -1;
@ -701,6 +720,8 @@ static int do_scan(struct cmd_opt *cmd, int argc, const char *argv[])
unsigned int i;
int mode;
(void)argc;
if (!client_connected())
return -1;
@ -797,6 +818,9 @@ static int do_start(struct cmd_opt *cmd, int argc, const char *argv[])
{
struct process *process;
(void)cmd;
(void)argc;
if (!client_connected())
return -1;
@ -818,6 +842,9 @@ static int do_status(struct cmd_opt *cmd, int argc, const char *argv[])
{
struct process *process;
(void)cmd;
(void)argc;
process = get_process(argv[1]);
if (!process)
return -1;
@ -831,6 +858,9 @@ static int do_stop(struct cmd_opt *cmd, int argc, const char *argv[])
{
struct process *process;
(void)cmd;
(void)argc;
if (!client_connected())
return -1;
@ -887,5 +917,10 @@ void readline_exit(void)
{
if (!quit)
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.
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

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

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
Priority: optional
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
Vcs-Git: https://github.com/sstefani/mtrace.git

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -47,6 +47,8 @@ void _debug(int level, const char *file, const char *function, int line, const c
va_end(args);
fprintf(stderr, "DEBUG: %s():%s@%d - %s\n", function, file, line, buf);
free(buf);
}
#endif

18
debug.h
View File

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

4
dict.c
View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -25,6 +24,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <malloc.h>
#include "common.h"
#include "dict.h"

3
dict.h
View File

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

123
dwarf.c
View File

@ -1,6 +1,6 @@
/*
* 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 work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
@ -36,6 +36,7 @@
#include <inttypes.h>
#include <errno.h>
#include <unistd.h>
#include <malloc.h>
#include "backend.h"
#include "common.h"
@ -462,7 +463,7 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
{
struct dwarf_addr_space *indirect_as = as;
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;
void *tmp_ptr;
int ret;
@ -476,16 +477,6 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
arch_addr_t addr;
} 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));
if (valp)
@ -494,7 +485,7 @@ static int dwarf_read_encoded_pointer(struct dwarf_addr_space *as, int local,
valp = &val;
tmp_ptr = NULL;
}
if (local)
as = NULL;
@ -620,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)
{
#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);
}
@ -686,7 +686,7 @@ static int parse_cie(struct dwarf_addr_space *as, arch_addr_t addr, struct dwarf
return ret;
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;
}
@ -870,20 +870,16 @@ static int dwarf_extract_cfi_from_fde(struct dwarf_addr_space *as, void *addrp)
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)
{
struct dwarf_cursor *c = &as->cursor;
struct libref *libref = c->libref;
if (c->use_prev_instr)
ip -= 1;
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;
}
@ -894,16 +890,16 @@ int dwarf_locate_map(struct dwarf_addr_space *as, arch_addr_t ip)
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;
unsigned long lo, hi;
if (!table_len)
if (!fde_count)
return NULL;
lo = 0;
hi = table_len;
hi = fde_count;
f = NULL;
do {
unsigned long mid = (lo + hi) / 2;
@ -921,7 +917,7 @@ static const struct table_entry *lookup(const struct table_entry *table, size_t
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;
void *fde_addr;
@ -929,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 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)) {
/* 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);
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))
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)
dci->start_ip &= 0xffffffff;
@ -973,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)
{
arch_addr_t val = DWARF_GET_LOC(loc);
arch_addr_t addr = DWARF_GET_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)
val &= 0xffffffff;
addr &= 0xffffffff;
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;
}
@ -1053,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_cie_info *dci = &c->dci;
unsigned int num_regs = as->num_regs;
struct dwarf_reg_stack {
struct dwarf_reg_stack *next; /* for reg state stack */
struct dwarf_reg_state store;
} *rs_stack = NULL, *rs_tmp;
unsigned int reg_stack_ptr = 0;
unsigned int reg_stack_entry_len = regs_size(as);
unsigned char reg_stack[16 * reg_stack_entry_len];
curr_ip = dci->start_ip;
@ -1165,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);
break;
case DW_CFA_remember_state:
rs_tmp = malloc(regs_size(as));
memcpy(&rs_tmp->store, rs_current, regs_size(as));
rs_tmp->next = rs_stack;
rs_stack = rs_tmp;
if (unlikely(sizeof(reg_stack) - reg_stack_ptr < reg_stack_entry_len)) {
debug(DEBUG_DWARF, "register-state stack overflow");
ret = -DWARF_EINVAL;
goto fail;
}
memcpy(reg_stack + reg_stack_ptr, rs_current, reg_stack_entry_len);
reg_stack_ptr += reg_stack_entry_len;
break;
case DW_CFA_restore_state:
if (unlikely(!rs_stack)) {
if (unlikely(!reg_stack_ptr)) {
debug(DEBUG_DWARF, "register-state stack underflow");
ret = -DWARF_EINVAL;
goto fail;
}
rs_tmp = rs_stack;
memcpy(rs_current, &rs_tmp->store, regs_size(as));
rs_stack = rs_tmp->next;
free(rs_tmp);
reg_stack_ptr -= reg_stack_entry_len;
memcpy(rs_current, reg_stack + reg_stack_ptr, reg_stack_entry_len);
break;
case DW_CFA_def_cfa:
if ((unlikely((ret = read_regnum(num_regs, addr, &regnum)) < 0)
@ -1268,12 +1263,6 @@ static int run_cfi_program(struct dwarf_addr_space *as, struct dwarf_reg_state *
ret = 0;
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;
}
@ -1807,7 +1796,7 @@ static int fetch_proc_info(struct dwarf_addr_space *as, arch_addr_t ip)
struct libref *libref = c->libref;
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)
return ret;
@ -1941,8 +1930,6 @@ fail:
c->ip = ip;
if (ret == -DWARF_ENOINFO) {
debug(DEBUG_DWARF, "try arch specific step");
ret = dwarf_arch_step(as);
if (!ret) {
if (dwarf_locate_map(as, c->ip) < 0)
@ -1987,7 +1974,8 @@ fail:
break;
}
#endif
debug(DEBUG_DWARF, "error %d", ret);
if (ret != -DWARF_ENOINFO && ret != -DWARF_EBADFRAME)
debug(DEBUG_DWARF, "error %d", ret);
c->valid = 0;
}
@ -1995,11 +1983,14 @@ fail:
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;
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));
@ -2009,26 +2000,32 @@ int dwarf_get_unwind_table(struct task *task, struct libref *libref, struct dwar
if (hdr->version != DW_EH_VERSION) {
debug(DEBUG_DWARF, "exception table has unexpected version %d", hdr->version);
abort();
return -DWARF_ENOINFO;
}
addr = ARCH_ADDR_T(hdr + 1);
/* (Optionally) read eh_frame_ptr: */
if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, NULL, 0)) < 0)
/* read eh_frame_ptr: */
if ((ret = dwarf_read_encoded_pointer_local(&tmp_as, &addr, hdr->eh_frame_ptr_enc, &eh_frame, 0)) < 0) {
abort();
return -DWARF_ENOINFO;
}
/* (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;
}
if (hdr->table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
debug(DEBUG_DWARF, "unsupported unwind table encoding.");
abort();
return -DWARF_EINVAL;
}
libref->table_data = (void *)addr;
libref->table_len = fde_count;
libref->fde_tab = (void *)addr;
libref->fde_count = fde_count;
return 0;
}

View File

@ -1,6 +1,6 @@
/*
* 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 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_EBADVERSION 5 /* unwind info has unsupported version */
#define DWARF_ENOINFO 6 /* no unwind info found */
#define DWARF_STOPUNWIND 7 /* no unwind info found */
#define DWARF_STOPUNWIND 7
struct dwarf_cie_info {
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_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_unwind(struct dwarf_addr_space *as);

293
event.c
View File

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

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -67,8 +66,8 @@ void libref_delete(struct libref *libref)
free(sym);
}
if (libref->image_addr)
munmap(libref->image_addr, libref->load_size);
if (libref->mmap_addr)
munmap(libref->mmap_addr, libref->txt_size);
free((void *)libref->filename);
free(libref);
@ -113,7 +112,7 @@ struct library_symbol *library_symbol_new(struct libref *libref, arch_addr_t add
return libsym;
}
void library_delete(struct task *task, struct library *lib)
static void library_delete(struct task *task, struct library *lib)
{
if (lib == NULL)
return;
@ -150,14 +149,14 @@ struct library_symbol *library_find_symbol(struct libref *libref, arch_addr_t ad
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;
list_for_each(it, list) {
struct library *lib = container_of(it, struct library, list);
if (lib->libref->key == key)
if (lib->libref->dyn == dyn)
return lib;
}
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 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))
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);
}
@ -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 rb_node **new = &(leader->libraries_tree.rb_node);
@ -224,10 +218,10 @@ struct libref *addr2libref(struct task *leader, arch_addr_t addr)
while (*new) {
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;
if (this->load_addr < addr)
if (this->txt_vaddr < addr)
new = &((*new)->rb_left);
else
new = &((*new)->rb_right);
@ -246,7 +240,7 @@ static void insert_lib(struct task *leader, struct library *lib)
parent = *new;
if (this->libref->load_addr < lib->libref->load_addr)
if (this->libref->txt_vaddr < lib->libref->txt_vaddr)
new = &((*new)->rb_left);
else
new = &((*new)->rb_right);
@ -259,15 +253,12 @@ static void insert_lib(struct task *leader, struct library *lib)
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);
struct library *lib = malloc(sizeof(*lib));
if (lib == NULL)
return NULL;
memset(lib, 0, sizeof(*lib));
lib->libref = libref_get(libref);
@ -277,7 +268,7 @@ static struct library *_library_add(struct task *leader, struct libref *libref)
insert_lib(leader, lib);
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;
}

View File

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

28
list.h
View File

@ -1,6 +1,6 @@
/*
* 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 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
* the prev/next entries already!
*/
static inline void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
static inline void __list_add(struct list_head *elem, struct list_head *prev, struct list_head *next)
{
next->prev = new;
new->next = next;
new->prev = prev;
prev->next = new;
next->prev = elem;
elem->next = next;
elem->prev = prev;
prev->next = elem;
}
/**
* 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
*
* Insert a new entry after the specified head.
* 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
* @new: new entry to be added
* @elem: new entry to be added
* @head: list head to add it before
*
* Insert a new entry before the specified head.
* 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);
}
/*
@ -212,7 +210,7 @@ static inline void list_splice_init(struct list_head *list,
*/
#define list_for_each(pos, head) \
for (pos = (head)->next; prefetch(pos->next), pos != (head); \
pos = pos->next)
pos = pos->next)
/**
* list_for_each_safe - iterate over a list safe against removal of list entry

39
main.c
View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -39,7 +39,9 @@
#include "backend.h"
#include "breakpoint.h"
#include "common.h"
#ifndef DISABLE_CLIENT
#include "client.h"
#endif
#include "debug.h"
#include "options.h"
#include "library.h"
@ -59,6 +61,8 @@ struct mt_timer report_in_time;
struct mt_timer report_out_time;
struct mt_timer skip_bp_time;
pid_t mtrace_pid;
static int do_exit;
void mtrace_request_exit(void)
@ -67,7 +71,7 @@ void mtrace_request_exit(void)
return;
if (unlikely(options.verbose))
fprintf(stderr, "+++ request exit +++\n");
fprintf(stderr, "+++ request exit\n");
do_exit = 1;
wait_event_wakeup();
@ -104,18 +108,20 @@ static void mtrace_exit(void)
each_pid(remove_task);
}
static void mtrace_init(char **cmd)
static void mtrace_init(char **cmd_args)
{
struct opt_p_t *opt_p_tmp;
mtrace_pid = getpid();
if (options.command) {
struct task *task = task_create(options.command, cmd);
struct task *task = task_create(cmd_args);
if (!task)
exit(EXIT_FAILURE);
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)
@ -124,12 +130,17 @@ static void mtrace_init(char **cmd)
static void mtrace_main(void)
{
struct task *task;
while(!do_exit) {
if (task_list_empty())
break;
if (handle_event() == -1)
break;
task = next_event();
if (task) {
if (handle_event(task) == -1)
break;
}
if (server_poll() == -1)
break;
@ -138,9 +149,7 @@ static void mtrace_main(void)
int main(int argc, char *argv[])
{
char **cmd = process_options(argc, argv);
init_pid_hash();
char **cmd_args = process_options(argc, argv);
if (options.trace) {
if (options.logfile) {
@ -153,7 +162,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
else {
#if DISABLE_CLIENT
#ifdef DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE);
#else
@ -168,7 +177,7 @@ int main(int argc, char *argv[])
}
}
else {
#if DISABLE_CLIENT
#ifdef DISABLE_CLIENT
fprintf(stderr, "direct mode not supported\n");
exit(EXIT_FAILURE);
#else
@ -186,14 +195,14 @@ int main(int argc, char *argv[])
if (os_init())
exit(EXIT_FAILURE);
mtrace_init(cmd);
mtrace_init(cmd_args);
mtrace_main();
mtrace_exit();
report_info(0);
report_disconnect();
#if !DISABLE_CLIENT
#ifndef DISABLE_CLIENT
client_stop();
#endif
server_stop();

5
main.h
View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -23,6 +23,8 @@
#ifndef _INC_MAIN_H
#define _INC_MAIN_H
#include <sys/types.h>
#include "timer.h"
void mtrace_request_exit(void);
@ -36,5 +38,6 @@ struct mt_timer report_in_time;
struct mt_timer report_out_time;
struct mt_timer skip_bp_time;
pid_t mtrace_pid;
#endif

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -31,7 +31,7 @@
#define IS64BIT 0
#endif
#define MEMTRACE_SI_VERSION 7
#define MEMTRACE_SI_VERSION 9
#define MEMTRACE_SI_FORK 1
#define MEMTRACE_SI_EXEC 2
@ -100,6 +100,7 @@ struct __attribute__((packed)) mt_pid_payload {
struct __attribute__((packed)) mt_scan_payload {
uint32_t ptr_size;
uint32_t pad; // for 64 bit alignment
uint64_t mask;
char data[0];
};
@ -135,6 +136,7 @@ struct __attribute__((packed)) mt_map_payload {
uint64_t addr;
uint64_t offset;
uint64_t size;
uint64_t bias;
char filename[0];
};

167
mtelf.c
View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -48,6 +47,34 @@
#include "common.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)
{
char *cwd;
@ -217,48 +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);
}
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;
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) {
fprintf(stderr, "mmap failed\n");
return -1;
}
*image_addr = addr;
/* prefetch */
for(p = addr; (void *)p <= addr + mte->txt_hdr.p_filesz; p += PAGE_SIZE)
*p;
*mmap_addr = addr;
return 0;
}
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;
libref->base = ARCH_ADDR_T(mte->base_addr);
libref->entry = ARCH_ADDR_T(mte->entry_addr);
libref->load_offset = mte->txt_hdr.p_offset;
libref->load_addr = mte->txt_hdr.p_vaddr + mte->bias;
libref->load_size = mte->txt_hdr.p_filesz;
libref->seg_offset = mte->eh_hdr.p_offset;
libref->gp = mte->pltgot;
libref->mmap_offset = mte->loadbase;
libref->mmap_size = mte->loadsize;
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->eh_hdr_offset = mte->eh_hdr.p_offset - mte->loadbase;
libref->eh_hdr_vaddr = mte->eh_hdr.p_vaddr - mte->vstart + mte->bias;
libref->pltgot = mte->pltgot - mte->vstart + mte->bias;
libref->dyn = mte->dyn - mte->vstart + mte->bias;
#ifdef __arm__
if (mte->exidx_hdr.p_filesz) {
libref->exidx_data = libref->image_addr + mte->exidx_hdr.p_offset;
libref->exidx_len = mte->exidx_hdr.p_memsz;
libref->exidx_data = libref->mmap_addr + mte->exidx_hdr.p_offset - mte->loadbase;
libref->exidx_len = mte->exidx_hdr.p_filesz;
}
#endif
if (mte->eh_hdr.p_filesz && mte->dyn_addr) {
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 (mte->eh_hdr.p_filesz && mte->dyn) {
if (dwarf_get_unwind_table(task, libref) < 0)
return -1;
}
@ -273,11 +299,20 @@ static void close_elf(struct mt_elf *mte)
if (mte->fd != -1) {
elf_end(mte->elf);
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);
if (open_elf(mte, task, filename) < 0)
@ -288,18 +323,31 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename,
memset(&mte->txt_hdr, 0, sizeof(mte->txt_hdr));
memset(&mte->eh_hdr, 0, sizeof(mte->eh_hdr));
memset(&mte->dyn_hdr, 0, sizeof(mte->dyn_hdr));
memset(&mte->exidx_hdr, 0, sizeof(mte->exidx_hdr));
for (i = 0; gelf_getphdr(mte->elf, i, &phdr) != NULL; ++i) {
switch (phdr.p_type) {
case PT_LOAD:
if (!mte->base_addr || mte->base_addr > phdr.p_vaddr + bias)
mte->base_addr = phdr.p_vaddr + bias;
loadsegs++;
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)
mte->txt_hdr = phdr;
break;
case PT_GNU_EH_FRAME:
mte->eh_hdr = phdr;
@ -310,22 +358,28 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename,
break;
#endif
case PT_INTERP:
mte->interp = phdr.p_vaddr + bias;
mte->interp = phdr.p_vaddr;
break;
case PT_DYNAMIC:
mte->dyn = phdr.p_vaddr;
break;
default:
break;
}
}
if (!mte->base_addr) {
fprintf(stderr, "Couldn't determine base address of %s\n", filename);
if (!loadsegs) {
fprintf(stderr, "No loadable segemnts in %s\n", filename);
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,
(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);
for (i = 1; i < mte->ehdr.e_shnum; ++i) {
@ -366,16 +420,9 @@ static int elf_read(struct mt_elf *mte, struct task *task, const char *filename,
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) {
fprintf(stderr, "Couldn't find .dynsym or .dynstr in \"%s\"\n", filename);
return -1;
@ -391,11 +438,11 @@ int elf_read_library(struct task *task, struct libref *libref, const char *filen
libref_set_filename(libref, filename);
if (elf_read(&mte, task, filename, bias) == -1)
if (elf_read(&mte, task, filename) == -1)
return -1;
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);
@ -444,7 +491,7 @@ static arch_addr_t find_solib_break(struct mt_elf *mte)
{
if (mte->symtab && mte->strtab) {
arch_addr_t addr = _find_solib_break(mte, mte->symtab, mte->strtab, mte->symtab_count);
if (addr)
return addr;
}
@ -470,7 +517,7 @@ static int entry_breakpoint_on_hit(struct task *task, struct breakpoint *a)
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];
int ret;
@ -494,9 +541,11 @@ struct libref *elf_read_main_binary(struct task *task)
fname[ret] = 0;
free(filename);
libref_set_filename(libref, fname);
if (elf_read(&mte, task, filename, 0) == -1)
if (elf_read(&mte, task, fname) == -1)
goto fail3;
task->is_64bit = is_64bit(&mte);
@ -506,19 +555,15 @@ struct libref *elf_read_main_binary(struct task *task)
goto fail3;
}
free(filename);
mte.bias = (GElf_Addr) (uintptr_t) entry - mte.ehdr.e_entry;
mte.entry_addr = (GElf_Addr) (uintptr_t) entry;
libref->key = ARCH_ADDR_T(mte.bias);
mte.bias = entry - mte.ehdr.e_entry - mte.vstart;
mte.entry_addr = entry;
if (elf_lib_init(&mte, task, libref))
goto fail3;
close_elf(&mte);
report_attach(task);
report_attach(task, was_attached);
library_add(task, libref);
@ -527,9 +572,12 @@ struct libref *elf_read_main_binary(struct task *task)
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;
libref = libref_new(LIBTYPE_LOADER);
@ -538,16 +586,14 @@ struct libref *elf_read_main_binary(struct task *task)
libref_set_filename(libref, fname);
mte_ld.bias = (GElf_Addr)base;
mte_ld.entry_addr = mte_ld.ehdr.e_entry + (GElf_Addr)base;
libref->key = ARCH_ADDR_T(mte_ld.bias);
mte_ld.bias = base;
mte_ld.entry_addr = base + mte_ld.ehdr.e_entry - mte.vstart;
ret = elf_lib_init(&mte_ld, task, libref);
if (!ret) {
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);
if (!addr)
addr = ARCH_ADDR_T(entry);
@ -562,7 +608,7 @@ struct libref *elf_read_main_binary(struct task *task)
else {
entry_bp->breakpoint.on_hit = entry_breakpoint_on_hit;
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);
}
@ -598,3 +644,8 @@ fail1:
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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -30,38 +29,12 @@
#include "forward.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_Phdr dyn_hdr;
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);
/* 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

View File

@ -165,6 +165,8 @@ void operator delete(void* p) __THROW
void operator delete(void* p, const std::nothrow_t& nt) __THROW
void operator delete[](void* p) __THROW
void operator delete[](void* p, const std::nothrow_t& nt) __THROW
void operator delete(void*, unsigned long)
void operator delete[](void*, unsigned long)
.fi
.in
.PP
@ -306,6 +308,12 @@ Sort by the number of average allocations (number of bytes in used / number of o
.RE
.RE
.RS
\fIbadfree\fR
.RS
Sort by number of bad free releases (only useful with \-S option).
.RE
.RE
.RS
\fIbytes-leaked\fR
.RS
Sort by number of bytes leaked (only useful with \-a option).
@ -348,8 +356,8 @@ Sort by number of bytes in use of all open allocations.
.RE
.RE
.IP "\-S, \-\-sanity"
Check mismatching operations against new/delete. This options also
sets the sort-by options to mismatched.
Check mismatching operations against new/delete or free releases. This options
also sets the sort-by options to mismatched if no other sort option was set.
.IP "\-t, \-\-trace"
Run \fBmtrace-ng\fR in trace mode. In this mode all attached processes will run under
the control of \fBmtrace-ng\fR and all dynamic memory function calls will be traced.
@ -399,7 +407,7 @@ at any time. It accepts a maximum of three parameters:
\fIsortby\fR
.RS
Sort the output of dump by the keyword. The keyword is the same as for the
\-S option (\fIallocations, \fIaverage\fR, \fIbytes-leaked\fR, \fIleaks\fR,
\-S option (\fIallocations, \fIaverage\fR, \fIbadfree\fR \fIbytes-leaked\fR, \fIleaks\fR,
\fImismatched\fR, \fIstacks\fR, \fItotal\fR, \fItsc\fR and \fIusage\fR). See
\-S option for more details about the sortby keywords. The default sort order
is \fIallocations\fR when no sortby parameter is used.

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -39,6 +38,7 @@
#include <pwd.h>
#include "common.h"
#include "debug.h"
#include "options.h"
#ifndef SYSCONFDIR
@ -106,7 +106,7 @@ static void usage(void)
" allocations, average, bytes-leaked, leaks,\n"
" mismatched, stacks, total, tsc, usage\n"
#endif
" -S, --sanity check mismatching operations against new/delete\n"
" -S, --sanity check for mismatching operations\n"
" -t, --trace trace mode\n"
" -u, --user=USERNAME run command with the userid, groupid of username\n"
" -V, --version output version information and exit\n"
@ -119,14 +119,15 @@ static void usage(void)
#ifdef DEBUG
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,
"\n"
" number ref. in source description\n"
" 1 general Generally helpful progress information\n"
" 10 event Shows every event received by a traced process\n"
" 20 process Shows actions carried upon a traced processes\n"
" 40 function Shows every entry to internal functions\n"
" number description\n"
" 1 ptrace events\n"
" 2 dwarf issues\n"
" 4 Shows every event received by a traced process\n"
" 8 Shows actions carried upon a traced processes\n"
" 16 Shows every entry to internal functions\n"
"\n"
"Debugging options are mixed using bitwise-or.\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)
{
struct opt_F_t *tmp = malloc(sizeof(*tmp));
if (access(filename, R_OK))
return -1;
struct opt_F_t *tmp = malloc(sizeof(*tmp));
if (!tmp) {
fprintf(stderr, "%s\n", strerror(errno));
exit(1);
@ -198,7 +199,7 @@ static void def_config(void)
{
char *path;
char *filename;
path = getenv("HOME");
if (!path) {
struct passwd *pwd = getpwuid(getuid());
@ -409,9 +410,9 @@ char **process_options(int argc, char **argv)
usage_debug();
exit(0);
}
options.debug = strtoul(optarg, &p, 8);
options.debug = strtoul(optarg, &p, 0);
if (*p) {
fprintf(stderr, "%s: --debug requires an octal argument\n", progname);
fprintf(stderr, "%s: --debug requires an numeric argument\n", progname);
err_usage();
}
#endif
@ -504,6 +505,9 @@ char **process_options(int argc, char **argv)
if (!strncmp(optarg, "average", 2))
options.sort_by = OPT_SORT_AVERAGE;
else
if (!strncmp(optarg, "badfree", 1))
options.sort_by = OPT_SORT_BADFREE;
else
if (!strncmp(optarg, "bytes-leaked", 1))
options.sort_by = OPT_SORT_BYTES_LEAKED;
else
@ -540,7 +544,7 @@ char **process_options(int argc, char **argv)
break;
case 'V':
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"
"This software was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.\n"
"\n"
@ -666,7 +670,7 @@ char **process_options(int argc, char **argv)
}
}
else {
if (options.sanity)
if (options.sanity && options.sort_by == -1)
options.sort_by = OPT_SORT_MISMATCHED;
}

View File

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

View File

@ -1,7 +1,6 @@
/*
* Red Black Trees
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the linux kernel source
* Copyright (C) 1999 Andrea Arcangeli <andrea@suse.de>
* Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org>
@ -400,7 +399,7 @@ int rb_iterate(const struct rb_root *root, int (*func)(struct rb_node *,void *us
do {
parent = rb_parent(node);
ret = func(node, user);
if (ret)
break;

View File

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

147
report.c
View File

@ -2,7 +2,7 @@
* report events to client
*
* 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.
*
@ -63,7 +63,7 @@ static void report_alloc64(struct task *task, enum mt_operation op, unsigned lon
if (unlikely(!alloc->data[i]))
break;
++i;
++i;
}
}
@ -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));
}
@ -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);
server_send_msg(op, task->leader->pid, alloc, sizeof(*alloc) + i * sizeof(uint32_t));
@ -115,11 +114,11 @@ static void report_alloc32(struct task *task, enum mt_operation op, unsigned lon
static void report_alloc(struct task *task, enum mt_operation op, unsigned long ptr, unsigned long size, int depth, struct library_symbol *libsym)
{
debug(DEBUG_FUNCTION, "%d [%d]: %#lx %lu", op, task->pid, ptr, size);
if (!ptr)
return;
debug(DEBUG_FUNCTION, "%d [%d]: %#lx %lu", op, task->pid, ptr, size);
if (task_is_64bit(task))
report_alloc64(task, op, ptr, size, depth, libsym);
else
@ -139,6 +138,23 @@ static void _report_malloc(struct task *task, struct library_symbol *libsym)
_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)
{
_report_alloc_op(task, libsym, options.sanity ? MT_NEW : MT_MALLOC);
@ -173,14 +189,20 @@ static void report_delete_array(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);
if (ret) {
unsigned long size = fetch_param(task, 1);
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
if (!task->in_realloc) {
if (ret)
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
return;
}
task->in_realloc = 0;
if (ret)
report_alloc(task, MT_REALLOC, ret, size, options.bt_depth, libsym);
if (task_is_64bit(task)) {
struct mt_alloc_payload_64 *alloc = alloca(sizeof(*alloc));
@ -203,7 +225,12 @@ static void report_realloc(struct task *task, struct library_symbol *libsym)
{
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)
@ -214,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);
}
static ssize_t arch_pagesize = -1;
static void _report_mmap(struct task *task, struct library_symbol *libsym)
{
unsigned long ret = fetch_retval(task);
@ -222,6 +252,11 @@ static void _report_mmap(struct task *task, struct library_symbol *libsym)
return;
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);
}
@ -242,7 +277,7 @@ static void _report_mmap64(struct task *task, struct library_symbol *libsym)
} size;
size.l = fetch_param(task, 1);
if (!task_is_64bit(task)) {
size.v.v1 = fetch_param(task, 1);
size.v.v2 = fetch_param(task, 2);
@ -250,17 +285,34 @@ static void _report_mmap64(struct task *task, struct library_symbol *libsym)
else
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);
}
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 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);
}
static void _report_memalign(struct task *task, struct library_symbol *libsym)
{
unsigned long size = fetch_param(task, 1);
@ -317,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);
}
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)
{
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);
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[] = {
@ -341,13 +393,23 @@ static const struct function flist[] = {
{ "posix_memalign", "posix_memalign", 0, NULL, _report_posix_memalign },
{ "mmap", "mmap", 0, NULL, _report_mmap },
{ "mmap64", "mmap64", 1, NULL, _report_mmap64 },
{ "munmap", "munmap", 0, report_munmap, NULL },
{ "munmap", "munmap", 0, NULL, _report_munmap },
{ "memalign", "memalign", 0, NULL, _report_memalign },
{ "aligned_alloc", "aligned_alloc", 1, NULL, _report_aligned_alloc },
{ "valloc", "valloc", 1, NULL, _report_valloc },
{ "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 },
{ "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)", "_Znaj", 1, NULL, _report_new_array },
@ -359,10 +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&)", "_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*)", "_ZdaPv", 1, report_delete_array, 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*, 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)", "_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)
@ -385,9 +469,10 @@ int _report_map(struct task *task, struct library *lib, enum mt_operation op)
size_t len = strlen(libref->filename) + 1;
struct mt_map_payload *payload = alloca(sizeof(struct mt_map_payload) + len);
payload->addr = libref->load_addr;
payload->offset = libref->load_offset;
payload->size = libref->load_size;
payload->addr = libref->txt_vaddr;
payload->offset = libref->txt_offset;
payload->size = libref->txt_size;
payload->bias = libref->bias;
memcpy(payload->filename, libref->filename, len);
@ -459,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);
}
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())
return -1;
@ -523,7 +608,7 @@ static void report_process(struct task *leader)
{
struct list_head *it;
report_attach(leader);
report_attach(leader, 1);
list_for_each(it, &leader->libraries_list) {
struct library *lib = container_of(it, struct library, list);

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -23,6 +23,8 @@
#ifndef _INC_REPORT_H
#define _INC_REPORT_H
#include <unistd.h>
#include "forward.h"
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_info(int do_trace);
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_exit(struct task *task);
int report_about_exit(struct task *task);

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -31,6 +31,7 @@
#include <sys/sysinfo.h>
#include <semaphore.h>
#include <netinet/tcp.h>
#include <sys/uio.h>
#include "backend.h"
#include "breakpoint.h"
@ -98,8 +99,7 @@ int server_poll(void)
{
int ret = 0;
if (command_pending) {
if (command_pending) {
ret = server_handle_command();
if (options.trace)
@ -241,6 +241,8 @@ static void *server_listen_thread(void *ptr)
{
int ret;
(void)ptr;
for(;;) {
if (!server_connected()) {
thread_enable_cancel();
@ -307,6 +309,8 @@ static void *server_pair_thread(void *ptr)
{
int ret;
(void)ptr;
for(;;) {
if (!server_connected())
break;
@ -389,8 +393,11 @@ int server_stop(void)
if (listen_fd != -1) {
thread_cancel(thread);
if (thread)
if (thread) {
thread_join(thread);
free(thread);
thread = NULL;
}
if (is_named(options.address))
unlink(options.address);

View File

@ -1,6 +1,6 @@
/*
* 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.
*

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.
* 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.
*
@ -47,6 +47,7 @@
int is_64bit(struct mt_elf *mte)
{
(void)(mte);
return 0;
}
@ -207,7 +208,7 @@ static int arm_get_next_pcs(struct task *task, const uint32_t pc, uint32_t next_
if (BITS(this_instr, 12, 15) != ARM_REG_PC)
break;
if (BITS(this_instr, 22, 25) == 0 && BITS(this_instr, 4, 7) == 9) /* multiply */
if (BITS(this_instr, 22, 25) == 0 && BITS(this_instr, 4, 7) == 9) /* multiply */
goto invalid;
/* BX <reg>, BLX <reg> */
@ -669,7 +670,7 @@ static int ptrace_cont(struct task *task)
return 0;
}
int do_singlestep(struct task *task)
int do_singlestep(struct task *task, struct breakpoint *bp)
{
const uint32_t pc = get_instruction_pointer(task);
uint32_t cpsr;
@ -690,7 +691,7 @@ int do_singlestep(struct task *task)
bp1 = breakpoint_find(task, next_pcs[0]);
if (!bp1) {
bp1 = breakpoint_new(task, next_pcs[0], NULL, SW_BP);
bp1 = breakpoint_new(task, next_pcs[0], NULL, BP_SW);
if (!bp1)
return -1;
}
@ -702,7 +703,7 @@ int do_singlestep(struct task *task)
if (next_pcs[1]) {
bp2 = breakpoint_find(task, next_pcs[1]);
if (!bp2) {
bp2 = breakpoint_new(task, next_pcs[1], NULL, SW_BP);
bp2 = breakpoint_new(task, next_pcs[1], NULL, BP_SW);
if (!bp2)
return -1;
}
@ -714,16 +715,13 @@ int do_singlestep(struct task *task)
else
bp2 = NULL;
ret = handle_singlestep(task, ptrace_cont);
ret = handle_singlestep(task, ptrace_cont, bp);
if (bp1)
breakpoint_disable(task, bp1);
if (bp2)
breakpoint_disable(task, bp2);
if (ret)
return ret;
return 0;
return ret;
}

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -33,7 +32,7 @@
#include "common.h"
#include "backend.h"
#include "debug.h"
#include "dwarf.h"
#include "../../../dwarf.h"
#include "library.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)
{
(void)(as);
if (reg >= ARRAY_SIZE(dwarf_to_regnum_map))
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 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);
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);
}
#else
(void)(as);
#endif
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 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;
arch_addr_t val;
@ -612,7 +614,7 @@ static int arm_frame_step(struct dwarf_addr_space *as)
ip_loc = DWARF_MEM_LOC(fp);
fp_loc = DWARF_MEM_LOC(fp - 4);
}
if (dwarf_get(as, ip_loc, &ip) < 0)
return -DWARF_EBADFRAME;
@ -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)
{
(void)(as);
(void)(ip);
return 1;
}

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -59,6 +59,11 @@ void set_instruction_pointer(struct task *task, arch_addr_t addr)
}
}
unsigned int ip_reg_addr(void)
{
return offsetof(struct pt_regs, ARM_pc);
}
arch_addr_t get_return_addr(struct task *task)
{
return ARCH_ADDR_T(task->context.regs.ARM_lr);

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -44,6 +44,7 @@
#include <pwd.h>
#include <grp.h>
#include <sys/prctl.h>
#include <sys/sysmacros.h>
#include "backend.h"
#include "breakpoint.h"
@ -59,9 +60,12 @@ struct map {
unsigned long long start;
unsigned long long end;
};
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));
#ifndef DISABLE_CLIENT
@ -70,37 +74,37 @@ static void report_fault(int signo, siginfo_t* siginf, void* arg)
void *trace[48];
char **strings;
Dl_info info;
char linkname[PATH_MAX];
char linkname[PATH_MAX];
bfd* abfd = 0;
asymbol **syms = 0;
asection *text = 0;
int l;
l = readlink("/proc/self/exe", linkname, sizeof(linkname));
if (l == -1) {
if (l == -1) {
perror("failed to find executable\n");
return;
}
}
linkname[l] = 0;
bfd_init();
abfd = bfd_openr(linkname, 0);
if (!abfd) {
perror("bfd_openr failed: ");
return;
}
/* oddly, this is required for it to work... */
bfd_check_format(abfd,bfd_object);
unsigned storage_needed = bfd_get_symtab_upper_bound(abfd);
syms = (asymbol **) malloc(storage_needed);
bfd_canonicalize_symtab(abfd, syms);
bfd_init();
abfd = bfd_openr(linkname, 0);
if (!abfd) {
perror("bfd_openr failed: ");
return;
}
/* oddly, this is required for it to work... */
bfd_check_format(abfd,bfd_object);
unsigned storage_needed = bfd_get_symtab_upper_bound(abfd);
syms = (asymbol **) malloc(storage_needed);
bfd_canonicalize_symtab(abfd, syms);
text = bfd_get_section_by_name(abfd, ".text");
nptrs = backtrace(trace, ARRAY_SIZE(trace));
strings = backtrace_symbols(trace, nptrs);
@ -147,6 +151,8 @@ skip:
static void signal_exit(int sig)
{
(void)sig;
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
@ -216,7 +222,7 @@ static struct map *get_writeable_mappings(struct task *task)
if (permw != 'w' || permr != 'r')
continue;
if (map >= maps_size - 1) {
maps_size += 16;
maps = realloc(maps, maps_size * sizeof(*maps));
@ -250,6 +256,9 @@ void *mem_scan(struct task *task, struct mt_msg *cmd, void *payload, unsigned lo
unsigned long start;
unsigned long end;
if (unlikely(options.verbose))
fprintf(stderr, "+++ scan for memory leaks...\n");
if (!n)
return NULL;
@ -315,7 +324,7 @@ finish:
return blocks;
}
void change_uid(const char *command)
void change_uid(void)
{
uid_t run_uid, run_euid;
gid_t run_gid, run_egid;
@ -348,12 +357,11 @@ void change_uid(const char *command)
run_egid = run_gid;
if (!stat(options.command, &statbuf)) {
if (statbuf.st_mode & S_ISUID) {
if (statbuf.st_mode & S_ISUID)
run_euid = statbuf.st_uid;
}
if (statbuf.st_mode & S_ISGID) {
if (statbuf.st_mode & S_ISGID)
run_egid = statbuf.st_gid;
}
}
if (setregid(run_gid, run_egid) < 0) {
perror("mtrace-ng: setregid");
@ -366,28 +374,6 @@ void change_uid(const char *command)
}
}
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)
{
struct sigaction act;

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* 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.
*
@ -25,6 +25,6 @@
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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* 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.
*
@ -74,6 +74,11 @@ void set_instruction_pointer(struct task *task, arch_addr_t addr)
}
}
unsigned int ip_reg_addr(void)
{
return sizeof(unsigned long) * PT_NIP;
}
arch_addr_t get_return_addr(struct task *task)
{
#ifdef __powerpc64__

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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;
for(;;) {
struct dirent entry;
struct dirent *result;
if (readdir_r(d, &entry, &result) != 0) {
free(tasks);
return -1;
}
errno = 0;
result = readdir(d);
if (result == NULL)
if (!result) {
if (errno)
goto fail;
break;
}
if (result->d_type == DT_DIR && all_digits(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;
ntasks = realloc(tasks, sizeof(*tasks) * alloc);
if (!ntasks) {
free(tasks);
return -1;
}
if (!ntasks)
goto fail;
tasks = ntasks;
}
tasks[n++] = npid;
@ -198,6 +196,14 @@ int process_tasks(pid_t pid, pid_t ** ret_tasks, size_t *ret_n)
*ret_n = n;
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
@ -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);
}
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;
}
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)
{
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? */
lib = library_find_with_key(&task->libraries_list, ARCH_ADDR_T(rlm.l_addr));
lib = library_find_by_dyn(&task->libraries_list, ARCH_ADDR_T(rlm.l_ld));
if (lib)
continue;
@ -426,8 +420,6 @@ static void linkmap_add(struct task *task, struct lt_r_debug_64 *dbg)
continue;
}
libref->key = ARCH_ADDR_T(rlm.l_addr);
library_add(task, libref);
}
@ -464,7 +456,7 @@ static void linkmap_del(struct task *task, struct lt_r_debug_64 *dbg)
addr = ARCH_ADDR_T(rlm.l_next);
lib = library_find_with_key(&tmp_list, ARCH_ADDR_T(rlm.l_addr));
lib = library_find_by_dyn(&tmp_list, ARCH_ADDR_T(rlm.l_ld));
if (lib)
list_move_tail(&lib->list, &task->libraries_list);
}
@ -475,7 +467,6 @@ static void linkmap_del(struct task *task, struct lt_r_debug_64 *dbg)
}
static int load_debug_struct(struct task *task, arch_addr_t debug_addr, struct lt_r_debug_64 *ret)
{
debug(DEBUG_FUNCTION, "pid=%d", task->pid);
@ -492,6 +483,8 @@ static int rdebug_bp_on_hit(struct task *task, struct breakpoint *bp)
struct lt_r_debug_64 rdbg;
struct task *leader = task->leader;
(void)bp;
debug(DEBUG_FUNCTION, "pid=%d", task->pid);
if (load_debug_struct(task, leader->os.debug_addr, &rdbg) < 0)
@ -561,7 +554,7 @@ int process_get_entry(struct task *task, unsigned long *entryp, unsigned long *i
{
PROC_PID_FILE(fn, "/proc/%d/auxv", task->pid);
int fd, ret;
fd = open(fn, O_RDONLY);
if (fd == -1)
goto fail;
@ -570,8 +563,9 @@ int process_get_entry(struct task *task, unsigned long *entryp, unsigned long *i
GElf_Addr at_bias = 0;
while (1) {
Elf64_auxv_t entry = { };
if (auxv_fetcher(task)(fd, &entry) < 0)
Elf_auxv_t entry = { };
if (fetch_auxv_entry(fd, &entry) < 0)
goto fail;
if (entry.a_type == AT_NULL)
@ -584,8 +578,6 @@ int process_get_entry(struct task *task, unsigned long *entryp, unsigned long *i
case AT_ENTRY:
at_entry = entry.a_un.a_val;
break;
case AT_NULL:
break;
default:
break;
}
@ -618,6 +610,7 @@ int os_task_init(struct task *task)
void os_task_destroy(struct task *task)
{
(void)task;
}
int os_task_clone(struct task *retp, struct task *task)

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -106,7 +106,7 @@ int sock_send_msg(int fd, enum mt_operation op, uint32_t pid, const void *payloa
}
ret = TEMP_FAILURE_RETRY(sendmsg(fd, &msghdr, MSG_NOSIGNAL));
if ((size_t)ret != sizeof(mt_msg) + payload_len)
return -1;

View File

@ -1,6 +1,6 @@
/*
* 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.
*

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
*
* 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.
*

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -39,10 +39,6 @@
#include <sys/prctl.h>
#include <sys/uio.h>
#ifdef HAVE_LIBSELINUX
#include <selinux/selinux.h>
#endif
#include "backend.h"
#include "breakpoint.h"
#include "debug.h"
@ -56,34 +52,48 @@
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
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;
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)
{
int stop_signal;
task->traced = 1;
task->stopped = 1;
task->leader->threads_stopped++;
task->event.type = EVENT_SIGNAL;
task->event.e_un.signum = 0;
int sig;
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;
}
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) {
task->event.e_un.signum = stop_signal;
sig = WSTOPSIG(status);
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;
}
@ -94,10 +104,8 @@ static int _trace_wait(struct task *task, int signum)
{
int status;
if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) {
fprintf(stderr, "%s pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
if (unlikely(wait_task(task, &status) == -1))
return -1;
}
if (WIFEXITED(status))
return -1;
@ -107,35 +115,35 @@ static int _trace_wait(struct task *task, int signum)
int trace_wait(struct task *task)
{
assert(task->attached == 0);
if (_trace_wait(task, SIGTRAP))
return -1;
queue_event(task);
return 0;
}
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_EVENT, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
return -1;
}
debug(DEBUG_TRACE, "child event %d pid=%d, newpid=%d", ev, task->pid, task->event.e_un.newpid);
if (unlikely(ptrace(PTRACE_GETEVENTMSG, task->pid, NULL, &data) == -1))
debug(DEBUG_TRACE, "PTRACE_GETEVENTMSG pid=%d %s", task->pid, strerror(errno));
int pid = data;
if (!pid)
return -1;
if (!pid2task(pid)) {
struct task *child = task_new(pid);
if (unlikely(!child))
return -1;
if (_trace_wait(child, SIGSTOP)) {
remove_task(child);
return -1;
}
child->attached = 1;
}
task->event.e_un.newpid = pid;
@ -146,108 +154,142 @@ static int child_event(struct task *task, enum event_type ev)
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)) {
debug(DEBUG_TRACE, "EXIT_SIGNAL: pid=%d, signum=%d", task->pid, task->event.e_un.signum);
task->event.type = EVENT_EXIT_SIGNAL;
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;
}
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.e_un.ret_val = WEXITSTATUS(status);
debug(DEBUG_EVENT, "EXIT: pid=%d, status=%d", task->pid, task->event.e_un.ret_val);
return 0;
}
if (!WIFSTOPPED(status)) {
/* should never happen */
debug(DEBUG_EVENT, "NONE: pid=%d ???", task->pid);
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: not WIFSTOPPED pid=%d\n", __func__, task->pid);
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) {
case 0:
break;
case PTRACE_EVENT_VFORK:
if (child_event(task, EVENT_VFORK))
return -1;
debug(DEBUG_EVENT, "VFORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
debug(DEBUG_TRACE, "VFORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return child_event(task, EVENT_VFORK);
case PTRACE_EVENT_FORK:
if (child_event(task, EVENT_FORK))
return -1;
debug(DEBUG_EVENT, "FORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
debug(DEBUG_TRACE, "FORK: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return child_event(task, EVENT_FORK);
case PTRACE_EVENT_CLONE:
if (child_event(task, EVENT_CLONE))
return -1;
debug(DEBUG_EVENT, "CLONE: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return 0;
debug(DEBUG_TRACE, "CLONE: pid=%d, newpid=%d", task->pid, task->event.e_un.newpid);
return child_event(task, EVENT_CLONE);
case PTRACE_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;
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.type = EVENT_ABOUT_EXIT;
debug(DEBUG_EVENT, "ABOUT_EXIT: pid=%d", task->pid);
return 0;
}
default:
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: PTRACE_EVENT_????? pid=%d %d\n", __func__, task->pid, status >> 16);
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.e_un.signum = stop_signal;
task->event.e_un.signum = sig;
debug(DEBUG_EVENT, "SIGNAL: pid=%d, signum=%d", task->pid, stop_signal);
return stop_signal;
debug(DEBUG_TRACE, "SIGNAL: pid=%d, signum=%d", task->pid, sig);
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 breakpoint *bp = NULL;
arch_addr_t ip;
int sig;
assert(task->stopped == 0);
assert(leader != NULL);
if (unlikely(options.verbose > 1))
start_time(&task->halt_time);
task->stopped = 1;
leader->threads_stopped++;
stop_signal = _process_event(task, status);
if (stop_signal == -1) {
task->event.type = EVENT_NONE;
sig = _process_event(task, status);
if (sig < 0) {
continue_task(task, 0);
return;
return NULL;
}
if (stop_signal == 0)
return;
if (task->event.type == EVENT_NONE) {
continue_task(task, task->event.e_un.signum);
return NULL;
}
if (unlikely(stop_signal != SIGTRAP))
return;
if (unlikely(sig != SIGTRAP))
return task;
if (unlikely(fetch_context(task) == -1)) {
task->event.type = EVENT_NONE;
continue_task(task, 0);
return;
return NULL;
}
ip = get_instruction_pointer(task);
@ -259,7 +301,6 @@ static void process_event(struct task *task, int status)
if (task->hw_bp[i] && task->hw_bp[i]->addr == ip) {
if (likely(get_hw_bp_state(task, i)))
bp = task->hw_bp[i];
break;
}
}
@ -273,9 +314,9 @@ static void process_event(struct task *task, int status)
{
bp = breakpoint_find(leader, ip - DECR_PC_AFTER_BREAK);
if (unlikely(!bp)) {
task->event.type = EVENT_NONE;
continue_task(task, 0);
return;
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: SIGTRAP pid=%d\n", __func__, task->pid);
return task;
}
#if HW_BREAKPOINTS > 0
assert(bp->type != BP_HW_SCRATCH);
@ -293,30 +334,14 @@ static void process_event(struct task *task, int status)
task->event.type = EVENT_BREAKPOINT;
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;
}
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
return task;
}
void trace_me(void)
{
debug(DEBUG_PROCESS, "pid=%d", getpid());
debug(DEBUG_TRACE, "pid=%d", getpid());
prctl(PR_SET_PDEATHSIG, SIGKILL);
@ -326,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) {
task->was_stopped = 0;
signum = 0;
if (unlikely(options.verbose)) {
if (signum == SIGSTOP)
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;
}
int untrace_task(struct task *task, int signum)
int untrace_task(struct task *task)
{
int ret = 0;
int sig = 0;
assert(task->leader != NULL);
debug(DEBUG_PROCESS, "pid=%d", task->pid);
if (!task->stopped)
return 0;
assert(task->stopped);
if (unlikely(ptrace(PTRACE_SETOPTIONS, task->pid, 0, (void *)0) == -1)) {
if (errno != ESRCH)
fprintf(stderr, "PTRACE_SETOPTIONS pid=%d %s\n", task->pid, strerror(errno));
ret = -1;
goto skip;
return -1;
}
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 (task->traced) {
if (errno != ESRCH)
fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno));
ret = -1;
goto skip;
}
if (unlikely(ptrace(PTRACE_DETACH, task->pid, 0, sig) == -1)) {
if (errno != ESRCH)
fprintf(stderr, "PTRACE_DETACH pid=%d %s\n", task->pid, strerror(errno));
return -1;
}
task_kill(task, SIGCONT);
skip:
task->leader->threads_stopped--;
task->stopped = 0;
task->was_stopped = 0;
task->traced = 0;
// task_kill(task, SIGCONT);
return 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)
{
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 (errno != ESRCH)
fprintf(stderr, "PTRACE_ATTACH pid=%d %s\n", task->pid, strerror(errno));
trace_fail_warning();
return -1;
}
if (_trace_wait(task, SIGSTOP))
return -1;
queue_event(task);
return 0;
}
@ -399,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;
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 (errno != ESRCH)
@ -411,15 +437,22 @@ int trace_set_options(struct task *task)
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->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->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)
fprintf(stderr, "PTRACE_CONT pid=%d %s\n", task->pid, strerror(errno));
return -1;
@ -429,10 +462,12 @@ int continue_task(struct task *task, int signum)
static void do_stop_cb(struct task *task, void *data)
{
(void)data;
if (task->stopped)
return;
task->was_stopped = 1;
debug(DEBUG_TRACE, "task stop pid=%d", task->pid);
task_kill(task, SIGSTOP);
}
@ -443,6 +478,8 @@ void stop_threads(struct task *task)
assert(task->leader != NULL);
debug(DEBUG_TRACE, "stop threads pid=%d", task->pid);
if (leader->threads != leader->threads_stopped) {
struct timespec start;
@ -451,62 +488,87 @@ void stop_threads(struct task *task)
each_task(leader, &do_stop_cb, NULL);
while (leader->threads != leader->threads_stopped)
queue_event(wait_event());
while(leader->threads != leader->threads_stopped) {
assert(leader->threads > leader->threads_stopped);
task = wait_event();
if (task)
queue_event(task);
}
if (unlikely(options.verbose > 1))
set_timer(&start, &stop_time);
}
}
int handle_singlestep(struct task *task, int (*singlestep)(struct task *task))
int handle_singlestep(struct task *task, int (*singlestep)(struct task *task), struct breakpoint *bp)
{
int status;
int stop_signal;
int sig;
for(;;) {
if (unlikely(singlestep(task) == -1))
return -1;
assert(task->stopped);
assert(task->skip_bp == NULL);
assert(bp->enabled == 0);
if (unlikely(TEMP_FAILURE_RETRY(waitpid(task->pid, &status, __WALL)) != task->pid)) {
fprintf(stderr, "%s waitpid pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
return -1;
}
task->event.type = EVENT_NONE;
stop_signal = _process_event(task, status);
if (stop_signal == -1)
return -1;
if (likely(stop_signal == SIGTRAP))
return 0; /* check if was a real breakpoint code there */
if (likely(!stop_signal)) {
queue_event(task);
return 0;
}
if (fix_signal(task, stop_signal) > 0) {
queue_event(task);
return 1;
}
if (unlikely(singlestep(task) == -1)) {
if (unlikely(options.verbose))
fprintf(stderr, "!!!%s: single step failed pid=%d\n", __func__, task->pid);
return -1;
}
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
static int ptrace_singlestep(struct task *task)
{
if (unlikely(ptrace(PTRACE_SINGLESTEP, task->pid, 0, 0) == -1)) {
if (errno != ESRCH)
fprintf(stderr, "%s PTRACE_SINGLESTEP pid=%d %s\n", __FUNCTION__, task->pid, strerror(errno));
if (unlikely(options.verbose && errno != ESRCH))
fprintf(stderr, "!!!%s: PTRACE_SINGLESTEP pid=%d %s\n", __func__, task->pid, strerror(errno));
return -1;
}
return 0;
}
int do_singlestep(struct task *task)
int do_singlestep(struct task *task, struct breakpoint *bp)
{
return handle_singlestep(task, ptrace_singlestep);
return handle_singlestep(task, ptrace_singlestep, bp);
}
#endif
@ -515,15 +577,11 @@ struct task *wait_event(void)
struct task *task;
int status;
int pid;
pid = waitpid(-1, &status, __WALL);
pid = wait_task(NULL, &status);
if (unlikely(pid == -1)) {
if (errno != EINTR) {
if (errno == ECHILD)
debug(DEBUG_EVENT, "No more traced programs");
else
fprintf(stderr, "%s waitpid %s\n", __FUNCTION__, strerror(errno));
}
if (errno == ECHILD)
debug(DEBUG_TRACE, "No more traced programs");
return NULL;
}
@ -543,12 +601,50 @@ struct task *wait_event(void)
if (likely(task))
trace_setup(task, status, SIGSTOP);
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;
}
@ -603,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 != 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;
}
@ -740,10 +837,10 @@ ssize_t copy_str_from_proc(struct task *task, arch_addr_t addr, char *dst, size_
errno = 0;
if (--len < 0)
if (!len--)
return -1;
while (len) {
while(len) {
a.a = ptrace(PTRACE_PEEKTEXT, task->pid, addr, 0);
if (unlikely(a.a == -1 && errno)) {
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.
* 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.
*
@ -106,17 +106,17 @@ static int set_breakpoint_mode(struct task *task, unsigned int n, int type, int
uint32_t mode;
uint32_t dr7, mask;
mask = (0b1111 << (16 + 4 * n)) | (0b11 << (2 * n));
mask = (0b1111U << (16 + 4 * n)) | (0b11U << (2 * n));
switch(type) {
case BP_X:
mode = 0b0000;
mode = 0b0000U;
break;
case BP_W:
mode = 0b0001;
mode = 0b0001U;
break;
case BP_RW:
mode = 0b0011;
mode = 0b0011U;
break;
default:
fprintf(stderr, "invalid hw breakpoint type\n");
@ -125,37 +125,37 @@ static int set_breakpoint_mode(struct task *task, unsigned int n, int type, int
switch(len) {
case 1:
mode |= 0b0000;
mode |= 0b0000U;
break;
case 2:
mode |= 0b0100;
mode |= 0b0100U;
break;
case 4:
mode |= 0b1100;
mode |= 0b1100U;
break;
case 8:
mode |= 0b1000;
mode |= 0b1000U;
break;
}
dr7 = task->arch.dr7 & ~mask;
dr7 |= mode << (16 + 4 * n);
if (local) {
dr7 |= 0b01 << (2 * n);
dr7 |= 0b01U << (2 * n);
dr7 |= 1 << 8;
}
else
if (!(dr7 & 0b01010101))
if (!(dr7 & 0b01010101U))
dr7 &= ~(1 << 8);
if (global) {
dr7 |= 0b10 << (2 * n);
dr7 |= 0b10U << (2 * n);
dr7 |= 1 << 9;
}
else
if (!(dr7 & 0b10101010))
if (!(dr7 & 0b10101010U))
dr7 &= ~(1 << 9);
return apply_hw_bp(task, dr7);
@ -183,14 +183,14 @@ int reset_hw_bp(struct task *task, unsigned int n)
{
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;
if (!(dr7 & 0b01010101))
if (!(dr7 & 0b01010101U))
dr7 &= ~(1 << 8);
if (!(dr7 & 0b10101010))
if (!(dr7 & 0b10101010U))
dr7 &= ~(1 << 9);
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)
{
return mte->ehdr.e_machine != EM_386;
return !mte_cmp_machine(mte, EM_386);
}
int arch_task_init(struct task *task)
{
unsigned int i;
for(i = 0; i < HW_BREAKPOINTS; ++i)
for(i = 0; i != HW_BREAKPOINTS; ++i)
task->arch.hw_bp[i] = 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)
{
(void)retp;
(void)task;
return 0;
}

View File

@ -1,7 +1,6 @@
/*
* This file is part of mtrace-ng.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* 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.
* Copyright (C) 2015 Stefani Seibold <stefani@seibold.net>
* This file is based on the ltrace source
* Copyright (C) 2018 Stefani Seibold <stefani@seibold.net>
*
* This work was sponsored by Rohde & Schwarz GmbH & Co. KG, Munich/Germany.
*
@ -30,7 +29,7 @@
#include "common.h"
#include "backend.h"
#include "debug.h"
#include "dwarf.h"
#include "../../../dwarf.h"
#include "library.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)
{
(void)as;
#if 0
struct dwarf_cursor *c = &as->cursor;
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;
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 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]))
break;
}

View File

@ -1,6 +1,6 @@
/*
* 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.
*
@ -91,12 +91,21 @@ void set_instruction_pointer(struct task *task, arch_addr_t addr)
fprintf(stderr, "pid=%d Couldn't set instruction pointer: %s\n", task->pid, strerror(errno));
}
unsigned int ip_reg_addr(void)
{
#ifdef __x86_64__
return sizeof(unsigned long) * RIP;
#else
return sizeof(unsigned long) * EIP;
#endif
}
arch_addr_t get_return_addr(struct task *task)
{
long a;
errno = 0;
a = ptrace(PTRACE_PEEKTEXT, task->pid, get_stack_pointer(task), 0);
if (a == -1 && errno) {
if (errno != ESRCH)

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