Dwarves debugging tools
 help / color / mirror / Atom feed
* [PATCH dwarves v1 0/2] Support in-memory return values for s390
@ 2026-11-22 21:06 Maxim Khmelevskii
  2026-11-22 21:06 ` [PATCH dwarves v1 1/2] dwarf_loader: " Maxim Khmelevskii
  2026-11-22 21:06 ` [PATCH dwarves v1 2/2] tests: Add test for in-memory return values Maxim Khmelevskii
  0 siblings, 2 replies; 3+ messages in thread
From: Maxim Khmelevskii @ 2026-11-22 21:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: dwarves, linux-debuggers, Alan Maguire, Ilya Leoshkevich

The s390 ABI returns any aggregate and scalars larger than 8 bytes, such
as __int128, in a return value buffer allocated by the caller.
This buffer's address is treated like a "hidden argument" and passed
by the caller in %r2. The function's first parameter is passed in %r3.

Without this change pahole skips such functions and with "--verbose"
prints a message like this:

<function> : skipping BTF encoding of function due to unexpected register usage for parameter

Set the first parameter register index (reg_idx) to the proper value.
Move function's return type resolution before parameters
are analyzed, because the analysis depends on the return type.

Although param_loc_supported is not set for s390, calculate
the reg_idx in function__match_clang_parameter_locations in case
the flag is enabled in the future.

Add test for in-memory return values.

The change affects only s390.

Maxim Khmelevskii (2):
  dwarf_loader: Support in-memory return values for s390
  tests: Add test for in-memory return values

 dwarf_loader.c         |  84 +++++++++++++++++++++++-------
 dwarves.h              |   1 +
 tests/ret_in_memory.sh | 113 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 180 insertions(+), 18 deletions(-)
 create mode 100755 tests/ret_in_memory.sh

-- 
2.56.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-22 21:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 21:06 [PATCH dwarves v1 0/2] Support in-memory return values for s390 Maxim Khmelevskii
2026-11-22 21:06 ` [PATCH dwarves v1 1/2] dwarf_loader: " Maxim Khmelevskii
2026-11-22 21:06 ` [PATCH dwarves v1 2/2] tests: Add test for in-memory return values Maxim Khmelevskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox