[Dwarf-discuss] Question about section .debug_aranges

2023-10-24 Thread Claudio Eterno via Dwarf-discuss
Hi, I'm taking a look at docs.
On dwarf-2.0.0.pdf I see at "7.20 Address Range Table"



*This header is followed by a series of tuples.Each tuple consists of an
address and a length, each in the size appropriate for an address on
thetarget architecture. The first tuple following the header in each set
begins at an offset that is amultiple of the size of a single tuple (that
is, twice the size of an address). The header is padded, if necessary, to
the appropriate boundary. Each set of tuples is terminated by a 0 for the
address and 0 for the length.*

on Dwarf3.pdf is identical.

I've some HEX data on my file (elf version 2):
The ".debug_aranges" section 0x0007482F
---

000748201c
 |."S.|
00074830  00 00 00 02 00 63 02 00  00 04 00 00 00 00 00 30
 |.c.0|
00074840  54 01 80 ec 02 00 00 00  00 00 00 00 00 00 00 1c
 |T...|
00074850  00 00 00 02 00 94 0d 00  00 04 00 00 00 00 00 1c
 ||
00074860  57 01 80 82 03 00 00 00  00 00 00 00 00 00 00 1c
 |W...|

Exploding the data at the first address range I see this:
00:: 1c 00 00 00

1. 0x001c (28) length

04:: 02 00 63 02 00 00 04 00

2. 0x0002
3. 0x0263 (611)
4  0x04 (4)
5. 0x00 (0)

0c:: 00 00 00 00 (I suppose this is padding padding)

10:: 30 54 01 80 ec 02 00 00
6. 0x80015430 0x02ec
18:: 00 00 00 00 00 00 00 00 <- termination (28th byte)

a. If I understood well what is written, after field 5, there are four
bytes of padding, am I correct?
b. About the "appropriate bound", just for confirmation, the address must
stay at 0xHHH0 or 0xHHH8 respect to the relative address. Is this
correct?

In this case (4 bytes address) the alignment is (2x4):
0xHHH0 or 0xHHH8
If we were in (8 bytes address) the allowed alignment would be (2x8)
0xHHH0
the padding would disappear?
Thank you in advance,
C.
-- 
Dwarf-discuss mailing list
Dwarf-discuss@lists.dwarfstd.org
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss


Re: [Dwarf-discuss] Question about section .debug_aranges

2023-10-24 Thread David Anderson via Dwarf-discuss

On 10/24/23 06:08, Claudio Eterno via Dwarf-discuss wrote:

Hi, I'm taking a look at docs.
On dwarf-2.0.0.pdf I see at "7.20 Address Range Table"
/This header is followed by a series of tuples.
Each tuple consists of an address and a length, each in the size 




on Dwarf3.pdf is identical.


DWARF5 is also identical.

Yes, you have understood it. All correct.
David Anderson
--
Overflow on /dev/null, please empty the bit bucket.
-- seen on slashdot.org

--
Dwarf-discuss mailing list
Dwarf-discuss@lists.dwarfstd.org
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss


Re: [Dwarf-discuss] Question about section .debug_aranges

2023-10-24 Thread David Blaikie via Dwarf-discuss
On Tue, Oct 24, 2023 at 6:09 AM Claudio Eterno via Dwarf-discuss <
dwarf-discuss@lists.dwarfstd.org> wrote:

> Hi, I'm taking a look at docs.
> On dwarf-2.0.0.pdf I see at "7.20 Address Range Table"
>

For what it's worth, I'd encourage you to consider other options for
address lookup, as the plan at the moment is to remove this feature in
DWARFv6 ( https://dwarfstd.org/issues/220724.1.html ) - and clang, for
instance, hasn't produced these by default for 10+ years.
-- 
Dwarf-discuss mailing list
Dwarf-discuss@lists.dwarfstd.org
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss