Stefani Seibold e3652d8901 fix attach for 64 bit processes
init the backtrace for the cloned threads after the leader is
initialized
2015-04-29 15:58:53 +02:00
autom4te.cache initial commit 2015-04-20 09:08:14 +02:00
client the way to the first working release 2015-04-28 13:17:17 +02:00
config initial commit 2015-04-20 09:08:14 +02:00
sysdeps fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
.gitignore features and fixes 2015-04-27 10:58:08 +02:00
aclocal.m4 initial commit 2015-04-20 09:08:14 +02:00
backend.h the way to the first working release 2015-04-28 13:17:17 +02:00
backtrace.h initial commit 2015-04-20 09:08:14 +02:00
bootstrap initial commit 2015-04-20 09:08:14 +02:00
breakpoint.c the way to the first working release 2015-04-28 13:17:17 +02:00
breakpoint.h the way to the first working release 2015-04-28 13:17:17 +02:00
common.c initial commit 2015-04-20 09:08:14 +02:00
common.h initial commit 2015-04-20 09:08:14 +02:00
config.h.in initial commit 2015-04-20 09:08:14 +02:00
configure initial commit 2015-04-20 09:08:14 +02:00
configure.ac initial commit 2015-04-20 09:08:14 +02:00
COPYING initial commit 2015-04-20 09:08:14 +02:00
CREDITS initial commit 2015-04-20 09:08:14 +02:00
debug.c initial commit 2015-04-20 09:08:14 +02:00
debug.h initial commit 2015-04-20 09:08:14 +02:00
dict.c initial commit 2015-04-20 09:08:14 +02:00
dict.h initial commit 2015-04-20 09:08:14 +02:00
dwarf.c fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
dwarf.h fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
event.c fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
event.h fixes 2015-04-26 16:08:45 +02:00
forward.h initial commit 2015-04-20 09:08:14 +02:00
INSTALL initial commit 2015-04-20 09:08:14 +02:00
library.c initial commit 2015-04-20 09:08:14 +02:00
library.h initial commit 2015-04-20 09:08:14 +02:00
list.h initial commit 2015-04-20 09:08:14 +02:00
main.c initial commit 2015-04-20 09:08:14 +02:00
main.h initial commit 2015-04-20 09:08:14 +02:00
Makefile.am initial commit 2015-04-20 09:08:14 +02:00
Makefile.in initial commit 2015-04-20 09:08:14 +02:00
memtrace.h fixes 2015-04-26 16:08:45 +02:00
mtelf.c fixes 2015-04-26 16:08:45 +02:00
mtelf.h initial commit 2015-04-20 09:08:14 +02:00
mtrace.h initial commit 2015-04-20 09:08:14 +02:00
NEWS initial commit 2015-04-20 09:08:14 +02:00
options.c the way to the first working release 2015-04-28 13:17:17 +02:00
options.h the way to the first working release 2015-04-28 13:17:17 +02:00
rbtree.c initial commit 2015-04-20 09:08:14 +02:00
rbtree.h initial commit 2015-04-20 09:08:14 +02:00
README fixes 2015-04-26 16:08:45 +02:00
README.md initial commit 2015-04-20 09:08:14 +02:00
report.c fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
report.h fixes 2015-04-26 16:08:45 +02:00
server.c initial commit 2015-04-20 09:08:14 +02:00
server.h initial commit 2015-04-20 09:08:14 +02:00
task.c fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
task.h fix attach for 64 bit processes 2015-04-29 15:58:53 +02:00
thread.h initial commit 2015-04-20 09:08:14 +02:00
TODO features and fixes 2015-04-27 10:58:08 +02:00
trace.c fixes 2015-04-26 16:08:45 +02:00
trace.h initial commit 2015-04-20 09:08:14 +02:00

mtrace is an interactive dynamic memory tracer/debugger for C and C++ using GLIBC, which intercepts and reports all kinds of dynamic memory allocations using a preloaded library.

It supports the developer to get statistics about the memory usage and finding memory leaks in an arbitrate application. There is no need of modification of the source code nor any recompilation.

Unlike other dynamic memory tracer, mtrace is able to find no longer referenced memory allocation by scanning all writable memory mappings of the program against the addresses of the allocation. If the memory address will be not found during a scan there is a high change for a missing reference and therefore for a memory leak.

The mtrace utility was designed to run in a very constrained environment, like small embedded systems. This is one of the reasons for a client/server architecture. The server runs on the target side and the interactive client runs on the host side, the communication is done via TCP. If server and client are on the same machine then the communication can be done via UNIX Domain Socket. Both sides can run on different architectures, address sizes and endianness, but for tracing 64 bit programs the client must be compiled as a 64 bit program. On the host side all binaries (including debug information) must be accessible, there is no need for debug information on the target side.

The mtrace utility intercepts the following GLIBC calls:

malloc()
memalign()
realloc()
free()
posix_memalign()
aligned_alloc()
valloc()
pvalloc()
mmap()
munmap()
clone()
system()
execve()
exit()

The operator new() method is using malloc(), so memory allocations of a C++ application can also be traced.

There is currently support for X86 (32 udn 64 Bit), PowerPC (32 Bit) and ARM (32 Bit). Only Linux is now supported, but there are plans to support different operating systems and CPU's.

Stay tuned...