if (ui_loop_hook) ui_loop_hook(0);
if (deprecated_ui_loop_hook) deprecated_ui_loop_hook(0);
static int angel_RDI_ExecuteOrStep(PointHandle *handle, word type,                                    unsigned ninstr){  extern int (*ui_loop_hook) (int);  int err;  adp_stopped_struct stopped_info;  void* stateptr = (void *)&stopped_info;  ChannelCallback HandleStoppedMessageFPtr=(ChannelCallback) HandleStoppedMessage;  int status, reasoncode, debugID, OSinfo1, OSinfo2;  Packet *packet = NULL;  TracePrint(("angel_RDI_ExecuteOrStep\n"));  err = Adp_ChannelRegisterRead(CI_TADP,                                HandleStoppedMessageFPtr, stateptr);  if (err != RDIError_NoError) {#ifdef DEBUG    angel_DebugPrint("TADP Register failed.\n");#endif    return err;  }  /* Set executing TRUE here, as it must be set up before the target has   * had any chance at all to execute, or it may send its stopped message   * before we get round to setting executing = TRUE !!!   */  executing = TRUE;  register_debug_message_handler();#ifdef TEST_DC_APPL  Adp_Install_DC_Appl_Handler( test_dc_appl_handler );#endif#ifdef DEBUG  angel_DebugPrint("Transmiting %s message.\n",                   type == ADP_Execute ? "execute": "step");#endif  register_debug_message_handler();  /* Extra ninstr parameter for execute message will simply be ignored */  err = msgsend(CI_HADP,"%w%w%w%w%w", type | HtoT, 0,                ADP_HandleUnknown, ADP_HandleUnknown, ninstr);#if DEBUG  if (err != RDIError_NoError) angel_DebugPrint("Transmit failed.\n");#endif  reasoncode = type | TtoH;  err = wait_for_debug_message( &reasoncode, &debugID, &OSinfo1, &OSinfo2,                                &status, &packet );  if (err != RDIError_NoError)     return err;  else if (status != RDIError_NoError)     return status;#ifdef DEBUG  angel_DebugPrint("Waiting for program to finish...\n");#endif  interrupt_request = FALSE;  stop_request = FALSE;    signal(SIGINT, ardi_sigint_handler);  while( executing )  {    if (ui_loop_hook)      ui_loop_hook(0);        if (interrupt_request || stop_request)      {        interrupt_target();        interrupt_request = FALSE;        stop_request = FALSE;      }    Adp_AsynchronousProcessing( async_block_on_nothing );  }  signal(SIGINT, SIG_IGN);#ifdef TEST_DC_APPL  Adp_Install_DC_Appl_Handler( NULL );#endif  (void)Adp_ChannelRegisterRead(CI_TADP, NULL, NULL);  *handle = (PointHandle)stopped_info.data;  CallStoppedProcs(stopped_info.stopped_reason);  return stopped_info.stopped_status;}