# PetscStackPrint
Prints a given PETSc stack to an ASCII file 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStackPrint(PetscStack *sint, FILE *fp)
```
Not Collective


## Input Parameters

- ***sint -*** the PETSc stack to print
- ***file -*** the file pointer





## Notes
In debug mode PETSc maintains a stack of the current function calls that can be used to help to quickly see where a problem has
occurred, for example, when a signal is received. It is recommended to use the debugger if extensive information is needed to
help debug the problem.

The default stack is a global variable called `petscstack`.


## Developer Note
`PetscStackPrint()` and `PetscStackView()` should be merged into a single API.


## See Also
 `PetscAttachDebugger()`, `PetscStackCopy()`, `PetscStackView()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/error/pstack.c.html#PetscStackPrint">src/sys/error/pstack.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/pstack.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
