From: Petr Machata Date: Wed, 15 Sep 2010 21:31:56 +0000 (+0200) Subject: dwarflint: Add the ability to query the die parent in all_dies_iterator X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1f4dc015997948c9b3c5b7ee047981f82678384;p=thirdparty%2Felfutils.git dwarflint: Add the ability to query the die parent in all_dies_iterator --- diff --git a/dwarflint/all-dies-it.hh b/dwarflint/all-dies-it.hh index a20e1a692..615825762 100644 --- a/dwarflint/all-dies-it.hh +++ b/dwarflint/all-dies-it.hh @@ -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;