mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-12-23 12:03:41 +01:00
eh_elf: actually use eh_elf in unw_step
This commit is contained in:
parent
e0efd00acd
commit
7a3518d325
1 changed files with 11 additions and 0 deletions
|
@ -26,6 +26,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
|
|
||||||
#include "unwind_i.h"
|
#include "unwind_i.h"
|
||||||
|
#include "../eh_elf/eh_elf.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
/* Recognise PLT entries such as:
|
/* Recognise PLT entries such as:
|
||||||
|
@ -66,6 +67,16 @@ unw_step (unw_cursor_t *cursor)
|
||||||
Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n",
|
Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx)\n",
|
||||||
c, c->dwarf.ip, c->dwarf.cfa);
|
c, c->dwarf.ip, c->dwarf.cfa);
|
||||||
|
|
||||||
|
// Try eh_elf based unwinding...
|
||||||
|
ret = eh_elf_step_cursor(&c);
|
||||||
|
|
||||||
|
if(ret < 0) {
|
||||||
|
Debug(2, "eh_elf unwinding failed (%d), falling back\n", ret);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Try DWARF-based unwinding... */
|
/* Try DWARF-based unwinding... */
|
||||||
c->sigcontext_format = X86_64_SCF_NONE;
|
c->sigcontext_format = X86_64_SCF_NONE;
|
||||||
ret = dwarf_step (&c->dwarf);
|
ret = dwarf_step (&c->dwarf);
|
||||||
|
|
Loading…
Reference in a new issue