]> localhost Git - dotfiles.git/commitdiff
Put gdb-posix into script
authorMisomosi <[email protected]>
Wed, 9 Oct 2024 01:51:22 +0000 (21:51 -0400)
committerMisomosi <[email protected]>
Wed, 9 Oct 2024 01:51:22 +0000 (21:51 -0400)
.bashrc
.local/bin/gdb-posix [new file with mode: 0755]
README.md

diff --git a/.bashrc b/.bashrc
index 43a7f14e317d29cdbd085e6bff81b74979fc856a..b4f9ec11435f8708eb60daec686238be27dbb5ba 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -1,19 +1,10 @@
-function gdb-posix () {
-       # Producing coredumps on segfaults is usually what I want by default
-       if [ ! -f .breakpoints ] ; then echo '
-catch signal SIGSEGV
-commands
-gcore core.latest
-end
-' >.breakpoints ; fi
-       gdb "$@"
-}
 export PATH="$HOME/.local/bin:$PATH"
 export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH"
 
 # This is equivalent to 'auto-load' but with '.breakpoints'
-# Remove this as well if you don't like 'auto-load'
-alias gdb="gdb-posix -ex 'source .breakpoints'"
+# if you look at the script. Remove this as well if you
+# don't like 'auto-load'
+alias gdb="gdb-posix"
 
 # Debian comes with Wayland so this is what I use
 # If you use X, then xclip is what you're looking for
diff --git a/.local/bin/gdb-posix b/.local/bin/gdb-posix
new file mode 100755 (executable)
index 0000000..ab16220
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Producing coredumps on segfaults is usually what I want by default
+if [ ! -f .breakpoints ] ; then echo '
+catch signal SIGSEGV
+commands
+gcore core.latest
+end
+' >.breakpoints ; fi
+gdb -ex 'source .breakpoints' "$@"
index 2291a1401d64e8a1952b47abeecbc5f359d6772b..e7e273444c5dc41e1b0d3dc75ad231766ed798c3 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,7 +10,6 @@ Worry not because my dotfiles have come to the rescue
 dotfiles so simple, they fit on a page
 
 ## .vimrc / .exrc
-
 ```
 set autoindent
 set ignorecase
@@ -21,7 +20,6 @@ set wrapscan
 ```
 
 ## .tmux.conf
-
 ```
 # I may or may not have protanopia so this makes the contrast higher while still looking green to me
 set -g window-style bg=#000000,fg=#60e000
@@ -43,18 +41,7 @@ end
 ```
 
 ## .bashrc or similar
-
 ```
-function gdb-posix () {
-       # Producing coredumps on segfaults is usually what I want by default
-       if [ ! -f .breakpoints ] ; then echo '
-catch signal SIGSEGV
-commands
-gcore core.latest
-end
-' >.breakpoints ; fi
-       gdb "$@"
-}
 export PATH="$HOME/.local/bin:$PATH"
 export LD_LIBRARY_PATH="$HOME/.local/lib:$LD_LIBRARY_PATH"
 
@@ -68,6 +55,19 @@ alias tmux-copy="tmux show-buffer | wl-copy"
 alias tmux-paste="wl-paste"
 ```
 
+## .local/bin/gdb-posix
+```
+#!/bin/sh
+# Producing coredumps on segfaults is usually what I want by default
+if [ ! -f .breakpoints ] ; then echo '
+catch signal SIGSEGV
+commands
+gcore core.latest
+end
+' >.breakpoints ; fi
+gdb -ex 'source .breakpoints' "$@"
+```
+
 ## .ssh config
 ```
 Host github.com