summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachTask.cpp
Commit message (Collapse)AuthorAgeFilesLines
* lldb arm64 import.Jason Molenda2014-03-291-1043/+0
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* <rdar://problem/13963648>Han Ming Ong2013-05-221-1/+9
| | | | | | Collect 'anonymous memory' info, if possible llvm-svn: 182523
* fix a couple of clang static analyzer warnings.Jason Molenda2013-05-041-1/+1
| | | | | | | Most important was a new[] + delete mismatch in ScanFormatDescriptor() and a couple of possible memory leaks in FileSpec::EnumerateDirectory(). llvm-svn: 181080
* Update MachVMMemory::PageSize to get the page size of a specific processJason Molenda2013-04-061-1/+7
| | | | | | | | | | | if we have an updated task_info call available; else fall back to getting the default host-wide page size. Update all uses of the vm page size to get it via MachVMMemory::PageSize(). <rdar://problem/13477763>, <rdar://problem/13498504> llvm-svn: 178953
* <rdar://problem/13498504>Han Ming Ong2013-03-251-5/+13
| | | | | | Don't hard code vm page size in profiling code llvm-svn: 177907
* <rdar://problem/13338758>Han Ming Ong2013-03-041-70/+107
| | | | | | | Make it configurable what to profile. For Mac, we don't use the dirty page size yet and hence there is no need to gather that. This should be way better in not draining the battery since we are operating between 0% to 0.1% on the Mac after this change. llvm-svn: 176451
* <rdar://problem/13282582>Han Ming Ong2013-02-261-2/+5
| | | | | | Really don't call sysctl again when we already have the result. llvm-svn: 176062
* <rdar://problem/13282582>Han Ming Ong2013-02-251-1/+9
| | | | | | Need available CPU on target device to support CPU reporting. llvm-svn: 176008
* <rdar://problem/13277100>Han Ming Ong2013-02-221-0/+12
| | | | | | Need host_statistics on profile data to get host's user/system/idle clicks llvm-svn: 175928
* Remove unintended comment.Jason Molenda2013-02-221-2/+0
| | | | llvm-svn: 175873
* Change debugserver from using the mach port number (in debugserver'sJason Molenda2013-02-221-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | own port namepsace) as the thread identifier to using the system-wide globally unique thread id as the thread identifier number. MachThread.cpp keeps both the unique id and the mach port number for each thread. All layers outside MachThread class use the unique id with three exceptions: (1) Mach exceptions come in with the port number (thread_port) which needs to be translated, (2) any calls to low-level thread_get_state/thread_set_state/thread_suspend etc need to use the mach port number, (3) MachThreadList::UpdateThreadList which creates the MachThread objects gets the unique id and passes it to the MachThread ctor as an argument. In general, any time nub_thread_t is used, it is now referring to a unique thread id. Any time a thread_t is used, it is now referring to a mach port number. There was some interchangability of these types previously. nub_thread_t has also been changed to a 64-bit type which necessitated some printf specification string changes. I haven't been able to test these changes extensively yet but want to checkpoint the work. The scenarios I've been testing are all working correctly so while there may be some corner cases I haven't hit yet, I think it is substantially correct. <rdar://problem/12931414> llvm-svn: 175870
* <rdar://13073234>Han Ming Ong2013-01-251-6/+5
| | | | | | Get the number of threads correct. llvm-svn: 173466
* <rdar://problem/12976277>Han Ming Ong2013-01-181-2/+1
| | | | | | Swap in index ids for thread ids in GDBRemoteCommunicationClient. Besides dealing with the async logic, I have to take care of the situation when the inferior paused as well. llvm-svn: 172869
* Use a more unique end delimiter. In any case, the thread names are hexified ↵Han Ming Ong2013-01-101-1/+1
| | | | | | when returning to lldb. llvm-svn: 172021
* <rdar://problem/12975489>Han Ming Ong2013-01-091-6/+5
| | | | | | | 1. Using mach port number, just like when inferior is paused. 2. Use key:value pair of thread used time instead of comma separated notation. llvm-svn: 172012
* <rdar://problem/12890948>Han Ming Ong2012-12-171-11/+16
| | | | | | Send thread name using hex encoding. llvm-svn: 170370
* <rdar://problem/12890901>Han Ming Ong2012-12-171-22/+41
| | | | | | Capturing thread name during profiling. llvm-svn: 170312
* <rdar://problem/12780259>Han Ming Ong2012-11-291-12/+8
| | | | | | | Prevent async and sync calls to get profile data from stomping on each other. At the same time, don't use '$' as end delimiter per chunk of profile data. llvm-svn: 168948
* <rdar://problem/12759744> Provide physical memory distribution as part of ↵Han Ming Ong2012-11-271-7/+17
| | | | | | | | profile data Make use of unix system calls to provide physical memory usage profile data. llvm-svn: 168720
* Han Ming's commit in r168228 had a bunch of 4-space tabsJason Molenda2012-11-171-49/+49
| | | | | | | in the source files. Expand to spaces. No content changes, just whitespace. llvm-svn: 168238
* <rdar://problem/12720514> Sub-TLF: Provide service to profile the inferiorHan Ming Ong2012-11-171-0/+128
| | | | | | This allows client to query profiling states on the inferior. llvm-svn: 168228
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-2/+2
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* Patch from Filipe Cabecinhas.Greg Clayton2012-04-261-1/+0
| | | | llvm-svn: 155641
* <rdar://problem/11007934> Greg Clayton2012-03-081-1/+1
| | | | | | | | On darwin, if child process of process being debugged dies due to mach exception, the debugged process will die. debugserver now only handles the mach exceptions for the task being debugged. llvm-svn: 152291
* <rdar://problem/10986692>Greg Clayton2012-03-061-1/+18
| | | | | | Safeguard against building on next OS and run on current OS. llvm-svn: 152077
* Change #ifdef markers around lockdown and SpringBoardJason Molenda2012-02-221-6/+6
| | | | | | | calls to dpeend on WITH_SPRINGBOARD and WITH_LOCKDOWN instead of __arm__. Add an RNBSocket::useFD method. llvm-svn: 151119
* Added optional calls to lldb_private::Process for getting memory region infoGreg Clayton2011-11-181-3/+8
| | | | | | | | | | | | | | | | | | | | | | | from a process and hooked it up to the new packet that was recently added to our GDB remote executable named debugserver. Now Process has the following new calls: virtual Error Process::GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo &range_info); virtual uint32_t GetLoadAddressPermissions (lldb::addr_t load_addr); Only the first one needs to be implemented by subclasses that can add this support. Cleaned up the way the new packet was implemented in debugserver to be more useful as an API inside debugserver. Also found an error where finding a region for an address actually will pick up the next region that follows the address in the query so we also need ot make sure that the address we requested the region for falls into the region that gets returned. llvm-svn: 144976
* Remove the QAddressIsExecutable packet I added last night.Jason Molenda2011-11-091-9/+8
| | | | | | | | | | | | | | | 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
* Add "QAddressIsExecutable" packet to debugserver. Used to testJason Molenda2011-11-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | whether a given address is in an executable region of memory or not. I haven't written the lldb side that will use this packet it hasn't been tested yet but it's a simple enough bit of code. I want to have this feature available for the unwinder code. When we're stopped at an address with no valid symbol context, there are a number of questions I'd like to ask -- is the current pc value in an executable region (e.g. did they jump to unallocated/unexecutable memory? we know how to unwind from here if so.) Is the stack pointer or the frame pointer the correct register to use to find the caller's saved pc value? Once we're past the first frame we can trust things like eh_frame and ABI unwind schemes but the first frame is challenging and having a way to check potential addresses to see if they're executable or not would help narrow down the possibilities a lot. llvm-svn: 144074
* Enabled the "printf" attribute on all debugserver logging functions and fixed Greg Clayton2011-10-281-4/+8
| | | | | | the ensuing mayhem. llvm-svn: 143244
* Basic infrastructure code to exploit malloc stack logging as available on ↵Enrico Granata2011-09-091-0/+84
| | | | | | Mac OS X to track the allocation history of pointers on the target process llvm-svn: 139337
* Add a (currently disabled) bear trap where instead of deallocating pages, we ↵Jim Ingham2011-01-221-2/+9
| | | | | | remove all permissions. llvm-svn: 124012
* Fixed an issue with MachTask::TaskResume () where if the task was alreadyGreg Clayton2010-10-161-2/+6
| | | | | | | suspended, we would call "int ::task_resume (task_t task);" as many times as it took to resume the task which isn't what we want to do. llvm-svn: 116674
* Retry task_for_pid a few times to avoid some cases where task_for_pid fails.Greg Clayton2010-09-301-22/+33
| | | | llvm-svn: 115184
* Fixed debugserver to not exit when we are able to spawn the process, yet notGreg Clayton2010-07-301-6/+3
| | | | | | | | launch it due to not being able to get the task port. A SIGHUP was killing us and also an error string wasn't properly being passed along. Got rid of a class error variable that can only lead to multi-threaded crashes. llvm-svn: 109930
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+660
llvm-svn: 105619
OpenPOWER on IntegriCloud