[lldb][PPC64] Fixed vector and struct return value
authorPavel Labath <labath@google.com>
Fri, 16 Feb 2018 09:29:41 +0000 (09:29 +0000)
committerPavel Labath <labath@google.com>
Fri, 16 Feb 2018 09:29:41 +0000 (09:29 +0000)
commit686b27b55adc6f458883b1601b6acb674083b2ae
tree4167f50a8c92735273158f742c4fa785b3c07c56
parentd41059a9f6d04d3314636f6da524ba74b3442f3b
[lldb][PPC64] Fixed vector and struct return value

Summary:
The PowerPC64 ABI plugin was modified to:

- properly handle vector type return values
- implement support for struct/class return values

A refactoring in the code that handles return values was also performed, to make it possible to handle structs without repeating (when possible) code that handles its fields.

There was also an issue with CreateInstance(), that only created an instance in the first time it was called and then cached it in a static var. When restarting a process under LLDB's control, the ABI's process weak pointer would become null, and using it would result in a segmentation fault. This issue became more evident after the latest changes to PPC64 plugin, that now uses the process pointer to get the target byte order, making LLDB to seg fault when restarting a program. This was fixed by making CreateInstance() to always create a new ABI instance.

All of LLDB's ReturnValue tests are passing for PPC64le now. It should work for PPC64be too, although this was not tested.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: lbianc, anajuliapc, llvm-commits, alexandreyy, nemanjai, kbarton

Differential Revision: https://reviews.llvm.org/D42468
Patch by Leandro Lupori <leandro.lupori@gmail.com>.

llvm-svn: 325324
lldb/source/Host/common/HostInfoBase.cpp
lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp