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

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