#include <stdlib.h>
#include <pthread.h>
+#if __APPLE__
+ #include <mach-o/dyld.h>
+#endif
+
#include "libunwind.h"
#include "AddressSpace.hpp"
typedef typename A::pint_t pint_t;
public:
UnwindCursor(unw_context_t *context, A &as);
- UnwindCursor(A &as, thread_t thread);
+ UnwindCursor(A &as, void *threadArg);
virtual ~UnwindCursor() {}
virtual bool validReg(int);
virtual unw_word_t getReg(int);
}
template <typename A, typename R>
-UnwindCursor<A, R>::UnwindCursor(A &as, thread_t )
+UnwindCursor<A, R>::UnwindCursor(A &as, void *)
: _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) {
bzero(&_info, sizeof(_info));
// FIXME
- // fill in _registers from thread
+ // fill in _registers from thread arg
}
+
template <typename A, typename R>
bool UnwindCursor<A, R>::validReg(int regNum) {
return _registers.validRegister(regNum);
/// Create a cursor into a thread in another process.
_LIBUNWIND_EXPORT int unw_init_remote_thread(unw_cursor_t *cursor,
unw_addr_space_t as,
- thread_t thread) {
+ void *arg) {
// special case: unw_init_remote(xx, unw_local_addr_space, xx)
if (as == (unw_addr_space_t) & sThisAddressSpace)
return unw_init_local(cursor, NULL); //FIXME
case CPU_TYPE_I386:
new ((void *)cursor)
UnwindCursor<OtherAddressSpace<Pointer32<LittleEndian> >,
- Registers_x86>(((unw_addr_space_i386 *)as)->oas, thread);
+ Registers_x86>(((unw_addr_space_i386 *)as)->oas, arg);
break;
case CPU_TYPE_X86_64:
new ((void *)cursor) UnwindCursor<
OtherAddressSpace<Pointer64<LittleEndian> >, Registers_x86_64>(
- ((unw_addr_space_x86_64 *)as)->oas, thread);
+ ((unw_addr_space_x86_64 *)as)->oas, arg);
break;
case CPU_TYPE_POWERPC:
new ((void *)cursor)
UnwindCursor<OtherAddressSpace<Pointer32<BigEndian> >, Registers_ppc>(
- ((unw_addr_space_ppc *)as)->oas, thread);
+ ((unw_addr_space_ppc *)as)->oas, arg);
break;
default:
return UNW_EUNSPEC;