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

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