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

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