Remove the QAddressIsExecutable packet I added last night.
Add a more general purpose qMemoryRegionInfo packet which can
describe various attributes about a memory region. Currently it
will return the start address, size, and permissions (read, write,
executable) for the memory region. It may be possible to add
additional attributes in the future such as whether the region is
designated as stack memory or jitted code a la vmmap.
I still haven't implemented the lldb side of the code to use this
packet yet so there may be unexpected behavior - but the basic implementation looks
about right. I'll hook it up to lldb soon and fix any problems that crop up.
llvm-svn: 144175
diff --git a/lldb/tools/debugserver/source/MacOSX/MachTask.cpp b/lldb/tools/debugserver/source/MacOSX/MachTask.cpp
index 035198e..b6368fc 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachTask.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachTask.cpp
@@ -205,18 +205,17 @@
}
//----------------------------------------------------------------------
-// MachTask::IsAddressExecutable
+// MachTask::MemoryRegionInfo
//----------------------------------------------------------------------
-bool
-MachTask::IsAddressExecutable (nub_addr_t addr)
+int
+MachTask::MemoryRegionInfo (nub_addr_t addr, char *outbuf, nub_size_t outbufsize)
{
task_t task = TaskPort();
- bool ret = false;
- if (task != TASK_NULL)
- {
- ret = m_vm_memory.IsExecutable(task, addr);
- DNBLogThreadedIf(LOG_MEMORY, "MachTask::IsAddressExecutable ( addr = 0x%8.8llx ) => %s", (uint64_t)addr, (ret ? "true" : "false"));
- }
+ if (task == TASK_NULL)
+ return -1;
+
+ int ret = m_vm_memory.MemoryRegionInfo(task, addr, outbuf, outbufsize);
+ DNBLogThreadedIf(LOG_MEMORY, "MachTask::MemoryRegionInfo ( addr = 0x%8.8llx ) => %d", (uint64_t)addr, ret);
return ret;
}