Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: Odd trap return status
- X-seq: zsh-workers 17258
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx (Zsh hackers list)
- Subject: Re: PATCH: Re: Odd trap return status
- Date: Wed, 29 May 2002 19:34:12 +0100
- In-reply-to: "Bart Schaefer"'s message of "Wed, 29 May 2002 11:00:40 PDT." <Pine.LNX.4.44.0205291055460.7907-100000@xxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> Right, but
>
> foo () {
> trap 'false' DEBUG
> true
> }
>
> should not cause the exit status of foo to be nonzero.
This is already handled specially. I think the code was sort of working
before execsave()/execrestore() got introduced for safety rather than
for logic.
if (sigtrapped[SIGDEBUG]) {
exiting = donetrap;
ret = lastval;
dotrap(SIGDEBUG);
lastval = ret;
donetrap = exiting;
noerrexit = oldnoerrexit;
}
> Installing a debug
> trap shouldn't change the behavior of the debugged code unless it *also*
> (intentionally) changes the command flow.
That's going to be kind of tricky with the code quoted above, which I
missed before. But I don't feel like digging an even deeper hole.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author