Skip to content

Commit cd4d498

Browse files
committed
Small steps towards Bug1 of #53
1 parent 19388d8 commit cd4d498

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

command/backtrace.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# gdb-like "backtrace" debugger command
33
#
44
# Copyright (C) 2002-2006, 2008, 2010-2011, 2018-2019
5-
# Rocky Bernstein <rocky@gnu.org>
5+
# 2024 Rocky Bernstein <rocky@gnu.org>
66
#
77
# This program is free software; you can redistribute it and/or
88
# modify it under the terms of the GNU General Public License as
@@ -153,8 +153,6 @@ function _Dbg_do_backtrace {
153153
adjusted_pos=$(_Dbg_frame_adjusted_pos $i)
154154
_Dbg_msg_nocr $(_Dbg_frame_prefix $i)$i ${FUNCNAME[$adjusted_pos-1]}
155155

156-
typeset parms=''
157-
158156
# Print out parameter list.
159157
if (( 0 != ${#BASH_ARGC[@]} )) ; then
160158
_Dbg_frame_fn_param_str

lib/file.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ function _Dbg_resolve_expand_filename {
105105
typeset -i n=${#_Dbg_dir[@]}
106106
typeset -i i
107107
for (( i=0 ; i < n; i++ )) ; do
108-
typeset basename="${_Dbg_dir[i]}"
109-
if [[ "$basename" == '\$cdir' ]] ; then
110-
basename=$_Dbg_cdir
111-
elif [[ "$basename" == '\$cwd' ]] ; then
112-
basename=$(pwd)
108+
typeset dirname="${_Dbg_dir[i]}"
109+
if [[ "$dirname" == '\$cdir' ]] ; then
110+
dirname=$_Dbg_cdir
111+
elif [[ "$dirname" == '\$cwd' ]] ; then
112+
dirname=$(pwd)
113113
fi
114-
if [[ -f "$basename/$find_file" ]] ; then
115-
echo "$basename/$find_file"
114+
if [[ -f "$dirname/$find_file" ]] ; then
115+
echo "$dirname/$find_file"
116116
return 0
117117
fi
118118
done

lib/hook.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# hook.sh - Debugger trap hook
33
#
44
# Copyright (C) 2002-2011, 2014, 2017-2019
5-
# Rocky Bernstein <rocky@gnu.org>
5+
# 2024 Rocky Bernstein <rocky@gnu.org>
66
#
77
# This program is free software; you can redistribute it and/or
88
# modify it under the terms of the GNU General Public License as
@@ -150,6 +150,7 @@ _Dbg_debug_trap_handler() {
150150
_Dbg_full_filename=$(_Dbg_is_file "$_Dbg_frame_last_filename")
151151
if [[ -r "$_Dbg_full_filename" ]] ; then
152152
_Dbg_file2canonic["$_Dbg_frame_last_filename"]="$_Dbg_full_filename"
153+
_Dbg_file2canonic["${BASH_SOURCE[1]}"]="$_Dbg_full_filename"
153154
fi
154155

155156
# Run applicable action statement

0 commit comments

Comments
 (0)