summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/State.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-05-17 03:37:42 +0000
committerGreg Clayton <gclayton@apple.com>2011-05-17 03:37:42 +0000
commitd495c5340d57a30a83496e6e9794b8bc746f99ad (patch)
tree90b52232337d36803413ea7d5c7089be68e3f50d /lldb/source/Core/State.cpp
parenta7ae4552af7f272482a4b2b43b737412488519e4 (diff)
downloadbcm5719-llvm-d495c5340d57a30a83496e6e9794b8bc746f99ad.tar.gz
bcm5719-llvm-d495c5340d57a30a83496e6e9794b8bc746f99ad.zip
Added an allocated memory cache to avoid having to allocate memory over and
over when running JITed expressions. The allocated memory cache will cache allocate memory a page at a time for each permission combination and divvy up the memory and hand it out in 16 byte increments. llvm-svn: 131453
Diffstat (limited to 'lldb/source/Core/State.cpp')
-rw-r--r--lldb/source/Core/State.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/source/Core/State.cpp b/lldb/source/Core/State.cpp
index 92687045fb9..ad73ba8e3d5 100644
--- a/lldb/source/Core/State.cpp
+++ b/lldb/source/Core/State.cpp
@@ -84,6 +84,31 @@ lldb_private::GetFormatAsCString (lldb::Format format)
return unknown_format_string;
}
+
+const char *
+lldb_private::GetPermissionsAsCString (uint32_t permissions)
+{
+ switch (permissions)
+ {
+ case 0: return "---";
+ case ePermissionsWritable: return "-w-";
+ case ePermissionsReadable: return "r--";
+ case ePermissionsExecutable: return "--x";
+ case ePermissionsReadable |
+ ePermissionsWritable: return "rw-";
+ case ePermissionsReadable |
+ ePermissionsExecutable: return "r-x";
+ case ePermissionsWritable |
+ ePermissionsExecutable: return "-wx";
+ case ePermissionsReadable |
+ ePermissionsWritable |
+ ePermissionsExecutable: return "rwx";
+ default:
+ break;
+ }
+ return "???";
+}
+
bool
lldb_private::StateIsRunningState (StateType state)
{
OpenPOWER on IntegriCloud