[Lldb-commits] [PATCH] D54221: Add setting to require hardware breakpoints.
Kamil Rytarowski via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Nov 7 13:17:08 PST 2018
krytarowski added a comment.
On NetBSD one has to check PaX MPROTECT property of a traced process.
Something like:
bool IsMPROTECT(pid_t pid) {
#if defined(__NetBSD__)
int mib[3];
int paxflags;
size_t len = sizeof(paxflags);
mib[0] = CTL_PROC;
mib[1] = pid;
mib[2] = PROC_PID_PAXFLAGS;
if (sysctl(mib, 3, &paxflags, &len, NULL, 0) != 0)
err(EXIT_FAILURE, "sysctl"); /* or return true */
return !!(paxflags & CTL_PROC_PAXFLAGS_MPROTECT);
#else
return false;
#endif
}
If IsMPROTECT is true, then we must use hardware assisted/emulated breakpoints.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D54221
More information about the lldb-commits
mailing list