Add lowlevellock DWARF

This commit is contained in:
Théophile Bastian 2019-10-19 09:31:34 +02:00
parent 6791c53069
commit eab39a9ef3
3 changed files with 61 additions and 6 deletions

View file

@ -328,14 +328,20 @@ Segmentation fault.
\end{frame}
\begin{frame}
\todo{Actually add lowlevellock code}
\lstinputlisting[language=bash,numbers=none,basicstyle=\tt\fontsize{8pt}{9pt}\selectfont]{src/lowlevellock_dw_extr.c}
In \prog{glibc}, \prog{lowlevellock.h}:
\alert{off by one error in unwinding data}.
\only<2>{
\begin{textblock*}{0.60\textwidth}[0.5,0.5](0.5\paperwidth,0.5\paperheight)%
\begin{tcolorbox}[halign=center, colframe=OliveGreen, colback=YellowGreen]
In \prog{glibc}, \prog{lowlevellock.h}:
\alert{off by one error in unwinding data}.
\lstinputlisting[language=gdb,numbers=none]{src/lowlevellock_backtrace}
\lstinputlisting[language=gdb,numbers=none]{src/lowlevellock_backtrace}
\end{tcolorbox}
\end{textblock*}
}
\only<2->{
\only<3->{
\begin{textblock*}{0.90\textwidth}[0.5,0](0.5\paperwidth,0.10\paperheight)%
\begin{tcolorbox}[halign=center, colframe=red, colback=Lavender]
\bf \LARGE
@ -344,7 +350,7 @@ Segmentation fault.
\end{textblock*}
}
\only<3->{
\only<4->{
\begin{textblock*}{0.90\textwidth}[0.5,0](0.5\paperwidth,0.30\paperheight)%
\begin{tcolorbox}[halign=center, colframe=red, colback=Lavender]
\LARGE

25
src/lowlevellock_dw.c Normal file
View file

@ -0,0 +1,25 @@
#define LLL_STUB_UNWIND_INFO_START
".section .eh_frame,\"a\",@progbits\n"
"5:\t" ".long 7f-6f # Length of Common Information Entry\n"
"6:\t" ".long 0x0 # CIE Identifier Tag\n\t"
".byte 0x1 # CIE Version\n\t"
".ascii \"zR\\0\" # CIE Augmentation\n\t"
".uleb128 0x1 # CIE Code Alignment Factor\n\t"
".sleb128 -4 # CIE RA Column\n\t"
".byte 0x8 # Augmentation size\n\t"
".uleb128 0x1 # FDE Encoding (pcrel sdata4)\n\t"
".byte 0x1b # DW_CFA_def_cfa\n\t"
".byte 0xc\n\t"
".uleb128 0x4\n\t"
".uleb128 0x0\n\t"
".align 4\n"
"7:\t" ".long 17f-8f # FDE Length\n"
"8:\t" ".long 8b-5b # FDE CIE offset\n\t"
".long 1b-. # FDE initial location\n\t"
".long 4b-1b # FDE address range\n\t"
".uleb128 0x0 # Augmentation size\n\t"
".byte 0x16 # DW_CFA_val_expression\n\t"
".uleb128 0x8\n\t"
".uleb128 10f-9f\n"
"9:\t" ".byte 0x78 # DW_OP_breg8\n\t"
".sleb128 3b-1b\n"

View file

@ -0,0 +1,24 @@
.section .eh_frame,"a",@progbits
5: .long 7f-6f # Length of Common Information Entry
6: .long 0x0 # CIE Identifier Tag
.byte 0x1 # CIE Version
.ascii "zR\\0" # CIE Augmentation
.uleb128 0x1 # CIE Code Alignment Factor
.sleb128 -4 # CIE RA Column
.byte 0x8 # Augmentation size
.uleb128 0x1 # FDE Encoding (pcrel sdata4)
.byte 0x1b # DW_CFA_def_cfa
.byte 0xc
.uleb128 0x4
.uleb128 0x0
.align 4
7: .long 17f-8f # FDE Length
8: .long 8b-5b # FDE CIE offset
.long 1b-. # FDE initial location
.long 4b-1b # FDE address range
.uleb128 0x0 # Augmentation size
.byte 0x16 # DW_CFA_val_expression
.uleb128 0x8
.uleb128 10f-9f
9: .byte 0x78 # DW_OP_breg8
.sleb128 3b-1b