\doxysection{Using dwarf\+\_\+expand\+\_\+frame\+\_\+instructions }
\hypertarget{group__examples}{}\label{group__examples}\index{Using dwarf\_expand\_frame\_instructions@{Using dwarf\_expand\_frame\_instructions}}


Example using dwarf\+\_\+expand\+\_\+frame\+\_\+instructions.  


Example using dwarf\+\_\+expand\+\_\+frame\+\_\+instructions. 


\begin{DoxyCode}{0}
\DoxyCodeLine{*/}
\DoxyCodeLine{\textcolor{keywordtype}{int}\ examples(\doxymbox{\hyperlink{group__allstructs_gabc722c9c5e457634fe3e9fce95613c96}{Dwarf\_Cie}}\ cie,}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga376c1939313af42401fc67bc998fdd2c}{Dwarf\_Ptr}}\ instruction,\doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ len,}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_ga8d4fac0e48040b6ca91e06ffda09766a}{Dwarf\_Error}}\ *error)}
\DoxyCodeLine{\{}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__allstructs_gab7273fb778aa7b8f136da9a97a99f4b6}{Dwarf\_Frame\_Instr\_Head}}\ head\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ \ \ \ \ \ \ \ count\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordtype}{int}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ res\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ \ \ \ \ \ \ \ i\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ res\ =\ \doxymbox{\hyperlink{group__frame_ga92ff9aa1ceaeeb80be4c223c3d418ac2}{dwarf\_expand\_frame\_instructions}}(cie,instruction,len,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \&head,\&count,\ error);}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{if}\ (res\ !=\ DW\_DLV\_OK)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{\ \ \ \ \}}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \textcolor{keywordflow}{for}\ (i\ =\ 0;\ i\ <\ count;\ ++i)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ instr\_offset\_in\_instrs\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga52e439e652a1a30277679f64f83cc0fe}{Dwarf\_Small}}\ \ \ \ \ cfa\_operation\ \ \ \ \ \ \ \ \ \ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ \ \ \ \ *fields\_description\ \ \ \ \ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ u0\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ u1\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_gac91d9490d58c8d86a4d5b63ca93ba6dd}{Dwarf\_Signed}}\ \ \ \ s0\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_gac91d9490d58c8d86a4d5b63ca93ba6dd}{Dwarf\_Signed}}\ \ \ \ s1\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_ga5de64bb9627534a24dcbccc327916265}{Dwarf\_Unsigned}}\ \ code\_alignment\_factor\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__basicdatatypes_gac91d9490d58c8d86a4d5b63ca93ba6dd}{Dwarf\_Signed}}\ \ \ \ data\_alignment\_factor\ =\ 0;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__allstructs_gaf33d59f922707c0eb204edf251d323db}{Dwarf\_Block}}\ \ \ \ \ expression\_block;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *\ \ \ \ op\_name\ =\ 0;}
\DoxyCodeLine{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ memset(\&expression\_block,0,\textcolor{keyword}{sizeof}(expression\_block));}
\DoxyCodeLine{\ \ \ \ \ \ \ \ res\ =\ \doxymbox{\hyperlink{group__frame_gaa40c12f619117a6c8a7b0628aa971a75}{dwarf\_get\_frame\_instruction}}(head,i,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&instr\_offset\_in\_instrs,\&cfa\_operation,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&fields\_description,\&u0,\&u1,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&s0,\&s1,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&code\_alignment\_factor,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&data\_alignment\_factor,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \&expression\_block,error);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (res\ ==\ DW\_DLV\_ERROR)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \doxymbox{\hyperlink{group__frame_ga1aed531588ec95b9672123d010a3ee1d}{dwarf\_dealloc\_frame\_instr\_head}}(head);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ res;}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (res\ ==\ DW\_DLV\_OK)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ res\ =\ \doxymbox{\hyperlink{group___naming_ga377aab6b096e6bbb6c2487f351d98cd8}{dwarf\_get\_CFA\_name}}(cfa\_operation,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \&op\_name);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (res\ !=\ DW\_DLV\_OK)\ \{}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ op\_name\ =\ \textcolor{stringliteral}{"{}unknown\ op"{}};}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ printf(\textcolor{stringliteral}{"{}Instr\ \%2lu\ \%-\/22s\ \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (\textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{long})i,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ op\_name,}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ fields\_description);}
\DoxyCodeLine{\ \ \ \ \ \ \ \ \ \ \ \ \textcolor{comment}{/*\ \ Do\ something\ with\ the\ various\ data}}
\DoxyCodeLine{\textcolor{comment}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ as\ guided\ by\ the\ fields\_description.\ }}

\end{DoxyCode}
