Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread Jakub Jelinek via Dwarf-Discuss
On Tue, Mar 09, 2021 at 04:32:35PM -0800, David Blaikie wrote: > Ah, OK. Hmm - do you have different call_site_parameters for registers > versus parameters? Or I guess a call_site_parameter without a > DW_AT_location and only a DW_AT_call_value? Yes, those DW_TAG_call_site_parameter DIEs have DW_A

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread Metzger, Markus T via Dwarf-Discuss
AFAIK the main reason to annotate a subprogram with a calling convention is so that a debugger can manufacture a call correctly, in response to a user command. Right - and generally the debugger would expect to call this function using the ABI - except that with internalized functions (either sta

[Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Jakub Jelinek via Dwarf-Discuss
Hi! We got a report today that GCC even for -gdwarf-5 -gsplit-dwarf uses .debug_rnglists section + DW_AT_ranges + DW_AT_low_pc + DW_AT_rnglists_base attributes in the DW_TAG_skeleton_unit (and then some DW_AT_ranges in .debug_info.dwo that use DW_FORM_rnglistx, but no .debug_rnglists.dwo section).

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread Michael Eager via Dwarf-Discuss
On 3/9/21 7:05 AM, Andrew Cagney via Dwarf-Discuss wrote: Part of a typical Application Binary Interface is to specify the function calling convention. Several uses are: - ensuring function calls across interface boundaries work (function in one object calls function in second object) - the deb

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 10:27 AM Jakub Jelinek via Dwarf-Discuss < dwarf-discuss@lists.dwarfstd.org> wrote: > Hi! > > We got a report today that GCC even for -gdwarf-5 -gsplit-dwarf uses > .debug_rnglists section + DW_AT_ranges + DW_AT_low_pc + DW_AT_rnglists_base > attributes in the DW_TAG_skelet

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Simon Marchi via Dwarf-Discuss
On 2021-03-10 10:59 a.m., Jakub Jelinek via Dwarf-Discuss wrote:> Hi! > > We got a report today that GCC even for -gdwarf-5 -gsplit-dwarf uses > .debug_rnglists section + DW_AT_ranges + DW_AT_low_pc + DW_AT_rnglists_base > attributes in the DW_TAG_skeleton_unit (and then some DW_AT_ranges in > .de

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Cary Coutant via Dwarf-Discuss
Location List and Range List Sections Improvement/Enhancement >> We got a report today that GCC even for -gdwarf-5 -gsplit-dwarf uses >> .debug_rnglists section + DW_AT_ranges + DW_AT_low_pc + DW_AT_rnglists_base >> attributes in the DW_TAG_skeleton_unit (and then some DW_AT_ranges in >> .debug_inf

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 12:32 PM Cary Coutant wrote: > Location List and Range List Sections Improvement/Enhancement >> We > got a report today that GCC even for -gdwarf-5 -gsplit-dwarf uses > >> .debug_rnglists section + DW_AT_ranges + DW_AT_low_pc + > DW_AT_rnglists_base > >> attributes in the

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 9:51 AM Michael Eager via Dwarf-Discuss < dwarf-discuss@lists.dwarfstd.org> wrote: > On 3/9/21 7:05 AM, Andrew Cagney via Dwarf-Discuss wrote: > > Part of a typical Application Binary Interface is to specify the > > function calling convention. Several uses are: > > > > -

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Cary Coutant via Dwarf-Discuss
> But what about the DW_AT_ranges on the skeleton CU when using split DWARF? > > Are you suggesting that both LLVM and GCC's emission is incorrect - and that > it's not possible to use rnglistx in the skeleton CU (instead you must use > sec_offset for DW_AT_ranges on the skeleton CU)? (& that the

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread Cary Coutant via Dwarf-Discuss
> Speculation beyond the original question: > Given that it's a pretty common/core feature of a debugger to call functions, > perhaps a start would be some way for the producer to communicate, via DWARF, > that it has changed the ABI of a function and so the consumer should not try > to synthesi

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 1:16 PM Cary Coutant wrote: > > But what about the DW_AT_ranges on the skeleton CU when using split > DWARF? > > > > Are you suggesting that both LLVM and GCC's emission is incorrect - and > that it's not possible to use rnglistx in the skeleton CU (instead you must > use

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Jakub Jelinek via Dwarf-Discuss
On Wed, Mar 10, 2021 at 01:16:24PM -0800, Cary Coutant wrote: > > But what about the DW_AT_ranges on the skeleton CU when using split DWARF? > > > > Are you suggesting that both LLVM and GCC's emission is incorrect - and > > that it's not possible to use rnglistx in the skeleton CU (instead you mu

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 1:21 PM Cary Coutant wrote: > > Speculation beyond the original question: > > Given that it's a pretty common/core feature of a debugger to call > functions, perhaps a start would be some way for the producer to > communicate, via DWARF, that it has changed the ABI of a fu

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 1:27 PM Jakub Jelinek wrote: > On Wed, Mar 10, 2021 at 01:16:24PM -0800, Cary Coutant wrote: > > > But what about the DW_AT_ranges on the skeleton CU when using split > DWARF? > > > > > > Are you suggesting that both LLVM and GCC's emission is incorrect - > and that it's n

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread Michael Eager via Dwarf-Discuss
On 3/10/21 1:28 PM, David Blaikie wrote: On Wed, Mar 10, 2021 at 1:21 PM Cary Coutant > wrote: > Speculation beyond the original question: > Given that it's a pretty common/core feature of a debugger to call functions, perhaps a start would be some way fo

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Cary Coutant via Dwarf-Discuss
On Wed, Mar 10, 2021 at 1:27 PM David Blaikie wrote: > > On Wed, Mar 10, 2021 at 1:16 PM Cary Coutant wrote: >> >> > But what about the DW_AT_ranges on the skeleton CU when using split DWARF? >> > >> > Are you suggesting that both LLVM and GCC's emission is incorrect - and >> > that it's not pos

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 2:36 PM Cary Coutant wrote: > On Wed, Mar 10, 2021 at 1:27 PM David Blaikie wrote: > > > > On Wed, Mar 10, 2021 at 1:16 PM Cary Coutant wrote: > >> > >> > But what about the DW_AT_ranges on the skeleton CU when using split > DWARF? > >> > > >> > Are you suggesting that b

Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls?

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 2:31 PM Michael Eager wrote: > On 3/10/21 1:28 PM, David Blaikie wrote: > > On Wed, Mar 10, 2021 at 1:21 PM Cary Coutant > > wrote: > > > > > Speculation beyond the original question: > > > Given that it's a pretty common/core feature

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Simon Marchi via Dwarf-Discuss
> But you've got me thinking Perhaps we should have *both* > .debug_rnglists *and* .debug_rnglists.dwo. The former could contain > only the range list needed for the DW_AT_ranges attribute in the > skeleton CU, while the latter would contain the range lists for any > DW_AT_r

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Cary Coutant via Dwarf-Discuss
> > So in the end the logical thing to do when encountering a > > DW_FORM_rnglistx in a split-unit, in order to support everybody, is > > probably to go to the .debug_rnglists.dwo section, if there's one, > > disregarding the (inherited) DW_AT_rnglists_base. If there isn't, then > > try the linked

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 4:02 PM Cary Coutant wrote: > > > So in the end the logical thing to do when encountering a > > > DW_FORM_rnglistx in a split-unit, in order to support everybody, is > > > probably to go to the .debug_rnglists.dwo section, if there's one, > > > disregarding the (inherited)

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread Jakub Jelinek via Dwarf-Discuss
On Wed, Mar 10, 2021 at 04:12:57PM -0800, David Blaikie via Dwarf-Discuss wrote: > On Wed, Mar 10, 2021 at 4:02 PM Cary Coutant wrote: > > > > > So in the end the logical thing to do when encountering a > > > > DW_FORM_rnglistx in a split-unit, in order to support everybody, is > > > > probably t

Re: [Dwarf-Discuss] Split Dwarf vs. CU DW_AT_ranges / DW_AT_low_pc placement

2021-03-10 Thread David Blaikie via Dwarf-Discuss
On Wed, Mar 10, 2021 at 9:38 PM Jakub Jelinek wrote: > On Wed, Mar 10, 2021 at 04:12:57PM -0800, David Blaikie via Dwarf-Discuss > wrote: > > On Wed, Mar 10, 2021 at 4:02 PM Cary Coutant wrote: > > > > > > > So in the end the logical thing to do when encountering a > > > > > DW_FORM_rnglistx in

Re: [Dwarf-Discuss] Retrieving variables, function address using dwarf

2021-03-10 Thread Archana Deshmukh via Dwarf-Discuss
Thanks Michael for the response. Actually, I have only this much information. I need to get information related to For global variables , I read the address "55b51afea000" from > /proc//maps file. I use DW_OP_addr parameter to retrieve the address. 55b51afea000 + DW_OP_addr gives me the ad