Use pdb.post_mortem instead of pdb.set_trace in debug utility.