summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Utility
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2017-08-16 12:55:02 +0000
committerEd Maste <emaste@freebsd.org>2017-08-16 12:55:02 +0000
commit37c40af7127469754891ebc8f78439c2720f71cd (patch)
tree6559531793b89baca913816945534b0534783c5c /lldb/source/Plugins/Process/Utility
parent9c5d64b901cf3b056edf17c9960ae54338a4bd52 (diff)
downloadbcm5719-llvm-37c40af7127469754891ebc8f78439c2720f71cd.tar.gz
bcm5719-llvm-37c40af7127469754891ebc8f78439c2720f71cd.zip
Make i386-*-freebsd expression work on JIT path
* Enable i386 ABI creation for freebsd * Added an extra argument in ABISysV_i386::PrepareTrivialCall for mmap syscall * Unlike linux, the last argument of mmap is actually 64-bit(off_t). This requires us to push an additional word for the higher order bits. * Prior to this change, ktrace dump will show mmap failures due to invalid argument coming from the 6th mmap argument. Patch by Karnajit Wangkhem Differential Revision: https://reviews.llvm.org/D34776 llvm-svn: 311002
Diffstat (limited to 'lldb/source/Plugins/Process/Utility')
-rw-r--r--lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
index 4e1f10c6ae1..5c51a035ec6 100644
--- a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+++ b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
@@ -64,7 +64,7 @@ bool lldb_private::InferiorCallMmap(Process *process, addr_t &allocated_addr,
options.SetTimeout(std::chrono::milliseconds(500));
options.SetTrapExceptions(false);
- addr_t prot_arg, flags_arg = 0;
+ addr_t prot_arg;
if (prot == eMmapProtNone)
prot_arg = PROT_NONE;
else {
@@ -77,11 +77,6 @@ bool lldb_private::InferiorCallMmap(Process *process, addr_t &allocated_addr,
prot_arg |= PROT_WRITE;
}
- const ArchSpec arch = process->GetTarget().GetArchitecture();
- flags_arg =
- process->GetTarget().GetPlatform()->ConvertMmapFlagsToPlatform(arch,
- flags);
-
AddressRange mmap_range;
if (sc.GetAddressRange(range_scope, 0, use_inline_block_range,
mmap_range)) {
@@ -89,7 +84,10 @@ bool lldb_private::InferiorCallMmap(Process *process, addr_t &allocated_addr,
process->GetTarget().GetScratchClangASTContext();
CompilerType clang_void_ptr_type =
clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
- lldb::addr_t args[] = {addr, length, prot_arg, flags_arg, fd, offset};
+ const ArchSpec arch = process->GetTarget().GetArchitecture();
+ MmapArgList args =
+ process->GetTarget().GetPlatform()->GetMmapArgumentList(
+ arch, addr, length, prot_arg, flags, fd, offset);
lldb::ThreadPlanSP call_plan_sp(
new ThreadPlanCallFunction(*thread, mmap_range.GetBaseAddress(),
clang_void_ptr_type, args, options));
OpenPOWER on IntegriCloud