patches/gdb/6.8a/130-reg-no-longer-active.patch
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 17 18:29:35 2011 +0200 (2011-07-17)
changeset 2926 d304c8a7bfa8
parent 1343 e6f6153d318c
permissions -rw-r--r--
binutils: split binutils to backend/frontend, a-la cc_core

Move the actual binutils code to a backend function that builds the
required combo of build/host/target as requested by a frontend.

This split is currently a no-op, but is required for the upcoming
canadian-cross rework, where we'll be needing to build two binutils,
one for build/build/target, and one for build/host/target.

This applies to the three binutils:
- GNU binutils
- elf2flt
- sstrip

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