Bug #95857 Add an option to generate gdb index
Submitted: 18 Jun 2019 10:53 Modified: 12 Jul 2019 18:21
Reporter: Knut Anders Hatlen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[18 Jun 2019 10:53] Knut Anders Hatlen
Description:
The LLD and GNU gold linkers accept an option --gdb-index which generates a .gdb_index section in the linked binaries, and which makes it much faster to load them in a debugger. With LLD the overhead of generating the index at link time seems to be so small that it might make sense to enable it by default in debug builds.

How to repeat:
gdb mysqld takes a long time to load.
[12 Jul 2019 18:21] Paul DuBois
Posted by developer:
 
Fixed in 8.0.18.

The new ADD_GDB_INDEX CMake option determines whether to enable
generation of a .gdb_index section in binaries, which makes loading
them in a debugger faster. The option is enabled by default for debug
builds on Linux when the lld linker is used, and is disabled by
default otherwise. The option has no effect if a linker other than
lld or GNU gold is used.
[26 Jul 2019 12:52] Paul DuBois
Posted by developer:
 
Corrected changelog entry:

The new ADD_GDB_INDEX CMake option determines whether to enable
generation of a .gdb_index section in binaries, which makes loading
them in a debugger faster. The option is disabled by default. It has
no effect if a linker other than lld or GNU gold is used.