# PetscAttachDebugger
Attaches the debugger to the running process. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscAttachDebugger(void)
```
Not Collective


## Options Database Keys

- ***-start_in_debugger [noxterm,dbx,xxgdb,xdb,xldb,gdb] [-*** display name] [-debugger_ranks m,n] -debug_terminal xterm or Terminal (for Apple)


- ***-on_error_attach_debugger [noxterm,dbx,xxgdb,xdb,xldb,gdb] [-*** display name] - Activates debugger attachment





## Developer Note
Since this can be called by the error handler should it be calling `SETERRQ()` and `PetscCall()`?


## See Also
 `PetscSetDebugger()`, `PetscSetDefaultDebugger()`, `PetscSetDebugTerminal()`, `PetscAttachDebuggerErrorHandler()`, `PetscStopForDebugger()`

## Level
advanced

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/error/adebug.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)  
