summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed an unneccesary #if now that debugserver-mini links Foundation.Sean Callanan2017-01-261-2/+0
| | | | llvm-svn: 293161
* Instead of weak-linking against LoggingSupport framework (whichJason Molenda2017-01-261-0/+1
| | | | | | | | | | | | requires that this private framework be available - and it is not available earlier than macOS 10.12 - to build lldb), dlopen the framework binary on demand in debugserver. We're already using dlsym() to look up all the symbols so there is no need to use weak linking here. <rdar://problem/30158797> llvm-svn: 293135
* Link debugserver against Foundation to get access to NSProcessInfo.Sean Callanan2017-01-251-0/+2
| | | | | | debugserver-mini can't use Foundation so disable that code there. llvm-svn: 293098
* Conditionalized OsLogger.cpp on a modern SDK.Sean Callanan2017-01-251-1/+3
| | | | llvm-svn: 293020
* Fix the last commit; compression was being enabled on mac nativeJason Molenda2017-01-241-1/+1
| | | | | | | | | | | | | | | | | | | which led to ERROR: test_auxv_chunked_reads_work_debugserver (tools/lldb-server/TestGdbRemoteAuxvSupport.py) ERROR: test_auxv_data_is_correct_size_debugserver (tools/lldb-server/TestGdbRemoteAuxvSupport.py) ERROR: test_auxv_keys_look_valid_debugserver (tools/lldb-server/TestGdbRemoteAuxvSupport.py) ERROR: test_qSupported_returns_known_stub_features_debugserver (tools/lldb-server/TestLldbGdbServer.py) failures because debugserver was advertising compression being available, e.g. send packet: $qSupported:xmlRegisters=i386,arm,mips#12 read packet: $qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-deflate;DefaultCompressionMinSize=384#00 maybe these tests should be a little more accepting of additional features. but I didn't mean for this to be enabled on mac native. llvm-svn: 292890
* Enable compression capability in debugserver for all of ios/watchos/tvosJason Molenda2017-01-241-6/+1
| | | | | | | | environments. <rdar://problem/30159019> llvm-svn: 292882
* Revert part of cleanup to fix a build breakDavid Blaikie2017-01-061-2/+13
| | | | | | | | Wasn't sure I could include ErrorHandling.h here, and evidently I wasn't building this part (must've made the change using sed after getting tired of fixing each compilation error individually). llvm-svn: 291204
* Make lldb -Werror clean for -Wstring-conversionDavid Blaikie2017-01-061-13/+2
| | | | | | | | | Also found/fixed one bug identified by this warning in RenderScriptx86ABIFixups.cpp where a string literal was being used in an effort to provide a name for an instruction/register, but was instead being passed as the bool 'isVolatile' parameter. llvm-svn: 291198
* Quiet a warning where we weren't checking if this was the same and rhs.Greg Clayton2016-12-281-1/+2
| | | | llvm-svn: 290687
* Change the timeout in CallBoardSystemServiceOpenApplication to Jason Molenda2016-12-201-1/+1
| | | | | | | | 30 seconds to match the old springboard timeout; the launcher should time out before that and we will hopefully get back an informative error message instead of timing out ourselves. llvm-svn: 290163
* [CMake] Refactor LLDB libraries and tools to be componentsChris Bieneman2016-12-151-5/+1
| | | | | | In LLVM's CMake we have a convention that components have both a build and an install target. Making LLDB follow this convention will allow LLDB to take advantage of the LLVM_DISTRIBUTION_COMPONENTS build option from LLVM. llvm-svn: 289879
* Increase timeout for Frontboard app launch request from 9 to 20 secondsJason Molenda2016-12-081-1/+1
| | | | | | to match other timeouts. llvm-svn: 289023
* Add the ability for the task port to change when a process execs.Greg Clayton2016-09-283-3/+34
| | | | | | <rdar://problem/28476369> llvm-svn: 282632
* [CMake] Initial support for LLDB.frameworkChris Bieneman2016-09-211-18/+9
| | | | | | | | | | | | | | | | | | | Summary: This patch adds a CMake option LLDB_BUILD_FRAMEWORK, which builds libLLDB as a macOS framework instead of as a *nix shared library. With this patch any LLDB executable that has the INCLUDE_IN_FRAMEWORK option set will be built into the Framework's resources directory, and a symlink to the exeuctable will be placed under the build directory's bin folder. Creating the symlinks allows users to run commands from the build directory without altering the workflow. The framework generated by this patch passes the LLDB test suite, but has not been tested beyond that. It is not expected to be fully ready to ship, but it is a first step. With this patch binaries that are placed inside the framework aren't being properly installed. Fixing that would increase the patch size significantly, so I'd like to do that in a follow-up. Reviewers: zturner, tfiala Subscribers: beanz, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D24749 llvm-svn: 282110
* Move StdStringExtractor to tools/debugserverPavel Labath2016-09-125-5/+533
| | | | | | | | The class is only used in the debugserver. The rest of lldb has the StringExtractor class. Xcode project will need to be updated after this. llvm-svn: 281226
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-06103-33925/+32473
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Fix darwin cmake build for r279997Pavel Labath2016-08-301-1/+1
| | | | llvm-svn: 280087
* Copy StringExtractor to StdStringExtractor.Zachary Turner2016-08-293-16/+16
| | | | | | | | | | | I have some improvements to make to StringExtractor that require using LLVM. debugserver can't take a dependency on LLVM but uses this file, so I'm forking it off into StdStringExtractor and StringExtractor, so that StringExtractor can take advantage of some performance improvements and readability improvements that LLVM can provide. llvm-svn: 279997
* Fix warnings preventing copy elision.Pavel Labath2016-08-251-10/+10
| | | | | | | | | | | | | | | | | Summary: Moving a temporary object prevents copy elision, which is exactly what clang points out by warning about this pattern. The fix is simply removal of std::move applied to temporary objects. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D23825 Author: Taras Tsugrii <ttsugrii@fb.com> llvm-svn: 279724
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1935-29/+3527
| | | | | | | | | | | | Take 2, with missing cmake line fixed. Build tested on Ubuntu 14.04 with clang-3.6. See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279202
* Revert "Add StructuredData plugin type; showcase with new DarwinLog feature"Todd Fiala2016-08-1935-3527/+29
| | | | | | This reverts commit 1d885845d1451e7b232f53fba2e36be67aadabd8. llvm-svn: 279200
* Add StructuredData plugin type; showcase with new DarwinLog featureTodd Fiala2016-08-1935-29/+3527
| | | | | | | | | See docs/structured_data/StructuredDataPlugins.md for details. differential review: https://reviews.llvm.org/D22976 reviewers: clayborg, jingham llvm-svn: 279198
* Switch over to using socketpair for local debugserver connections as they ↵Greg Clayton2016-08-121-1/+46
| | | | | | | | | | | | | | | | are twice as fast as TCP sockets (on macOS at least). This change opens a socket pair and passes the second socket pair file descriptor down to the debugserver binary using a new option: "--fd=N" where N is the file descriptor. This file descriptor gets passed via posix_spawn() so that there is no need to do any bind/listen or bind/accept calls and eliminates the hanshake unix socket that is used to pass the result of the actual port that ends up being used so it can save time on launch as well as being faster. This is currently only enabled on __APPLE__ builds. Other OSs should try modifying the #define from ProcessGDBRemote.cpp but the first person will need to port the --fd option over to lldb-server. Any OSs that enable USE_SOCKETPAIR_FOR_LOCAL_CONNECTION in their native builds can use the socket pair stuff. The #define is Apple only right now, but looks like: #if defined (__APPLE__) #define USE_SOCKETPAIR_FOR_LOCAL_CONNECTION 1 #endif <rdar://problem/27814880> llvm-svn: 278524
* Undo usage of LLVM macros in debugserverTodd Fiala2016-08-101-2/+2
| | | | | | | We don't take a dependency on LLVM in debugserver. This was failing to compile before. llvm-svn: 278190
* Delete Host/windows/win32.hZachary Turner2016-08-092-5/+5
| | | | | | | | | | | | | | | | | | | It's always hard to remember when to include this file, and when you do include it it's hard to remember what preprocessor check it needs to be behind, and then you further have to remember whether it's windows.h or win32.h which you need to include. This patch changes the name to PosixApi.h, which is more appropriately named, and makes it independent of any preprocessor setting. There's still the issue of people not knowing when to include this, because there's not a well-defined set of things it exposes other than "whatever is missing on Windows", but at least this should make it less painful to fix when problems arise. This patch depends on LLVM revision r278170. llvm-svn: 278177
* [debugserver] Delete CFData.{h,cpp}, since they appear to be dead (NFCI)Vedant Kumar2016-08-094-114/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D23070 llvm-svn: 278142
* [lldb] Delete dead, infinitely-recursive code (NFC)Vedant Kumar2016-08-012-12/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D22985 llvm-svn: 277351
* Try to fix the OSX build with old SDK after r274725Tamas Berghammer2016-07-071-2/+12
| | | | llvm-svn: 274743
* debugserver will now report the minimum version load commandJason Molenda2016-07-072-0/+47
| | | | | | | | | | | | os name and version # from the mach-o binary as it scans the header/load commands from memory and sends the details back in the jGetLoadedDynamicLibrariesInfos response. lldb isn't using these fields yet but I have a suspicion I'm going to need them soon. <rdar://problem/25251243> llvm-svn: 274725
* Add support to debugserver for some new ways to interact with dyldJason Molenda2016-07-076-174/+611
| | | | | | | | | | | | to find the solibs loaded in a process. Support two new ways of sending the jGetLoadedDynamicLibrariesInfos packet to debugserver and add a new jGetSharedCacheInfo packet. Update the documentation for these packets as well. The changes to lldb to use these will be a separate commit. <rdar://problem/25251243> llvm-svn: 274718
* 64-bit LEB values are not always correctly decoded due to a casting issue, ↵Greg Clayton2016-06-281-2/+2
| | | | | | | | now they are. <rdar://problem/27002247> llvm-svn: 274037
* Change the "debugserver-mini" target (a version of debugserverJason Molenda2016-06-211-5/+16
| | | | | | | | | | | | | | | | | | which doesn't like against all the extra UI frameworks on ios) so it now generates a binary called "debugserver-nonui" and puts it in /usr/local/bin instead of /Developer/usr/bin. Add some cruft to RNBDefs.h to get the version number (provided by Xcode at build time) with either the name "debugserver" or "debugserver_nonui" as appropriate. Add the "debugserver-mini" target to the top level "ios" target in lldb xcode project file, so this nonui debugserver will be built along with the normal lldb / debugserver. <rdar://problem/24730789> llvm-svn: 273236
* [cmake] Add ability to customize (and skip) debugserver codesignPavel Labath2016-05-261-23/+25
| | | | | | | | | | | | | | | | | | Summary: This adds the ability to customize the debugserver codesign process via cmake cache variable. The user can set the codesign indentity (with the default being the customary lldb_codesign), and if the identity is set to a empty string, the codesign step is skipped completely. We needed the last feature to enable building lldb on buildservers which do not have the right certificates installed. Reviewers: sas, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D20623 llvm-svn: 270832
* Check that __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ is definedJason Molenda2016-05-191-1/+1
| | | | | | | before comparing the value of it. <rdar://problem/26333564> llvm-svn: 270015
* Fix an issue where debugserver would not properly vend OS version ↵Enrico Granata2016-05-181-7/+5
| | | | | | | | | | | information on iOS devices The __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED macro is only defined on OS X, so the check as written compiled the code out for iOS The right thing to do is compile the code out for older OSX versions, but leave iOS alone rdar://26333564 llvm-svn: 270004
* Don't crash when a process' task port goes bad.Greg Clayton2016-05-121-1/+0
| | | | | | <rdar://problem/26256049> llvm-svn: 269373
* debugserver; fix -Wunused-local-typedef, -Wunused-variable warningsSaleem Abdulrasool2016-05-061-7/+0
| | | | | | | Remove the typedef and local structure which was unused. Fixes last of the new clang warnings in the debugserver build. NFC. llvm-svn: 268759
* debugserver: fix a couple of -Wmissing-field-initializers warningsSaleem Abdulrasool2016-05-061-1/+3
| | | | | | | Explicitly provide an initializer for the std::vector in the constructed type. Addresses -Wmissing-field-initializers warnings from clang. NFC. llvm-svn: 268758
* debugserver: fix some -Wpessimizing-move warningsSaleem Abdulrasool2016-05-061-3/+3
| | | | | | | Remove the unnecessary use of std::move to permit the compiler to perform NVRO instead. Fixes more warnings from clang. NFC. llvm-svn: 268757
* debugserver: fix a few -Wcovered-swift-default warningsSaleem Abdulrasool2016-05-062-2/+0
| | | | | | | | Remove a couple of `default` cases from switches which are covered. This is beneficial since it would allow the compiler to indicate when a new enum value is added and the switch is not updated. Fixes some warnings from clang. NFC. llvm-svn: 268756
* debugserver: fix some -Wformat-pedantic warningsSaleem Abdulrasool2016-05-061-16/+7
| | | | | | | Perform explicit casts for the log message to address some `-Wformat-pedantic` warnings from clang. NFC. llvm-svn: 268755
* debugserver should fflush its log stream in FileLogCallback, now it does.Greg Clayton2016-05-021-2/+3
| | | | | | <rdar://problem/24728287> llvm-svn: 268325
* Fixed an issue that could cause debugserver to return two stop reply packets ↵Greg Clayton2016-04-012-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ($T packets) for one \x03 interrupt. The problem was that when a \x03 byte is sent to debugserver while the process is running, and up calling: rnb_err_t RNBRemote::HandlePacket_stop_process (const char *p) { if (!DNBProcessInterrupt(m_ctx.ProcessID())) HandlePacket_last_signal (NULL); return rnb_success; } In the call to DNBProcessInterrupt we did: nub_bool_t DNBProcessInterrupt(nub_process_t pid) { MachProcessSP procSP; if (GetProcessSP (pid, procSP)) return procSP->Interrupt(); return false; } This would always return false. It would cause HandlePacket_stop_process to always call "HandlePacket_last_signal (NULL);" which would send an extra stop reply packet _if_ the process is stopped. On a machine with enough cores, it would call DNBProcessInterrupt(...) and then HandlePacket_last_signal(NULL) so quickly that it will never send out an extra stop reply packet. But if the machine is slow enough or doesn't have enough cores, it could cause the call to HandlePacket_last_signal() to actually succeed and send an extra stop reply packet. This would cause problems up in GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse() where it would get the first stop reply packet and then possibly return or execute an async packet. If it returned, then the next packet that was sent will get the second stop reply as its response. If it executes an async packet, the async packet will get the wrong response. To fix this I did the following: 1 - in debugserver, I fixed "bool MachProcess::Interrupt()" to return true if it sends the signal so we avoid sending the stop reply twice on slower machines 2 - Added a log line to RNBRemote::HandlePacket_stop_process() to say if we ever send an extra stop reply so we will see this in the darwin console output if this does happen 3 - Added response validators to StringExtractorGDBRemote so that we can verify some responses to some packets. 4 - Added validators to packets that often follow stop reply packets like the "m" packet for memory reads, JSON packets since "jThreadsInfo" is often sent immediately following a stop reply. 5 - Modified GDBRemoteCommunicationClient::SendPacketAndWaitForResponseNoLock() to validate responses. Any "StringExtractorGDBRemote &response" that contains a valid response verifier will verify the response and keep looking for correct responses up to 3 times. This will help us get back on track if we do get extra stop replies. If a StringExtractorGDBRemote does not have a response validator, it will accept any packet in response. 6 - In GDBRemoteCommunicationClient::SendPacketAndWaitForResponse we copy the response validator from the "response" argument over into m_async_response so that if we send the packet by interrupting the running process, we can validate the response we actually get in GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse() 7 - Modified GDBRemoteCommunicationClient::SendContinuePacketAndWaitForResponse() to always check for an extra stop reply packet for 100ms when the process is interrupted. We were already doing this because we might interrupt a process with a \x03 packet, yet the process was in the process of stopping due to another reason. This race condition could cause an extra stop reply packet because the GDB remote protocol says if a \x03 packet is sent while the process is stopped, we should send a stop reply packet back. Now we always check for an extra stop reply packet when we manually interrupt a process. The issue was showing up when our IDE would attempt to set a breakpoint while the process is running and this would happen: --> \x03 <-- $T<stop reply 1> --> z0,AAAAA,BB (set breakpoint) <-- $T<stop reply 1> (incorrect extra stop reply packet) --> c <-- OK (response from z0 packet) Now all packet traffic was off by one response. Since we now have a validator on the response for "z" packets, we do this: --> \x03 <-- $T<stop reply 1> --> z0,AAAAA,BB (set breakpoint) <-- $T<stop reply 1> (Ignore this because this can't be the response to z0 packets) <-- OK -- (we are back on track as this is a valid response to z0) ... As time goes on we should add more packet validators. <rdar://problem/22859505> llvm-svn: 265086
* Removed unused functions.Greg Clayton2016-02-242-105/+0
| | | | llvm-svn: 261768
* Add a missing break.Jim Ingham2016-02-101-1/+1
| | | | llvm-svn: 260345
* If we set the DYLD_INSERT_LIBRARIES environment variable when launching ↵Greg Clayton2016-02-091-0/+4
| | | | | | debugserver, for use with /usr/lib/libgmalloc.dylib, then make sure we don't pass this environment variable on to any child processes. llvm-svn: 260284
* Remove autoconf support from source directories.Eugene Zelenko2016-01-284-138/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* A while back in revison 244716 we added support for getting the host OS ↵Greg Clayton2016-01-281-8/+2
| | | | | | | | version info from debugserver. We added keys to "qHostInfo" that were "osmajor", "osminor" and "ospatch", but no one ever parsed those, so I am removing them from debugserver. We accidentally also added a "version" key to qHostInfo instead of "os_version". So now we need to support both "version" and "os_version" in qHostInfo since we have debugserver binaries out in the wild that support this old packet type. I have updated debugserver ot use the correct "os_version" for future compatability or correctness. <rdar://problem/24378699> llvm-svn: 259003
* Fixed some #ifdefs. We were erroneously not supporting certain simulators.Sean Callanan2016-01-201-2/+2
| | | | | | | | We had some #ifdefs that were looking for the wrong #defines and as a result debugserver didn't have support for certain simulators. This patch resolves the problem. llvm-svn: 258365
* Changes to lldb and debugserver to reduce extraneous memory readsJason Molenda2016-01-122-38/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | at each public stop to improve performance a bit. Most of the information lldb needed was already in the jThreadsInfo response; complete that information and catch a few cases where we could still fall back to getting the information via discrete memory reads. debugserver adds 'associated_with_dispatch_queue' and 'dispatch_queue_t keys to the jThreadsInfo response for all the threads. lldb needs the dispatch_queue_t value. And associated_with_dispatch_queue helps to identify which threads definitively don't have any queue information so lldb doesn't try to do memory reads to get that information just because it was absent in the jThreadsInfo response. Remove the queue information from the questionmark (T) packet. We'll get the information for all threads via the jThreadsInfo response - sending the information for the stopping thread (on all the private stops, plus the less frequent public stop) was unnecessary information being sent over the wire. SystemRuntimeMacOSX will try to get information about queues by asking the Threads for them, instead of reading memory. ProcessGDBRemote changes to recognize the new keys being sent in the jThreadsInfo response. Changes to ThreadGDBRemote to track the new information. Also, when a thread is marked as definitively not associated with a libdispatch queue, don't fall back to the system runtime to try memory reads to find the queue name / kind / ID etc. <rdar://problem/23309359> llvm-svn: 257453
OpenPOWER on IntegriCloud