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

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