2009-07-08 Roland McGrath <roland@redhat.com>
+ * c++/dwarf-knowledge.cc (expected_value_space):
+ DW_AT_data_member_location can be constant or location.
+ * c++/values.cc (what_space): Treat only data[48] as *ptr when those
+ are expected. No other data forms can be *ptr.
+
* c++/output-shape.cc: New file.
* Makefile.am (libdwpp_a_SOURCES): Add it.
* c++/dwarf_output: Call add_shape method there.
case DW_AT_location:
case DW_AT_string_length:
case DW_AT_return_addr:
- case DW_AT_data_member_location:
case DW_AT_frame_base:
case DW_AT_segment:
case DW_AT_static_link:
case DW_AT_vtable_elem_location:
return VS(location);
+ case DW_AT_data_member_location:
+ return VS(location) | VS(constant);
+
case DW_AT_name:
switch (tag)
{
return VS_location;
break;
- case DW_FORM_data1:
- case DW_FORM_data2:
case DW_FORM_data4:
case DW_FORM_data8:
+ // *ptr can only be these forms. Otherwise these are constants.
+ possible = VS(location) | VS(lineptr) | VS(macptr) | VS(rangelistptr);
+ if (expected & possible)
+ break;
+ /* Fall through. */
+
+ case DW_FORM_data1:
+ case DW_FORM_data2:
case DW_FORM_udata:
case DW_FORM_sdata:
- /* Target constant, known DWARF constant, or *ptr. */
+ /* Target constant, known DWARF constant. */
possible = (VS(dwarf_constant) | VS(constant)
- | VS(source_file) | VS(source_line) | VS(source_column)
- | VS(location) // loclistptr
- | VS(lineptr) | VS(macptr) | VS(rangelistptr));
- if ((expected & possible) == (VS(constant) | VS(location)))
- /* When both are expected, a constant is not a loclistptr. */
- return VS_constant;
+ | VS(source_file) | VS(source_line) | VS(source_column));
break;
case DW_FORM_string: