mirror of
https://github.com/python/cpython.git
synced 2026-01-01 13:03:56 +00:00
gh-138122: Add blocking mode for accurate stack traces in Tachyon (#142998)
This commit is contained in:
parent
f9704f1d84
commit
81c8eb85e1
15 changed files with 855 additions and 77 deletions
|
|
@ -33,6 +33,9 @@ extern "C" {
|
|||
#ifdef __linux__
|
||||
# include <elf.h>
|
||||
# include <sys/uio.h>
|
||||
# include <sys/ptrace.h>
|
||||
# include <sys/wait.h>
|
||||
# include <dirent.h>
|
||||
# if INTPTR_MAX == INT64_MAX
|
||||
# define Elf_Ehdr Elf64_Ehdr
|
||||
# define Elf_Shdr Elf64_Shdr
|
||||
|
|
@ -43,6 +46,17 @@ extern "C" {
|
|||
# define Elf_Phdr Elf32_Phdr
|
||||
# endif
|
||||
# include <sys/mman.h>
|
||||
|
||||
// PTRACE options - define if not available
|
||||
# ifndef PTRACE_SEIZE
|
||||
# define PTRACE_SEIZE 0x4206
|
||||
# endif
|
||||
# ifndef PTRACE_INTERRUPT
|
||||
# define PTRACE_INTERRUPT 0x4207
|
||||
# endif
|
||||
# ifndef PTRACE_EVENT_STOP
|
||||
# define PTRACE_EVENT_STOP 128
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__) && defined(TARGET_OS_OSX) && TARGET_OS_OSX
|
||||
|
|
@ -55,6 +69,7 @@ extern "C" {
|
|||
# include <mach/mach_vm.h>
|
||||
# include <mach/machine.h>
|
||||
# include <mach/task_info.h>
|
||||
# include <mach/thread_act.h>
|
||||
# include <sys/mman.h>
|
||||
# include <sys/proc.h>
|
||||
# include <sys/sysctl.h>
|
||||
|
|
@ -169,7 +184,7 @@ _Py_RemoteDebug_InitProcHandle(proc_handle_t *handle, pid_t pid) {
|
|||
}
|
||||
#elif defined(MS_WINDOWS)
|
||||
handle->hProcess = OpenProcess(
|
||||
PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION,
|
||||
PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION | PROCESS_QUERY_INFORMATION | PROCESS_SUSPEND_RESUME,
|
||||
FALSE, pid);
|
||||
if (handle->hProcess == NULL) {
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue