walker dwarf
TRANSCRIPT
-
8/12/2019 Walker Dwarf
1/16
-
8/12/2019 Walker Dwarf
2/16
2
SummaryDebug information is mostly comparable to GCC.
LLVM is more aggressive at doing function inlining resultingin larger debug tables at O2.
Areas for improvement:Remove duplication of inlined function parameter information.
Enumerators missing in pubnames.System included files in line table if referenced by symbols.Generate stack information for ARM.Generate stack information for AARCH64 function epilogues.
debug_types can provide significant improvements in reducing size ofthe debug information.
No sibling entries reduce debug info sizes at the cost ofloading speed (change can be around 10%).
-
8/12/2019 Walker Dwarf
3/16
3
What was used in the comparisonComparison performed on a C program of about 70,000 lines
of source in 58 source files and 16 header filesNo library code linked in ... all debug information from thecompiled sourcesUses the same header files
GCC 4.8.2 using:arm-none-eabi-gcc g gpubnames gstrict-dwarfLLVM tip of trunk using:clang target=arm-none-eabi -g
-
8/12/2019 Walker Dwarf
4/16
4
DWARF debug section sizes
020000
40000
60000
80000
100000
120000
140000160000
180000LLVM -O0LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
Effect of function inlining
-
8/12/2019 Walker Dwarf
5/16
5
DWARF Tags (symbols)
0
500
1000
1500
2000
2500
3000LLVM -O0LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
-
8/12/2019 Walker Dwarf
6/16
6
DWARF Attributes (symbol properties)
0
2000
4000
6000
8000
10000
12000LLVM -O0
LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
Due to inlined function arameters
Due to inlined functions
-
8/12/2019 Walker Dwarf
7/167
Are siblings attributes worth the space?LLVM deliberately does not generate entries the
DW_AT_sibling attribute due to the size the occupied in the.debug_info section.GCC does generate DW_AT_sibling entries:
Take ~4% of the .debug_info section size (in this example).
Contribute no actual debug information.Implemented using 4-byte entries.... But of 1508 entries only 96 have a value greater than 255.
What is the effect of not having sibling entries in a debugger?
... Can affect loading speed by about 10%.
-
8/12/2019 Walker Dwarf
8/168
Line Table DifferencesLLVM does not include system header files/directories in the
line table.But symbols defined in the system header files have a file/linereference .... The file entry pointing at the current source file.
LLVM generates End of Function Prologue entries. Needs support in debugger but will help to remove the need forheuristics used by debuggers to find the prologue end.
LLVM (sometimes) marks the function prologue instruction asa place not to put a source level breakpoint.Neither compiler generates Start of Function Epilogueentries.
-
8/12/2019 Walker Dwarf
9/169
Stack Frame DifferencesLLVM does not generate .debug_frame information for the
selected arm-none-eabi target.GCC generates the changes that occur in a functionepilogue, LLVM does not (comparing AARCH64).
The effect of this is that when instruction stepping thefunction epilogue in LLVM generated code, register usage inthe called function may be displayed incorrectly.
-
8/12/2019 Walker Dwarf
10/1610
DWARF .debug_types coming soonThe .debug_types section was added in DWARF 4 in order to
help common up duplicated type information. This removalof duplicate information can results in smaller file sizes andas a consequence means debuggers have less debugginginformation to process and load.
I am looking forward to the completion of the currentdevelopment effort to implement support for the .debug_typessection.
GCC already has support for .debug_types, so we can seethe possible benefits of adding this support.
-
8/12/2019 Walker Dwarf
11/1611
DWARF Debug section sizes (GCC)
0
50000
100000
150000
200000
250000
GCC -O2GCC -O2 (types)
Main sections that change
-
8/12/2019 Walker Dwarf
12/1612
Questions?
-
8/12/2019 Walker Dwarf
13/1613
DWARF debug section sizes
0
20000
40000
60000
80000
100000
120000
140000
160000
180000LLVM -O0LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
-
8/12/2019 Walker Dwarf
14/1614
DWARF Tags (symbols)
0500
100015002000250030003500400045005000
LLVM -O0LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
-
8/12/2019 Walker Dwarf
15/1615
DWARF Attributes (symbol properties)
0
2000
4000
6000
8000
10000
12000
a b s t r a c t
_ o r i g
i n
a c c e s s
i b i l i t y
b y t e
_ s i z e
c a l l_ f i l e
c a l l_ l i n e
c
o m p
_ d i r
c o n s t
_ v a
l u e
d a
t a_
m e m
b e r
_ l o c a
t i o n
d e c l
_ f i l e
d e c l
_ l i n e
d e c l a r a
t i o n
e n c o
d i n g
e n
t r y_ p c
e x t e r n a
l
f r a m
e_
b a s e
h i g h
_ p c
i n l i n e
l a n g u a g e
l o c a
t i o n
l o w
_ p c
n a m e
p r o
d u c e r
p r o
t o t y p e
d
r a n g e s
s i b l i n g
s t m
t_ l i s t
t y p e
u p p e r_
b o u n
d
LLVM -O0LLVM -O1LLVM -O2GCC -O0GCC -O1GCC -O2
-
8/12/2019 Walker Dwarf
16/1616
Thank You
The trademarks featured in this presentation are registered and/or unregistered trademarks of ARMLimited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved. Any other marks featured
may be trademarks of their respective owners