Skip to content

Commit

Permalink
Small steps towards Bug1 of #53
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Dec 8, 2024
1 parent 19388d8 commit cd4d498
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 1 addition & 3 deletions command/backtrace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# gdb-like "backtrace" debugger command
#
# Copyright (C) 2002-2006, 2008, 2010-2011, 2018-2019
# Rocky Bernstein <[email protected]>
# 2024 Rocky Bernstein <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -153,8 +153,6 @@ function _Dbg_do_backtrace {
adjusted_pos=$(_Dbg_frame_adjusted_pos $i)
_Dbg_msg_nocr $(_Dbg_frame_prefix $i)$i ${FUNCNAME[$adjusted_pos-1]}

typeset parms=''

# Print out parameter list.
if (( 0 != ${#BASH_ARGC[@]} )) ; then
_Dbg_frame_fn_param_str
Expand Down
14 changes: 7 additions & 7 deletions lib/file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ function _Dbg_resolve_expand_filename {
typeset -i n=${#_Dbg_dir[@]}
typeset -i i
for (( i=0 ; i < n; i++ )) ; do
typeset basename="${_Dbg_dir[i]}"
if [[ "$basename" == '\$cdir' ]] ; then
basename=$_Dbg_cdir
elif [[ "$basename" == '\$cwd' ]] ; then
basename=$(pwd)
typeset dirname="${_Dbg_dir[i]}"
if [[ "$dirname" == '\$cdir' ]] ; then
dirname=$_Dbg_cdir
elif [[ "$dirname" == '\$cwd' ]] ; then
dirname=$(pwd)
fi
if [[ -f "$basename/$find_file" ]] ; then
echo "$basename/$find_file"
if [[ -f "$dirname/$find_file" ]] ; then
echo "$dirname/$find_file"
return 0
fi
done
Expand Down
3 changes: 2 additions & 1 deletion lib/hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# hook.sh - Debugger trap hook
#
# Copyright (C) 2002-2011, 2014, 2017-2019
# Rocky Bernstein <[email protected]>
# 2024 Rocky Bernstein <[email protected]>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -150,6 +150,7 @@ _Dbg_debug_trap_handler() {
_Dbg_full_filename=$(_Dbg_is_file "$_Dbg_frame_last_filename")
if [[ -r "$_Dbg_full_filename" ]] ; then
_Dbg_file2canonic["$_Dbg_frame_last_filename"]="$_Dbg_full_filename"
_Dbg_file2canonic["${BASH_SOURCE[1]}"]="$_Dbg_full_filename"
fi

# Run applicable action statement
Expand Down

0 comments on commit cd4d498

Please sign in to comment.