mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
Fixes for old glibc (Debian Etch) (#17564)
This commit is contained in:
parent
c9b6149d7b
commit
43feee7a51
@ -319,6 +319,8 @@ static RDebugReasonType linux_handle_new_task(RDebug *dbg, int tid) {
|
||||
if (ret == -1) {
|
||||
continue;
|
||||
}
|
||||
#ifdef PT_GETEVENTMSG
|
||||
// NOTE: This API was added in Linux 2.5.46
|
||||
if (siginfo.si_signo == SIGTRAP) {
|
||||
// si_code = (SIGTRAP | PTRACE_EVENT_* << 8)
|
||||
int pt_evt = siginfo.si_code >> 8;
|
||||
@ -333,6 +335,7 @@ static RDebugReasonType linux_handle_new_task(RDebug *dbg, int tid) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return R_DEBUG_REASON_UNKNOWN;
|
||||
|
@ -14,6 +14,16 @@
|
||||
#define PTRACE_SETSIGINFO 0x4203
|
||||
#endif
|
||||
|
||||
// A special case of the older Glibc but the kernel newer than 2.5.46
|
||||
// Sadly, there is no reliable and portable way to check the linux kernel
|
||||
// version from headers, so we assume it's supported.
|
||||
#if defined(__GLIBC__) && defined(__GLIBC_MINOR__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 3)
|
||||
#if !defined(PT_GETEVENTMSG) && !defined(PTRACE_GETEVENTMSG)
|
||||
#define PTRACE_GETEVENTMSG 0x4201
|
||||
#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(PTRACE_EVENT_FORK) && !defined(PTRACE_EVENT_VFORK) && !defined(PTRACE_EVENT_CLONE) \
|
||||
&& !defined(PTRACE_EVENT_EXEC) && !defined(PTRACE_EVENT_VFORK_DONE) && !defined(PTRACE_EVENT_EXIT)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user