if (!event_loop_p || !target_can_async_p ())
if (!target_can_async_p ())
finish_command (char *arg, int from_tty){  struct symtab_and_line sal;  struct frame_info *frame;  struct symbol *function;  struct breakpoint *breakpoint;  struct cleanup *old_chain;  struct continuation_arg *arg1, *arg2, *arg3;  int async_exec = 0;  /* Find out whether we must run in the background.  */  if (arg != NULL)    async_exec = strip_bg_char (&arg);  /* If we must run in the background, but the target can't do it,     error out.  */  if (event_loop_p && async_exec && !target_can_async_p ())    error ("Asynchronous execution not supported on this target.");  /* If we are not asked to run in the bg, then prepare to run in the     foreground, synchronously.  */  if (event_loop_p && !async_exec && target_can_async_p ())    {      /* Simulate synchronous execution.  */      async_disable_stdin ();    }  if (arg)    error ("The \"finish\" command does not take any arguments.");  if (!target_has_execution)    error ("The program is not running.");  if (deprecated_selected_frame == NULL)    error ("No selected frame.");  frame = get_prev_frame (deprecated_selected_frame);  if (frame == 0)    error ("\"finish\" not meaningful in the outermost frame.");  clear_proceed_status ();  sal = find_pc_line (get_frame_pc (frame), 0);  sal.pc = get_frame_pc (frame);  breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), bp_finish);  if (!event_loop_p || !target_can_async_p ())    old_chain = make_cleanup_delete_breakpoint (breakpoint);  else    old_chain = make_exec_cleanup_delete_breakpoint (breakpoint);  /* Find the function we will return from.  */  function = find_pc_function (get_frame_pc (deprecated_selected_frame));  /* Print info on the selected frame, including level number but not     source.  */  if (from_tty)    {      printf_filtered ("Run till exit from ");      print_stack_frame (deprecated_selected_frame,			 frame_relative_level (deprecated_selected_frame), 0);    }  /* If running asynchronously and the target support asynchronous     execution, set things up for the rest of the finish command to be     completed later on, when gdb has detected that the target has     stopped, in fetch_inferior_event.  */  if (event_loop_p && target_can_async_p ())    {      arg1 =	(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));      arg2 =	(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));      arg3 =	(struct continuation_arg *) xmalloc (sizeof (struct continuation_arg));      arg1->next = arg2;      arg2->next = arg3;      arg3->next = NULL;      arg1->data.pointer = breakpoint;      arg2->data.pointer = function;      arg3->data.pointer = old_chain;      add_continuation (finish_command_continuation, arg1);    }  proceed_to_finish = 1;	/* We want stop_registers, please...  */  proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);  /* Do this only if not running asynchronously or if the target     cannot do async execution.  Otherwise, complete this command when     the target actually stops, in fetch_inferior_event.  */  if (!event_loop_p || !target_can_async_p ())    {      /* Did we stop at our breakpoint?  */      if (bpstat_find_breakpoint (stop_bpstat, breakpoint) != NULL	  && function != NULL)	{	  struct type *value_type;	  int struct_return;	  int gcc_compiled;	  value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function));	  if (!value_type)	    internal_error (__FILE__, __LINE__,			    "finish_command: function has no target type");	  /* FIXME: Shouldn't we do the cleanups before returning?  */	  if (TYPE_CODE (value_type) == TYPE_CODE_VOID)	    return;	  CHECK_TYPEDEF (value_type);	  gcc_compiled = BLOCK_GCC_COMPILED (SYMBOL_BLOCK_VALUE (function));	  struct_return = using_struct_return (value_type, gcc_compiled);	  print_return_value (struct_return, value_type); 	}      do_cleanups (old_chain);    }}