summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2016-10-19 22:44:45 +0200
committerYves Orton <demerphq@gmail.com>2016-10-19 22:44:45 +0200
commit2155384086267a57ee889c698fad3a1380105303 (patch)
treebce77c9b06c2c056829e99d5074425965c8b3fd5 /embed.fnc
parent04a83e5bd7a0783edd6a771c965154e14a103644 (diff)
downloadperl-2155384086267a57ee889c698fad3a1380105303.tar.gz
Add a way to have functions with a trailing depth argument under debugging
In the regex engine it can be useful in debugging mode to maintain a depth counter, but in normal mode this argument would be unused. This allows us to define functions in embed.fnc with a "W" flag which use _pDEPTH and _aDEPTH defines which effectively define/pass through a U32 depth parameter to the macro wrappers. These defines are similar to the existing aTHX and pTHX parameters.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc20
1 files changed, 13 insertions, 7 deletions
diff --git a/embed.fnc b/embed.fnc
index c58f49a8b3..94cb9845a9 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -144,6 +144,13 @@
:
: (currently no effect)
:
+: W Add a _pDEPTH argument to function prototypes, and an _aDEPTH
+: argument to the function calls. This means that under DEBUGGING
+: a depth argument is added to the functions, which is used for
+: example by the regex engine for debugging and trace output.
+: A non DEBUGGING build will not pass the unused argument.
+: Currently restricted to functions with at least one argument.
+:
: X Explicitly exported:
:
: add entry to the list of exported symbols, unless x or m
@@ -2402,21 +2409,20 @@ Es |U8 |regtail_study |NN RExC_state_t *pRExC_state \
ERs |bool |isFOO_lc |const U8 classnum|const U8 character
ERs |bool |isFOO_utf8_lc |const U8 classnum|NN const U8* character
ERs |SSize_t|regmatch |NN regmatch_info *reginfo|NN char *startpos|NN regnode *prog
-ERs |I32 |regrepeat |NN regexp *prog|NN char **startposp \
+WERs |I32 |regrepeat |NN regexp *prog|NN char **startposp \
|NN const regnode *p \
|NN regmatch_info *const reginfo \
- |I32 max \
- |int depth
+ |I32 max
ERs |bool |regtry |NN regmatch_info *reginfo|NN char **startposp
ERs |bool |reginclass |NULLOK regexp * const prog \
|NN const regnode * const n \
|NN const U8 * const p \
|NN const U8 * const p_end \
|bool const utf8_target
-Es |CHECKPOINT|regcppush |NN const regexp *rex|I32 parenfloor\
- |U32 maxopenparen|int depth
-Es |void |regcppop |NN regexp *rex\
- |NN U32 *maxopenparen_p|int depth
+WEs |CHECKPOINT|regcppush |NN const regexp *rex|I32 parenfloor\
+ |U32 maxopenparen
+WEs |void |regcppop |NN regexp *rex|NN U32 *maxopenparen_p
+WEs |void |regcp_restore |NN regexp *rex|I32 ix|NN U32 *maxopenparen_p
ERsn |U8* |reghop3 |NN U8 *s|SSize_t off|NN const U8 *lim
ERsn |U8* |reghop4 |NN U8 *s|SSize_t off|NN const U8 *llim \
|NN const U8 *rlim