Bug 15350 - GDB can't read compressed debug sections (mingw32 target)
Summary: GDB can't read compressed debug sections (mingw32 target)
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 normal
Target Milestone: 2.34
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-09 13:36 UTC by Dmitry Gorbachev
Modified: 2019-12-29 12:03 UTC (History)
1 user (show)

See Also:
Host:
Target: mingw32
Build:
Last reconfirmed:


Attachments
Attaching both uncompressed and compressed .exe files (54.63 KB, application/octet-stream)
2013-04-09 23:24 UTC, Dmitry Gorbachev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2013-04-09 13:36:42 UTC
$ 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.
[...]
Comment 1 Tom Tromey 2013-04-09 18:14:01 UTC
Can you attach the .exe?
Comment 2 Dmitry Gorbachev 2013-04-09 23:24:22 UTC
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
Comment 3 Tom Tromey 2013-04-10 14:30:14 UTC
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.
Comment 4 Sourceware Commits 2019-12-29 11:44:27 UTC
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.
Comment 5 Alan Modra 2019-12-29 12:03:15 UTC
Should be fixed.