Index: stack.c
===================================================================
RCS file: /sources/netbsd/NetBSD-cvs/src/gnu/dist/toolchain/gdb/stack.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 stack.c
--- stack.c	26 Jul 2000 00:33:01 -0000	1.1.1.1
+++ stack.c	9 Apr 2002 16:29:36 -0000
@@ -1088,6 +1088,47 @@
 }
 #endif
 
+/* Print stack from SP ARG */
+
+static void
+backfrom_command (char *arg, int from_tty)
+{
+  struct frame_info *trailing, *fi;
+  CORE_ADDR fp, pc;
+  int i = 0;
+  char *space_index;
+
+  if (!target_has_stack)
+    error ("No stack.");
+    
+  if (arg == NULL)
+      error ("missing arg");
+
+  space_index = (char *) strchr (arg, ' ');
+  if (space_index == NULL)
+      error ("missing arg (need fp, pc)");
+
+  *space_index = '\0';
+
+  fp = parse_and_eval_address (arg);
+  pc = parse_and_eval_address (space_index + 1);
+
+  trailing = create_new_frame (fp, pc);
+
+  for (i = 0, fi = trailing;
+       fi;
+       i++, fi = get_prev_frame (fi))
+    {
+      QUIT;
+
+      /* Don't use print_stack_frame; if an error() occurs it probably
+	 means further attempts to backtrace would fail (on the other
+	 hand, perhaps the code does or could be fixed to make sure
+	 the frame->prev field gets set to NULL in that case).  */
+      print_frame_info_base (fi, i, 0, 1);
+    }
+}
+
 /* Print briefly all stack frames or just the innermost COUNT frames.  */
 
 static void backtrace_command_1 PARAMS ((char *count_exp, int show_locals, int from_tty));
@@ -2138,6 +2179,7 @@
     }
 
   add_com_alias ("where", "backtrace", class_alias, 0);
+  add_com ("backfrom", class_stack, backfrom_command, "foo");
   add_info ("stack", backtrace_command,
 	    "Backtrace of the stack, or innermost COUNT frames.");
   add_info_alias ("s", "stack", 1);
