On 03/29/17 04:51 PM, Doug Moore wrote:
> Can’t we fix this whole problem by having getcontext subtract from the pc to 
> start with, so that nobody ever has to decrement the pc on the first call to 
> unw_step?

That would assume that the ucontext is usually from a signal frame
(third argument from a sigaction handler), which is probably pretty
common.  It would break anyone that grabbed it outside a handler using
getcontext() instead of unw_getcontext() though.

The current documentation says:

```
On IA-64, unw_context_t has a layout that is compatible with that of
ucontext_t and such structures can be initialized with getcontext()
instead of unw_getcontext()
```

so it might be a somewhat interface breaking change.  

Conversely, for your use case you might just be able to bump the ip by
one in the ucontext before the first unw_step()?


_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to