octave-maintainers
[Top][All Lists]
Advanced

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

Re: print_usage not triggering a backtrace


From: Jaroslav Hajek
Subject: Re: print_usage not triggering a backtrace
Date: Tue, 19 Jan 2010 07:24:38 +0100

On Mon, Jan 18, 2010 at 11:08 PM, John W. Eaton <address@hidden> wrote:
> On 18-Jan-2010, Jaroslav Hajek wrote:
>
> | today I noticed that if a DLD or built-in function throws an error
> | through print_usage, backtrace is not generated. Is this intentional?
> | Or shall I attempt a fix?
>
> The reason this happens is that the character string that print_usage
> sends to the error function ends in a newline character, and the error
> function omits backtrace info if the character string it is given ends
> in a newline character.
>
> I'm not sure what is best here, but I don't think it was intentional
> to omit the backtrace info if the error is raised by print_usage.
>
> It is intentional that the error function omit backtrace info if its
> argument ends in a newline character.
>

OK. Exactly why is that? I suppose there is a good reason, but I don't
see it right now.

> Shouldn't we discuss this on the maintainers list?
>

OK.
So what about the following change?
http://hg.savannah.gnu.org/hgweb/octave/rev/30817aa3889a

print_usage examines the dbstack to determine whether it's being
called from top level. If not, it omits the additional help message
and replaces the last newline by space, enabling backtrace again. It's
a bit of a hack, admittedly.

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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