Skip to content

Instantly share code, notes, and snippets.

@marcusmueller
Last active December 16, 2016 21:30
Show Gist options
  • Select an option

  • Save marcusmueller/3086f2afe85c1d2bd393c0278dddfad5 to your computer and use it in GitHub Desktop.

Select an option

Save marcusmueller/3086f2afe85c1d2bd393c0278dddfad5 to your computer and use it in GitHub Desktop.
% Beamer Color Theme using the Solarized Palette,
% http://ethanschoonover.com/solarized.
%
% Copyright 2012 Jeffrey B. Arnold
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
\ProvidesPackage{beamercolorthemesolarized}[2013/10/11 1.0.1 Solarized color theme for beamer]
\RequirePackage{etoolbox}
\RequirePackage{kvoptions}
%% This is ugly. First time using options and conditionals in LaTeX
\SetupKeyvalOptions{
family=solarized,
prefix=solarized@,
}
\DeclareBoolOption[false]{dark}
\DeclareComplementaryOption{light}{dark}
\DeclareStringOption[yellow]{accent}[yellow]
\ProcessKeyvalOptions*
% Solarized palette
\definecolor{solarizedBase03}{HTML}{002B36}
\definecolor{solarizedBase02}{HTML}{073642}
\definecolor{solarizedBase01}{HTML}{586e75}
\definecolor{solarizedBase00}{HTML}{657b83}
\definecolor{solarizedBase0}{HTML}{839496}
\definecolor{solarizedBase1}{HTML}{93a1a1}
\definecolor{solarizedBase2}{HTML}{EEE8D5}
\definecolor{solarizedBase3}{HTML}{FDF6E3}
\definecolor{solarizedYellow}{HTML}{B58900}
\definecolor{solarizedOrange}{HTML}{CB4B16}
\definecolor{solarizedRed}{HTML}{DC322F}
\definecolor{solarizedMagenta}{HTML}{D33682}
\definecolor{solarizedViolet}{HTML}{6C71C4}
\definecolor{solarizedBlue}{HTML}{268BD2}
\definecolor{solarizedCyan}{HTML}{2AA198}
\definecolor{solarizedGreen}{HTML}{859900}
% Set Accent color
% Ugly. Should be done with a switch
\ifdefstring{\solarized@accent}{yellow}{
\colorlet{solarizedAccent}{solarizedYellow}
}{}
\ifdefstring{\solarized@accent}{orange}{
\colorlet{solarizedAccent}{solarizedOrange}
}{}
\ifdefstring{\solarized@accent}{red}{
\colorlet{solarizedAccent}{solarizedRed}
}{}
\ifdefstring{\solarized@accent}{magenta}{
\colorlet{solarizedAccent}{solarizedMagenta}
}{}
\ifdefstring{\solarized@accent}{violet}{
\colorlet{solarizedAccent}{solarizedViolet}
}{}
\ifdefstring{\solarized@accent}{blue}{
\colorlet{solarizedAccent}{solarizedBlue}
}{}
\ifdefstring{\solarized@accent}{cyan}{
\colorlet{solarizedAccent}{solarizedCyan}
}{}
\ifdefstring{\solarized@accent}{green}{
\colorlet{solarizedAccent}{solarizedGreen}
}{}
%% Set base colors for dark or light versions
%% Dark
% Switch between light and dark themes using the method in the CSS
% stylesheet http://ethanschoonover.com/solarized
\ifboolexpe{ bool {solarized@dark}}{
\colorlet{solarizedRebase03}{solarizedBase03}
\colorlet{solarizedRebase02}{solarizedBase02}
\colorlet{solarizedRebase01}{solarizedBase01}
\colorlet{solarizedRebase00}{solarizedBase00}
\colorlet{solarizedRebase0}{solarizedBase0}
\colorlet{solarizedRebase1}{solarizedBase1}
\colorlet{solarizedRebase2}{solarizedBase2}
\colorlet{solarizedRebase3}{solarizedBase3}
}{
%% Light
\colorlet{solarizedRebase03}{solarizedBase3}
\colorlet{solarizedRebase02}{solarizedBase2}
\colorlet{solarizedRebase01}{solarizedBase1}
\colorlet{solarizedRebase00}{solarizedBase0}
\colorlet{solarizedRebase0}{solarizedBase00}
\colorlet{solarizedRebase1}{solarizedBase01}
\colorlet{solarizedRebase2}{solarizedBase02}
\colorlet{solarizedRebase3}{solarizedBase03}
}
\mode<presentation>
\setbeamercolor{normal text}{fg=solarizedRebase0, bg=solarizedRebase03}
\setbeamercolor{alerted text}{fg=solarizedAccent}
% based css pre element
\setbeamercolor{example text}{fg=solarizedRebase1, bg=solarizedRebase02}
% Header and footer from CSS
\setbeamercolor{footline}{bg=solarizedRebase02,fg=solarizedRebase01}
\setbeamercolor{headline}{bg=solarizedRebase01,fg=solarizedRebase1}
% Titles
\setbeamercolor*{titlelike}{fg=solarizedAccent}
\setbeamercolor*{frametitle}{fg=solarizedAccent}
\setbeamercolor*{title}{fg=solarizedAccent}
% Structure elements use css style for header
\setbeamercolor*{structure}{bg=solarizedRebase01, fg=solarizedRebase1}
% Do not mess with subtle colors in palette. I don't like it.
\setbeamercolor*{palette primary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette secondary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette tertiary}{bg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette quaternary}{bg=solarizedRebase01, fg=solarizedRebase1}
% Make Blocks slightly lighter/darker
\setbeamercolor{block title}{fg=solarizedAccent, bg=solarizedRebase02}
%\setbeamercolor{block title alerted}{}
%\setbeamercolor{block title example}{}
\setbeamercolor{block body}{parent=normal text, bg=solarizedRebase02}
% \setbeamercolor{block body alerted}{}
% \setbeamercolor{block body example}{}
% same as footline
% Set Sidebar and footline to use the css style for footer
\setbeamercolor*{sidebar}{parent=headline}
\setbeamercolor*{palette sidebar primary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar secondary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar tertiary}{fg=solarizedRebase01, fg=solarizedRebase1}
\setbeamercolor*{palette sidebar quaternary}{fg=solarizedRebase01, fg=solarizedRebase1}
% border-color for headings
\setbeamercolor{separation line}{fg=solarizedRebase0}
\setbeamercolor{fine separation line}{fg=solarizedRebase0}
\setbeamercolor*{section in sidebar shaded}{parent=palette sidebar primary}
% a.hover.navlink in CSS
\setbeamercolor*{section in sidebar}{parent=palette sidebar primary, fg=solarizedRebase02}
\setbeamercolor*{subsection in sidebar}{parent=section in sidebar}
\setbeamercolor*{subsection in sidebar shaded}{parent=section in sidebar shaded}
\mode
<all>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
all: pres.pdf
pres.pdf: pres.tex grcon.pdf segfaultcmd.png coredumped.png
latexmk -pdf pres.tex
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{microtype}
\usepackage{xspace}
\usepackage{listings}
\lstset{inputencoding=utf8}
\newcommand{\GR}{GNU\,Radio\xspace}
\usepackage{siunitx}
\sisetup{per-mode = fraction}
\DeclareSIUnit[number-unit-product = {\,}]\sample{S}
\usecolortheme[dark]{solarized}
\title {Debugging \GR problems with GDB}
\logo{\includegraphics[height=4em]{grcon}}
\subtitle{SDR folks don't make mistakes -- we create challenges for ourselves}
\author{Marcus Müller}
\institute{Ettus Research}
\date{September 16\textsuperscript{th} 2016}
\subject{Taming the toppling}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{frame}{}
\titlepage
\mbox{\small Vaguely based on \url{http://gnuradio.org/redmine/projects/gnuradio/wiki/TutorialsGDB}}
\end{frame}
\begin{frame}
\frametitle{Outline}
\begin{enumerate}
\item Crashes
\item Debugging things that misbehave
\end{enumerate}
\end{frame}
\begin{frame}{The Problem}
Software
\begin{itemize}
\item<1-> crashes,
\item<2-> calculates the wrong results,
\item<3-> or just makes your Mars orbiter crash directly onto the planet.
\end{itemize}
\end{frame}
\begin{frame}{In \GR, things are especially hard}
\begin{itemize}
\item \GR is inherently multithreaded
\item there's the whole Python/C++/SWIG fun thing
\item oh, and by the way, we do things at a couple
\si{\mega\sample\per\second}
\end{itemize}
\end{frame}
\begin{frame}{Crashes / Segfaults}
Looks like this:\bigskip
\only<1>{\includegraphics[width=\textwidth]{segfaultcmd}}\only<2>{\includegraphics[width=\textwidth]{coredumped}}\bigskip
\begin{itemize}
\item Your process just ``sees'' the memory mapped into its own, isolated
memory space.
\item Access to memory that is not mapped, your OS gets called by a CPU interrupt
(typically)
\item Your OS gets a little cross with you, and kills your process
\end{itemize}
\end{frame}
\begin{frame}{Core Dumps}
\begin{itemize}
\item Basically: The memory of your process the moment it crashed, saved to a
file (Plus: State of CPU registers, and a bit of info on the state of the
process)
\item useful for post-mortem diagnosis
\item but: looking through a representation of a process mem space with a
hex editor is no fun
\item \textbf{[Enter] Debuggers}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{GDB -- The \textbf{G}NU \textbf{D}e\textbf{b}ugger}
\begin{itemize}
\item<1-> Needs to know which executable we're dealing with
\item<1-> takes a core dump (wiki link on title page)
\item <2-> or a live process, actually!
\end{itemize}
\only<3->{\centering\huge{\textbf{DEMO}}}
\end{frame}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment