help-bash
[Top][All Lists]
Advanced

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

Can I use unwind_* mechanism in my loadable builtin?


From: Robert E. Griffith
Subject: Can I use unwind_* mechanism in my loadable builtin?
Date: Tue, 21 Jun 2022 09:34:24 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

In my loadable builtin I have a error handling mechanism based on setjmp/longjump. I thought I would use theĀ  unwind_prot.h/c mechanism to clean up resources but even though I am calling begin_unwind_frame() and discard_unwind_frame() in pairs, sometimes the discard fails because the tag set by begin_unwind_frame() does not exist. I think its after my builtin invokes the source.def builtin.

Maybe I dont fully understand the unwind mechanism. I thought it is a stack and as long as I leave it as it was (ie. each begin is followed by a discard or a run) that it should play nice with bashes' use of it.

Am I mistaken on that? Should my builtin provide a similar but separate mechanism?

--BobG





reply via email to

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