\doxysection{Using dwarf\+\_\+globals\+\_\+by\+\_\+type() }
\hypertarget{group__exampleg}{}\label{group__exampleg}\index{Using dwarf\_globals\_by\_type()@{Using dwarf\_globals\_by\_type()}}


Example reading .debug\+\_\+pubtypes.  


Example reading .debug\+\_\+pubtypes. 

The .debug\+\_\+pubtypes section was in DWARF4, it could appear as an extension in other DWARF versions.. In libdwarf 0.\+5.\+0 and earlier the function \doxylink{group__pubnames_ga10ffe6065920a9dca3f4e29deedce14b}{dwarf\+\_\+get\+\_\+pubtypes()} was used instead.


\begin{DoxyCode}{0}
\DoxyCodeLine{*/}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ exampleg(\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\_Debug}}\ dbg,\ \doxymbox{\hyperlink{group__allstructs_ga8d4fac0e48040b6ca91e06ffda09766a}{Dwarf\_Error}}\ *error)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_gac91d9490d58c8d86a4d5b63ca93ba6dd}{Dwarf\_Signed}}\ \ count\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga59a6e779b3b390cf4f234c9edee87008}{Dwarf\_Global}}\ *types\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_gac91d9490d58c8d86a4d5b63ca93ba6dd}{Dwarf\_Signed}}\ \ i\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ res\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ res\ =\ \doxymbox{\hyperlink{group__pubnames_gaef3a5b4e40f2f1e65c42eeff102733aa}{dwarf\_globals\_by\_type}}(dbg,DW\_GL\_PUBTYPES,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \&types,\&count,error);}
\DoxyCodeLine{\ \ \ \ \textcolor{comment}{/*\ \ Alternatively\ the\ 0.5.0\ and\ earlier\ call:}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ \ \ \ \ res=dwarf\_get\_pubtypes(dbg,\ \&types,\&count,\ error);\ }}

\end{DoxyCode}
