This corresponds to the August 11, 2015 distribution...
[dwarf-doc.git] / dwarf5 / latexdoc / dwarf5.tex
1 \documentclass[12pt,letterpaper,oneside]{memoir} 
2 % for debugging, add 'draft' (without quotes) to the [] document class list.
3 % If draft is in the document class list, pix are just suggested
4 % by an outline, the pic does not appear as a picture.
5 %
6 \newcommand{\docdate}{August 11, 2015}
7 %
8 \usepackage{ifthen}
9 \newcommand{\ifthen}[2]{\ifthenelse{#1}{#2}{}}
10 \newboolean{isdraft}\setboolean{isdraft}{true}
11 \newcommand{\draftmark}{\ifthenelse{\boolean{isdraft}}{*** DRAFT ***}{}}
12 %
13 \usepackage[T1]{fontenc}
14 \usepackage{palatino}
15 \usepackage{cmtt}
16 \renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter instead of Courier
17 %\usepackage{ascii}
18 %\renewcommand{\ttdefault}{ascii}
19 %\renewcommand{\ttfamily}{\asciifamily}
20 %\usepackage{microtype}
21 %\DisableLigatures[f]{encoding=T1}
22 %\renewcommand{\familydefault}{phv}  % font family helvetica
23 %
24
25 \usepackage{url}           % for color in letters. Links instead?
26 \usepackage[usenames]{color}%for color in letters. Links instead?
27 \usepackage{ellipsis}      % provides ... as \dots
28 \usepackage[utf8]{inputenc}% to type directly diacritic characters
29 %\usepackage{color}
30 \usepackage{listings}
31 \usepackage{alltt}
32 \lstset{ %
33 language={},               % choose the language of the code
34 basicstyle=\footnotesize\ttfamily, % the size of the fonts that are used for the code
35 numbers=none,              % where to put the line-numbers
36 numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers
37 numberfirstline=true,
38 firstnumber=1,             % first line number in each listing
39 stepnumber=5,              % the step between two line-numbers. If it is 1 each line will be numbered
40 numbersep=10pt,            % how far the line-numbers are from the code
41 backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color}
42 showspaces=false,          % show spaces adding particular underscores
43 showstringspaces=false,    % underline spaces within strings
44 showtabs=false,            % show tabs within strings adding particular underscores
45 frame=single,              % adds a frame around the code
46 tabsize=2,                 % sets default tabsize to 2 spaces
47 captionpos=b,              % sets the caption-position to bottom
48 breaklines=true,           % sets automatic line breaking
49 breakatwhitespace=false,   % sets if automatic breaks should only happen at whitespace
50 escapeinside={\%*}{*)}     % if you want to add a comment within your code
51 }
52 \usepackage{float}
53 \restylefloat{figure}
54 \usepackage{amsmath}       % Provides \nobreakdash
55 \usepackage{amssymb}       % maths
56 \usepackage{graphicx}      % For pictures
57 \usepackage{epstopdf}      % Autoconvert .eps to .pdf
58 \epstopdfsetup{suffix=-generated} % Mark generaed PDF as such
59 \usepackage{longtable}     % For multipage tables
60 \usepackage{hhline}        % Single column horizontal lines
61 \usepackage{varioref}      % defines \vref
62 % \textregistered is the trademark symbol
63 \usepackage[headheight=16pt,paper=letterpaper]{geometry}
64 \setlength{\headheight}{15pt}  % avoids warning from latex
65 \usepackage{needspace}     % For assuring space remaining on a page
66 \usepackage{ifthen}        % For conditional processing
67 \usepackage{changepage}    % For odd/even page checks
68 \usepackage[usenames,dvipsnames]{xcolor}
69 \usepackage{lscape}        % For landscape mode (Appendix B)
70 \usepackage{tikz}          % graphics (Name Index (Fig 6.1), Appendix B)
71 \usetikzlibrary{arrows}
72 \usetikzlibrary{arrows.meta}
73 \usetikzlibrary{backgrounds}
74 \usetikzlibrary{calc}
75 \usetikzlibrary{chains}
76 \usetikzlibrary{decorations.pathreplacing}
77 \usetikzlibrary{shapes.geometric}
78 \usetikzlibrary{shapes.multipart}
79 \usetikzlibrary{shapes.symbols}
80 \usepackage{changebar}     % For change bars in margin
81 \usepackage{makeidx}       % For making an index
82 % hyperref must be the last package listed.
83 % The hyperref settings helps hypertext get links right in the 
84 % pdf of the index. 
85 % Also, allcolors lets us generate colored active links inside a pdf.
86 % And breaklinks resolves truncation issues with very long link names.
87 \usepackage[breaklinks,plainpages=false,pdfpagelabels,pagebackref,allcolors=blue,bookmarksnumbered=true]{hyperref}
88 \makeindex  % This and the makeidx package allow \index to create index entries.
89
90 \newcommand{\dwf}{DWARF Debugging Information Format}
91
92 \newenvironment{myindentpara}[1]%
93   {\begin{list}{}%
94     {\setlength{\leftmargin}{#1}}%
95     \item[]%
96   }
97   {\end{list}}
98
99 \hypersetup{colorlinks=true,
100   %bookmarks=true,
101   pdfauthor={\dwf\ Committee},
102   pdftitle={\dwf\ Version 5}
103 }
104
105 % An environment to create a listing-like (boxed) presentation for DWARF examples
106 % Use like \begin{lstlisting}...\end{lstlisting}. Does not do line numbers (boo)
107 % but does full LaTex processing within its scope (unlike \verb).
108 \newsavebox{\savedwf}
109 \newenvironment{dwflisting}{\begin{lrbox}{\savedwf}
110   \begin{minipage}{\textwidth}\footnotesize}
111   {\end{minipage}\end{lrbox}\fbox{\usebox{\savedwf}}}
112 % A helper to annotate the parts of a multipage figure
113 \newcommand{\figurepart}[2]{\raggedleft{\textit{\tiny{part #1 of #2}}}}
114
115 % Define a simple hyper-reference to a given URL
116 \newcommand{\hrefself}[1]{\href{#1}{#1}}
117
118 % Generate a page ref.
119 % use like   \refersec{chap:registervalues}
120 %\newcommand{\refersec}[1]{\ref{#1} on page \pageref{#1}}
121 \newcommand{\refersec}[1]{\vref{#1}}  % beware possible rerun loop
122 \newcommand{\referfol}[1]{\ref{#1} following}
123
124 % Generate a live link in the document
125 % use like \livelink{chap:DWOPdup}{DW\_OP\_dup}
126 \newcommand{\livelink}[2]{\hyperlink{#1}{#2}\index{#2}}
127 % use when the index is different from the text and target.
128 \newcommand{\livelinki}[3]{\hyperlink{#1}{#2}\index{#3}}
129 % livetarg is the declaration that is the target of livelinks.
130 \newcommand{\livetarg}[2]{\hypertarget{#1}{#2}\index{#2}}
131 % When we want the index entry to look different from the name.
132 \newcommand{\livetargi}[3]{\hypertarget{#1}{#2}\index{#3}}
133
134 \newcommand{\thirtytwobitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{32-bit DWARF format}}
135 \newcommand{\sixtyfourbitdwarfformat}[1][]{\livelink{datarep:xxbitdwffmt}{64-bit DWARF format}}
136
137 \newcommand{\dash}{\nobreakdash-\hspace{0pt}}  % So we handle dashes ok.
138
139 % The following two let us mark a word as 'do not link' or
140 % 'do not index' to indicate the word is used generically
141 % and has been considered so do not index or link it.
142 % There is no significant difference in the two commands, though
143 % \nolink would be more oriented to words such as flag or address
144 % that might be linked (and indexed) in some circumstances.
145 \newcommand{\nolink}[1]{#1}
146 \newcommand{\noindex}[1]{#1}
147
148 % For index entries. The tt-variant of each pair is designed to
149 % allow a word to appear in tt font in the main test and the index
150 % but to collate in the index in its non-tt order. (LaTex normally
151 % sorts all tt words before all non-tt words.)
152 \newcommand{\addtoindex}[1]{#1\index{#1}}
153 \newcommand{\addttindex}[1]{\texttt{#1}\index{#1@\texttt{#1}}}
154 \newcommand{\addtoindexi}[2]{#1\index{#2}}
155 \newcommand{\addttindexi}[2]{\texttt{#1}\index{#2@\texttt{#2}}}
156 \newcommand{\addtoindexx}[1]{\index{#1}}
157 \newcommand{\addttindexx}[1]{\index{#1@\texttt{#1}}}
158
159 % Quote commands that avoid need for inline UTF-8 in these sources
160 \newcommand{\doublequote}[1]{\textquotedblleft #1\textquotedblright}
161 \newcommand{\singlequote}[1]{\textquoteleft #1\textquoteright}
162
163 % Better naming for the lowest level section header
164 \newcommand{\subsubsubsection}[1]{\paragraph{#1}~\newline}
165 %\newcommand{\subsubsubsubsection}[1]{\subparagraph{#1}.~}  %% Huh?
166 \newcommand{\subsubsubsubsection}[1]{\textbf{#1}.~~}
167 %\newcommand{\subsubsubsection}         %% Has to be in a style file--ugh...
168 %   {\@startsection{subsubsubsection}{4}{0mm}{-\baselineskip}{\baselineskip}{\normalfont\normalsize\itshap}}
169
170 % Issue \clearpage if less than n lines remain on page
171 \newcommand{\needlines}[1]{\needspace{#1\baselineskip}}
172
173 % Helper for item lists with bold subject markers
174 \newcommand{\itembf}[1]{\item \textbf{#1}}
175 \newcommand{\itembfnl}[1]{\itembf{#1} \\}
176
177 % And description lists with normal (not bold) text
178 \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textnormal{#1}}
179 \newcommand{\descriptionlabelnl}[1]{\item[#1] \mbox{}\\}
180
181 \newcommand{\emptypage}{
182     \clearpage
183     \vspace*{4in}
184     \begin{center} \textit{(empty page)} \end{center}
185     }
186
187 % Define a new column type P that is just like p except
188 % that it uses ragged right (rather than right justification}
189 % within a column  of a tabular environment. (See Goossens,
190 % Mittelback&Samarin, "The LaTex Companion", pp108&114.)
191 \newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp}
192 \newcolumntype{P}[1]{>{\PBS\raggedright\hspace{0pt}}p{#1}}
193
194 % A simple rule used in simple tables; default length is 2 inches
195 \newcommand{\simplerule}[1][2in]{\rule[4pt]{#1}{0.5pt}}
196
197 % A simple one column table of names; default width is 2 inches
198 \newcommand{\simplenametablerule}{\simplerule[2in]}
199 \newenvironment{simplenametable}[3][2in]
200     {   \begin{table}[h] \caption{#2} \label{#3}
201         \begin{center}
202         \renewcommand{\simplenametablerule}{\simplerule[#1]}
203         \simplenametablerule \\
204         \begin{tabular*}{#1}{l}
205         }
206     {   \end{tabular*}
207         \vspace{4pt} \\
208         \simplenametablerule \\
209         \end{center}
210         \end{table}
211         }
212
213 % Complement of \isundefined
214 \newcommand{\isdefined}[1]{\not{\isundefined{#1}}}
215
216 % Preferred changebar asliases
217 \newcommand{\bb}{\cbstart}      % Begin (change) bar
218 \newcommand{\eb}{\cbend}        % End (change) bar
219
220 % Define commands for all of the DWARF names (DW\_*, .debug_*, a few others)
221 %
222 \newcommand{\definition}[1]{\textcolor{red!80!black}{#1}}
223 \newcommand{\definitionx}[1]{\definition{\addtoindex{#1}}}
224 \include{dwarfnamecmds}
225
226 % Define commands for pgf use in the name index figure (Fig 6.1)
227 %
228 \include{pgfcmdsfornameindexfig}
229
230 %--- Begin the document pages
231 %
232 \begin{document}
233 \frontmatter
234 \thispagestyle{empty}
235
236 \nonzeroparskip
237 \setlength{\parindent}{0pt} 
238 \setlength{\headheight}{6cm}
239 \setlength{\uppermargin}{6cm}
240 \setlength{\topsep}{0pt}
241 \tightlists                                     % less spacing before/after lists
242
243 \begin{center}
244 \LARGE
245 \textbf{\dwf}
246 \\
247 \textbf{Version 5}
248 \\
249 \vspace{1cm}
250 \includegraphics[keepaspectratio=true,scale=1.0]{dwarf-logo}
251 \\
252 \vspace{1cm}
253 \href{http://www.dwarfstd.org}{\dwf}
254 \href{http://www.dwarfstd.org}{Committee}
255 \\
256 \vspace{0.5cm} 
257 \url{http://www.dwarfstd.org}
258 \\
259 \vspace{2cm}
260 {\Large \textbf{\docdate}}
261 \\
262 \ifthenelse{\boolean{isdraft}}{
263         \vspace{2cm}
264         \draftmark}
265         {}
266 \end{center}
267
268 \textmd
269 \normalsize
270 \setlength{\headheight}{15pt}  
271 \pagestyle{plain}
272 %\makeevenhead{plain}{}{}{}
273 %\makeoddhead{plain}{}{}{}
274 %\makeevenfoot{plain}{}{}{}
275 %\makeoddfoot{plain}{}{}{}
276 \nonzeroparskip
277 \setlength{\parindent}{0pt} 
278 \settrims{0.5in}{0.5in}
279 \settypeblocksize{8.2in}{6.0in}
280 %\setlrmarginsandblock{0.6in}{0.6in}{*}
281 %\setheadfoot{15pt}{15pt}
282 %\setheaderspaces {*}{2\onelineskip}{*}
283 \nouppercaseheads
284 \makeevenhead{plain}{}{\rightmark}{}
285 \makeoddhead{plain}{}{\rightmark}{}
286 \makeevenfoot{plain}{\docdate}{\draftmark}{Page \thepage}
287 \makeoddfoot{plain}{\docdate}{\draftmark}{Page \thepage}
288
289 %\openany
290
291 \nonzeroparskip
292 \setlength{\parindent}{0pt} 
293 \flushleft
294 \include{copyright}
295 \include{foreword}
296
297 \newpage
298 ~ % Make the page non-empty...
299 \newpage
300 \tableofcontents
301
302 \clearpage
303 \listoffigures
304
305 \clearpage
306 \listoftables
307
308 \ifthenelse{\boolean{isdraft}}
309         {       %\emptypage
310                 {% Environment to keep the following header change local
311                 \clearpage
312                 \makeevenhead{plain}{}{Change Summary}{}
313                 \makeoddhead{plain}{}{Change Summary}{}
314                 \include{changesummary}
315                 %\emptypage
316                 }
317         }{}
318 %\cleardoublepage
319 \flushleft
320 \raggedbottom
321 \chapterstyle{default}
322
323 \setlength{\parindent}{0pt} 
324
325 \makepagestyle{fragFirstChPage}
326     \makeevenhead{fragFirstChPage}{}{}{}
327     \makeoddhead{fragFirstChPage}{}{}{}
328     \makeoddfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
329     \makeevenfoot{fragFirstChPage}{\docdate}{\draftmark}{Page \thepage}
330 \nouppercaseheads
331 \aliaspagestyle{chapter}{fragFirstChPage}
332
333 % ----- Start the main part of the document -----
334 \mainmatter
335 % Define the levels of sectionality that are numbered.
336 \setcounter{secnumdepth}{5}
337
338 \include{introduction}                  %\emptypage
339 \include{generaldescription}            \emptypage
340 \include{programscope}                  \emptypage
341 \include{dataobject}                    %\emptypage
342 \include{typeentries}                   %\emptypage
343 \include{otherdebugginginformation}     \emptypage
344 \include{datarepresentation}            %\emptypage
345
346 %  The \appendix command toggles us into appendix chapters
347 \appendix
348
349 \include{attributesbytag}               %\emptypage
350 \include{debugsectionrelationships}     \emptypage
351 \include{encodingdecoding}              \emptypage
352 \include{examples}                      %\emptypage
353 \include{compression}                   \emptypage
354 \include{splitobjects}                  \emptypage
355 \include{sectionversionnumbers}         \emptypage
356 \include{gnulicense}                    \emptypage
357
358 % Maybe someday the selected glossary concept will be of interest...
359 %\include{selectedglossary}             %\emptypage
360
361 \printindex
362
363 \end{document}