On Sat, 26 Oct 2013 23:52:18 +0200, Mark Wielaard wrote:
> But I see now it should be initialized due to false warnings by
No, that is not the reason. If we wouldn't guarantee it is set then if
some code access it anyway before setting itself then valgrind would be
right to warn about that.
Valgrind would always warn if the application did not set it. Even if the
appplication never used it. It would warn on lines:
if (! process->callbacks->set_initial_registers (thread,
process->callbacks->thread_detach (thread, thread->callbacks_arg);
as CALLBACKS_ARG is passed there by value, not by reference.
What I want is that the thread_argp can be used as iterator state
OK, I have put it there but it is a different design style than I intended.
'void **thread_argp' should have been output-only parameter only for
set_initial_registers() and thread_detach() only for that one thread.
For iteration of threads next_thread() should have used 'void *dwfl_arg'.
That way the state doesn't (all) have to be held in the
dwfl_arg (like is currently done for both the pid and core backends).
Yes, that was intended so.
Sorry but you really should be on the second line of ChangeLog. You wrote
some parts of code and I already do not agree with various changes we made.
I do not mind but all together it is not authored only by me.
NULL would be the initial value passed in, after that the callback
to set it (possibly different for each thread). So what I would like is
something like the following:
Used your patch.