mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[unwind] Fix unw_init_remote_thread() use to void* instead of thread_t for parameter to match other implementations
llvm-svn: 192248
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#if __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#include "libunwind.h"
|
||||
|
||||
#include "AddressSpace.hpp"
|
||||
@@ -382,7 +386,7 @@ class UnwindCursor : public AbstractUnwindCursor{
|
||||
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);
|
||||
@@ -522,13 +526,14 @@ UnwindCursor<A, R>::UnwindCursor(unw_context_t *context, A &as)
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -65,7 +65,7 @@ _LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space =
|
||||
/// 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
|
||||
@@ -75,17 +75,17 @@ _LIBUNWIND_EXPORT int unw_init_remote_thread(unw_cursor_t *cursor,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user