--- gdb-4.18/gdb/stack.c.old	Tue Dec 14 23:32:26 1999
+++ gdb-4.18/gdb/stack.c	Wed Dec 15 00:00:58 1999
@@ -94,6 +94,7 @@
 static void print_stack_frame_base PARAMS ((struct frame_info *, int, int));
 
 static void backtrace_command PARAMS ((char *, int));
+static void backfrom_command PARAMS ((char *, int));
 
 struct frame_info *parse_frame_specification PARAMS ((char *));
 
@@ -969,6 +970,44 @@
 }
 #endif
 
+/* Print stack from SP ARG */
+
+static void
+backfrom_command (char *arg, int from_tty)
+{
+  register struct frame_info *trailing, *fi;
+  register CORE_ADDR fp, pc;
+  register int i = 0;
+  char *space_index;
+
+  if (!target_has_stack)
+    error ("No stack.");
+    
+  space_index = (char *) strchr (arg, ' ');
+  if (space_index == NULL)
+      error ("missing arg");
+
+  *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
@@ -1977,6 +2016,9 @@
 With a negative argument, print outermost -COUNT frames.\n\
 Use of the 'full' qualifier also prints the values of the local variables.\n");
   add_com_alias ("bt", "backtrace", class_stack, 0);
+
+  add_com ("backfrom", class_stack, backfrom_command,
+	   "Print backtrace of FRAMEPOINTER and PROGRAMCOUNTER.\n");
   if (xdb_commands)
     {
       add_com_alias ("t", "backtrace", class_stack, 0);
