[PATCH] Fix frame ID comparison problem on s390

Ulrich Weigand weigand@i1.informatik.uni-erlangen.de
Sun Jun 27 22:35:00 GMT 2004


Daniel Jacobowitz wrote:

> Some future version of GCC will warn about this mistake.  The only
> valid values for "int : 1" are 0 and -1.

Good point, I had forgotten about this.  B.t.w. according to C99,
it is actually implementation-defined whether a bit field type 'int'
is signed or unsigned.  (Which still means it is a good idea to
explicitly use 'unsigned int', of course.)

Fixed by the following patch.  Tested on s390-ibm-linux and
s390x-ibm-linux, committed to mainline as obvious.

Bye,
Ulrich


ChangeLog:

	* frame.h (struct frame_id): Change bit field type of stack_addr_p, 
	code_addr_p and special_addr_p to 'unsigned int'.

Index: gdb/frame.h
===================================================================
RCS file: /cvs/src/src/gdb/frame.h,v
retrieving revision 1.135
diff -c -p -r1.135 frame.h
*** gdb/frame.h	27 Jun 2004 20:45:05 -0000	1.135
--- gdb/frame.h	27 Jun 2004 22:12:00 -0000
*************** struct frame_id
*** 124,132 ****
    CORE_ADDR special_addr;
  
    /* Flags to indicate the above fields have valid contents.  */
!   int stack_addr_p : 1;
!   int code_addr_p : 1;
!   int special_addr_p : 1;
  };
  
  /* Methods for constructing and comparing Frame IDs.
--- 124,132 ----
    CORE_ADDR special_addr;
  
    /* Flags to indicate the above fields have valid contents.  */
!   unsigned int stack_addr_p : 1;
!   unsigned int code_addr_p : 1;
!   unsigned int special_addr_p : 1;
  };
  
  /* Methods for constructing and comparing Frame IDs.


-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de



More information about the Gdb-patches mailing list