<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118161>118161</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-dwarfdump does not correctly dump .debug_rnglists
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
oltolm
</td>
</tr>
</table>
<pre>
I created an exe with DWARF5 with Clang and dumped it with `llvm-dwarfdump`
```
llvm-dwarfdump.exe --debug-info --debug-rnglists bin\test_mgwhelp.exe
```
This is the incorrect result:
```
.debug_rnglists contents:
range list header: length = 0x0000001b, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
offsets: [
0x00000004
]
ranges:
[0x0000000000000031, 0x00000000000002a5)
[0x00000000000002b1, 0x0000000000000c58)
[0x0000000000000000, 0x000000000000005c)
<End of list>
```
The correct output is produced inline in `.debug_info` output:
```
DW_AT_ranges [DW_FORM_rnglistx] (indexed (0x0) rangelist = 0x00000010
[0x0000000140001390, 0x0000000140001604)
[0x0000000140001610, 0x0000000140001fb7)
[0x0000000140001fc0, 0x000000014000201c))
```
the correct raw output is produced when passing `--verbose`
```
.debug_rnglists contents:
0x00000000: range list header: length = 0x0000001b, format = DWARF32, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000001
offsets: [
0x00000004 => 0x00000010
]
ranges:
0x00000010: [DW_RLE_base_addressx]: 0x0000000000000031
0x00000012: [DW_RLE_offset_pair ]: 0x0000000000000000, 0x0000000000000274 => [0x0000000000000031, 0x00000000000002a5)
0x00000016: [DW_RLE_offset_pair ]: 0x0000000000000280, 0x0000000000000c27 => [0x00000000000002b1, 0x0000000000000c58)
0x0000001b: [DW_RLE_startx_length]: 0x0000000000000032, 0x000000000000005c => [0x0000000000000000, 0x000000000000005c)
0x0000001e: [DW_RLE_end_of_list ]
bin\test_mgwhelp.exe: file format COFF-x86-64
```
The wrong output is neither the raw output nor the one from `.debug_info`. I could contribute a fix that always outputs the raw contents of `.debug_rnglists`. What do you think?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVt9v4jgQ_mvMiwXyjySQhzywpUgr3WmlaqU-Rk48SXwXbGQ7hd5ff7IDlADt7b5eVKXtjOfzeOabLxbOqVYDFCj9htLNTAy-M7YwvTf9blYZ-V58x7UF4UFioTEcAR-U7_Dmdf2yTce_n3qhWyy0xHLY7UFi5UcHykjfv-3m8iBsE3woI4isw3v8IeupfxHw53MJ1dDOlW7M5R-r214573ClNEqfPDhf7tpDB30MukFFZP2zUw4rh30HWOnaWAu1xxbc0HvE1zcBi7hLedmlNtqD9m5caYVuAQcP7kBIsIivcQ-6DWfkG0yOJD60QuwJN8buhI-OWCXOgvUNrFNGf6xPg1VIaUun_oGzfRWsDtqJkQSjaRoHvgTt7XtZm0H7yd6EIrIe14SscWgoWV-8SThwujkf5nQwlH67rDg9nIbNbqxMpIjlDwNY9SigTlefBZDxOLfWtD4F8KdnLbFpYr0Rf37UWsDnhprB7wcfGr23Rg51YJ_ulQ5ND_w7NTZwCWXktPy-_3jybF7L9c9yLFQo5Oa13P54-fNMj2MsZI7YSmkJR5AYsRU5EsRyHIMiUybEuN8DY3xdG5qEF8-ntRmtGUnG2vwCQkYfITTV8pcRmvoBAiM09mds0VXh_FUvrDg86sehA433QWl0G1oyn7-BrYyDezX4egw_KBMI_n8YyrAY8ecpT-7H9Mo9gmxey5c_nstKOChDtuBcJCVf380Vp9cAbApwSn8vlA1UiAB3CA_nlS0vyf-2iFyyyX4_G7Z6lE3Nlp9n8x8KdcWTSTbOC-uP5cioz4rLHkvZF6X5Wv0uycA0GdCyNE05CkvkxyffwcCXvFE9nBn_9GO7nR9X2TxLHivpwRrdXs2tBuU7sPHDeTXR2owmowE31uzuxXWBv-PaDL2MY2tVNXjAAjfqiH0nPBb9Qby7E5674J9nPEj-B-ZZAiLu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