Which version of GDB? If you didn't try the latest v12.1, please do.
If you did, and it still gives you trouble, suggest to ask a question on the GDB mailing list (gdb@sourceware.org),