::Dwarf_CU *_m_cu;
unsigned char *_m_readptr;
- static unsigned char *formptr (Dwarf_Attribute *);
- const_iterator (Dwarf_Attribute *, unsigned char *readptr);
+ static unsigned char *formptr (int secndx, Dwarf_Attribute *);
+ const_iterator (int secndx, Dwarf_Attribute *, unsigned char *readptr);
public:
// Default constructor: only valid for operator=.
}
};
- const_iterator begin () const
- {
- const_iterator it (_m_attr.thisattr (), 0);
- return ++it;
- }
+ const_iterator begin () const;
const_iterator end () const
{
- return const_iterator (_m_attr.thisattr (), (unsigned char *)-1);
+ return const_iterator (-1, _m_attr.thisattr (), (unsigned char *)-1);
}
const_iterator find (const key_type &match) const
// For end iterator.
inline explicit const_iterator (Dwarf_Attribute *attr)
- : dwarf::range_list::const_iterator (attr, (unsigned char *)-1)
+ : dwarf::range_list::const_iterator (-1, attr, (unsigned char *)-1)
, _m_block ()
{}
// dwarf::range_list
unsigned char *
-dwarf::range_list::const_iterator::formptr (Dwarf_Attribute *attr)
+dwarf::range_list::const_iterator::formptr (int secndx, Dwarf_Attribute *attr)
{
- unsigned char *readptr = __libdw_formptr (attr, IDX_debug_ranges,
+ unsigned char *readptr = __libdw_formptr (attr, secndx,
DWARF_E_NO_DEBUG_RANGES,
NULL, NULL);
xif (attr, readptr == NULL);
return readptr;
}
-dwarf::range_list::const_iterator::const_iterator (Dwarf_Attribute *attr,
+dwarf::range_list::const_iterator
+dwarf::range_list::begin () const
+{
+ const_iterator it (IDX_debug_ranges, _m_attr.thisattr (), 0);
+ return ++it;
+}
+
+dwarf::range_list::const_iterator::const_iterator (int secndx,
+ Dwarf_Attribute *attr,
unsigned char *readptr)
: _m_base (-1), _m_begin (0), _m_end (0), _m_cu (attr->cu)
, _m_readptr (readptr)
{
if (_m_readptr == NULL)
{
- _m_readptr = formptr (attr);
+ _m_readptr = formptr (secndx, attr);
xif (attr, _m_readptr == NULL);
}
}
const_iterator i (_m_attr.thisattr ());
if (is_list ())
{
- i._m_readptr = const_iterator::formptr (_m_attr.thisattr ());
+ i._m_readptr = const_iterator::formptr (IDX_debug_loc,
+ _m_attr.thisattr ());
xif (_m_attr.thisattr (), i._m_readptr == NULL);
i.advance ();
}