4 This directory contains pre-generated ELF and DWARF files used to test
5 the debug info analysis feature, including lookup of DWARF debugging
6 information via build ID and debug link methods, as well as the source
7 files used to generate them.
9 The generated files are:
11 * `libhello_so` (ELF and DWARF)
12 * `libhello_elf_so` (ELF only)
13 * `libhello_build_id_so` (ELF with separate DWARF via build ID)
14 * `libhello_debug_link_so` (ELF with separate DWARF via debug link)
15 * `libhello_debug_link_so.debug` (DWARF for debug link)
16 * `.build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug` (DWARF for build ID)
18 We use a suffix of "_so" instead of ".so" since some distributions
19 build systems will consider ".so" files as artifacts from a previous
20 build that were "left-over" and will remove them prior to the build.
22 All files are generated from the four (4) following source files:
29 The generated executables were built using a GNU toolchain on an
32 To regenerate them, you can use follow these steps:
36 $ gcc -g -fPIC -c -I. tp.c libhello.c
37 $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello.so -o libhello_so tp.o libhello.o
41 $ gcc -fPIC -c -I. tp.c libhello.c
42 $ gcc -shared -llttng-ust -ldl -Wl,-soname,libhello_elf.so -o libhello_elf_so tp.o libhello.o
44 ## ELF and DWARF with Build ID
46 $ gcc -g -fPIC -c -I. tp.c libhello.c
47 $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_build_id.so -Wl,--build-id=sha1 -o libhello_build_id_so tp.o libhello.o
48 $ mkdir -p .build-id/cd/
49 $ objcopy --only-keep-debug libhello_build_id_so .build-id/cd/d98cdd87f7fe64c13b6daad553987eafd40cbb.debug
50 $ strip -g libhello_build_id_so
52 The build ID might not be the same once the executable is regenerated
53 on your system, so adjust the values in the directory and file names
54 accordingly. Refer to the GDB documentation for more information:
55 https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html
57 ## ELF and DWARF with Debug Link
59 $ gcc -g -fPIC -c -I. tp.c libhello.c
60 $ gcc -shared -g -llttng-ust -ldl -Wl,-soname,libhello_debug_link.so -o libhello_debug_link_so tp.o libhello.o
62 $ objcopy --only-keep-debug libhello_debug_link_so libhello_debug_link_so.debug
63 $ strip -g libhello_debug_link_so
64 $ objcopy --add-gnu-debuglink=libhello_debug_link_so.debug libhello_debug_link_so