summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/DNB.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2011-11-09 08:03:56 +0000
committerJason Molenda <jmolenda@apple.com>2011-11-09 08:03:56 +0000
commit3dc8583c96e249fba8884b9785ea02910f418f2b (patch)
treed9a80c29cd08a31e195243954dbbd0d1d023e958 /lldb/tools/debugserver/source/DNB.cpp
parent8c8a43105720bcc5eedd35efc490afc84c8fe668 (diff)
downloadbcm5719-llvm-3dc8583c96e249fba8884b9785ea02910f418f2b.tar.gz
bcm5719-llvm-3dc8583c96e249fba8884b9785ea02910f418f2b.zip
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
Diffstat (limited to 'lldb/tools/debugserver/source/DNB.cpp')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index e9461221954..c6dc313cd31 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -1125,29 +1125,26 @@ DNBProcessMemoryDeallocate (nub_process_t pid, nub_addr_t addr)
}
//----------------------------------------------------------------------
-// Try to determine if a given address in the process PID is in an
-// executable region or not. Used for sniffing potential caller addresses
-// when unwinding a stack and we're making guesses about where the caller
-// frame addr might be saved.
+// Find attributes of the memory region that contains ADDR for process PID,
+// if possible, and return a string describing those attributes.
//
-// RETURNS: 1 if executable
-// 0 if not executable
-// -1 if we cannot make a determination on this target
+// Returns 1 if we could find attributes for this region and OUTBUF can
+// be sent to the remote debugger.
+//
+// Returns 0 if we couldn't find the attributes for a region of memory at
+// that address and OUTBUF should not be sent.
+//
+// Returns -1 if this platform cannot look up information about memory regions
+// or if we do not yet have a valid launched process.
//
-// Note that unmapped memory (an address that is not an allocated page in
-// PID) will return as 0 - it is not executable memory. -1 is intended
-// for a platform where we can't inspect memory region attributes.
//----------------------------------------------------------------------
int
-DNBIsAddressExecutable (nub_process_t pid, nub_addr_t addr)
+DNBMemoryRegionInfo (nub_process_t pid, nub_addr_t addr, char *outbuf, nub_size_t outbufsize)
{
MachProcessSP procSP;
if (GetProcessSP (pid, procSP))
{
- if (procSP->IsAddressExecutable(addr))
- return 1;
- else
- return 0;
+ return procSP->MemoryRegionInfo(addr, outbuf, outbufsize);
}
return -1;
}
OpenPOWER on IntegriCloud