Blame SOURCES/gdb-6.8-bz436037-reg-no-longer-active.patch

7a6771
Index: gdb-6.8.50.20090803/gdb/valops.c
7a6771
===================================================================
7a6771
--- gdb-6.8.50.20090803.orig/gdb/valops.c	2009-08-04 06:30:45.000000000 +0200
7a6771
+++ gdb-6.8.50.20090803/gdb/valops.c	2009-08-04 06:33:05.000000000 +0200
7a6771
@@ -926,10 +926,18 @@ value_assign (struct value *toval, struc
7a6771
 	struct gdbarch *gdbarch;
7a6771
 	int value_reg;
7a6771
 
7a6771
-	/* Figure out which frame this is in currently.  */
7a6771
-	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
7a6771
 	value_reg = VALUE_REGNUM (toval);
7a6771
 
7a6771
+	/* Figure out which frame this is in currently.  */
7a6771
+	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
7a6771
+	/* "set $reg+=1" should work on programs with no debug info,
7a6771
+	   but frame_find_by_id returns NULL here (RH bug 436037).
7a6771
+	   Use current frame, it represents CPU state in this case.
7a6771
+	   If frame_find_by_id is changed to do it internally
7a6771
+	   (it is contemplated there), remove this.  */
7a6771
+	if (!frame)
7a6771
+	  frame = get_current_frame ();
7a6771
+	/* Probably never happens.  */
7a6771
 	if (!frame)
7a6771
 	  error (_("Value being assigned to is no longer active."));
7a6771