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] Retrieving variables, function address using dwarf

2021-03-09 Thread Michael Eager via Dwarf-Discuss
It's difficult to offer advice with such a spare description. You might read the executable and relocate the .debug_info and other debug sections using the process map. If you have the process image, this probably would not be necessary. On 3/8/21 1:49 AM, Archana Deshmukh via Dwarf-Discuss

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] compilers generating ABI

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

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

2021-03-09 Thread Andrew Cagney via Dwarf-Discuss
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 debugger supplementing the debug information describing the