summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source
Commit message (Collapse)AuthorAgeFilesLines
...
* Delete dead code in MachVMMemory.cpp, NFCVedant Kumar2018-02-241-36/+0
| | | | | | This addresses a compiler warning. llvm-svn: 326002
* [unittests] Disable lldb-server tests if an external debug server is in useVedant Kumar2018-02-241-2/+3
| | | | | | | | | | | | The lldb-server unit tests don't test the right thing when the debug server in use is copied from somewhere else. This can lead to spurious test failures. Disable these unit tests when an external debug server is in use. Fixes llvm.org/PR36494. llvm-svn: 326001
* Add DEBUGSERVER_PATH to the cache so it'll be available for tests.Don Hinton2018-02-171-2/+2
| | | | | | | | This fixed a problem caused by r325442. Differential Revision: https://reviews.llvm.org/D43432 llvm-svn: 325452
* [cmake] Fix LLDB_CODESIGN_IDENTITY logic.Don Hinton2018-02-171-3/+17
| | | | | | | | | | | | | | | | | | | | | | Summary: Consolidate LLDB_CODESIGN_IDENTITY logic in one place and use SKIP_DEBUGSERVER, which can be set independently, to control codesigning targets. Currently, running cmake the first time in a clean directory, without passing -DLLDB_CODESIGN_IDENTITY='', fails. However, subsequent runs succeed. That's because LLDB_CODESIGN_IDENTITY gets added to the CACHE after the initial test. To fix that, the default value must be set before it's tested. Here's the error produced on the first run: CMake Error at tools/lldb/tools/debugserver/source/CMakeLists.txt:215 (add_custom_command): No TARGET 'debugserver' has been created in this directory. Differential Revision: https://reviews.llvm.org/D43432 llvm-svn: 325442
* [cmake] Darwin: Copy in the system debugserver if neededVedant Kumar2018-02-131-1/+9
| | | | | | | This makes the built debugger functional on Darwin when compiling without code signing (as documented in docs/code-signing.txt). llvm-svn: 325068
* Make use of physical footprint as memory measurement.Han Ming Ong2018-02-014-339/+19
| | | | | | | | | | | | 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
* When parsing the target.xml register file, if no architecture hasJason Molenda2018-01-121-0/+7
| | | | | | | | | | | | | | | | | been specified yet (either by the user, or by one of the lldb extensions like qHostInfo or qProcessInfo), and the target.xml includes a <architecture> tag specifying x86_64, set the architecture appropriately. I'm not sure what we can expect to see in the <architecture> tag, so I'm only doing this for x86_64 right now where I've seen "i386:x86_64" used. I've seen a target.xml from a jtag board that sends just "arm" because it doesn't know more specifically what type of board it is connected to... <rdar://problem/29908970> llvm-svn: 322339
* debugserver: Propagate environment in launch-mode (pr35671)Pavel Labath2017-12-223-8/+34
| | | | | | | | | | | | | | | | | | Summary: Make sure we propagate environment when starting debugserver with a pre-loaded inferior. AFAIK, RNBRunLoopLaunchInferior is only called in pre-loaded inferior scenario, so we can just pick up the debugserver environment instead of trying to construct an envp from the (empty) context. This makes debugserver pass an test added for an equivalent lldb-server fix. Reviewers: jasonmolenda, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41352 llvm-svn: 321355
* Change uses of strncpy in debugserver to strlcpyJason Molenda2017-12-095-15/+15
| | | | | | | | for better safety. <rdar://problem/32906923> llvm-svn: 320242
* [MachException] Avoid alignment UB, NFCVedant Kumar2017-12-082-4/+11
| | | | | | | | | | | Fix alignment UB in some Mach exception-handling logic. This lets us build lldb and debugserver with UBSan in trapping mode, and get further along in the testing process before a trap is encountered. rdar://35923991 llvm-svn: 320127
* Remove extant references to g_message_mutex, NFCVedant Kumar2017-12-081-9/+6
| | | | | | Thanks to Jim Ingham for providing the explanation! llvm-svn: 320126
* Fix the -Wunused-function warning properly (MachProcess.mm)Vedant Kumar2017-12-061-1/+1
| | | | | | | r319938 was not NFC, because it got the preprocessor guard wrong. Check WITH_FBS and WITH_BKS before defining SplitEventData. llvm-svn: 319943
* Fix an -Wunused-function warning, NFCVedant Kumar2017-12-061-20/+22
| | | | llvm-svn: 319938
* Fix misc -Wcast-qual warnings, NFCVedant Kumar2017-12-067-22/+29
| | | | llvm-svn: 319937
* Remove no-op function pointer null checks, NFCVedant Kumar2017-12-062-30/+22
| | | | | | | | | | | | | | Null-checking functions which aren't marked weak_import is a no-op (the compiler rewrites the check to 'true'), regardless of whether a library providing its definition is weak-linked. If the deployment target is greater than the minimum requirement, the availability markup on APIs does not lower to weak_import. Remove no-op null checks to clean up the code and silence warnings. Differential Revision: https://reviews.llvm.org/D40812 llvm-svn: 319936
* Fix warnings in JSON.cpp, NFCVedant Kumar2017-12-011-3/+0
| | | | | | These asserts are no-ops, and are supplanted by -Wcovered-switch. llvm-svn: 319596
* Fix warnings in DNBDataRef.cpp, NFCVedant Kumar2017-12-011-6/+6
| | | | llvm-svn: 319595
* Recognize another magic token sent in the LaunchInfo's EventData.Jim Ingham2017-11-171-29/+71
| | | | | | <rdar://problem/32505028> llvm-svn: 318496
* [CMake] Need to set WITH_LOCKDOWN on debugserver targetChris Bieneman2017-09-061-0/+5
| | | | | | | | | | Turns out WITH_LOCKDOWN define changes the struct layout and constructor implementation for RNBSocket which is used in debugserver.cpp, so we need to make sure this is consistent. In the future we should change WITH_LOCKDOWN to be configured in a generated header, but for now we can just set it correctly. <rdar://problem/33900552> llvm-svn: 312666
* Change the ftag x87 register from being 8-bits wide to 16-bits wideJason Molenda2017-08-242-8/+8
| | | | | | | | to match the changes Saleem Abdulrasool committed in r311579. Fixes a testsuite failure now that the testsuite expects a 16 bit return value for thsi reg. llvm-svn: 311627
* Fix typo in variable name.Lang Hames2017-08-161-1/+1
| | | | llvm-svn: 310984
* [CMake] Fixing an error in STREQUAL usage.Chris Bieneman2017-08-151-1/+1
| | | | llvm-svn: 310955
* [CMake] Disable code sign entitlements when using lldb_codesignChris Bieneman2017-08-151-2/+11
| | | | | | Turns out self-signed certificates and entitlements don't always play well together... llvm-svn: 310936
* [CMake] debugserver-nonui doesn't go in the frameworkChris Bieneman2017-07-281-1/+1
| | | | | | Small change to correct the install path of the nonui debugserver. llvm-svn: 309428
* [CMake] libcompression is optional not required for debugserverChris Bieneman2017-07-281-2/+6
| | | | | | Fix a quick bug from r309395. llvm-svn: 309396
* [CMake] Add checks for libcompressionChris Bieneman2017-07-281-5/+17
| | | | | | This enables libcompression when available in the CMake build system. llvm-svn: 309395
* [CMake] Build debugserver & debugserver_nonuiChris Bieneman2017-07-251-8/+64
| | | | | | | | When building for iOS we build two variants of debugserver. One which supports UI functionality like Springboard for launching applications, and one which does not. This patch adds support for building debugserver with and without UI support libraries being available. llvm-svn: 309026
* [CMake] Add debugserver entitlementsChris Bieneman2017-07-251-2/+6
| | | | | | When consigning debugserver we should also include the entitlements file on the code sign command. llvm-svn: 309020
* [CMake] Refactor debugserver build systemChris Bieneman2017-07-185-22/+37
| | | | | | | | | This refactoring changes two significant things about how the debugserver build system works: (1) debugserver will include all appropriate architecture support, so we can now build arm or ppc debugservers (2) debugserver can be built by itself, so you don't have to configure all of LLDB in order to generate debugserver. llvm-svn: 308377
* Fix debugserver accepting remote connectionsChris Bieneman2017-07-131-3/+18
| | | | | | | | While adding IPv6 support to debugserver I broke handling wildcard addresses and fully qualified address filtering. This patch resolves that bug and adds a test for matching the address "*". <rdar://problem/32947613> llvm-svn: 307957
* Fix some type-based warningsTim Hammerquist2017-06-291-3/+3
| | | | llvm-svn: 306765
* Update default cpu subtype for armv7 processes to armv7k, the mostJason Molenda2017-06-291-1/+1
| | | | | | likely cpu subtype at this point. llvm-svn: 306752
* Rename Error -> Status.Zachary Turner2017-05-1214-51/+52
| | | | | | | | | | | | | | | 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
* Re-landing IPv6 support for LLDB HostChris Bieneman2017-04-263-132/+131
| | | | | | | | | | | | | | | | | | | | | | This support was landed in r300579, and reverted in r300669 due to failures on the bots. The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that. Summary from the original change: This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way. This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me). The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call. This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address. The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. https://reviews.llvm.org/D31823 llvm-svn: 301492
* Correct the names of some target conditional defines in debugserver.Jason Molenda2017-04-211-1/+1
| | | | llvm-svn: 301034
* Revert yesterdays IPv6 patchesPavel Labath2017-04-193-130/+132
| | | | | | | | | | | | | The break the linux bots (and probably any other machine which would run the test suite in a massively parallel way). The problem is that it can happen that we only successfully create an IPv6 listening socket (because the relevant IPv4 port is used by another process) and then the connecting side attempts to connect to the IPv4 port and fails. It's not very obvious how to fix this problem, so I am reverting this until we come up with a solution. llvm-svn: 300669
* Update DebugServer to support IPv6 over TCPChris Bieneman2017-04-183-132/+130
| | | | | | | | | | | | | | Summary: This patch adds IPv6 support to debugserver. It follows a similar pattern to the changes proposed for LLDB/Host except that the listen implementation is only with kqueue(2) because debugserver is only supported on Darwin. Reviewers: jingham, jasonmolenda, clayborg Reviewed By: clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31824 llvm-svn: 300580
* Support Unit Testing debugserverChris Bieneman2017-04-122-85/+69
| | | | | | | | | | | | | | | | | Summary: This patch refactors the CMake build system's support for building debugserver to allow us to build the majority of debugserver's sources into the debugserverCommon library which can then be reused by unit tests. The first unit test I've written tests debug server's ability to accept incoming connections from LLDB. The test forks the process, and one side creates a listening socket using debugserver's socket API, the other side creates a transmitting socket using LLDB's TCPSocket class. I have no clue where to even start getting this connected into the LLDB Xcode project, so for now these tests are CMake-only. Reviewers: zturner, labath, jasonmolenda Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D31357 llvm-svn: 300111
* Back out temporary masking of EXC_SYSCALL mach exceptions.Jason Molenda2017-04-031-1/+1
| | | | | | <rdar://problem/31359720> llvm-svn: 299345
* Mask out EXC_SYSCALL exceptions as well.Jason Molenda2017-03-301-1/+1
| | | | | | <rdar://problem/31335814> llvm-svn: 299040
* [debugserver] NFC. One more small cleanup to DNBArchImplX86_64::SetFPUStateChris Bieneman2017-03-151-13/+9
| | | | | | This is another similar cleanup to other changes I've been making to simplify the AVX code in debugserver. llvm-svn: 297880
* [debugserver] NFC. Cleanup Get/Set Register Value/ContextChris Bieneman2017-03-142-978/+535
| | | | | | This patch modifies the Get/Set Register Value/Context functions for Intel to not duplicate code for reading non-AVX registers. This is similar to other transformations I've been making to the AVX register handling code. llvm-svn: 297787
* [debugserver] Fixing a small logic error from r297685Chris Bieneman2017-03-141-1/+1
| | | | | | I had mixed up the logic during patch review. This resolves the test failure reading YMM registers on Darwin. llvm-svn: 297774
* [debugserver] NFC. Missed one bit of cleanup in r297688Chris Bieneman2017-03-131-22/+13
| | | | | | I did this cleanup in the x86_64, but missed it in the i386 code. This just simplifies the calls to thread_get_state. llvm-svn: 297691
* [debugserver] NFC. Cleanup DNBArchImpl*::GetFPUState()Chris Bieneman2017-03-133-242/+125
| | | | | | | | This patch consolidates the DEBUG_FPU_REGS code for i386 and x86_64 to take advantage of the fact that the non-AVX members of the avx register state structure overlap with the standard fpu register state structure. This reduces the amount of code required to set debug values into the register state structures because the register state structures are stored in a union. llvm-svn: 297688
* [debugserver] This is a small cleanup patch to AVX support detectionChris Bieneman2017-03-135-113/+55
| | | | | | | | | | | | | | | | | | | | | Summary: The first Sandybridge iMacs with AVX support shipped in Spring 2011 with Snow Leopard as their OS. Unfortunately due to a kernel bug debugging AVX code was not really possible until 10.7.4. The old code here checked the kernel build number to determine when to support AVX, but that code was incorrect. It verified that the kernel build number was greater than xnu-2020, which is the build of the kernel that had the fix for 10.8. The fix was also back ported to 10.7.4. Which means all publicly available OS builds 10.7.4 and later have working AVX support. This new patch verifies that the host OS is greater than or equal to 10.7.4 by checking that the build number is greater than or equal to 11Exx. The patch also removes the HasAVX assembly blob in favor of querying the kernel via sysctl for the hardware features. Using sysctl is slower, however since the code is executed once and the result cached it is a better approach because it is possible for the kernel to disable AVX support on hardware that supports it, so listening to the kernel is a better approach for the debugger to take. Reviewers: jasonmolenda, spyffe Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30918 llvm-svn: 297685
* fix format specifier warningsTim Hammerquist2017-03-073-14/+21
| | | | llvm-svn: 297228
* Fix darwin build (llvm::once_flag fallout)Pavel Labath2017-02-061-2/+2
| | | | llvm-svn: 294221
* Switch std::call_once to llvm::call_onceKamil Rytarowski2017-02-061-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms. This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, mehdi_amini, clayborg Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29288 llvm-svn: 294202
* [CMake] Add accurate dependency specificationsChris Bieneman2017-01-312-16/+19
| | | | | | | | | | | | | | | | | Summary: This patch adds accurate dependency specifications to the mail LLDB libraries and tools. In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way. For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up. Reviewers: labath, zturner Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell Differential Revision: https://reviews.llvm.org/D29333 llvm-svn: 293686
OpenPOWER on IntegriCloud