Instead of fighting against the normal flow, just signal a SIGTRAP and let the existing flow handle it, as long as we set the halt flag correctly the system should halt.