recording file death
[deliverable/binutils-gdb.git] / gdb / stack.c
index f0625e219f495598d1fc65f9f243db1e937ca243..a8037c4551d256d0c26e01a8050551816fd5f502 100644 (file)
@@ -624,7 +624,7 @@ backtrace_command (count_exp, from_tty)
          fi = get_frame_info (frame);
          ps = find_pc_psymtab (fi->pc);
          if (ps)
-           (void) PSYMTAB_TO_SYMTAB (ps);      /* Force syms to come in */
+           PSYMTAB_TO_SYMTAB (ps);     /* Force syms to come in */
        }
     }
 
@@ -779,7 +779,7 @@ print_frame_label_vars (frame, this_level_only, stream)
 
   bl = blockvector_for_pc (BLOCK_END (block) - 4, &index);
   blocks_printed = (char *) alloca (BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
-  bzero (blocks_printed, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
+  memset (blocks_printed, 0, BLOCKVECTOR_NBLOCKS (bl) * sizeof (char));
 
   while (block != 0)
     {
@@ -1066,7 +1066,7 @@ up_silently_command (count_exp, from_tty)
     count = parse_and_eval_address (count_exp);
   count1 = count;
   
-  if (!target_has_stack)
+  if (target_has_stack == 0 || selected_frame == 0)
     error ("No stack.");
 
   frame = find_relative_frame (selected_frame, &count1);
@@ -1099,7 +1099,7 @@ down_silently_command (count_exp, from_tty)
     count = - parse_and_eval_address (count_exp);
   count1 = count;
   
-  if (!target_has_stack)
+  if (target_has_stack == 0 || selected_frame == 0)
     error ("No stack.");
 
   frame = find_relative_frame (selected_frame, &count1);
@@ -1129,6 +1129,7 @@ return_command (retval_exp, from_tty)
   FRAME frame;
   char *funcname;
   struct cleanup *back_to;
+  value return_value;
 
   if (selected_frame == NULL)
     error ("No selected frame.");
@@ -1136,6 +1137,16 @@ return_command (retval_exp, from_tty)
   selected_frame_addr = FRAME_FP (selected_frame);
   selected_frame_pc = (get_frame_info (selected_frame))->pc;
 
+  /* Compute the return value (if any -- possibly getting errors here).
+     Call VALUE_CONTENTS to make sure we have fully evaluated it, since
+     it might live in the stack frame we're about to pop.  */
+
+  if (retval_exp)
+    {
+      return_value = parse_and_eval (retval_exp);
+      VALUE_CONTENTS (return_value);
+    }
+
   /* If interactive, require confirmation.  */
 
   if (from_tty)
@@ -1173,7 +1184,7 @@ return_command (retval_exp, from_tty)
      for return values.  */
 
   if (retval_exp)
-    set_return_value (parse_and_eval (retval_exp));
+    set_return_value (return_value);
 
   /* If interactive, print the frame that is now current.  */
 
@@ -1228,6 +1239,7 @@ This is useful in command scripts.");
           "Select and print stack frame called by this one.\n\
 An argument says how many frames down to go.");
   add_com_alias ("do", "down", class_stack, 1);
+  add_com_alias ("dow", "down", class_stack, 1);
   add_com ("down-silently", class_support, down_silently_command,
           "Same as the `down' command, but does not print anything.\n\
 This is useful in command scripts.");
This page took 0.025673 seconds and 4 git commands to generate.