summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-08-22Improve HFA-related test casesPetr Machata5-392/+474
- Moved a bunch of preexisting HFA tests to a separate test case (and converted them to new style in the process). Added another bunch of HFA tests.
2014-08-22Manpage and --help clarificationsPetr Machata2-6/+9
2014-08-22Don't crash untraced calls via PLT in prelinked PPC64 binariesPetr Machata2-21/+94
In prelinked binaries, ltrace has to unprelinks PLT slots in order to catch calls done through PLT. This makes the calls done through these slots invalid, because the special first PLT slot is not initialized, and dynamic linker SIGSEGVs because of this. Ltrace relies on arranging breakpoints such that the dynamic linker is not actually entered, and moves PC around itself to simulate the effects of a call through PLT. Originally, arch_elf_add_plt_entry was called only for symbols that were actually traced. Later this was changed and it's now called for all PLT entries, and the resulting candidate list is filtered afterwards. This gives backends a chance to rename the symbol, as is useful with IRELATIVE PLT calls, where symbol name may not be available at all. But the PPC backend was never updated to reflect this, and unresolved all symbols for which arch_elf_add_plt_entry was called, thus rendering _all_ PLT slots invalid, even those that weren't later procted by breakpoints. Thus calls done through any untraced slots failed. This patch fixes this problem by deferring the unprelinking of PLT slots into the on_install hook of breakpoints.
2014-08-22Add a new per-breakpoint callback on_installPetr Machata2-2/+18
2014-08-22Drop unused function enable_all_breakpointsPetr Machata2-22/+0
2014-08-22Type umovebytes properlyPetr Machata2-5/+6
2014-08-22Initialize libsym early in trace.c to help the compiler.Mark Wielaard1-2/+2
GCC 4.4.7 isn't smart enough to realize own_libsym will always be zero when it sees the goto done which might jump over the initialization of libsym. And so will produce a warning like: cc1: warnings being treated as errors trace.c: In function ‘ifunc_ret_hit’: trace.c:1433: error: ‘libsym’ may be used uninitialized in this function
2014-08-22Add support for using elfutils as unwinder.Mark Wielaard10-12/+229
This adds support for using elfutils as unwinder with -w. Since elfutils 0.158 elfutils contains a simple unwinder interface that matches nicely on the ltrace backtrace support. The code reuses the libunwind infrastructure already in ltrace where possible (by defining HAVE_UNWINDER which is 1 if either libunwind or elfutils is used). It also reuses the ltrace proc_add_library callback to keep track of the ELF files mapped for the unwinder. The current implementation matches the output as if libunwind was used. But elfutils can also provide some more information since it can lookup the DWARF debuginfo. So if the source info of an address can be found through elfutils the backtrace will also include this as an additional output line per frame.
2014-08-22Type proc_each_breakpoint properlyPetr Machata2-9/+10
2014-08-22Fix a problem in tracing across fork on PPC64Petr Machata1-1/+13
In order to avoid single-stepping through large portions of the dynamic linker, ltrace remembers at which address the instruction that resolved a PLT slot is. It then puts a breakpoint to this address so that it can fast-forward to that address next time it needs to catch a PLT slot being resolved. When a process is cloned, the pointer to this breakpoint is simply copied over to the new process, instead of being looked up in the new process structures. This patches fixes this.
2014-08-22minor fixes in manpagesJuan Cespedes2-4/+5
2014-08-22NitsPetr Machata2-13/+19
- Fix some coding style issues in output.c - Add a couple items to TODO
2014-08-22Fix infinite loop in stack unwindLuca Clementi1-3/+7
This bug was introduced in af452c6 Reported-by: Petr Machata <pmachata@redhat.com>
2014-08-22Minor fixes in manpagesJuan Cespedes2-10/+10
2014-08-22check return value of unw_get_reg and unw_get_proc_nameLuca Clementi3-9/+13
Before printng the current procedure name and IP verify their validity
2014-08-22Drop debian/ directoryJuan Cespedes5-738/+0
Every distribution should create its own specific files
2014-08-22Support IRELATIVE relocations on s390Petr Machata2-0/+24
2014-08-22On s390{,x}, r2 is scrambled after syscall entryPetr Machata1-5/+12
This was caught by system_call_params.exp test case: exe->mount("source", "target", "filesystemtype", 0, nil <unfinished ...> mount@SYS("", "target", "filesystemtype", 0, nil) = -2 <... mount resumed> = -1 Note how the first parameter disappears--r2 now holds syscall number (21 in this case), and the original value is stored in orig_gpr2 in save area.
2014-08-22On x86{,_64}, PLT entries may not be ordered by their relocationPetr Machata2-1/+111
- In general they are. But IRELATIVE relocations are sorted to come last, and PLT entries are not sorted accordingly.
2014-08-22Consider exec and exit events an end of outstanding callsPetr Machata12-183/+299
- This cleans up a lot of stuff. The actual substance is addition of account_current_callstack in handle_event.c (which however uses those cleaned-up interfaces). - trace-exec.exp was extended to check that the exec syscall can be seen in -c output. That's one of the symptoms of what this fixes. - This hides dict_opt_c in summary.c. It also gets rid of the global variable current_time_spent--instead, the information is passed via a function argument in a struct timedelta (so that we never confuse absolute time with relative). callstack_element.time_spent was renamed to .enter_time, as that is what it has always been.
2014-08-22Update NEWSPetr Machata1-1/+11
2014-08-22Add a test case for wide character functionsPetr Machata2-1/+215
2014-08-22Update NEWSPetr Machata1-2/+6
2014-08-22In read_config_file.c, clone type info when unsharing itPetr Machata1-3/+3
2014-08-22CleanupsPetr Machata3-2/+4
2014-08-22Add many wide cheracter functions to libc.so.confPetr Machata1-5/+77
2014-08-22Use wcwidth to exactly determine how much space a character tookPetr Machata1-5/+12
- So far we assumed it's one character worth of screen real-estaty per character written, but combining and wide characters can change this.
2014-08-22Add fdopen prototype to libc.so.confPetr Machata1-0/+1
2014-08-22When a typedef X_t is requested, don't match lens named X insteadPetr Machata1-1/+2
2014-08-22Add error message if ltelf_init fails to open ELFPetr Machata1-1/+4
2014-08-22In ltrace_init, don't call ltelf_destroy if ltelf_init failsPetr Machata1-3/+7
2014-08-22Support wide character stringsPetr Machata6-57/+185
- "string" lens and "format" pack were extended such that using an integer as underlying array type denotes a wide character string. - several prototypes from wchar.h were added to libc.so.conf. - ltrace.conf.5 was updated
2014-08-22Add a TODO itemPetr Machata1-0/+3
2014-08-22Support pre-8.5 TCL's by providing our own lreverse in ltrace.expPetr Machata1-0/+12
2014-08-22Replace a chain of stpcpy's with a sprintfPetr Machata1-2/+1
- That's clearer and doesn't require _POSIX_SOURCE defines (that are missing anyway)
2014-08-22Plug a leakPetr Machata1-0/+1
2014-08-22Plug a leakPetr Machata1-1/+9
2014-08-22Fix use-after-freePetr Machata1-2/+2
2014-08-22Fix compilation on ARMPetr Machata2-1/+17
- This was broken several commits back by removing pltrel from struct ltelf.
2014-08-22In ARM backend, move hooks for ltrace_elf and library to plt.cPetr Machata2-190/+192
- That's the customary location for backend hooks.
2014-08-22Move load_dynamic_entry from PPC backend to ltrace-elf.c/.hPetr Machata3-38/+43
2014-08-22Add trace-irelative.exp to Makefile.amPetr Machata1-26/+12
2014-08-22Update TODOPetr Machata1-1/+2
2014-08-22Imported Upstream version 0.7.91upstream/0.7.91upstreamChanho Park174-52250/+10305
2013-01-15Imported Upstream version 0.7.2upstream/0.7.2Anas Nashif303-7086/+76470
2012-11-13Imported Upstream version 0.5.3upstream/0.5.3Anas Nashif196-0/+19692