mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
* dwarf2read.c (dwarf2_const_value_data): Never sign extend.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2010-07-27 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2read.c (dwarf2_const_value_data): Never sign extend.
|
||||||
|
|
||||||
2010-07-28 Daniel Jacobowitz <dan@codesourcery.com>
|
2010-07-28 Daniel Jacobowitz <dan@codesourcery.com>
|
||||||
|
|
||||||
* dwarf2read.c (read_subroutine_type): Improve THIS detection,
|
* dwarf2read.c (read_subroutine_type): Improve THIS detection,
|
||||||
|
@ -10485,8 +10485,13 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Given an attr with a DW_FORM_dataN value in host byte order, sign-
|
/* Given an attr with a DW_FORM_dataN value in host byte order,
|
||||||
or zero-extend it as appropriate for the symbol's type. */
|
zero-extend it as appropriate for the symbol's type. The DWARF
|
||||||
|
standard (v4) is not entirely clear about the meaning of using
|
||||||
|
DW_FORM_dataN for a constant with a signed type, where the type is
|
||||||
|
wider than the data. The conclusion of a discussion on the DWARF
|
||||||
|
list was that this is unspecified. We choose to always zero-extend
|
||||||
|
because that is the interpretation long in use by GCC. */
|
||||||
static void
|
static void
|
||||||
dwarf2_const_value_data (struct attribute *attr,
|
dwarf2_const_value_data (struct attribute *attr,
|
||||||
struct symbol *sym,
|
struct symbol *sym,
|
||||||
@ -10495,12 +10500,7 @@ dwarf2_const_value_data (struct attribute *attr,
|
|||||||
LONGEST l = DW_UNSND (attr);
|
LONGEST l = DW_UNSND (attr);
|
||||||
|
|
||||||
if (bits < sizeof (l) * 8)
|
if (bits < sizeof (l) * 8)
|
||||||
{
|
|
||||||
if (TYPE_UNSIGNED (SYMBOL_TYPE (sym)))
|
|
||||||
l &= ((LONGEST) 1 << bits) - 1;
|
l &= ((LONGEST) 1 << bits) - 1;
|
||||||
else
|
|
||||||
l = (l << (sizeof (l) * 8 - bits)) >> (sizeof (l) * 8 - bits);
|
|
||||||
}
|
|
||||||
|
|
||||||
SYMBOL_VALUE (sym) = l;
|
SYMBOL_VALUE (sym) = l;
|
||||||
SYMBOL_CLASS (sym) = LOC_CONST;
|
SYMBOL_CLASS (sym) = LOC_CONST;
|
||||||
|
Reference in New Issue
Block a user