tui: Simplify tui_alloc_content
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 98c386ac6322ed1b79bea5f336fd4ae072ac8b4d..54aa1ef4cc49cfa01669972978bbc3ef33dca442 100644 (file)
@@ -1585,22 +1585,15 @@ advance_command (char *arg, int from_tty)
    right after an inferior call has finished.  */
 
 struct value *
-get_return_value (struct value *function, struct type *value_type,
-                 struct dummy_frame_context_saver *ctx_saver)
+get_return_value (struct value *function, struct type *value_type)
 {
-  struct regcache *stop_regs = NULL;
+  struct regcache *stop_regs;
   struct gdbarch *gdbarch;
   struct value *value;
-  struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
+  struct cleanup *cleanup;
 
-  /* If registers were not saved, use the current registers.  */
-  if (ctx_saver != NULL)
-    stop_regs = dummy_frame_context_saver_get_regs (ctx_saver);
-  else
-    {
-      stop_regs = regcache_dup (get_current_regcache ());
-      make_cleanup_regcache_xfree (stop_regs);
-    }
+  stop_regs = regcache_dup (get_current_regcache ());
+  cleanup = make_cleanup_regcache_xfree (stop_regs);
 
   gdbarch = get_regcache_arch (stop_regs);
 
@@ -1800,8 +1793,9 @@ finish_command_fsm_should_stop (struct thread_fsm *self)
          struct value *func;
 
          func = read_var_value (f->function, NULL, get_current_frame ());
-         rv->value = get_return_value (func, rv->type, NULL);
-         rv->value_history_index = record_latest_value (rv->value);
+         rv->value = get_return_value (func, rv->type);
+         if (rv->value != NULL)
+           rv->value_history_index = record_latest_value (rv->value);
        }
     }
   else if (tp->control.stop_step)
@@ -2697,7 +2691,8 @@ struct attach_command_continuation_args
 static void
 attach_command_continuation (void *args, int err)
 {
-  struct attach_command_continuation_args *a = args;
+  struct attach_command_continuation_args *a
+    = (struct attach_command_continuation_args *) args;
 
   if (err)
     return;
@@ -2708,7 +2703,8 @@ attach_command_continuation (void *args, int err)
 static void
 attach_command_continuation_free_args (void *args)
 {
-  struct attach_command_continuation_args *a = args;
+  struct attach_command_continuation_args *a
+    = (struct attach_command_continuation_args *) args;
 
   xfree (a->args);
   xfree (a);
This page took 0.024433 seconds and 4 git commands to generate.