Age | Commit message (Collapse) | Author |
|
|
|
- Extract the logic to a separate function, called from open_pid and
entry_breakpoint_on_hit.
- Since there is no other way to get on dyn_addr in open_pid anyway,
simply look for the main library, and read it there. That means we
don't need to track that information at entry_breakpoint anymore,
and we can get rid of struct entry_breakpoint.
|
|
- In cb_breakpoint_for_symbol, we would need CBS_FAIL_IF. But
CBS_FAIL isn't properly handled anywhere. The iterator client user
must provide alternate means of signalling errors anyway (e.g. a
flag passed in data) anyway. So convert this to CBS_STOP_IF, the
caller already assumes all stops are failures.
|
|
- This compiles down to the exact same code, but we want to be clear
about the calling convention.
|
|
- GCC points out that the constant in dict.c that we use
for computing string hashes is not implicitly unsigned.
- When building without unwinding support, we can't access
ifdef'd-out fields. I remember having writted it this way
to increase exposure of the error handling code for syntax
checks, but it can't work.
|
|
|
|
|
|
- In fact, libsym->name would cause a SIGSEGV.
|
|
- the semantics should be start_after, as in other cases in ltrace
|
|
The original code was releasing the original memory, not the clone,
and single block would be released potentially many times. This led
to severe memory errors.
|
|
The cloned library may have been allocated, but not initialized. It
is not correct to destroy such library, only the memory needs to be
released.
|
|
- add_process returns -1 on failures
- in process_bare_init, when we fail to initialize the process, but it
already was added, unlist it before bailing out.
|
|
|
|
Output should verify whether unwinding was properly initialized. Said
initialization should be skipped altogether unless requested on
command line.
|
|
- In many places, DICT_FIND was awkward to use, as it required the use
of pointers even in cases that the dictionary already stored
pointers. For those cases, add DICT_FIND_VAL.
- Rename the original DICT_FIND to DICT_FIND_REF to make the
disctinction clear. That is useful if the dictionary holds actual
structures.
|
|
It's now a bit more strongly typed, can grow and shrink on demand, and has
a more complete interface.
It uses open addressing scheme to store hashes.
|
|
- Use backend hook umovebytes to read the bytes from inferior.
|
|
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.
|
|
|
|
The same is inlined in the for() initializer.
|
|
|
|
|
|
This pops up when a thread calls vfork. In that case there are no
libraries assigned to the process itself, but newly-vfork'd process is
itself a leader, and therefore needs its own libraries and breakpoints.
|
|
This makes the code less verbose.
Also add a note related to extraction to future callstack.c.
|
|
Since we are done cloning the generic part of the process, it
is proper to simply call private_process_destroy on failures.
If os_process_clone passed, but arch_process_clone fails,
os_process_destroy must be called.
|
|
|
|
The code in breakpoint_clone was buggy--it looked through old_proc's
symbols. It was also needlessly verbose, proc_find_symbol uses library
key to find the right library. Instead use the new interface and call
it on new_proc to find the new symbol.
We also didn't relink symbols in stack elements of a cloned process in
process_clone. Use proc_find_symbol for this as well.
|
|
This plugs a leak.
|
|
This is meant to be the same for per-OS configuration as arch_process_data
is for per-arch configuration.
|
|
That in case that arch_process_destroy needs the global state. Unlikely,
but we do it that way for exec, so let's be consistent.
|
|
This plugs a leak
|
|
This plugs a leak
|
|
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
|
|
|
|
Neither latent, nor delayed symbols are given a breakpoint. The difference
is in who's responsible for the state. Latent symbols are (will be) used
by ltrace core. Delayed symbols are used by backends. Only when both of
these flags are cleared is a breakpoint enabled for the symbol.
|
|
MIPS needs a backend specific way to load symbol info.
We add fields to the symbol representation to keep track
of the state of the dynamic symbol.
At arch_dynlink_done we go through the symbols that are
connected to a GOT entry but that where not resolved at
startup time (e.g function pointers to external syms).
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
|
|
Not all arch's (e.g MIPS) have a direct mapping to
sym->enter_addr.
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
|
|
Technically only s390 needs this at the moment, but it seems general enough
that it should be alongside the e_machine flag. Eventually it is desirable
to replace both fields with either a backend-provided ABI enum, or with
an ABI object that would implement the interesting back end calls.
|
|
|
|
|
|
- the reason being that the que-handling was declared on global level, but
was only implemented in one back end. If this is deemed generally useful,
it should all be moved to front end, but as things are it's all the same,
so I'm preferring the less invasive change
|
|
- 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
|
|
- 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.
|
|
|
|
This does many things, we only care obout the unlisting.
|
|
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.
|
|
Also use proc_each_breakpoint instead of dict_apply_to_all.
|
|
|
|
|
|
|