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] 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

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

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

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] 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

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

2021-03-10 Thread Metzger, Markus T via Dwarf-Discuss
the called function would interpret garbage as arguments. Markus. From: Dwarf-Discuss On Behalf Of David Blaikie via Dwarf-Discuss Sent: Mittwoch, 10. März 2021 00:28 To: Paul Robinson Cc: DWARF Discuss Subject: Re: [Dwarf-Discuss] compilers generating ABI non-compliant function calls? On Tue, M

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

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

2021-03-09 Thread David Blaikie via Dwarf-Discuss
On Tue, Mar 9, 2021 at 3:40 PM Jakub Jelinek wrote: > On Tue, Mar 09, 2021 at 03:22:35PM -0800, David Blaikie wrote: > > So, when the consumer evaluates DW_OP_GNU_parameter_ref, it handles it > > > similarly to DW_OP_entry_value, unwinds to caller if it can identify > it, > > > and just looks up

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

2021-03-09 Thread Jakub Jelinek via Dwarf-Discuss
On Tue, Mar 09, 2021 at 03:22:35PM -0800, David Blaikie wrote: > So, when the consumer evaluates DW_OP_GNU_parameter_ref, it handles it > > similarly to DW_OP_entry_value, unwinds to caller if it can identify it, > > and just looks up if some value is specified for it in that particular > >

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

2021-03-09 Thread David Blaikie via Dwarf-Discuss
On Tue, Mar 9, 2021 at 11:52 AM Jakub Jelinek wrote: > On Tue, Mar 09, 2021 at 11:43:54AM -0800, David Blaikie wrote: > > Thanks for the details! So in this case GCC changes the ABI of foo(int x, > > int y) to be equivalent to foo(int y) and the parameter description of > 'y' > > No, it is

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

2021-03-09 Thread Jakub Jelinek via Dwarf-Discuss
On Tue, Mar 09, 2021 at 11:43:54AM -0800, David Blaikie wrote: > Thanks for the details! So in this case GCC changes the ABI of foo(int x, > int y) to be equivalent to foo(int y) and the parameter description of 'y' No, it is actually equivalent to foo(void) but DW_TAG_call_site_parameter in

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

2021-03-09 Thread David Blaikie via Dwarf-Discuss
On Tue, Mar 9, 2021 at 11:29 AM Jakub Jelinek wrote: > On Tue, Mar 09, 2021 at 11:16:01AM -0800, David Blaikie via Dwarf-Discuss > wrote: > > void f1(int i) { } > > > > to include a DW_AT_location with fbreg, nothing about how the ABI > > represents 'i' - so that would be an ABI gap. > > > > In

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

2021-03-09 Thread Jakub Jelinek via Dwarf-Discuss
On Tue, Mar 09, 2021 at 11:16:01AM -0800, David Blaikie via Dwarf-Discuss wrote: > void f1(int i) { } > > to include a DW_AT_location with fbreg, nothing about how the ABI > represents 'i' - so that would be an ABI gap. > > In the cases where the compiler does modify any ABI-relevant properties,

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

2021-03-09 Thread David Blaikie via Dwarf-Discuss
Frank: FWIW, gcc does not leave ABI-dependent gaps in the DWARF generated for function parameters. First class location lists are given, whether or not they are in the ABI-governed locations, or whether they've been moved somewhere else, or whether they've been optimized out so that a consumer

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

2021-03-09 Thread Michael Eager via Dwarf-Discuss
On 3/9/21 7:13 AM, Frank Ch. Eigler via Dwarf-Discuss wrote: As I understand it, the location of*function return values* is however a gap in DWARF, and a consumer tool must resort to ABI specs. (Thus the elfutils dwfl_module_return_value_location() function.) I'm sure there's a Reason for

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

2021-03-09 Thread Andreas Arnez via Dwarf-Discuss
On Tue, Mar 09 2021, Frank Ch. Eigler via Dwarf-Discuss wrote: [...] > FWIW, gcc does not leave ABI-dependent gaps in the DWARF generated for > function parameters. First class location lists are given, whether or > not they are in the ABI-governed locations, or whether they've been > moved

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

2021-03-09 Thread Andrew Cagney via Dwarf-Discuss
On Tue, 9 Mar 2021 at 10:13, Frank Ch. Eigler wrote: > > Hi, Andrew - > > On Tue, Mar 09, 2021 at 10:05:04AM -0500, Andrew Cagney via Dwarf-Discuss > wrote: > > [...] > > This means that: > > - for simple objects, local functions; and > > - with link-time-optimization, everything except library

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

2021-03-09 Thread Luke Drummond via Dwarf-Discuss
Hi Andrew On Tue Mar 9, 2021 at 3:05 PM GMT, 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

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

2021-03-09 Thread Paul Robinson via Dwarf-Discuss
(re-sending because outlook omitted the group address) > -Original Message- > From: Dwarf-Discuss On Behalf > Of Jakub Jelinek via Dwarf-Discuss > Sent: Tuesday, March 9, 2021 10:16 AM > To: Andrew Cagney > Cc: DWARF Discussion > Subject: Re: [Dwarf-Discuss] com

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

2021-03-09 Thread Jakub Jelinek via Dwarf-Discuss
On Tue, Mar 09, 2021 at 10:05:04AM -0500, Andrew Cagney via Dwarf-Discuss wrote: > Is anyone aware of a compiler doing this (I figure with LTO there's a > strong incentive)? And if so, how is this described to the debugger. > The ABI / calling-convention is no longer on hand for filling in the >

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

2021-03-09 Thread Frank Ch. Eigler via Dwarf-Discuss
Hi, Andrew - On Tue, Mar 09, 2021 at 10:05:04AM -0500, Andrew Cagney via Dwarf-Discuss wrote: > [...] > This means that: > - for simple objects, local functions; and > - with link-time-optimization, everything except library interface functions > are fair game for ABI non-compliant call