summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/lib/Makefile1
-rw-r--r--lldb/source/Core/ArchSpec.cpp1
-rw-r--r--lldb/source/Host/freebsd/Host.cpp2
-rw-r--r--lldb/source/Plugins/ABI/CMakeLists.txt2
-rw-r--r--lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp24
-rw-r--r--lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp24
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp14
-rw-r--r--lldb/source/Target/Thread.cpp2
-rw-r--r--lldb/source/lldb.cpp1
9 files changed, 61 insertions, 10 deletions
diff --git a/lldb/lib/Makefile b/lldb/lib/Makefile
index 97c82641e0a..67975769180 100644
--- a/lldb/lib/Makefile
+++ b/lldb/lib/Makefile
@@ -34,6 +34,7 @@ USEDLIBS = lldbAPI.a \
lldbPluginABIMacOSX_arm.a \
lldbPluginABIMacOSX_arm64.a \
lldbPluginABIMacOSX_i386.a \
+ lldbPluginABISysV_ppc.a \
lldbPluginABISysV_ppc64.a \
lldbPluginABISysV_x86_64.a \
lldbPluginABISysV_hexagon.a \
diff --git a/lldb/source/Core/ArchSpec.cpp b/lldb/source/Core/ArchSpec.cpp
index 2562e98d74c..c1e3c137c08 100644
--- a/lldb/source/Core/ArchSpec.cpp
+++ b/lldb/source/Core/ArchSpec.cpp
@@ -19,7 +19,6 @@
#include "llvm/Support/ELF.h"
#include "llvm/Support/Host.h"
#include "lldb/Utility/SafeMachO.h"
-#include "lldb/Core/Log.h"
#include "lldb/Core/RegularExpression.h"
#include "lldb/Core/StringList.h"
#include "lldb/Host/Endian.h"
diff --git a/lldb/source/Host/freebsd/Host.cpp b/lldb/source/Host/freebsd/Host.cpp
index fcf074bafa9..770a04d1c1f 100644
--- a/lldb/source/Host/freebsd/Host.cpp
+++ b/lldb/source/Host/freebsd/Host.cpp
@@ -301,6 +301,8 @@ GetAuxvData32(lldb_private::Process *process)
DataBufferSP buf_sp;
std::unique_ptr<DataBufferHeap> buf_ap(new DataBufferHeap(1024, 0));
+ // TODO:FIXME: Need a way to get this dynamically, instead of a magic
+ // constant that only works on a single architecture.
ps_strings_addr = (void *)0xffffdff0;
pid.piod_op = PIOD_READ_D;
pid.piod_addr = &ps_strings;
diff --git a/lldb/source/Plugins/ABI/CMakeLists.txt b/lldb/source/Plugins/ABI/CMakeLists.txt
index 6a487c9123f..2d67a103c9d 100644
--- a/lldb/source/Plugins/ABI/CMakeLists.txt
+++ b/lldb/source/Plugins/ABI/CMakeLists.txt
@@ -1,6 +1,6 @@
add_subdirectory(SysV-hexagon)
-add_subdirectory(SysV-ppc64)
add_subdirectory(SysV-ppc)
+add_subdirectory(SysV-ppc64)
add_subdirectory(SysV-x86_64)
add_subdirectory(MacOSX-i386)
add_subdirectory(MacOSX-arm)
diff --git a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
index 378e47b360c..1988dd32c5e 100644
--- a/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
+++ b/lldb/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
@@ -637,6 +637,30 @@ ABISysV_ppc::GetReturnValueObjectSimple (Thread &thread,
}
else
{
+ const size_t byte_size = return_clang_type.GetByteSize();
+ if (byte_size <= sizeof(long double))
+ {
+ const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+ RegisterValue f1_value;
+ if (reg_ctx->ReadRegister (f1_info, f1_value))
+ {
+ DataExtractor data;
+ if (f1_value.GetData(data))
+ {
+ lldb::offset_t offset = 0;
+ if (byte_size == sizeof(float))
+ {
+ value.GetScalar() = (float) data.GetFloat(&offset);
+ success = true;
+ }
+ else if (byte_size == sizeof(double))
+ {
+ value.GetScalar() = (double) data.GetDouble(&offset);
+ success = true;
+ }
+ }
+ }
+ }
}
}
diff --git a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
index e2d7c02ad6e..d8e62bcb0f5 100644
--- a/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
+++ b/lldb/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
@@ -637,6 +637,30 @@ ABISysV_ppc64::GetReturnValueObjectSimple (Thread &thread,
}
else
{
+ const size_t byte_size = return_clang_type.GetByteSize();
+ if (byte_size <= sizeof(long double))
+ {
+ const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
+ RegisterValue f1_value;
+ if (reg_ctx->ReadRegister (f1_info, f1_value))
+ {
+ DataExtractor data;
+ if (f1_value.GetData(data))
+ {
+ lldb::offset_t offset = 0;
+ if (byte_size == sizeof(float))
+ {
+ value.GetScalar() = (float) data.GetFloat(&offset);
+ success = true;
+ }
+ else if (byte_size == sizeof(double))
+ {
+ value.GetScalar() = (double) data.GetDouble(&offset);
+ success = true;
+ }
+ }
+ }
+ }
}
}
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index ae2358ceaa7..b26847ed954 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -326,13 +326,13 @@ PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite
trap_opcode_size = sizeof(g_i386_opcode);
}
break;
- case llvm::Triple::ppc:
- case llvm::Triple::ppc64:
- {
- static const uint8_t g_ppc_opcode[] = { 0x7f, 0xe0, 0x00, 0x08 };
- trap_opcode = g_ppc_opcode;
- trap_opcode_size = sizeof(g_ppc_opcode);
- }
+ case llvm::Triple::ppc:
+ case llvm::Triple::ppc64:
+ {
+ static const uint8_t g_ppc_opcode[] = { 0x7f, 0xe0, 0x00, 0x08 };
+ trap_opcode = g_ppc_opcode;
+ trap_opcode_size = sizeof(g_ppc_opcode);
+ }
}
if (bp_site->SetTrapOpcode(trap_opcode, trap_opcode_size))
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index f1beac69a8e..23816772eda 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -2281,8 +2281,8 @@ Thread::GetUnwinder ()
case llvm::Triple::aarch64:
case llvm::Triple::thumb:
case llvm::Triple::mips64:
- case llvm::Triple::ppc64:
case llvm::Triple::ppc:
+ case llvm::Triple::ppc64:
case llvm::Triple::hexagon:
m_unwinder_ap.reset (new UnwindLLDB (*this));
break;
diff --git a/lldb/source/lldb.cpp b/lldb/source/lldb.cpp
index e1de7291f2b..69d8cef9b2e 100644
--- a/lldb/source/lldb.cpp
+++ b/lldb/source/lldb.cpp
@@ -229,6 +229,7 @@ lldb_private::Terminate ()
ABIMacOSX_arm::Terminate();
ABIMacOSX_arm64::Terminate();
ABISysV_x86_64::Terminate();
+ ABISysV_ppc::Terminate();
ABISysV_ppc64::Terminate();
DisassemblerLLVMC::Terminate();
ObjectContainerBSDArchive::Terminate();
OpenPOWER on IntegriCloud