Debugging a Program With dbx

lwp_exit

Fired when lwp has been exited. $lwp contains the id of the exited LWP.