$ gcc -g 1.c $ gdb a.exe [...] Reading symbols from /tmp/a.exe...done. [...] $ objcopy --compress-debug-sections a.exe $ gdb a.exe [...] Reading symbols from /tmp/prog.exe...Can't read data for section '.debug_line' in file '/tmp/prog.exe' (no debugging symbols found)...done. [...]
Can you attach the .exe?
Created attachment 6970 [details] Attaching both uncompressed and compressed .exe files $ gdb compressed.exe [...] Reading symbols from /tmp/compressed.exe...Can't read data for section '.debug_info' in file '/tmp/compressed.exe' Can't read data for section '.debug_frame' in file '/tmp/compressed.exe' [...] $ objcopy --decompress-debug-sections compressed.exe objcopy:compressed.exe[.debug_aranges]: Bad value
The bug is in BFD, either when compressing the sections or in the inflater. You can see this easily using objcopy + objdump, i.e., not involving gdb at all.
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a6e5765ff1c5fdebaf4953eed619a717178cc7e6 commit a6e5765ff1c5fdebaf4953eed619a717178cc7e6 Author: Alan Modra <amodra@gmail.com> Date: Sun Dec 29 12:41:12 2019 +1030 PR15350, Fix compressed debug sections for PE targets PR 15350 * bfd.c (bfd_update_compression_header): Write zlib header for formats other than ELF too.
Should be fixed.