The libunwind overview mentions how bidirectional iteration can be
achieved using cursor copies. I'd like to know how to safely copy a cursor. A
mere memcpy seems unsafe since the cursor contains a pointer to an
unw_context_t. The copy needs a state of its own doesn't it?
A suggestion could be to include a copy function in the libunwind. Something
like this:
unw_copy_cursor(unw_cursor_t* from, unw_cursor_t* to, unw_context_t* toContext);
The reason for passing the 'to' and 'toContext' is of course to avoid
the need for memory allocation.
Regards,
Thomas Hallgren