Menu

#1 please disable the debugged filename check being null: null is valid

1.0
open
nobody
None
2019-03-04
2019-02-16
Astara
No

Attached are the two files you wanted to duplicate this.
Part1 is run when you logon or some long time before. It defines a function "addnums" (adds arguments, prints results and tries to return them as an integer).

Part2 is script user is debugging. It calls 'addnums'. The debugger spits out err:
** Internal debug error _Dbg_is_file(): file argument null

because it can't find the file associated with addnums (because addnums is now a function
existing in the environment). Bash confirms this when tracing:

Ishtar:/tmp> bash -x part2

~/.bash_env#7> [[ -n '' ]]
~/.bash_env#7> [[ -O /tmp/debug_local ]]
~/.bash_env#12> : /home/law/.bash_env
~/.bash_env#13> export BASH_ENV
~/.bash_env#15> . /etc/local/bash_env.sh

/etc/local/bash_env.sh#8> typeset -xr LOCAL_DIR=/etc/local
/etc/local/bash_env.sh#9> shopt -s extglob
/etc/local/bash_env.sh#10> bash_env_f=x
/etc/local/bash_env.sh#10> [[ -n x ]]
/etc/local/bash_env.sh#10> set +x
/etc/local/bash_env.sh#15> [[ -z /home/law/.bash_env ]]

/etc/local/bash_env.sh#19> type -t include
/etc/local/bash_env.sh#19> [[ function == function ]]
~/.bash_env#16> [[ -n '' ]]
~/.bash_env#20> export _LOCAL_BASH_ENV_CALLED=1
~/.bash_env#20> _LOCAL_BASH_ENV_CALLED=1
~/.bash_env#21> [[ -n '' ]]
~/.bash_env#21> [[ -O /tmp/debug_local ]]
part2#3> read ln
1 2 3
part2#4> addnums 1 2 3
environment#0(addnums)> declare -i sum=0
environment#1(addnums)> (( 3 ))
environment#2(addnums)> [[ 1 =~ [-0-9]+ ]]
environment#3(addnums)> sum+=1
environment#4(addnums)> shift
environment#1(addnums)> (( 2 ))
environment#2(addnums)> [[ 2 =~ [-0-9]+ ]]
environment#3(addnums)> sum+=2
environment#4(addnums)> shift
environment#1(addnums)> (( 1 ))
environment#2(addnums)> [[ 3 =~ [-0-9]+ ]]
environment#3(addnums)> sum+=3
environment#4(addnums)> shift
environment#1(addnums)> (( 0 ))
environment#6(addnums)> printf '%d\n' 6
6
environment#7(addnums)> return 6
part2#3> read ln ^D
Ishtar:/tmp>

Running the debugger we see:

bashdb part2
bash debugger, bashdb, release 4.4-0.94

Copyright 2002, 2003, 2004, 2006-2012, 2014, 2016 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

(/tmp/part2:3):
3: while read ln; do
bashdb<0> n
1 2 3
(/tmp/part2:4):
4: addnums $ln
bashdb<1> s
** Internal debug error _Dbg_is_file(): file argument null
(:1):
1: #!/bin/bash
bashdb<2> q
bashdb: That's all, folks...

=== where bash displays the source as environment, bashdb throws an internal error.

It's not really an internal error. The filename will be null in cases like this.

2 Attachments

Discussion

  • Astara

    Astara - 2019-02-16

    Just delete the error message in "lib/filecache.sh". It's not needed that I can tell.

    I made sure to put the problem in 2 files as wanted. I got reminded as a "new version" got installed and undid my last patch...

    Thanks again for a great product (if only you knew how rarely I give such praise maybe you wouldn't have been so impatient w/me last time). Oh well, most engineers have the interpersonal skills of a krogan, klingon, or similar.

     

    Last edit: Astara 2019-02-16
  • Astara

    Astara - 2019-03-04

    The above is true as far as it goes, HOWEVER, to actually be able to single step through addnums (or 'include' in my own environment), it is required that bash save source and line numbers for all functions since invokation whether debugging is on or not.

    That request has been made on the bug-bash list. Chet seemed to think bash did save the sourcefilename and line number -- didn't know about the behavior, so reported it as a bug. and submitted slightly modified versions of the above files ...

     
  • Rocky Bernstein

    Rocky Bernstein - 2019-03-04

    Thanks for the information and investigation.

    I probably won't be able to get to this for a while. If you want to submit a patch that will move things along. Thanks.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.