\doxysection{using dwarf\+\_\+validate\+\_\+die\+\_\+sibling }
\hypertarget{group__example__sibvalid}{}\label{group__example__sibvalid}\index{using dwarf\_validate\_die\_sibling@{using dwarf\_validate\_die\_sibling}}


Example of a DIE tree validation.  


Example of a DIE tree validation. 

Here we show how one uses \doxylink{group__dieentry_gadd68eadd59dec0753baa6ffa561f9780}{dwarf\+\_\+validate\+\_\+die\+\_\+sibling()}. Dwarfdump uses this function as a part of its validation of DIE trees.

It is not something you need to use. But one must use it in a specific pattern for it to work properly.

\doxylink{group__dieentry_gadd68eadd59dec0753baa6ffa561f9780}{dwarf\+\_\+validate\+\_\+die\+\_\+sibling()} depends on data set by \doxylink{group__compilationunit_gab31f79265b1d39aff271b1780c6d0eb9}{dwarf\+\_\+child()} preceeding \doxylink{group__compilationunit_gab8ae0bd010de9b7dca65f761b2c395e1}{dwarf\+\_\+siblingof\+\_\+b()} . \doxylink{group__compilationunit_gab31f79265b1d39aff271b1780c6d0eb9}{dwarf\+\_\+child()} records a little bit of information invisibly in the \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug} data.


\begin{DoxyCode}{0}
\DoxyCodeLine{*/}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ example\_sibvalid(\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\_Debug}}\ dbg,}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga3a3759c3047d78dba9f590d5e5893be5}{Dwarf\_Die}}\ in\_die,}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga8d4fac0e48040b6ca91e06ffda09766a}{Dwarf\_Error}}*error)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ cres\ =\ DW\_DLV\_OK;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ sibres\ =\ DW\_DLV\_OK;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga3a3759c3047d78dba9f590d5e5893be5}{Dwarf\_Die}}\ \ die\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga3a3759c3047d78dba9f590d5e5893be5}{Dwarf\_Die}}\ \ sibdie\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga3a3759c3047d78dba9f590d5e5893be5}{Dwarf\_Die}}\ \ child\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga32afecc94a71aae2be36aa279f1dded8}{Dwarf\_Bool}}\ is\_info\ =\ \doxymbox{\hyperlink{group__compilationunit_ga62be9a37c432b6143e1c4e333946b454}{dwarf\_get\_die\_infotypes\_flag}}(die);}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ die\ =\ in\_die;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{for}\ (\ ;\ die\ ;\ die\ =\ sibdie)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordtype}{int}\ vres\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ offset\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{comment}{/*\ Maybe\ print\ something\ you\ extract\ from\ the\ DIE\ }}

\end{DoxyCode}
