summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Ah, misunderstood Jonas' feedback - fix this so we'llJason Molenda2019-02-181-1/+2
| | | | | | | do the right thing when both API are available. We want to try both of them if the first one fails. llvm-svn: 354288
* Clean up an unused variable warning when building this forJason Molenda2019-02-181-0/+4
| | | | | | mac native. llvm-svn: 354287
* Add some unconditional logging on the failure points when attachingJason Molenda2019-02-153-42/+69
| | | | | | | | | | | | | | 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
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-132-28/+28
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* Use std::make_shared in LLDB (NFC)Jonas Devlieghere2019-02-115-11/+19
| | | | | | | | | | | Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
* Silence fallthrough warnings in debugserver.Adrian Prantl2019-02-071-1/+4
| | | | llvm-svn: 353468
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-19106-424/+318
| | | | | | | | | | | | | | | | | 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
* [CMake] Prevent lldbDebugserverCommon from building if you disable ↵Alex Langford2019-01-171-85/+84
| | | | | | | | | | | | | | | | | | | | debugserver builds Summary: The flags `LLDB_USE_SYSTEM_DEBUGSERVER` and `LLDB_NO_DEBUGSERVER` were introduced to the debugserver build. If one of these two flags are set, then we do not build and sign debugserver. However I noticed that we were still building the lldbDebugserverCommon and lldbDebugserverCommon_NonUI libraries regardless of whether or not these flags were set. I don't believe we should be building these libraries unless we are building and signing debugserver. Reviewers: sgraenitz, davide, JDevlieghere, beanz, vsk, aprantl, labath Subscribers: mgorny, jfb, lldb-commits Differential Revision: https://reviews.llvm.org/D56763 llvm-svn: 351496
* [debugserver][CMake] Remove commented out lineAlex Langford2019-01-151-1/+0
| | | | | | | | This has been commented out since rL300111 (commit d742d081f3a1e7412cc609765139ba32d597ac15). Looks like it was committed as a commented out line, so I'm removing it. llvm-svn: 351263
* [CMake] Revised LLDB.framework buildsStefan Granitz2019-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add features to LLDB CMake builds that have so far only been available in Xcode. Clean up a few inconveniences and prepare further improvements. Options: * `LLDB_FRAMEWORK_BUILD_DIR` determines target directory (in build-tree) * `LLDB_FRAMEWORK_INSTALL_DIR` **only** determines target directory in install-tree * `LLVM_EXTERNALIZE_DEBUGINFO` allows externalized debug info (dSYM on Darwin, emitted to `bin`) * `LLDB_FRAMEWORK_TOOLS` determines which executables will be copied to the framework's Resources (dropped symlinking, removed INCLUDE_IN_SUITE, removed dummy targets) Other changes: * clean up `add_lldb_executable()` * include `LLDBFramework.cmake` from `source/API/CMakeLists.txt` * use `*.plist.in` files, which are typical for CMake and independent from Xcode * add clang headers to the framework bundle Reviewers: xiaobai, JDevlieghere, aprantl, davide, beanz, stella.stamenova, clayborg, labath Reviewed By: aprantl Subscribers: friss, mgorny, lldb-commits, #lldb Differential Revision: https://reviews.llvm.org/D55328 llvm-svn: 350391
* [CMake] Streamline code signing for debugserver #2Stefan Granitz2019-01-041-68/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Major fixes after D54476 (use Diff1 as base for comparison to see only recent changes): * In standalone builds target directory for debugserver must be LLDB's bin, not LLVM's bin * Default identity for code signing must not force-override LLVM_CODESIGNING_IDENTITY globally We have a lot of cases, make them explicit: * ID used for code signing (debugserver and in tests): ** `LLDB_CODESIGN_IDENTITY` if set explicitly, or otherwise ** `LLVM_CODESIGNING_IDENTITY` if set explicitly, or otherwise ** `lldb_codesign` as the default * On Darwin we have a debugserver target that: * On other systems, the debugserver target is not defined, which is equivalent to **[3A]** Common configurations on Darwin: * **[1A]** `cmake -GNinja ../llvm` builds debugserver from source and signs with `lldb_codesign`, no code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[1A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_CODESIGN_IDENTITY=lldb_codesign ../llvm` builds debugserver from source and signs with `lldb_codesign`, ad-hoc code signing for other binaries (prints status: //lldb debugserver: /path/to/bin/debugserver//) * **[2A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_USE_SYSTEM_DEBUGSERVER=ON ../llvm` copies debugserver from system, ad-hoc code signing for other binaries (prints status: //Copy system debugserver from: /path/to/system/debugserver//) * **[2B]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- ../llvm` same, but prints additional warning: //Cannot code sign debugserver with identity '-'. Will fall back to system's debugserver. Pass -DLLDB_CODESIGN_IDENTITY=lldb_codesign to override the LLVM value for debugserver.// * **[3A]** `cmake -GNinja -DLLVM_CODESIGNING_IDENTITY=- -DLLDB_NO_DEBUGSERVER=ON ../llvm` debugserver not available (prints status: //lldb debugserver will not be available)// Reviewers: JDevlieghere, beanz, davide, vsk, aprantl, labath Reviewed By: JDevlieghere, labath Subscribers: mgorny, #lldb, lldb-commits Differential Revision: https://reviews.llvm.org/D55013 llvm-svn: 350388
* [NFC] Replace `compare` with (in)equality operator where applicable.Jonas Devlieghere2018-12-211-7/+7
| | | | | | | | Using compare is verbose, bug prone and potentially inefficient (because of early termination). Replace relevant call sites with the (in)equality operator. llvm-svn: 349972
* Un-conditionalize use of libcompression. debugserver only buildsJason Molenda2018-12-181-58/+52
| | | | | | | | | | | | | | | | | | | | on Darwin systems and libcompression has been in the OS for over three years. Remove use of / linking to zlib. We'll always have libcompression available now. Create a scratch buffer via compression_encode_scratch_buffer_size() and use it in calls to compression_encode_buffer() to avoid compression_encode_buffer having to malloc & free a scratch buffer on each call. Tested by forcing compression to be enabled on macos native (normally only enabled on iOS et al devices), running the testsuite. <rdar://problem/41601084> llvm-svn: 349553
* Simplify Boolean expressionsJonas Devlieghere2018-12-1510-37/+24
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* Revert "[CMake] Streamline code signing for debugserver and pass ↵Davide Italiano2018-11-271-104/+68
| | | | | | | | entitlements to extended llvm_codesign" It breaks the lldb cmake bots. llvm-svn: 347619
* [CMake] Streamline code signing for debugserver and pass entitlements to ↵Stefan Granitz2018-11-201-68/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | extended llvm_codesign Summary: Use llvm_codesign to sign debugserver with entitlements. Set global LLVM_CODESIGNING_IDENTITY from LLDB_CODESIGN_IDENTITY (if given). Pass through ENTITLEMENTS from add_lldb_executable to add_llvm_executable. Handle reconfigurations correctly. We have a lot of cases, make them explicit: (1) build and sign debugserver, if all conditions apply: * LLDB_NO_DEBUGSERVER=OFF (default) * On Darwin: LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default) * On Darwin: LLVM_CODESIGNING_IDENTITY == lldb_codesign (2) use system debugserver, if on Darwin and any of: * LLDB_USE_SYSTEM_DEBUGSERVER=ON and found on system (explicit case) * LLVM_CODESIGNING_IDENTITY != lldb_codesign and found on system (fallback case) (3) debugserver will not be available, in case of: * LLDB_NO_DEBUGSERVER=ON * On Darwin: LLVM_CODESIGNING_IDENTITY != lldb_codesign and not found on system (4) error state, in case of: * LLDB_USE_SYSTEM_DEBUGSERVER=ON and not found on system * LLDB_USE_SYSTEM_DEBUGSERVER=ON and LLDB_NO_DEBUGSERVER=ON Reviewers: xiaobai, beanz, vsk, JDevlieghere Subscribers: mgorny, lldb-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D54476 llvm-svn: 347305
* Remove header grouping comments.Jonas Devlieghere2018-11-116-19/+1
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Remove comments after header includes.Jonas Devlieghere2018-11-112-4/+2
| | | | | | | | | | This patch removes the comments following the header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. Differential revision: https://reviews.llvm.org/D54385 llvm-svn: 346625
* Enable listening for EXC_RESOURCE events, and format machJason Molenda2018-11-101-19/+36
| | | | | | | | | | | | | | | | | | | | event as a thread stop reason if we receive one, using some macros to decode the payload. Patch originally written by Fred Riss, with a few small changes by myself. Writing a test for this is a little tricky because the mach exception data interpretation relies on header macros or function calls - it may change over time and writing a gdb_remote_client test for this would break as older encoding interpretation is changed. I'll tak with Fred about this more, but neither of us has been thrilled with the kind of tests we could write for it. <rdar://problem/13097323>, <rdar://problem/40144456> llvm-svn: 346571
* Remove llvm include from debugserver, change Jason Molenda2018-11-092-5/+3
| | | | | | | | LLVM_FALLTHROUGH's to [[clang::fallthrough]] - debugserver is only ever compiled on darwin systems with clang. llvm-svn: 346553
* Add missing includeAdrian Prantl2018-11-091-0/+1
| | | | llvm-svn: 346527
* Add missing includeAdrian Prantl2018-11-091-0/+1
| | | | llvm-svn: 346525
* Annotate switch with LLVM_FALLTHROUGHAdrian Prantl2018-11-092-2/+3
| | | | llvm-svn: 346519
* Remove working directory for debugserver code signing targetNathan Lanza2018-11-061-2/+0
| | | | | | | | | | | | | | | | | | Summary: LLVM puts output binaries in `${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin`. This chunk of code left out the `${CMAKE_CFG_INTDIR}`. Ultimately, the code signing target does not need a working directory anyways, so it's safe to just remove it. Reviewers: sas, xiaobai, beanz Reviewed By: beanz Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D53959 llvm-svn: 346281
* Re-instate a bit of code that was commented out in r188246 whichJason Molenda2018-09-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | reads an ObjectFileMachO's string table in one chunk. Originally this was commented out because binaries in the system's shared cache all share a mega-string table and so reading the entire mega-strtab for each binary was a performance problem. In the reinstated code, I add a check that the binary we're reading from memory is not in the shared cache (there isn't a constant in <mach-o/loader.h> for this bit yet; we hardcode the value in one other place in ObjectFileMachO alread). For binaries that we're reading out of memory that are NOT in the shared cache, reading the string table in one chunk is a big performance improvement. Also have debugserver send up the flags value for binaries in its response to the jGetLoadedDynamicLibrariesInfos request. NFC. <rdar://problem/33604496> llvm-svn: 341511
* Remove unnecessary entitlement in debugserver for iOS.Jason Molenda2018-08-281-2/+0
| | | | | | <rdar://problem/43631901> llvm-svn: 340877
* Introduce lldb-framework CMake target and centralize its logicAlex Langford2018-06-181-1/+1
| | | | | | | | | | | | | Summary: In this patch I aim to do the following: 1) Create an lldb-framework target that acts as the target that handles generating LLDB.framework. Previously, liblldb acted as the target for generating the framework in addition to generating the actual lldb library. This made the target feel overloaded. 2) Centralize framework generation as much as it makes sense to do so. 3) Create a target lldb-suite, which depends on every tool and library that makes liblldb fully functional. One result of having this target is it makes tracking dependencies much clearer. Differential Revision: https://reviews.llvm.org/D48060 llvm-svn: 334968
* Add support for PLATFORM_*SIMULATORFrederic Riss2018-06-151-0/+8
| | | | | | | | | | The toolchain in Xcode 10 uses a new LC_BUILD_VERSION entry to identify simulator binaries. Add support for reading those to debugserver. The exisitng test testing that code is currently failling when run with Xcode 10, no need for a new test. llvm-svn: 334784
* Add an entitlement to debugserverFrederic Riss2018-06-141-3/+2
| | | | | | | | | On macOS 10.14, debugserver needs to have an entitlement do be allowed to debug processes. Adding this to both the Xcode and cmake build system. This shouldn't have any impact on previous OSs. llvm-svn: 334772
* Delete some dead codeAlex Langford2018-06-081-5/+0
| | | | llvm-svn: 334320
* Typo fixes.Bruce Mitchener2018-05-292-4/+4
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* [CMake] Unify and relayer testingJonas Devlieghere2018-05-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This patch restructures part of LLDB's testing configuration: 1. I moved the test dependencies up the chain so every dotest dependency becomes a lit dependency as well. It wouldn't make sense for dotest to have other dependencies when it's being run by lit. Lit on the other hand can still specify extra dependencies. 2. I replaced as much generator expressions with variables as possible. This is consistent with the rest of LLVM and doesn't break generators that support multiple targets (MSVC, Xcode). This wasn't a problem before, but now we need to expand the dotest arguments in the lit configuration and there's only one test suite even with multiple targets. 3. I moved lldb-dotest into it's own directory under utils since there's no need anymore for it to located under `test/`. Differential revision: https://reviews.llvm.org/D46334 llvm-svn: 331463
* Silence compiler warning.Adrian Prantl2018-05-021-0/+1
| | | | llvm-svn: 331375
* Enable AUTOBRIEF in doxygen configuration.Adrian Prantl2018-05-021-1/+1
| | | | | | | | | | | | | | This brings the LLDB configuration closer to LLVM's and removes visual clutter in the source code by removing the @brief commands from comments. This patch also reflows the paragraphs in all doxygen comments. See also https://reviews.llvm.org/D46290. Differential Revision: https://reviews.llvm.org/D46321 llvm-svn: 331373
* [debugserver] Fix the G packet handling.Frederic Riss2018-04-271-1/+3
| | | | | | Of course r331004 needed a counterpart on the write side. llvm-svn: 331073
* [debugserver] Fix handling of the 'g' packetFrederic Riss2018-04-271-1/+3
| | | | | | | | | | | | | | LLDB doesn't use this packet so we never hit this, but it looks like some other projects talk to debugserver and are hitting an assert (https://github.com/derekparker/delve/issues/1015). We had an off by 1 in the accounting of the FPU structure sizes. I added a test that basically just check that 'g' doesn't return an error (currently it assert in debug builds). I didn't make it an lldb-server test because it looks like lldb-server doesn't implement the g packet. llvm-svn: 331004
* [debugserver] Return 'ios' instead of 'iphoneos' for the ostype.Frederic Riss2018-04-251-2/+2
| | | | | | | | | | | | | When I merged the 2 codepaths that return an OS type, I hade checked that the places accepting 'iphoneos' would also accept 'ios', but then I got it backwards and return 'iphoneos'. We use this value to build triples, and there 'iphoneos' is invalid. This also makes the test slightly simpler. llvm-svn: 330877
* Revert "[debugserver] Remove dead function call. NFCI."Davide Italiano2018-04-131-0/+3
| | | | | | | This reverts commit r330066 as it was wrong and the call was not dead. Thanks to Fred for pointing this out. llvm-svn: 330071
* [debugserver] Remove dead function call. NFCI.Davide Italiano2018-04-131-3/+0
| | | | llvm-svn: 330066
* [debugserver] Fix LC_BUILD_VERSION load command handling.Frederic Riss2018-04-065-169/+104
| | | | | | | | | | | | | | | | | | | | | | Summary: In one of the 2 places the LC_BUILD_VERSION load command is handled, there is a bug preventing us from actually handling them (the address where to read the load command was not updated). This patch factors reading the deployment target load commands into a helper and adds testing for the 2 code paths calling the helper. The testing is a little bit complicated because the only times those load commands matter is when debugging a simulator process. I added a new decorator to check that a specific SDK is available. The actual testing was fairly easy once I knew how to run a simulated process. Reviewers: jasonmolenda, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45298 llvm-svn: 329374
* Prevent double release of mach portsFrederic Riss2018-03-291-2/+0
| | | | | | | | | | | | | | | | Summary: When a MIG routine returns KERN_FAILURE, the demux function will release any OOL resources like ports. In this case, task_port and thread_port will be released twice, potentially resulting in use after free of the ports. I don't think we can test this in any useful way rdar://problem/37331387 Reviewers: jasonmolenda Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D45011 llvm-svn: 328761
* Add the same new entitlement from r326399 to Jason Molenda2018-03-261-0/+2
| | | | | | | the macos entitlement list. <rdar://problem/38887712> llvm-svn: 328591
* Rename remotectl_com.apple.internal.xpc.remote.debugserver.plistJason Molenda2018-03-191-0/+0
| | | | | | | | | to com.apple.internal.xpc.remote.debugserver.plist, not sure where that remotectl_ prefix came from. <rdar://problem/36751222> llvm-svn: 327922
* Add the ios-mini target to the top-level xcodeproj, which buildsJason Molenda2018-03-191-0/+35
| | | | | | | | the debugserver-mini target in debugserver. Add a new plist which needs to be installed for debugserver-mini. <rdar://problem/36751222> llvm-svn: 327915
* [cmake] Copy system debugserver from the right place when only CommandLineToolsVedant Kumar2018-03-161-2/+9
| | | | | | | | | | | | | | | | | | | are installed Instead of building debugserver when building lldb, I'd rather pass LLDB_CODESIGN_IDENTITY="" to cmake and use the one already on my system. However, on one of my machines I only have the CommandLineTools installed, and so the hardcoded path to the system debugserver does not work for me. Additionally, we should verify the LLDB framework exists on the machine before trying to set the path to debugserver. This allows us to warn the user at configure time that a system debugserver can't be found if they choose not to build it themselves. Patch by Alex Langford! Differential Revision: https://reviews.llvm.org/D44507 llvm-svn: 327691
* Upstreaming avx512 register support in debugserver. These changesJason Molenda2018-03-069-33/+1218
| | | | | | | | | | | | | | | | | | | were originally written by Chris Bieneman, they've undergone a number of changes since then. Also including the debugserver bridgeos support, another arm environment that runs Darwin akin to ios. These codepaths are activated when running in a bridgeos environment which we're not set up to test today. There's additional (small) lldb changes to handle bridgeos binaries that still need to be merged up. Tested on a darwin system with avx512 hardware and without. <rdar://problem/36424951> llvm-svn: 326756
* Add another entitlement that we need for debugserver.Jason Molenda2018-03-011-0/+2
| | | | | | <rdar://problem/29855293> llvm-svn: 326399
* Add ability to collect memory limit.Han Ming Ong2018-02-285-6/+34
| | | | | | | | 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
OpenPOWER on IntegriCloud