* PR 15693 fix.
Wed Jun 10 18:04:35 1998 Frank Ch. Eigler <fche@cygnus.com> * gdbtypes.c (get_discrete_bounds): Assign unsigned type flag for all-positive enum. (create_set_type): Ditto for all-positive set values. * values.c (unpack_field_as_long): Check for typedef in struct field unpacking.
This commit is contained in:
parent
05faca8731
commit
7924771e5d
|
@ -52,6 +52,14 @@ end-sanitize-java
|
||||||
* (decode_line_1): Move local variable defs into the block they are
|
* (decode_line_1): Move local variable defs into the block they are
|
||||||
used in. (Improves code readability.)
|
used in. (Improves code readability.)
|
||||||
|
|
||||||
|
Wed Jun 10 18:04:35 1998 Frank Ch. Eigler <fche@cygnus.com>
|
||||||
|
|
||||||
|
* gdbtypes.c (get_discrete_bounds): Assign unsigned type flag for
|
||||||
|
all-positive enum.
|
||||||
|
(create_set_type): Ditto for all-positive set values.
|
||||||
|
* values.c (unpack_field_as_long): Check for typedef in struct
|
||||||
|
field unpacking.
|
||||||
|
|
||||||
Wed Jun 10 14:06:05 1998 Jason Molenda (crash@bugshack.cygnus.com)
|
Wed Jun 10 14:06:05 1998 Jason Molenda (crash@bugshack.cygnus.com)
|
||||||
|
|
||||||
* configure.in: Add some tests for gnu-regex.c's benefit.
|
* configure.in: Add some tests for gnu-regex.c's benefit.
|
||||||
|
|
|
@ -395,6 +395,12 @@ get_discrete_bounds (type, lowp, highp)
|
||||||
if (TYPE_FIELD_BITPOS (type, i) > *highp)
|
if (TYPE_FIELD_BITPOS (type, i) > *highp)
|
||||||
*highp = TYPE_FIELD_BITPOS (type, i);
|
*highp = TYPE_FIELD_BITPOS (type, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set unsigned indicator if warranted. */
|
||||||
|
if(*lowp >= 0)
|
||||||
|
{
|
||||||
|
TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -519,6 +525,10 @@ create_set_type (result_type, domain_type)
|
||||||
= (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
|
= (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
|
||||||
}
|
}
|
||||||
TYPE_FIELD_TYPE (result_type, 0) = domain_type;
|
TYPE_FIELD_TYPE (result_type, 0) = domain_type;
|
||||||
|
|
||||||
|
if(low_bound >= 0)
|
||||||
|
TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
|
||||||
|
|
||||||
return (result_type);
|
return (result_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1180,8 +1180,11 @@ unpack_field_as_long (type, valaddr, fieldno)
|
||||||
int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
|
int bitpos = TYPE_FIELD_BITPOS (type, fieldno);
|
||||||
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
|
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
|
||||||
int lsbcount;
|
int lsbcount;
|
||||||
|
struct type *field_type;
|
||||||
|
|
||||||
val = extract_unsigned_integer (valaddr + bitpos / 8, sizeof (val));
|
val = extract_unsigned_integer (valaddr + bitpos / 8, sizeof (val));
|
||||||
|
field_type = TYPE_FIELD_TYPE (type, fieldno);
|
||||||
|
CHECK_TYPEDEF (field_type);
|
||||||
|
|
||||||
/* Extract bits. See comment above. */
|
/* Extract bits. See comment above. */
|
||||||
|
|
||||||
|
@ -1198,7 +1201,7 @@ unpack_field_as_long (type, valaddr, fieldno)
|
||||||
{
|
{
|
||||||
valmask = (((ULONGEST) 1) << bitsize) - 1;
|
valmask = (((ULONGEST) 1) << bitsize) - 1;
|
||||||
val &= valmask;
|
val &= valmask;
|
||||||
if (!TYPE_UNSIGNED (TYPE_FIELD_TYPE (type, fieldno)))
|
if (!TYPE_UNSIGNED (field_type))
|
||||||
{
|
{
|
||||||
if (val & (valmask ^ (valmask >> 1)))
|
if (val & (valmask ^ (valmask >> 1)))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue