bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please store source file name + line number for all functions define


From: Chet Ramey
Subject: Re: Please store source file name + line number for all functions defined whether or not bashdb is running.
Date: Mon, 4 Mar 2019 09:26:09 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.1

On 3/2/19 11:47 PM, L A Walsh wrote:

>>  You can get the file
>> and line number where the function is defined when extdebug is on, even if
>> you turn it on after the session has begun, and go from there.
>>   
> ----
>     Unfortunately, I can confirm that this DOES NOT WORK.

Sure it does.

> 
>     Earlier you said you could get the sourcefile + line number from
> BASH_SOURCE and BASH_LINENO(+LINENO).  I demonstrated that they printed
> out completely unrelated values.

No. I said they existed as an example of "behaviors available independent
of invoking the debugger." But that doesn't matter to this example.


> 
> Just now, I tried turning on extdebug and using declare -F to print
> the name of the source file and the line number:
> 
> This is the 1st few lines of a script that shows the problem:
> #!/bin/bash -u
> # vim=:SetNumberAndWidth
> #set -x
> hb=~law/bin (line#4)

I'm going to assume you added the parenthesized comment for this message.

> hl=~law/bin/lib
> 
> if ! [[ $hb =~ $PATH ]]; then export PATH="$hb:$hl:$PATH"; fi
> 
> trap $((1)) DEBUG   (line#0)
> shopt -s extdebug
> declare -F include
> include stdalias

Since you don't provide a definition for `include', it's hard to see
whether or not there's a problem and what it might be.

If you can provide a self-contained example that shows a probem, I'll
look at it.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]