[all-commits] [llvm/llvm-project] 726688: [libc] Support for argument-taking ptrace requests...

Pavel Labath via All-commits all-commits at lists.llvm.org
Fri Jun 5 06:32:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 72668850f6f204451350a1e42fe8a5d9954542a9
      https://github.com/llvm/llvm-project/commit/72668850f6f204451350a1e42fe8a5d9954542a9
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2026-06-05 (Fri, 05 Jun 2026)

  Changed paths:
    M libc/hdr/CMakeLists.txt
    A libc/hdr/sys_ptrace_macros.h
    M libc/include/llvm-libc-macros/sys-ptrace-macros.h
    M libc/include/sys/ptrace.yaml
    M libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
    M libc/src/__support/OSUtil/linux/syscall_wrappers/ptrace.h
    M libc/src/sys/ptrace/linux/CMakeLists.txt
    M libc/src/sys/ptrace/linux/ptrace.cpp
    M libc/test/integration/src/sys/ptrace/linux/ptrace_test.cpp

  Log Message:
  -----------
  [libc] Support for argument-taking ptrace requests (#201830)

Some of these requests are architecture specific, and linux/ptrace.h is
pretty clean, so I'm including it for all the constants definitions
(this matches bionic, but not musl or glibc).

There's one unfortunate rename that we need to fix up (kernel uses
PTRACE_PEEKUSR, without the *E*), and (matching all libc
implementations) I also add the BSD-compatibility names for the basic
requests (although the usefulness if this is questionable as nearly
everything about ptrace is OS-specific).

Some of the options structs also have a different name in the kernel
headers (ptrace_peeksiginfo_args) and glibc (__ptrace_peeksiginfo_args),
but:
- these are very scarcely used, and
- the manpage actually documents the kernel names

which is why I'm hoping we can get away with this.

The ptrace entry point implements the standard PTRACE_PEEK translation
from by-ptr arguments to return values.

---------

Co-authored-by: Jeff Bailey <jbailey at raspberryginger.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list