[Bug symtab/34440] New: [gdb/symtab] gdb-add-index adds uncompressed data to compressed .debug_str
"vries at gcc dot gnu.org via Gdb-prs" <[email protected]>
| Newsgroups | gmane.comp.gdb.bugs.discuss |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://sourceware.org/bugzilla/show_bug.cgi?id=34440
Bug ID: 34440
Summary: [gdb/symtab] gdb-add-index adds uncompressed data to
compressed .debug_str
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: symtab
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
I ran test-case gdb.python/py-section-script.exp with target board
cc-with-debug-names and ran into:
...
(gdb) break -qualified main^M
During symbol reading: Can't read data for section '.debug_str' in file
'py-section-script-compressed'^M
DWARF Error: DW_FORM_strp used without .debug_str section [in module
py-section-script-compressed]^M
DWARF Error: DW_FORM_strp used without .debug_str section [in module
py-section-script-compressed]^M
(gdb) FAIL: $exp: variant=compressed: gdb_breakpoint: set breakpoint at main
...
What happens is the following.
The test-case produces an executable using
-Wa,--compress-debug-sections=zlib-gabi.
Consequently, the .debug_info and the other debug sections (apart from
.debug_rnglists) are compressed.
Then the target board runs post-processing, calling gdb-add-index, which adds a
.debug_names section, which is not compressed:
...
$ readelf -WS
./outputs/gdb.python/py-section-script/py-section-script-compressed | grep
debug
[26] .debug_aranges PROGBITS 0000000000000000 003030 000077 00 C
0 0 8
[27] .debug_info PROGBITS 0000000000000000 0030a8 00021a 00 C
0 0 8
[28] .debug_abbrev PROGBITS 0000000000000000 0032c8 00012a 00 C
0 0 8
[29] .debug_line PROGBITS 0000000000000000 0033f8 00011f 00 C
0 0 8
[30] .debug_str PROGBITS 0000000000000000 003518 00025c 01 MSC
0 0 8
[31] .debug_line_str PROGBITS 0000000000000000 003778 0000ee 01 MSC
0 0 8
[32] .debug_rnglists PROGBITS 0000000000000000 003866 000042 00
0 0 1
[33] .debug_gdb_scripts PROGBITS 0000000000000000 0038a8 000104 00 SC
0 0 8
[34] .debug_names PROGBITS 0000000000000000 0039ac 0002e9 00
0 0 1
...
The problem is that gdb-add-index doesn't support compressed sections.
It simply appends uncompressed data to the compressed .debug_str section:
...
$ readelf -x .debug_str
outputs/gdb.python/py-section-script/py-section-script-compressed
Hex dump of section '.debug_str':
NOTE: This section is compressed, but its contents have NOT been expanded for
this dump.
0x00000000 01000000 00000000 a5040000 00000000 ................
0x00000010 01000000 00000000 789ced54 4d6fdb30 ........x..TMo.0
0x00000020 0cd54ff1 0f98ec38 7183ece0 c3dab543 ..O....8q......C
0x00000030 80a1199a 05c34e82 22d1b630 990af4b1 ......N."..0....
0x00000040 35fbf5a3 9c20ddba 1ebafb2e 921e453e 5.... ........E>
0x00000050 3e9184ca b20ac7a0 e110aac7 d5522c9b >............R,.
0x00000060 2a44e963 b965d5e0 46a8e43e 19ab2b7f *D.c.e..F..>..+.
0x00000070 184f87eb ddfae3fb aab766af f8bc6c66 .O........f...lf
0x00000080 fc647e32 542a24f6 e17e57bc db1684af .d~2T*$..~W.....
0x00000090 ca191313 251342ee 8d88b267 28e2f100 ....%.B....g(...
0x000000a0 ecd676cb 46dc0fda d39dc158 cf577448 ..v.F......X.WtH
0x000000b0 745acc45 9c486eea baa81765 53ce0abe tZ.E.Hn....eS...
0x000000c0 13779b87 cfebbbaf 62bbd93d dcdc167c .w......b..=...|
0x000000d0 8c09a1ed 01c11b45 507a35b4 f40cbe6c .......EPz5....l
0x000000e0 f8f779c1 fb826f68 0b51b73d 26a2e21d ..y...oh.Q.=&...
0x000000f0 edabb7dc a0350804 13fe30a8 79947b0b .....5....0.y.{.
0x00000100 81b00c47 548377e8 52e0cf2f e919ea1b ...GT.w.R../....
0x00000110 57568681 1fbc8ba0 a2714817 23f81eb8 WV.......qH.#...
0x00000120 b4962b87 e48531bb 7b97501b ec49571c ..+...1.{.P..IW.
0x00000130 2ee1e740 e74916e5 21891d3a 8a1bc789 [email protected]..!..:....
0x00000140 ea20a31a 72c2ac6d e2e780d1 1fdb7af9 . ..r..m......z.
0x00000150 a66e722e 22e3e03d 3a029fd6 54854e75 .nr."..=:...T.Nu
0x00000160 bfc969bb 642d19a3 0d7c741a 6c6bd044 ..i.d-...|t.lk.D
0x00000170 232d8747 50e79a7f 715e3394 23309b25 #-.GP...q^3.#0.%
0x00000180 4c4bc260 7a045d50 fdd90590 184ffdd2 LK.`z.]P.....O..
0x00000190 1054f8c9 c4b57396 600e2538 c5699748 .T....s.`.%8.i.H
0x000001a0 2e0b83f3 f14f12bc 7476ea67 e6609d75 .....O..tv.g.`.u
0x000001b0 329e9db3 cf53fe8c c47a43c3 42451329 2....S...zC.BE.)
0x000001c0 8066425b e1c13a25 23e4218a 46898381 .fB[..:%#.!.F...
0x000001d0 ff93f1da c9a0f867 dcff382e e55fdf83 .......g..8.._..
0x000001e0 f2d1d0ef 90bd4408 a756cc17 457d552e ......D..V..E}U.
0x000001f0 722b5e51 f81754b1 511a7c39 1952b25f r+^Q..T.Q.|9.R._
0x00000200 ad999714 63686172 00646f75 626c6500 ....char.double.
0x00000210 696e7400 696e7433 325f7400 6c6f6e67 int.int32_t.long
0x00000220 20696e74 006c6f6e 6720756e 7369676e int.long unsign
0x00000230 65642069 6e740073 69676e65 64206368 ed int.signed ch
0x00000240 61720073 73007569 6e743332 5f740075 ar.ss.uint32_t.u
0x00000250 6e736967 6e656420 696e7400 nsigned int.
...
--
You are receiving this mail because:
You are on the CC list for the bug.