rewrite ipdb with RAII