For running process:
gdb attach -p ${PID} -ex "thread apply all bt" -ex "detach" -ex "quit" > stacktrace-${PID}.log
For coredump:
#!/bin/bash | |
# Set the default period to 1 second | |
period=1 | |
# Parse the command line arguments | |
while getopts ":p:" opt; do | |
case ${opt} in | |
p ) | |
period=$OPTARG |
package main | |
import ( | |
"math/rand" | |
"sync" | |
"sync/atomic" | |
"testing" | |
"time" | |
) |
################################################################################ | |
# brew configuration | |
################################################################################ | |
eval "$(/opt/homebrew/bin/brew shellenv)" | |
export PATH=/opt/homebrew/opt/libtool/libexec/gnubin:$PATH | |
################################################################################ | |
# fzf configuration |
############################################################################### | |
# COLOUR (Solarized dark) # | |
############################################################################### | |
set-option -g status-style fg=yellow,bg=black #yellow and base02 | |
set-window-option -g window-status-style fg=brightblue,bg=default #base0 and default | |
set-window-option -g window-status-current-style fg=brightred,bg=default #orange and default | |
set-option -g pane-border-style fg=black #base02 | |
set-option -g pane-active-border-style fg=brightgreen #base01 | |
set-option -g message-style fg=brightred,bg=black #orange and base01 |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" General | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" set how many lines of history VIM has to remember | |
set history=1000 | |
" enable filetype plugins | |
" filetype plugin on | |
" filetype indent on | |
filetype on |