From e4fc0a382e4704d4c893a78dee8badf899016108 Mon Sep 17 00:00:00 2001 From: Misomosi Date: Tue, 8 Oct 2024 21:51:22 -0400 Subject: [PATCH] Put gdb-posix into script --- .bashrc | 15 +++------------ .local/bin/gdb-posix | 9 +++++++++ README.md | 26 +++++++++++++------------- 3 files changed, 25 insertions(+), 25 deletions(-) create mode 100755 .local/bin/gdb-posix diff --git a/.bashrc b/.bashrc index 43a7f14..b4f9ec1 100644 --- 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 index 0000000..ab16220 --- /dev/null +++ b/.local/bin/gdb-posix @@ -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' "$@" diff --git a/README.md b/README.md index 2291a14..e7e2734 100644 --- 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 -- 2.49.1