# std.debug: fix stack trace iteration code · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9c12237d2d0643fcf34ad6d027ce78d285e40271)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9c12237d2d0643fcf34ad6d027ce78d285e40271

Requested commit: 9c12237d2d0643fcf34ad6d027ce78d285e40271

Commit: 9c12237d2d0643fcf34ad6d027ce78d285e40271

Tree: 096fae1dbd0205141ac44491bb20ad00ffbfe098

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.debug: fix stack trace iteration code

Previously, the stack trace iteration code was using the number of
frames collected as the number of frames to print, not recognizing the
fixed size of the buffer. So it would redundantly print items, matching
the total number of frames ever collected.

Now the iteration code is limited to the actual stack trace frame count,
and will not print duplicate frames.

Closes #2447
Closes #2151

```

## Parents

- [a4aee8b24d321aa4c7a791d20500e5847a08b587](https://git.cafe/gitcafe/zig/commit/a4aee8b24d321aa4c7a791d20500e5847a08b587?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9c12237d2d0643fcf34ad6d027ce78d285e40271?format=markdown)
