make_cleanup (delete_breakpoint_current_contents, &through_sigtramp_breakpoint);
wait_for_inferior (void){  struct cleanup *old_cleanups;  struct execution_control_state ecss;  struct execution_control_state *ecs;  old_cleanups = make_cleanup (delete_step_resume_breakpoint,			       &step_resume_breakpoint);  make_cleanup (delete_breakpoint_current_contents,		&through_sigtramp_breakpoint);  /* wfi still stays in a loop, so it's OK just to take the address of     a local to get the ecs pointer.  */  ecs = &ecss;  /* Fill in with reasonable starting values.  */  init_execution_control_state (ecs);  /* We'll update this if & when we switch to a new thread. */  previous_inferior_ptid = inferior_ptid;  overlay_cache_invalid = 1;  /* We have to invalidate the registers BEFORE calling target_wait     because they can be loaded from the target while in target_wait.     This makes remote debugging a bit more efficient for those     targets that provide critical registers as part of their normal     status mechanism. */  registers_changed ();  while (1)    {      if (target_wait_hook)	ecs->ptid = target_wait_hook (ecs->waiton_ptid, ecs->wp);      else	ecs->ptid = target_wait (ecs->waiton_ptid, ecs->wp);      /* Now figure out what to do with the result of the result.  */      handle_inferior_event (ecs);      if (!ecs->wait_some_more)	break;    }  do_cleanups (old_cleanups);}