perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

implement C_BP macro for throwing a C debugger breakpoint WIP

Open bulk88 opened this issue 1 year ago • 4 comments

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 call snprintf() 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


  • This set of changes requires a perldelta entry, and I need help writing it.

bulk88 avatar Oct 15 '24 09:10 bulk88