implement C_BP macro for throwing a C debugger breakpoint WIP #22670
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My fingers hurt typing DebugBreak() all these years. Time for an API. Commit is a WIP since there is some dead code from 1st impl, but I decided the "speed" of
memcpy
, isn't worth the extra 0x30 bytes of machine code, and '\0' padding to 8 byte alignment boundaries done by MSVC of 4 separate c strings in RO data section vs 1 c string (snprintf
fmt str). Just callsnprintf()
the slow way. Runtime speed is irrelevant here. This code will never run except for an XS dev or p5p dev writing a new module or bug fixing.If there aren't suggested changes, I'll clean it up into a final version in a day or 2. The code could also be added to ppport.h to mk life easier for all XS devs on all PL releases.
-short macro name, less to type
-cross platform
-makes it easier to work on Perl core or XS CPAN
-emits debug info to console for CI/smoke/unattended machine -writes to STDOUT and STDERR, incase one of the 2 FDs are redirected
to a disk file or piped to another process, or that disk file is temp
flagged, and OS instantly deletes it
-breaking TAP testing is good
-C_BP; is less to type vs DebugBreak(); or __debugbreak(); on Win32