Debug stripped executables with detached symbols in GDB

Say you have an executable that will be shipped to target machines and you don&rsquo;t want to include any debug symbols, but at the same time if an annoying bug occurs you&rsquo;d like to debug the executable with symbols. Is it possible to have both ways? As a matter of fact, yes! GNU Debugger (GDB) has a feature where it can load a separate symbols file to make it easier to debug stripped…