fluffos/docs/efun/internals/dump_trace.md
gesslar 6e6d1c772b
docs: flesh out 31 TBW efun reference pages (#1248)
* empty

* docs: flesh out 31 TBW efun reference pages

Replace the placeholder "TBW" DESCRIPTION and type-only SYNOPSIS in 31
efun docs with real descriptions and named parameters, verified against
the driver source:

- math (general/): log10, log2, norm, dotprod, distance, angle
- matrix (general/): id_matrix, translate, scale, rotate_x/y/z,
  lookat_rotate, lookat_rotate2 -- note the in-place mutation of the
  passed matrix and that rotations are in degrees
- compress (general/): compress, uncompress, compress_file,
  uncompress_file -- note the file variants delete the source on success
- interactive/: send_zmp, act_mxp, request_term_type,
  start_request_term_type, request_term_size
- internals/: dump_trace, destructed_objects, check_memory (flag
  bitmask + DEBUGMALLOC build requirement), dump_stralloc, dump_jemalloc
- core: next_bit, explode_reversible, shallow_inherit_list

Each page keeps the existing manpage-style layout (4-space-indented
NAME/SYNOPSIS/DESCRIPTION, name(3) SEE ALSO). Example blocks are indented
to match, so all files are markdownlint-clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-11 22:07:47 -04:00

1.2 KiB

title
internals / dump_trace

dump_trace

NAME

dump_trace() - snapshot the current LPC call stack

SYNOPSIS

mixed *dump_trace();

DESCRIPTION

Returns an array describing the current LPC call stack, with the
innermost (currently executing) frame last. Each element is a mapping
describing one stack frame, with the following keys:

"function"  The function name. For a catch frame this is "CATCH", for
            a fake frame it is "<fake>", and for a function-pointer
            frame it is a rendering of the function pointer.
"program"   The program's filename, with a leading slash.
"object"    The object the frame is executing in.
"file"      The source file for the frame, with a leading slash.
"line"      The line number within that source file.

For real function frames, the mapping additionally carries an
"arguments" array (the arguments the frame was called with) and, when
present, a "locals" array (the frame's local variables).

Returns an empty array when there is no current program or call stack.
This is a snapshot intended for debugging and introspection.

SEE ALSO

call_stack(3), origin(3)