2009-09-30 Roland McGrath <roland@redhat.com>
+ * c++/values.cc (dwarf::attr_value::what_space):
+ Grok exprloc, flag_present, sec_offset.
+
* c++/values.cc (dwarf::attr_value::what_space): Fix data[48] case
to favor constants when expected.
switch (dwarf_whatform (thisattr ()))
{
case DW_FORM_flag:
+ case DW_FORM_flag_present:
return VS_flag;
case DW_FORM_addr:
case DW_FORM_block4:
/* Location expression or target constant. */
possible = VS(location) | VS(constant);
- if ((expected & possible) == possible)
+ if ((expected & possible) != possible)
/* When both are expected, a block is a location expression. */
- return VS_location;
- break;
+ break;
+ /* Fall through. */
+
+ case DW_FORM_exprloc:
+ return VS_location;
case DW_FORM_data1:
case DW_FORM_data2:
// If a constant is not expected, these can be *ptr instead.
possible = (VS(dwarf_constant) | VS(constant)
| VS(source_file) | VS(source_line) | VS(source_column));
- if ((expected & possible) == 0)
- possible = VS(location) | VS(lineptr) | VS(macptr) | VS(rangelistptr);
+ if (expected & possible)
+ break;
+
+ case DW_FORM_sec_offset:
+ possible = VS(location) | VS(lineptr) | VS(macptr) | VS(rangelistptr);
break;
case DW_FORM_string:
case DW_FORM_ref4:
case DW_FORM_ref8:
case DW_FORM_ref_udata:
- possible = VS(reference);
- break;
+ return VS_reference;
default:
throw std::runtime_error ("XXX bad form");