aboutsummaryrefslogtreecommitdiff
path: root/handle_event.c
AgeCommit message (Collapse)Author
2013-11-21Consider exec and exit events an end of outstanding callsPetr Machata
- 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.
2013-10-30If breakpoint_get_return_bp yields NULL breakpoint, don't try to add itPetr Machata
2013-10-23Look up protolibs whose name partially matches the loaded DSOPetr Machata
- The intention here is to allow matches of libc.so.conf for libc.so.6. Typically different sonames imply different binary interfaces, but for libc, we know that most interfaces won't change.
2013-10-23Call breakpoint_on_hit for return breakpoints as wellPetr Machata
- This was always supposed to happen, but did not by omission.
2013-10-23Split part of delete_breakpoint into delete_breakpoint_atPetr Machata
2013-10-23Introduce breakpoint_get_return_bpPetr Machata
- This should be used for per-breakpoint customization of how return breakpoints are constructed. Hopefully it will be possible to use this to implement the address mangling that the ARM backed currently has to do.
2013-10-23System calls are now part of dedicated symbol libraryPetr Machata
- This symbol library is still special in that symbols are created on demand and never actually added. It just serves as a link to protolibrary with system call prototypes, and has a name (SYS). - Prototypes for system calls were moved to a dedicated prototype library called syscalls.conf. - Because it's undesirable to look up syscall prototypes in anything but the dedicated syscall protolib, prototype.c/.h now understand that some lookups shouldn't be done recursively (and so we never pick the definition from -F file that just happens to have the same name as a system call). The good thing is that now libraries can actually use symbols named SYS_something without clashing with system call prototypes. - One test case needed to be updated, because we now display system calls as something@SYS instead of SYS_something.
2013-10-11Rename insert_breakpoint to insert_breakpoint_atPetr Machata
2013-03-12Drop return_addr from struct processPetr Machata
- The only interesting use seems to be in output.c, but there we assume we are working with top-of-callstack anyway, and store fetch context there, so we can simply fetch the return address this way as well.
2013-03-12Fix tracing Thumb mode on ARMPetr Machata
- Drop what amounts to global variable thumb_mode from struct process - Thumb mode is encoded to address. That means that the code in callstack_push_symfunc and insert_breakpoint has to assume that what comes from get_return_address is mangled, and needs to go through creating the breakpoint and then looking at its address. That's awkward, and we should come up with a better API.
2013-03-08Rewrite pending_new_removePetr Machata
- This is hopefully more idiomatic. It also doesn't suffer of use-after-free as the old version did.
2013-03-08Convert two if-aborts to assertsPetr Machata
- The previous conditions also used the wrong operator. - While there, fix a number of typos in variable names.
2013-03-08Put asserts to branches of handle_event switch where this ought to holdPetr Machata
2013-03-08Fix tracing for cases of failures in process_clonePetr Machata
There is some bookkeeping that needs to be done even when we won't be able to trace the cloned process.
2013-01-30Introduce continue_after_execPetr Machata
This needs to be handled differently on non-Linux platforms.
2012-12-17struct Process becomes struct processPetr Machata
This is for consistency with other structures, and ultimately with Linux coding style. The typedef ("Process") was dropped as well for this reason. This opportunity was used to fix coding style around the impacted lines.
2012-12-10Don't rely on availability of strsignalPetr Machata
2012-10-26Move stack entry cleanup to callstack_popPetr Machata
At the same time publish that function. Eventually the whole push/pop logic should be moved to a separate module.
2012-09-27mipsel: Update breakpoints when functions returnEdgar E. Iglesias
When functions return we check if the symbol went from unresolved to resolved and if the resolved address differs from the unresolved one. If so, we add a new breakpoint at the resolved address. This is not thread-safe. Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
2012-09-13reported time in system call was too largePaul Buerger
when -S and -T are specified and if the system call spans a second boundary, the reported time in the system call was too large by precisely 2 seconds Signed-off-by: Paul Buerger <pbuerger@avetec.org>
2012-09-03breakpoints.c: handle_event.c: Fix compilation on MIPSSedat Dilek
From my conversation with Petr Machata: >>> [ breakpoints.c ] >>> >>> MIPS arch has no own "breakpoints.c". >>> IIRC sth, was wrong with "list_of_symbols" in >>> enable_all_breakpoints()... "Process" has no member "list_of_symbols", >>> so cut off the mips-ifdef part. >>> Just testing compiles or not. >> >> Cutting this actually seems reasonable. There was a similar ifdef for >> PPC, and that is now gone as well (and PPC works fine). I believe >> ltrace now handles delaying breakpoint enablement. >> >>> [ handle_event.c ] >>> >>> Same as for breakpoints.c cut off the mips-ifdef, seen >>> "list_of_symbols" errors in handle_breakpoint(). >> >> Hmm, that seems like an implementation of the delayed start. I think >> this can be removed as well, with the same rationale as above. These two should probably be in a patch by themselves. Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
2012-09-03handle_event.c: Fix error pred uninitialized in pending_new_remove()Sedat Dilek
Petr Machata says to me: > Fix "pred" uninitialized in pending_new_remove(). That should go into a separate patch. It's a good catch, but conceptually has nothing to do with cleaning up MIPS. Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
2012-08-29Fix memory errorsPetr Machata
2012-08-29Pass proper TOF value to backend fetch_return_valuePetr Machata
2012-08-29Fix compilationPetr Machata
2012-08-29Fix stack underrun that broke tracing on PPC64Petr Machata
Rich parameter formatting is still very broken, but now at least we pass most test cases.
2012-08-29Add backend.h for backend interfacesPetr Machata
2012-08-29Add fetch.c/fetch.h, a module for fetching function argumentsPetr Machata
- this is now a thin wrapper over gimme_arg, ideally the backends will eventually use this right interface - in display_args.c, strip one layer of pointer wrapping, which is now done in output.c
2012-08-29Add expr.c, expr.h, plug in properlyPetr Machata
- in callstack_pop, we don't free arch_ptr. That's because this doesn't get copied over the clone. It's a mere coincidence that fork() doesn't need to save register arguments, and this works. - added copyright notices to files that this touches. This is based on git blame. Only contributors of 10+ lines are added - test suite adjusted to not include "void" type as "don't show this int". Back ends in general need to know the exact type, so this never worked anyway.
2012-04-25Replace some uses of error with fprintfPetr Machata
error is not standard so it has no business being used in generic code. The linux-gnu back end is useful for android, and that doesn't have that interface either.
2012-04-24Fix double frees, remove_process now releases memoryPetr Machata
Presence in singly-linked list strongly indicates that process is heap allocated, and that if we are about to stop tracing it, we should also reclaim the memory.
2012-04-23Don't build fake library for system callsPetr Machata
At least not this way, the idea itself is still attractive.
2012-04-20Fix tracing on x86_64 and i386Petr Machata
When breakpoints is deleted ultimately, we can't call continue_after_breakpoint, and therefore IP doesn't get adjusted. Do this explicitly in generic code for such cases.
2012-04-19Fix code that assumes that breakpoint is valid after removedPetr Machata
(Which may actually hold sometimes, but generally won't.)
2012-04-19Fix rebase falloutPetr Machata
2012-04-19NitsPetr Machata
2012-04-19Fixes for tracing across execPetr Machata
2012-04-19Drop unused includePetr Machata
2012-04-19Change a commentPetr Machata
2012-04-19Drop dead code for breakpoint cloningPetr Machata
2012-04-19Wait for initial event from process after execPetr Machata
2012-04-19Improve debug messages in handle_eventPetr Machata
2012-04-19Hide unused add_processPetr Machata
- the one outstanding use was a bug, clone_process already adds the process by the way of process_bare_init
2012-04-19Drop a piece of PPC64 crudPetr Machata
- Breakpoints on PPC64 are newly handled as proper PLT breakpoints
2012-04-19options.no_plt is uselessPetr Machata
- or, as of now, it's used to decide whether or not we should display "unexpected breakpoint" messages
2012-04-19Don't create PLT symbols that don't match filtering criteriaPetr Machata
- instead of creating them, keeping them around, and then just not enabling breakpoints for them
2012-04-19Implement @MAIN, @/path/name -e selectors, make former default for nowPetr Machata
- the default might become "*" in future, but keep things more or less the same as they always were for now
2012-04-19Fix compilation on ppc64Petr Machata
2012-04-19Remove "enable" flag from insert_breakpointPetr Machata
2012-04-19Add a new breakpoint callback: on_continuePetr Machata
- called instead of continue_after_breakpoint, which remains the default action if the callback is not defined