patches/gdb/6.8a/130-reg-no-longer-active.patch
author danielrubiob@gmail.com
Tue Feb 11 21:34:48 2014 +0100 (2014-02-11)
changeset 3285 a8cb9039fade
parent 1343 e6f6153d318c
permissions -rw-r--r--
complibs/cloog: bump version

Signed-off-by: Daniel Rubio Bonilla <danielrubiob@gmail.com>
[yann.morin.1998@free.fr: re-order versions]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Cody P Schafer <dev@codyps.com>
Message-Id: <c2de3964cd6d5e4173cc.1391984023@uemo>
Patchwork-Id: 318637
yann@1343
     1
Fix bug reported by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
yann@1343
     2
See: http://sourceware.org/ml/crossgcc/2009-05/msg00055.html
yann@1343
     3
     https://bugzilla.redhat.com/show_bug.cgi?id=436037
yann@1343
     4
yann@1343
     5
Fix from: http://cvs.fedoraproject.org/viewvc/devel/gdb/gdb-6.8-bz436037-reg-no-longer-active.patch?revision=1.1
yann@1343
     6
yann@1343
     7
diff -d -urpN src.0/gdb/valops.c src.1/gdb/valops.c
yann@1343
     8
--- src.0/gdb/valops.c	2008-07-27 04:00:03.000000000 +0200
yann@1343
     9
+++ src.1/gdb/valops.c	2008-07-31 15:17:42.000000000 +0200
yann@1343
    10
@@ -813,10 +813,18 @@ value_assign (struct value *toval, struc
yann@1343
    11
 	struct frame_info *frame;
yann@1343
    12
 	int value_reg;
yann@1343
    13
 
yann@1343
    14
-	/* Figure out which frame this is in currently.  */
yann@1343
    15
-	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
yann@1343
    16
 	value_reg = VALUE_REGNUM (toval);
yann@1343
    17
 
yann@1343
    18
+	/* Figure out which frame this is in currently.  */
yann@1343
    19
+	frame = frame_find_by_id (VALUE_FRAME_ID (toval));
yann@1343
    20
+	/* "set $reg+=1" should work on programs with no debug info,
yann@1343
    21
+	   but frame_find_by_id returns NULL here (RH bug 436037).
yann@1343
    22
+	   Use current frame, it represents CPU state in this case.
yann@1343
    23
+	   If frame_find_by_id is changed to do it internally
yann@1343
    24
+	   (it is contemplated there), remove this.  */
yann@1343
    25
+	if (!frame)
yann@1343
    26
+	  frame = get_current_frame ();
yann@1343
    27
+	/* Probably never happens.  */
yann@1343
    28
 	if (!frame)
yann@1343
    29
 	  error (_("Value being assigned to is no longer active."));
yann@1343
    30