Re: Range lists, zero-length functions, linker gc

2020-06-02 Thread Fangrui Song via Elfutils-devel
On 2020-06-03, Alan Modra wrote: On Tue, Jun 02, 2020 at 11:06:10AM -0700, David Blaikie via Binutils wrote: On Tue, Jun 2, 2020 at 9:50 AM Mark Wielaard wrote: > where I > would argue the compiler simply needs to make sure that if it generates > code in separate sections it also should create

Re: Range lists, zero-length functions, linker gc

2020-06-02 Thread Alan Modra via Elfutils-devel
On Tue, Jun 02, 2020 at 11:06:10AM -0700, David Blaikie via Binutils wrote: > On Tue, Jun 2, 2020 at 9:50 AM Mark Wielaard wrote: > > where I > > would argue the compiler simply needs to make sure that if it generates > > code in separate sections it also should create the DWARF separate > > secti

Re: location list

2020-06-02 Thread Sasha Da Rocha Pinheiro via Elfutils-devel
Well, I have been trying to use the Dwarf_Attribute. If you see the snippet below, locationAttribute is acquired by doing dwarf_attr(&e, DW_AT_location, &locationAttribute); and &e is the DW_TAG_variable DIE. Dwarf_Op * exprs = NULL; size_t exprlen = 0; std::vector locDesc

Re: Range lists, zero-length functions, linker gc

2020-06-02 Thread David Blaikie via Elfutils-devel
On Tue, Jun 2, 2020 at 9:50 AM Mark Wielaard wrote: > > Hi, > > On Mon, 2020-06-01 at 13:18 -0700, David Blaikie wrote: > > On Mon, Jun 1, 2020 at 2:31 AM Mark Wielaard wrote: > > > Each skeleton compilation unit has a DW_AT_dwo_name attribute which > > > indicates the .dwo file where the split u

Re: location list

2020-06-02 Thread Mark Wielaard
Hi, On Tue, 2020-06-02 at 14:18 +, Sasha Da Rocha Pinheiro wrote: > I am trying to parse a location list given as an sec_offset. > How do I get this offset value that points to .debug_loc so I can > call dwarf_getlocations()? > Should I pass this offset as the second parameter of this call?

Re: Range lists, zero-length functions, linker gc

2020-06-02 Thread Mark Wielaard
Hi, On Mon, 2020-06-01 at 13:18 -0700, David Blaikie wrote: > On Mon, Jun 1, 2020 at 2:31 AM Mark Wielaard wrote: > > Each skeleton compilation unit has a DW_AT_dwo_name attribute which > > indicates the .dwo file where the split unit sections can be found. It > > actually seems seems easier to g

location list

2020-06-02 Thread Sasha Da Rocha Pinheiro via Elfutils-devel
Hi all, I am trying to parse a location list given as an sec_offset.  How do I get this offset value that points to .debug_loc so I can call dwarf_getlocations()? Should I pass this offset as the second parameter of this call? Sasha