The patch for 8.0 almost applies to 7.12, at least when the revised test is dropped. (the rest is trivial #include differences) https://sourceware.org/bugzilla/show_bug.cgi?id=21555#c3
It does appear to fix the problem as I understand it and described it back at comment #27 It would be great if this bugfix could make it into a future Stretch update of gdb, as it affects everyday use. Is there something I can do to facilitate this? Jeff