summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/MacOSX/MachTask.mm
Commit message (Collapse)AuthorAgeFilesLines
* Workaround TestConcurrentMany* flakiness in a more pricipled wayFrederic Riss2019-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | The flakiness on our local machines seems to come for a race in the kernel between task_suspend and the creation of the Mach exceptions for the threads that hit breakpoints. The debugserver code is written with the assumption that the kernel will be able to provide us with all the exceptions for a given task once task_suspend returns. On machines with higher core counts, this seems not to be the case. The first batch of exceptions we get after task_suspend does not contain exceptions for all the threads that have hit a breakpoint, thus they get misreprorted in the first stop packet. Adding a 1ms timeout to the call that retrieves the batch of exceptions seems to workaround the issue reliably on our machines, and it shoulnd't impact standard debugging scenarios too much (a stop will incur an additional 1ms delay). We'll be talking to the kernel team to figure out the right contract for those APIs. This patch also reverts part of Jonas' previous workaround for the issue (r370785). llvm-svn: 370916
* Add some unconditional logging on the failure points when attachingJason Molenda2019-02-151-1/+3
| | | | | | | | | | | | | | to a process so we'll always get messages in the console logs. Also make the "is frontboard process" / "is backboard process" determination lazy, specifically take it out of the MachProcess::AttachForDebug codepath when we are attaching to a process, to simplify attaching. <rdar://problem/47982516> <rdar://problem/48060134> llvm-svn: 354181
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Add ability to collect memory limit.Han Ming Ong2018-02-281-4/+10
| | | | | | | | Reviewer: Jason Molenda <rdar://problem/37686560> llvm-svn: 326374
* Removed accidentally committed code from previous commit.Han Ming Ong2018-02-271-5/+1
| | | | llvm-svn: 326214
* Got rid of weak imports of libpenergy and libpsample because we are already ↵Han Ming Ong2018-02-271-3/+5
| | | | | | | requiring a modern macOS (at least 10.11) Reviewer: Jason Molenda llvm-svn: 326213
* Make use of physical footprint as memory measurement.Han Ming Ong2018-02-011-47/+4
| | | | | | | | | | | | Remove obsolete measurements. This check in requires at least 10.11 Reviewed: Jason Molenda, Jim Ingham <rdar://problem/37047106> Xcode Memory gauge should show the jetsam ledger footprint rather than anonymous llvm-svn: 324013
* Fix misc -Wcast-qual warnings, NFCVedant Kumar2017-12-061-1/+1
| | | | llvm-svn: 319937
* Rename Error -> Status.Zachary Turner2017-05-121-10/+10
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Add the ability for the task port to change when a process execs.Greg Clayton2016-09-281-0/+15
| | | | | | <rdar://problem/28476369> llvm-svn: 282632
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-826/+753
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Removed unused functions.Greg Clayton2016-02-241-85/+0
| | | | llvm-svn: 261768
* Fix warnings.Bruce Mitchener2015-07-221-3/+3
| | | | | | | | | | Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11404 llvm-svn: 242913
* Fix debugserver build breakage on Mavericks after lldb commit svn 240728Dawn Perchik2015-07-141-2/+2
| | | | | | | | vm_kernel_page_size appears to not be defined on OSX Mavericks, so the build fails. This patch fixes the build by calculating the pagesize if _VM_PAGE_SIZE_H_ is not defined. llvm-svn: 242114
* Use the right ifdef macro, reviewed by JasonHan Ming Ong2015-06-261-3/+3
| | | | llvm-svn: 240739
* rdar://problem/21469556Han Ming Ong2015-06-251-7/+20
| | | | | | Make sure that the memory report is correct for 64-bit devices. llvm-svn: 240728
* Fix debugserver warnings on MacOSX.Greg Clayton2015-03-091-6/+5
| | | | llvm-svn: 231692
* Fix unused-variable warnings from the clang static analyzer.Jason Molenda2014-10-151-2/+2
| | | | llvm-svn: 219863
* Increase the gdb-remote packet timeout for the first packet we sendJason Molenda2014-07-241-0/+19
| | | | | | | | | | | | | to the remote side (QStartNoAckMode) - it may take a little longer than normal to get a reply. In debugserver, hardcode the priority for several threads so they aren't de-prioritized when a user app is using system resources. Also, set the names of the threads. <rdar://problem/17509866> llvm-svn: 213828
* Fix typos.Bruce Mitchener2014-07-011-1/+1
| | | | llvm-svn: 212132
* Initial merge of some of the iOS 8 / Mac OS X Yosemite specificJason Molenda2014-06-131-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
* Allow for a task port to change when we exec. Greg Clayton2014-04-301-4/+5
| | | | llvm-svn: 207699
* lldb arm64 import.Jason Molenda2014-03-291-0/+1062
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
OpenPOWER on IntegriCloud