https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84550
--- Comment #16 from Kevin Buettner <kevinb at redhat dot com> --- Created attachment 43671 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43671&action=edit GDB patch - dwarf2read.c I've attached the GDB patch that I'm currently testing. When I try it against either Jakub's test case or in the one that I only slightly simplified, I find that I can step into foo() as expected. I see no regressions when testing against the GDB testsuite using either 1) /bin/gcc on my Fedora 23 machine or 2) A build of GCC using recent development sources However, if I use #2 along with -O2, I see some apparent regressions. I say "apparent" because the ones that I've investigated so far aren't really regressions. It turns out that -O2 causes much of the initial part of the function (upon which a breakpoint is being set) to be optimized away and having an extra breakpoint on the .cold location will sometimes cause GDB to consider a test with a "continue" to be a success due to being able to hit some other breakpoint, even if it's not at the correct line/location. (Yes, these tests should probably be revised so that doesn't happen. That said, the gdb testsuite doesn't really work very well with everything compiled with -O2 anyway.)