[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libunwind-devel] unwind-ptrace

From: Janne Karhunen
Subject: [Libunwind-devel] unwind-ptrace
Date: Thu, 29 May 2008 09:01:34 -0400


Quick question - is unw_step() supposed to work exactly
the same with unwind ptrace and locally?

This seems to be working fine when local, but when task
is remote (create_addr_space and all) unw_step finds no
frames. Yet unw_get_reg and everything are working, so
basic ptrace geekiness should be OK:

  as = unw_create_addr_space (&_UPT_accessors, 0);
  ui = _UPT_create (target_tid);
  ret = unw_init_remote (&c, as, ui);

  while (unw_step(&c) > 0)
    unw_get_reg(&c, UNW_REG_IP, &ip);
    unw_get_reg(&c, UNW_REG_SP, &sp);

    rc = dladdr ( (void*)ip, &info );
    if (rc > 0)
      printf ("0x%lx (%s), sp = 0x%lx\n", (long) ip, info.dli_sname, (long) sp);
      printf ("0x%lx, sp = 0x%lx\n", (long) ip, (long) sp);

// Janne

reply via email to

[Prev in Thread] Current Thread [Next in Thread]