Skip to content

Commit d4266b4

Browse files
authored
Merge pull request #573 from coolroman/func_debug_primitives
Added some FunC debug primitives description
2 parents dd3ccf0 + c0718a2 commit d4266b4

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

docs/develop/func/stdlib.mdx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ The pseudo-random number generator uses the random seed, an unsigned 256-bit Int
526526
Keep in mind that random numbers generated by the functions below can be predicted if you do not use additional tricks.
527527

528528
- [Random number generation](/develop/smart-contracts/guidelines/random-number-generation)
529+
529530
:::
530531

531532
#### random
@@ -650,7 +651,23 @@ A variant of `parse_std_addr` that returns the (rewritten) address as a slice `s
650651

651652
## Debug primitives
652653

653-
Currently, only one function is available.
654+
Debug primitives can be used for inspecting state of various variables while running tests or console scripts.
655+
656+
#### ~dump
657+
658+
```func
659+
forall X -> () ~dump(X value) impure asm "s0 DUMP";
660+
```
661+
662+
Outputs a value. Several values can be dumped as a tuple, e.g. `~dump([v1, v2, v3])`.
663+
664+
#### ~strdump
665+
666+
```func
667+
() ~strdump(slice str) impure asm "STRDUMP";
668+
```
669+
670+
Dumps a string. Slice parameter bit length must be divisible by 8.
654671

655672
#### dump_stack
656673

0 commit comments

Comments
 (0)