\doxysection{Harmless Error recording }
\hypertarget{group__harmless}{}\label{group__harmless}\index{Harmless Error recording@{Harmless Error recording}}
\doxysubsubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\Hypertarget{group__harmless_ga219cf48c726f23d3df32624ffbca8c04}\label{group__harmless_ga219cf48c726f23d3df32624ffbca8c04} 
\+\#define {\bfseries DW\+\_\+\+HARMLESS\+\_\+\+ERROR\+\_\+\+CIRCULAR\+\_\+\+LIST\+\_\+\+DEFAULT\+\_\+\+SIZE}~4
\begin{DoxyCompactList}\small\item\em Default size of the libdwarf-\/internal circular list. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
DW\+\_\+\+API int \doxymbox{\hyperlink{group__harmless_gac49da5fb76059c6759943ccd775648d2}{dwarf\+\_\+get\+\_\+harmless\+\_\+error\+\_\+list}} (\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}} dw\+\_\+dbg, unsigned int dw\+\_\+count, const char \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*}dw\+\_\+errmsg\+\_\+ptrs\+\_\+array, unsigned int \texorpdfstring{$\ast$}{*}dw\+\_\+newerr\+\_\+count)
\begin{DoxyCompactList}\small\item\em Get the harmless error count and content. \end{DoxyCompactList}\item 
DW\+\_\+\+API unsigned int \doxymbox{\hyperlink{group__harmless_gad5e39159defb6d7811a24467fed07c9b}{dwarf\+\_\+set\+\_\+harmless\+\_\+error\+\_\+list\+\_\+size}} (\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}} dw\+\_\+dbg, unsigned int dw\+\_\+maxcount)
\begin{DoxyCompactList}\small\item\em The size of the circular list of strings libdwarf holds internally may be set and reset as needed. If it is shortened excess messages are simply dropped. It returns the previous size. If zero passed in the size is unchanged and it simply returns the current size. \end{DoxyCompactList}\item 
DW\+\_\+\+API int \doxymbox{\hyperlink{group__harmless_ga07bb6b4aba797e93aeaf22d543a46b66}{dwarf\+\_\+set\+\_\+harmless\+\_\+errors\+\_\+enabled}} (\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}} dw\+\_\+dbg, int dw\+\_\+v)
\begin{DoxyCompactList}\small\item\em Enable or disable libdwarf tracking of harmless errors. Harmless errors are used by tools like dwarfdump. Disabling harmless errors can improve performance by avoiding string copies. Defaults to enabled. \end{DoxyCompactList}\item 
DW\+\_\+\+API void \doxymbox{\hyperlink{group__harmless_ga856df7d4e021ddff85815ff5376b88c1}{dwarf\+\_\+insert\+\_\+harmless\+\_\+error}} (\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}} dw\+\_\+dbg, char \texorpdfstring{$\ast$}{*}dw\+\_\+newerror)
\begin{DoxyCompactList}\small\item\em Harmless Error Insertion is only for testing. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
The harmless error list is a fixed size circular buffer of errors we note but which do not stop us from processing the object. Created so dwarfdump or other tools can report such inconsequential errors without causing anything to stop early.

You can change the list size from the default of DW\+\_\+\+HARMLESS\+\_\+\+ERROR\+\_\+\+CIRCULAR\+\_\+\+LIST\+\_\+\+DEFAULT\+\_\+\+SIZE at any time for a \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug} dbg.

Harmless error data is dealloc\textquotesingle{}d by \doxylink{group__initfunctions_ga14a505c07ee5481401735f280f719454}{dwarf\+\_\+finish()}. 

\label{doc-func-members}
\Hypertarget{group__harmless_doc-func-members}
\doxysubsection{Function Documentation}
\Hypertarget{group__harmless_gac49da5fb76059c6759943ccd775648d2}\index{Harmless Error recording@{Harmless Error recording}!dwarf\_get\_harmless\_error\_list@{dwarf\_get\_harmless\_error\_list}}
\index{dwarf\_get\_harmless\_error\_list@{dwarf\_get\_harmless\_error\_list}!Harmless Error recording@{Harmless Error recording}}
\doxysubsubsection{\texorpdfstring{dwarf\_get\_harmless\_error\_list()}{dwarf\_get\_harmless\_error\_list()}}
{\footnotesize\ttfamily \label{group__harmless_gac49da5fb76059c6759943ccd775648d2} 
DW\+\_\+\+API int dwarf\+\_\+get\+\_\+harmless\+\_\+error\+\_\+list (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}}}]{dw\+\_\+dbg}{, }\item[{unsigned int}]{dw\+\_\+count}{, }\item[{const char \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*}}]{dw\+\_\+errmsg\+\_\+ptrs\+\_\+array}{, }\item[{unsigned int \texorpdfstring{$\ast$}{*}}]{dw\+\_\+newerr\+\_\+count}{}\end{DoxyParamCaption})}



Get the harmless error count and content. 

User code supplies size of array of pointers dw\+\_\+errmsg\+\_\+ptrs\+\_\+array in count and the array of pointers (the pointers themselves need not be initialized). The pointers returned in the array of pointers are invalidated by ANY call to libdwarf. Use them before making another libdwarf call! The array of string pointers passed in always has a final null pointer, so if there are N pointers the and M actual strings, then MIN(M,N-\/1) pointers are set to point to error strings. The array of pointers to strings always terminates with a NULL pointer. Do not free the strings. Every string is null-\/terminated.

Each call empties the error list (discarding all current entries). and fills in your array


\begin{DoxyParams}{Parameters}
{\em dw\+\_\+dbg} & The applicable \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}. \\
\hline
{\em dw\+\_\+count} & The number of string buffers. If count is passed as zero no elements of the array are touched. \\
\hline
{\em dw\+\_\+errmsg\+\_\+ptrs\+\_\+array} & A pointer to a user-\/created array of pointer to const char. \\
\hline
{\em dw\+\_\+newerr\+\_\+count} & If non-\/\+NULL the count of harmless errors pointers since the last call is returned through the pointer. If dw\+\_\+count is greater than zero the first dw\+\_\+count of the pointers in the user-\/created array point to null-\/terminated strings. Do not free the strings. print or copy the strings before any other libdwarf call.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns DW\+\_\+\+DLV\+\_\+\+NO\+\_\+\+ENTRY if no harmless errors were noted so far. Returns DW\+\_\+\+DLV\+\_\+\+OK if there are harmless errors. Never returns DW\+\_\+\+DLV\+\_\+\+ERROR.
\end{DoxyReturn}
If DW\+\_\+\+DLV\+\_\+\+NO\+\_\+\+ENTRY is returned none of the arguments other than dw\+\_\+dbg are touched or used. \Hypertarget{group__harmless_ga856df7d4e021ddff85815ff5376b88c1}\index{Harmless Error recording@{Harmless Error recording}!dwarf\_insert\_harmless\_error@{dwarf\_insert\_harmless\_error}}
\index{dwarf\_insert\_harmless\_error@{dwarf\_insert\_harmless\_error}!Harmless Error recording@{Harmless Error recording}}
\doxysubsubsection{\texorpdfstring{dwarf\_insert\_harmless\_error()}{dwarf\_insert\_harmless\_error()}}
{\footnotesize\ttfamily \label{group__harmless_ga856df7d4e021ddff85815ff5376b88c1} 
DW\+\_\+\+API void dwarf\+\_\+insert\+\_\+harmless\+\_\+error (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}}}]{dw\+\_\+dbg}{, }\item[{char \texorpdfstring{$\ast$}{*}}]{dw\+\_\+newerror}{}\end{DoxyParamCaption})}



Harmless Error Insertion is only for testing. 

Useful for testing the harmless error mechanism.


\begin{DoxyParams}{Parameters}
{\em dw\+\_\+dbg} & Pass in an open \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug} \\
\hline
{\em dw\+\_\+newerror} & Pass in a string whose content the function inserts as a harmless error (which dwarf\+\_\+get\+\_\+harmless\+\_\+error\+\_\+list will retrieve). \\
\hline
\end{DoxyParams}
\Hypertarget{group__harmless_gad5e39159defb6d7811a24467fed07c9b}\index{Harmless Error recording@{Harmless Error recording}!dwarf\_set\_harmless\_error\_list\_size@{dwarf\_set\_harmless\_error\_list\_size}}
\index{dwarf\_set\_harmless\_error\_list\_size@{dwarf\_set\_harmless\_error\_list\_size}!Harmless Error recording@{Harmless Error recording}}
\doxysubsubsection{\texorpdfstring{dwarf\_set\_harmless\_error\_list\_size()}{dwarf\_set\_harmless\_error\_list\_size()}}
{\footnotesize\ttfamily \label{group__harmless_gad5e39159defb6d7811a24467fed07c9b} 
DW\+\_\+\+API unsigned int dwarf\+\_\+set\+\_\+harmless\+\_\+error\+\_\+list\+\_\+size (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}}}]{dw\+\_\+dbg}{, }\item[{unsigned int}]{dw\+\_\+maxcount}{}\end{DoxyParamCaption})}



The size of the circular list of strings libdwarf holds internally may be set and reset as needed. If it is shortened excess messages are simply dropped. It returns the previous size. If zero passed in the size is unchanged and it simply returns the current size. 


\begin{DoxyParams}{Parameters}
{\em dw\+\_\+dbg} & The applicable \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}. \\
\hline
{\em dw\+\_\+maxcount} & Set the new internal buffer count to a number greater than zero. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
returns the current size of the internal circular buffer if dw\+\_\+maxcount is zero. If dw\+\_\+maxcount is greater than zero the internal array is adjusted to hold that many and the previous number of harmless errors possible in the circular buffer is returned. 
\end{DoxyReturn}
\Hypertarget{group__harmless_ga07bb6b4aba797e93aeaf22d543a46b66}\index{Harmless Error recording@{Harmless Error recording}!dwarf\_set\_harmless\_errors\_enabled@{dwarf\_set\_harmless\_errors\_enabled}}
\index{dwarf\_set\_harmless\_errors\_enabled@{dwarf\_set\_harmless\_errors\_enabled}!Harmless Error recording@{Harmless Error recording}}
\doxysubsubsection{\texorpdfstring{dwarf\_set\_harmless\_errors\_enabled()}{dwarf\_set\_harmless\_errors\_enabled()}}
{\footnotesize\ttfamily \label{group__harmless_ga07bb6b4aba797e93aeaf22d543a46b66} 
DW\+\_\+\+API int dwarf\+\_\+set\+\_\+harmless\+\_\+errors\+\_\+enabled (\begin{DoxyParamCaption}\item[{\doxymbox{\hyperlink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug}}}]{dw\+\_\+dbg}{, }\item[{int}]{dw\+\_\+v}{}\end{DoxyParamCaption})}



Enable or disable libdwarf tracking of harmless errors. Harmless errors are used by tools like dwarfdump. Disabling harmless errors can improve performance by avoiding string copies. Defaults to enabled. 


\begin{DoxyParams}{Parameters}
{\em dw\+\_\+dbg} & Pass in an open \doxylink{group__allstructs_gac2ba1e1c1b70a3191506b414195ca807}{Dwarf\+\_\+\+Debug} \\
\hline
{\em dw\+\_\+v} & If zero passed in, harmless errors will not be tracked and libdwarf will run somewhat faster If non-\/zero passed in libdwarf will resume or continue tracking harmless errors \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Returns the previous version of the flag. 
\end{DoxyReturn}
