diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-08-31 10:11:25 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-08-31 10:16:19 +0100 |
commit | fb80a5f4c33188a87e852c1725e57a65b4645615 (patch) | |
tree | c88505c4808848e5e2e6d335b5ba795b8272aa1d | |
parent | af979624128b24303c2e29b3f2535445877056ec (diff) | |
download | gcc-fb80a5f4c33188a87e852c1725e57a65b4645615.zip gcc-fb80a5f4c33188a87e852c1725e57a65b4645615.tar.gz gcc-fb80a5f4c33188a87e852c1725e57a65b4645615.tar.bz2 |
libstdc++: Fix bootstrap failures in src/c++26/debugging.cc
ptrace on Darwin requires <sys/types.h>.
The inline x86 asm doesn't work with the Solaris assembler.
libstdc++-v3/ChangeLog:
* src/c++26/debugging.cc [_GLIBCXX_HAVE_SYS_PTRACE_H]: Include
<sys/types.h>.
(breakpoint) [__i386__ || __x86_64__]: Use "int 0x03" instead of
"int3".
-rw-r--r-- | libstdc++-v3/src/c++26/debugging.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/src/c++26/debugging.cc b/libstdc++-v3/src/c++26/debugging.cc index 72e305d..c6262db 100644 --- a/libstdc++-v3/src/c++26/debugging.cc +++ b/libstdc++-v3/src/c++26/debugging.cc @@ -33,6 +33,7 @@ #endif #if _GLIBCXX_HAVE_SYS_PTRACE_H +# include <sys/types.h> // for darwin ptrace # include <sys/ptrace.h> # include <errno.h> #endif @@ -138,7 +139,7 @@ std::breakpoint() noexcept __builtin_debugtrap(); // Clang #elif defined(__i386__) || defined(__x86_64__) // nop is for GDB, see https://sourceware.org/bugzilla/show_bug.cgi?id=31194 - __asm__ volatile ("int3\n\tnop"); + __asm__ volatile ("int $0x3\n\tnop"); #elifdef __thumb__ __asm__ volatile (".inst 0xde01"); #elifdef __aarch64__ |