summaryrefslogtreecommitdiff
path: root/bin/extra/gdbcore
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-30 00:50:16 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-30 00:50:16 +0100
commit15bc38edec39279f26969ca4b67126f6e544b831 (patch)
treec500f84a07c04acce18035b7635e93a2f710f162 /bin/extra/gdbcore
parent0e5e622952fe51588f1537e621c63cbe4a91c136 (diff)
checkpoint
Diffstat (limited to 'bin/extra/gdbcore')
-rwxr-xr-xbin/extra/gdbcore8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/extra/gdbcore b/bin/extra/gdbcore
index 3364ce8..69b1a64 100755
--- a/bin/extra/gdbcore
+++ b/bin/extra/gdbcore
@@ -23,10 +23,10 @@ coredir=/var/lib/systemd/coredump
# Temporary file listing core files location, later used as location for the corefile
tmp="$(mktemp)"
+
if [ "$2" = "-r" ]; then
- recent="$(find "$coredir" -name 'core.assert*' -printf '%Ts %f\n' |
- sort -n |
- head -n 1 |
+ recent="$(find "$coredir" -name "core.${prog##*/}*" -printf '%Ts %f\n' |
+ sort -n -r | head -n 1 |
cut -f 2- -d' ')"
corefile="$coredir"/"$recent"
else
@@ -39,7 +39,7 @@ else
-e 's/\.[0-9]\+\.[0-9a-f]\+\.[0-9]\+\.[0-9]\+\.zst / /' \
"$tmp" |
awk '{print NR ".", "[" $3,$2"]", $1}' |
- sort -k 2 -k 3 -r |
+ sort -r -k 3 -k 2 |
fzf -0 --with-nth=2..)"
if [ -z "$choice" ]; then
rm "$tmp"