]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Add the ability to query the die parent in all_dies_iterator
authorPetr Machata <pmachata@redhat.com>
Wed, 15 Sep 2010 21:31:56 +0000 (23:31 +0200)
committerPetr Machata <pmachata@redhat.com>
Wed, 15 Sep 2010 21:31:56 +0000 (23:31 +0200)
dwarflint/all-dies-it.hh

index a20e1a692f8c3ba09460dc4be62e8b21194d704f..615825762813239d56ccb6f7c0e4976341a8cd06 100644 (file)
@@ -122,6 +122,13 @@ public:
     return *_m_die_it;
   }
 
+  typename T::debug_info_entry const &parent ()
+  {
+    if (_m_die_it_stack.empty ())
+      throw std::runtime_error ("no parent");
+    return *_m_die_it_stack.back ().first;
+  }
+
   typename T::debug_info_entry const *operator-> () const
   {
     return &**this;