Allow the target to give out the size of the red zone for given ABIs.
A bit of cleanup in the heap module.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@174129 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index f4582da..115703e 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -2568,3 +2568,22 @@
return expr_result;
}
+
+lldb::addr_t
+SBTarget::GetStackRedZoneSize()
+{
+ TargetSP target_sp(GetSP());
+ if (target_sp)
+ {
+ ABISP abi_sp;
+ ProcessSP process_sp (target_sp->GetProcessSP());
+ if (process_sp)
+ abi_sp = process_sp->GetABI();
+ else
+ abi_sp = ABI::FindPlugin(target_sp->GetArchitecture());
+ if (abi_sp)
+ return abi_sp->GetRedZoneSize();
+ }
+ return 0;
+}
+