-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
@trufae This is a follow-up to #25144
It is desirable to replace a hack which was used earlier to make radare2 compile on powerpc with a proper fix, adding implementation for it. PowerPC has most of the stuff which is used in xnu_threads. However, it does not have ppc_debug_state_t, apparently.
The code uses *_debug state for i386 and arm here:
radare2/libr/debug/p/native/xnu/xnu_threads.h
Lines 60 to 71 in 29f4d28
| #if __arm64 || __aarch64 || __arm64__ || __aarch64__ || __arm64e__ | |
| union { | |
| arm_debug_state32_t drx32; | |
| arm_debug_state64_t drx64; | |
| } debug; | |
| #elif __arm__ || __arm || __armv7__ | |
| union { | |
| arm_debug_state_t drx; | |
| } debug; | |
| #elif __x86_64__ || __i386__ | |
| x86_debug_state_t drx; | |
| #endif |
Corresponding .c file has commented out chunk with it:
radare2/libr/debug/p/native/xnu/xnu_threads.c
Lines 138 to 147 in 29f4d28
| #elif __POWERPC__ | |
| /* not supported */ | |
| # ifndef PPC_DEBUG_STATE32 | |
| # define PPC_DEBUG_STATE32 1 | |
| # endif | |
| //ppc_debug_state_t *regs; | |
| //thread->flavor = PPC_DEBUG_STATE32; | |
| //thread->count = R_MIN (thread->count, sizeof (regs->uds.ds32)); | |
| return false; | |
| #else |
However that won’t really work in that form, AFAICT.
Compare:
i386 has debug_state: https://github.com/alexey-lysiuk/macos-sdk/blob/78bd32056afc9a4720580f82d4ac839e7e831b6e/MacOSX10.6.sdk/usr/include/mach/i386/thread_status.h#L109-L111
powerpc does not: https://github.com/alexey-lysiuk/macos-sdk/blob/78bd32056afc9a4720580f82d4ac839e7e831b6e/MacOSX10.6.sdk/usr/include/mach/ppc/thread_status.h#L44-L50
Likewise, LLVM docs do not mention it for powerpc: https://llvm.org/doxygen/BinaryFormat_2MachO_8h_source.html
So the question is whether something can be done about that, using what exists on powerpc, or we are out of luck here, and just keep it disabled indefinitely?