% https://github.com/lynnt/SE499-report

%% ----------------------------------------------------------------
%% Thesis.tex -- MAIN FILE (the one that you compile with LaTeX)
%% ---------------------------------------------------------------- 

% Set up the document
\documentclass[legalpaper, 11pt, oneside]{Thesis}  % Use the "Thesis" style, based on the ECS Thesis style by Steve Gunn
\graphicspath{Figures/}  % Location of the graphics files (set up for graphics to be in PDF format)

% Include any extra LaTeX packages required
\usepackage{times}
\usepackage[square, numbers, comma, sort&compress]{natbib}  % Use the "Natbib" style for the references in the Bibliography
\usepackage{verbatim}  % Needed for the "comment" environment to make LaTeX comments
\usepackage{vector}  % Allows "\bvec{}" and "\buvec{}" for "blackboard" style bold vectors in maths
\usepackage[pagewise]{lineno}
\usepackage{listings}

\usepackage{etoolbox} % for robustify
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}
\lstset{moredelim=**[is][\color{red}]{`}{`}}
\hypersetup{urlcolor=blue, colorlinks=true}  % Colours hyperlinks in blue, but this can be distracting if there are many links.
%\urlstyle{sf}
%% ----------------------------------------------------------------
\newcommand{\CFAIcon}{\textsf{C}\raisebox{\depth}{\rotatebox{180}{\textsf{A}}}\xspace} % Cforall symbolic name
\newcommand{\CFA}{\protect\CFAIcon}		% safe for section/caption
\newcommand{\CC}{\textrm{C}\kern-.1em\hbox{+\kern-.25em+}\xspace} % C++ symbolic name
\newcommand{\uC}{$\mu$\CC}


\begin{document}
\frontmatter      % Begin Roman style (i, ii, iii, iv...) page numbering
%\linenumbers    % TODO: remove this please
% Set up the Title Page
\title{GNU Debugger support for \uC and \CFA}
\authors  {\texorpdfstring
            {\href{tmltran@uwaterloo.ca}{Thi My Linh Tran}}
            {Thi My Linh Tran}
            }
\emails{tmltran@uwaterloo.ca}
\addresses  {\groupname\\\deptname\\\univname}  % Do not change this here, instead these must be set in the "Thesis.cls" file, please look through it instead
\date       {\today}
\subject    {}
\keywords   {}
\maketitle
\setcounter{page}{2}
%% ----------------------------------------------------------------

\setstretch{1.3}  % It is better to have smaller font and larger line spacing than the other way round

% Define the page headers using the FancyHdr package and set up for one-sided printing
\fancyhead{}  % Clears all page headers and footers
\rhead{\thepage}  % Sets the right side header to show the page number
\lhead{}  % Clears the left side page header

%  Reduce size of section titles
\makeatletter
\renewcommand\section{\@startsection{section}{1}{\z@}{-1.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}{-1.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1.0ex \@plus -1ex \@minus -.2ex}{1.0ex \@plus .2ex}{\normalfont\normalsize\bfseries}}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}{-2.0ex \@plus -1ex \@minus -.2ex}{-1em}{\normalfont\normalsize\bfseries}}
\makeatother

\lstset{numberstyle=\scriptsize\sffamily}

\pagestyle{fancy}  % Finally, use the "fancy" page style to implement the FancyHdr headers

%% ----------------------------------------------------------------
% The Abstract Page
\addtotoc{Preface}  % Add the "Abstract" page entry to the Contents
\preface{
\addtocontents{toc}{\vspace{1em}}  % Add a gap in the Contents, for aesthetics

The goal of this work is to add GNU Debugger support for the language \uC and \CFA. To
achieve this goal for \uC, new extensions are written to provide additional
support for high-level constructs that are unknown to the GNU Debugger. In addition to the work done for
\uC, many hooks are added in the GNU Debugger to enable the addition of a \CFA
demangler.

This report assumes the reader has basic knowledge of compiler construction.
Background knowledge about how the GNU Debugger works and specific features of \uC and
\CFA
are provided in the report.
}

\clearpage  % Abstract ended, start a new page
%% ----------------------------------------------------------------

\setstretch{1.3}  % Reset the line-spacing to 1.3 for body text (if it has changed)

% The Acknowledgements page, for thanking everyone
\acknowledgements{
\addtocontents{toc}{\vspace{1em}}  % Add a gap in the Contents, for aesthetics

I would like to thank Professor Peter Buhr and Thierry
Delisle for their guidance throughout the development of this project. The
GNU Debugger's internal manual \cite{Reference5} is used as a guide for the development of
adding a demangler for \CFA, and \CFA's main page \cite{Reference13} for
background knowledge and examples.
}
\clearpage  % End of the Acknowledgements
%% ----------------------------------------------------------------

\pagestyle{fancy}  %The page style headers have been "empty" all this time, now use the "fancy" headers as defined before to bring them back


%% ----------------------------------------------------------------
\lhead{\emph{Contents}}  % Set the left side page header to "Contents"
\addcontentsline{toc}{chapter}{Listings}
\tableofcontents  % Write out the Table of Contents

%% ----------------------------------------------------------------
%\lhead{\emph{List of Figures}}  % Set the left side page header to "List if Figures"
%\listoffigures  % Write out the List of Figures

%% ----------------------------------------------------------------
%\lhead{\emph{List of Tables}}  % Set the left side page header to "List of Tables"
%\listoftables  % Write out the List of Tables

%% ----------------------------------------------------------------
\lhead{\emph{List of Listings}}  % Set the left side page header to "List of Listings"
\lstlistoflistings

%% ----------------------------------------------------------------
\setstretch{1.5}  % Set the line spacing to 1.5, this makes the following tables easier to read
%\clearpage  % Start a new page
%\lhead{\emph{Abbreviations}}  % Set the left side page header to "Abbreviations"
%\listofsymbols{ll}  % Include a list of Abbreviations (a table of two columns)
%{
% \textbf{Acronym} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or \\
%\textbf{LAH} & \textbf{L}ist \textbf{A}bbreviations \textbf{H}ere \\
%\textbf{GDB} & GNU Debugger \\
%\textbf{API} & Application Programming Interface \\
%}

%% ----------------------------------------------------------------
\clearpage  % Start a new page
%% ----------------------------------------------------------------
% End of the pre-able, contents and lists of things
% Begin the Dedication page

\setstretch{1.3}  % Return the line spacing back to 1.3

\addtocontents{toc}{\vspace{2em}}  % Add a gap in the Contents, for aesthetics


%% ----------------------------------------------------------------
\mainmatter	  % Begin normal, numeric (1,2,3...) page numbering
\pagestyle{fancy}  % Return the page headers back to the "fancy" style

% Include the chapters of the thesis, as separate files
% Just uncomment the lines as you write the chapters

\lhead{\emph{Introduction}}  % Set the left side page header to "Abbreviations"
\input{Chapters/Introduction} % Introduction
% Background
\clearpage  % Start a new page
\lhead{\emph{\uC}}  % Set the left side page header to "Abbreviations"
\input{Chapters/uCPP}
\clearpage  %Start a new page
\lhead{\emph{GNU Debugger}}  % Set the left side page header to "Abbreviations"
\input{Chapters/GDB}
\clearpage  %Start a new page
\lhead{\emph{\CFA}}  % Set the left side page header to "Abbreviations"
\input{Chapters/CFA}
\clearpage  %Start a new page

% Real work done

\lhead{\emph{GNU Debugger Extensions for \uC}}  % Set the left side page header to "Abbreviations"
\input{Chapters/Extensions}
\clearpage  %Start a new page
\lhead{\emph{\CFA Demangler}}  % Set the left side page header to "Abbreviations"
\input{Chapters/Demangler}
\clearpage  %Start a new page

\lhead{\emph{Conclusion}}  % Set the left side page header to "Abbreviations"
\input{Chapters/Conclusion} % Conclusion

%% ----------------------------------------------------------------
% Now begin the Appendices, including them as separate files

\addtocontents{toc}{\vspace{2em}} % Add a gap in the Contents, for aesthetics

\appendix % Cue to tell LaTeX that the following 'chapters' are Appendices

%\input{Appendices/AppendixA}	% Appendix Title

%\input{Appendices/AppendixB} % Appendix Title

%\input{Appendices/AppendixC} % Appendix Title

\addtocontents{toc}{\vspace{2em}}  % Add a gap in the Contents, for aesthetics
\backmatter

%% ----------------------------------------------------------------
\label{Bibliography}
\lhead{\emph{Bibliography}}  % Change the left side page header to "Bibliography"
\bibliographystyle{unsrtnat}  % Use the "unsrtnat" BibTeX style for formatting the Bibliography
\bibliography{Bibliography}  % The references (bibliography) information are stored in the file named "Bibliography.bib"

\end{document}  % The End
%% ----------------------------------------------------------------
