[PATCH] libstdc++: Implement C++26 features (P2546R5)

2025-04-11 Thread Jonathan Wakely
On Friday, 11 April 2025, Jonathan Wakely wrote: > On Fri, 11 Apr 2025 at 08:00, Tomasz Kaminski wrote: >> >> >> >> On Thu, Apr 10, 2025 at 6:53 PM Jonathan Wakely wrote: >>> >>> It would be good to provide a macOS definition of is_debugger_present as >>> per https://developer.apple.com/library/

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Andrew Pinski
On Mon, Jun 3, 2024 at 9:06 AM Peter0x44 wrote: > > 3 Jun 2024 4:14:28 pm Jonathan Wakely : > > > On Mon, 3 Jun 2024 at 14:36, Peter0x44 wrote: > >>> +void > >>> +std::breakpoint() noexcept > >>> +{ > >>> +#if _GLIBCXX_HAVE_DEBUGAPI_H && defined(_WIN32) && > >>> !defined(__CYGWIN__) > >>> + Debug

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Peter0x44
3 Jun 2024 4:14:28 pm Jonathan Wakely : On Mon, 3 Jun 2024 at 14:36, Peter0x44 wrote: +void +std::breakpoint() noexcept +{ +#if _GLIBCXX_HAVE_DEBUGAPI_H && defined(_WIN32) && !defined(__CYGWIN__) +  DebugBreak(); +#elif __has_builtin(__builtin_debugtrap) +  __builtin_debugtrap(); // Clang +#eli

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Jonathan Wakely
On Mon, 3 Jun 2024 at 14:36, Peter0x44 wrote: > > +void > > +std::breakpoint() noexcept > > +{ > > +#if _GLIBCXX_HAVE_DEBUGAPI_H && defined(_WIN32) && > > !defined(__CYGWIN__) > > + DebugBreak(); > > +#elif __has_builtin(__builtin_debugtrap) > > + __builtin_debugtrap(); // Clang > > +#elif define

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Peter0x44
On 2024-06-01 03:22, Jonathan Wakely wrote: Here's an implementation of the C++26 header. We should really have some tests that invoke GDB and check that the breakpoint works when a debugger is attached. That seems tricky to do via the main conformance.exp testsuite. It could be done via the pr

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Ulrich Drepper
On Mon, Jun 3, 2024 at 12:20 PM Florian Weimer wrote: > Would it make sense to have a special function symbol for this, on which > the debugger sets the breakpoint? […] Jon and I discussed more details off-list. Hopefully a more complete version is coming soon-ish.

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-03 Thread Florian Weimer
* Jonathan Wakely: > +/** Stop the program with a breakpoint or debug trap. > + * > + * The details of how a breakpoint is implemented are platform-specific. > + * Some systems provide a special instruction, such as `int3` in x86. > + * When no more appropriate mechanism is available, this will st

Re: [PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-01 Thread Ulrich Drepper
Hey Jon, I think we should give debuggers a chance to announce themselves by providing an entry point they can call (in the inferior) which sets a flag. A set flag plus a tracer PID would then be a sufficient indicator. The remaining code should also stay but some additional code can be added:

[PATCH] libstdc++: Implement C++26 features (P2546R5)

2024-06-01 Thread Jonathan Wakely
Here's an implementation of the C++26 header. We should really have some tests that invoke GDB and check that the breakpoint works when a debugger is attached. That seems tricky to do via the main conformance.exp testsuite. It could be done via the prettyprinters.exp testsuite, which already uses