summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build on Mac OS.Eugene Zemtsov2017-05-121-2/+1
| | | | llvm-svn: 302948
* Rename Error -> Status.Zachary Turner2017-05-1244-508/+518
| | | | | | | | | | | | | | | 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
* Fix UDP Socket connectionsChris Bieneman2017-05-051-48/+34
| | | | | | Some of the refactoring in r301492 broke UDP socket connections. This is a partial revert of that refactoring. At some point I'll spend more time diagnosing where the refactoring went wrong and how to better clean up this code, but I don't have time to do that today. llvm-svn: 302282
* Fix segfault resulting from empty print promptPavel Labath2017-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce: 1) Launch lldb 2) Type `print` and hit enter. lldb will now prompt you to type a list of expressions, followed by an empty line. 3) Hit enter, indicating the end of your input. 4) Segfault! After some investigation, I've found the issue in Host/common/Editline.cpp. Editline::MoveCursor() relies on m_input_lines not being empty when the `to` argument is CursorPosition::BlockEnd. This scenario, as far as I can tell, occurs in one specific instance: In Editline::EndOrAddLineCommand() when the list of lines being processed contains exactly one string (""). Meeting this condition is fairly simple, I have posted steps to reproduce above. Reviewers: krytarowski, zturner, labath Reviewed By: labath Subscribers: scott.smith, lldb-commits Differential Revision: https://reviews.llvm.org/D32421 Patch by Alex Langford. llvm-svn: 302225
* MainLoop: Add unit testsPavel Labath2017-05-041-105/+101
| | | | | | | | | | | | | | | | | | | | Summary: This adds a couple of unit tests to the MainLoop class. To get the kqueue based version of the signal handling passing, I needed to modify the implementation a bit to make the queue object persistent. Otherwise, only the signals which are send during the Run call would get processed, which did not match the ppoll behaviour. I also took the opportunity to remove the ForEach template functions and replace them with something more reasonable. Reviewers: beanz, eugene Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D32753 llvm-svn: 302133
* Resurrect pselect MainLoop implementationPavel Labath2017-04-281-94/+208
| | | | | | | | | | | | | | | | | | | | Summary: It turns out that even though ppoll is available on all the android devices we support, it does not seem to be working properly on all of them -- MainLoop just does a busy loop with ppoll returning EINTR and not making any progress. This brings back the pselect implementation and makes it available on android. I could not do any cmake checks for this as the ppoll symbol is actually avaiable -- it just does not work. Reviewers: beanz, eugene Subscribers: srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D32600 llvm-svn: 301636
* Resurrect the standalone build of LLDBKamil Rytarowski2017-04-282-2/+2
| | | | | | | | Switch includes "llvm/Config/config.h" to "llvm/Config/llvm-config.h". Tested on NetBSD 7.99.70 amd64 llvm-svn: 301603
* NFC. Add comment about debugserver usageChris Bieneman2017-04-271-0/+6
| | | | | | | | This just adds a comment to SocketAddress about it being used by debugserver and the implications of that. If we need to make changes to this class that make it unsuitable for debugserver we can re-implement the minimal abstractions we need from this file in debugserver. I would prefer not to do that because code duplication is bad. Nuff said. llvm-svn: 301580
* TCPSocket: add back support for "*" addressPavel Labath2017-04-271-0/+2
| | | | | | | | | | | | | before r301492, we could specify "*:1234" as an address to lldb-server and it would interpret that as "any". I am not sure that's a good idea, but we have usages of that in the test suite, and without this the remote test suite fails. I'm adding that back, as it does not seem it was an intended side-effect of that change, but I am open to removing it in the future, after discussion and test suite fixup. llvm-svn: 301534
* One more try at the whole compiling thing...Chris Bieneman2017-04-271-1/+1
| | | | | | Need to actually use the right type in both parts of the cast. llvm-svn: 301506
* One more attempt to fix the broken bots.Chris Bieneman2017-04-271-0/+2
| | | | llvm-svn: 301504
* Fix Windows bots broken by r301492Chris Bieneman2017-04-271-1/+3
| | | | | | http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/8644/ llvm-svn: 301502
* Re-landing IPv6 support for LLDB HostChris Bieneman2017-04-269-207/+357
| | | | | | | | | | | | | | | | | | | | | | 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
* Add more arguments to SocketAddress::GetAddressInfoPavel Labath2017-04-241-19/+13
| | | | | | | | | | | | | | | | | | | Summary: the reason for this is two-fold: - getaddrinfo without the extra arguments will return the same (network-level) address multiple times, once for each supported transport protocol, which is not what is usually intended (it certainly wasn't in D31823) - it enables us to rewrite the getaddrinfo member function in terms of the static GetAddressInfo function. Reviewers: beanz, tberghammer Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32357 llvm-svn: 301168
* Simplify FreeBSD Host.cpp with early returnsEd Maste2017-04-231-78/+86
| | | | | | Based on NetBSD's Host.cpp. Also tidy up comments to match NetBSD. llvm-svn: 301100
* Revert yesterdays IPv6 patchesPavel Labath2017-04-198-350/+206
| | | | | | | | | | | | | 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
* One more attempt and WindowsChris Bieneman2017-04-191-0/+1
| | | | | | This is the last Windows compile error, so... Hit me with your best shot. llvm-svn: 300647
* Another netbsd build failure...Chris Bieneman2017-04-191-1/+0
| | | | llvm-svn: 300640
* Buildbot wack-a-mole!Chris Bieneman2017-04-191-1/+1
| | | | | | This should fix the netbsd bot I just broke. llvm-svn: 300638
* ifdefing out the signal handling code on WindowsChris Bieneman2017-04-191-6/+17
| | | | | | | | *fingers crossed* This might fix the Window bots, but I really don't know... llvm-svn: 300636
* Include time.h, and fix a Darwin warningChris Bieneman2017-04-181-8/+2
| | | | | | This is a little more cleanup from r300579. llvm-svn: 300615
* Fix Windows bot failureChris Bieneman2017-04-181-1/+8
| | | | | | timespec is not available on Windows, and we should use size_t instead of nfds_t. llvm-svn: 300610
* Fixing error on Android build (-Werror)Chris Bieneman2017-04-181-2/+2
| | | | | | This is fallout from r300579. llvm-svn: 300606
* Removing unused includeChris Bieneman2017-04-181-1/+0
| | | | | | This is causing the Windows bot failures. llvm-svn: 300605
* Writing multi-platform code is hard...Chris Bieneman2017-04-181-1/+1
| | | | | | Fixing another error from r300579. llvm-svn: 300589
* Fix broken windows build.Chris Bieneman2017-04-181-1/+0
| | | | | | This is not ideal, but it should get the bot going again. I'll need to revisit this if we want to get signal handling working on Windows. llvm-svn: 300587
* Fixing bot failure caused by r300579Chris Bieneman2017-04-181-1/+1
| | | | llvm-svn: 300582
* Update LLDB Host to support IPv6 over TCPChris Bieneman2017-04-188-201/+335
| | | | | | | | | | | | | | | | | | | | | Summary: 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. Reviewers: zturner, clayborg Subscribers: jasonmolenda, labath, lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D31823 llvm-svn: 300579
* [CMake] Support generating Config.hChris Bieneman2017-04-141-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead. This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance. I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere. Reviewers: labath, zturner Reviewed By: labath Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D31969 llvm-svn: 300372
* [NFC] Adding a new wrapper for getaddrinfoChris Bieneman2017-04-121-0/+48
| | | | | | | | | | | | | | Summary: This patch adds a new wrapper for getaddrinfo which returns a std::vector of SocketAddresses. While this patch doesn't add any uses of the new function, I have two separable patches that are dependent on this, so I put it in its own patch. Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31822 llvm-svn: 300112
* Correct environ parsing on NetBSDKamil Rytarowski2017-04-071-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces old code in Host::GetEnvironment for NetBSD with the version from Linux. This makes parsing environment variables correctly. It also fixes programs that depend on the variables like curses(3) applications. Long term this function should be moved to Process Plugin, as currently env variables are not available with remote debugging. Other BSDs might want to catch up after this change. Tested with NetBSD top(1). Sponsored by <The NetBSD Foundation> Reviewers: emaste, labath, joerg, kettenis Reviewed By: emaste Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31784 llvm-svn: 299783
* Correct environ parsing on FreeBSDEd Maste2017-04-071-12/+9
| | | | | | | Sync Host:GetEnvironment with Linux and Kamil Rytarowski's forthcoming NetBSD change in review D31784. llvm-svn: 299781
* iwyu fixes for lldbCore.Zachary Turner2017-04-062-1/+1
| | | | | | | | | | | | | | This adjusts header file includes for headers and source files in Core. In doing so, one dependency cycle is eliminated because all the includes from Core to that project were dead includes anyway. In places where some files in other projects were only compiling due to a transitive include from another header, fixups have been made so that those files also include the header they need. Tested on Windows and Linux, and plan to address failures on OSX and FreeBSD after watching the bots. llvm-svn: 299714
* Try to fix FreeBSD build after iwyu changes.Zachary Turner2017-04-061-0/+1
| | | | llvm-svn: 299705
* iwyu fixes on lldbUtility.Zachary Turner2017-04-061-0/+1
| | | | | | | | | | | | | This patch makes adjustments to header file includes in lldbUtility based on recommendations by the iwyu tool (include-what-you-use). The goal here is to make sure that all files include the exact set of headers which are needed for that file only, to eliminate cases of dead includes (e.g. someone deleted some code but forgot to delete the header includes that that code necessitated), and to eliminate the case where header includes are picked up transitively. llvm-svn: 299676
* Change how UDP sockets are set up -- use the same one socket forJason Molenda2017-04-063-38/+34
| | | | | | | | | both sending and receiving information, instead of using one socket to send and another to receive. The two socket arrangement fails over when a firewall is between the two systems. <rdar://problem/31286757> llvm-svn: 299608
* Battery of NetBSD support improvementsKamil Rytarowski2017-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Include initial support for: - single step mode (PT_STEP) - single step trap handling (TRAP_TRACE) - exec() trap (TRAP_EXEC) - add placeholder interfaces for FPR - initial code for NetBSD core(5) files - minor tweaks While there improve style of altered elf-core/ files. This code raises the number of passing tests on NetBSD to around 50% (600+/1200+). The introduced code is subject to improve afterwards for additional features and bug fixes. Sponsored by <The NetBSD Foundation> Reviewers: labath, joerg, emaste, kettenis Reviewed By: labath Subscribers: srhines, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31450 llvm-svn: 299109
* Add NetBSD path for Debugging Information in Separate FilesKamil Rytarowski2017-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD stores debug information files in the `/usr/libdata/debug` path. This change fixes debugging distribution executables, e.g. `look`(1): ``` $ lldb /usr/bin/look (lldb) target create "/usr/bin/look" Current executable set to '/usr/bin/look' (x86_64). (lldb) b main Breakpoint 1: where = look`main + 22 at look.c:107, address = 0x0000000000000da6 (lldb) r Process 23473 launched: '/usr/bin/look' (x86_64) Process 23473 stopped * thread #1, stop reason = breakpoint 1.1 frame #0: 0x0000000186600da6 look`main(argc=1, argv=0x00007f7fffc7c488) at look.c:107 104 105 string = NULL; 106 file = _PATH_WORDS; -> 107 termchar = '\0'; 108 while ((ch = getopt(argc, argv, "dft:")) != -1) 109 switch(ch) { 110 case 'd': (lldb) ``` There is no `/usr/lib/debug` path on NeBSD, so remove it from search. Sponsored by <The NetBSD Foundation> Reviewers: jingham, emaste, kettenis, labath, joerg Reviewed By: labath Subscribers: aprantl, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31461 llvm-svn: 299023
* Remove dead include <sys/user.h> from the NetBSD code.Kamil Rytarowski2017-03-291-3/+1
| | | | llvm-svn: 298970
* [LLDB] OpenBSD supportKamil Rytarowski2017-03-264-2/+299
| | | | | | | | | | | | | | | | | | | | Summary: Add basic OpenBSD support. This is enough to be able to analyze core dumps for OpenBSD/amd64, OpenBSD/arm, OpenBSD/arm64 and OpenBSD/i386. Note that part of the changes to source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp fix a bug that probably affects other platforms as well. The GetProgramHeaderByIndex() interface use 1-based indices, but in some case when looping over the headers the, the loop starts at 0 and misses the last header. This caused problems on OpenBSD since OpenBSD core dumps have the PT_NOTE segment as the last program header. Reviewers: joerg, labath, krytarowski Reviewed By: krytarowski Subscribers: aemerson, emaste, rengolin, srhines, krytarowski, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D31131 llvm-svn: 298810
* Fix warnings from clang build on macOS.Bruce Mitchener2017-03-232-0/+2
| | | | | | | | | | Reviewers: lldb-commits Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31279 llvm-svn: 298585
* Delete some more dead includes.Zachary Turner2017-03-221-2/+0
| | | | | | | This breaks the cycle between Target and PluginLanguageC++, reducing the overall cycle count from 43 to 42. llvm-svn: 298561
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-228-938/+6
| | | | llvm-svn: 298536
* Resubmit "Delete the remainder of platform specific code in FileSpec."Zachary Turner2017-03-223-114/+6
| | | | | | | | | | | | | | This was causing a test failure in one of LLDB's tests which specifically dealt with a limitation in LLVM's implementation of home_directory() that LLDB's own implementation had worked around. This limitation has been addressed in r298513 on the LLVM side, so the failing test (which is now unnecessary as the limitation no longer exists) was removed in r298519, allowing this patch to be re-submitted without modification. llvm-svn: 298526
* Reuse appropriate Launch and Attach on NetBSDKamil Rytarowski2017-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with NativeProcessNetBSD inherited from NativeProcessProtocol. Link Plugins/Process/gdb-remote with lldbPluginProcessNetBSD in order to resolve correctly the linking to Launch and Attach from the NetBSD plugin. Sponsored by <The NetBSD Foundation> Reviewers: kettenis, labath, emaste, joerg Reviewed By: labath, emaste Subscribers: mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31231 llvm-svn: 298524
* Revert "Delete the remainder of platform specific code in FileSpec."Pavel Labath2017-03-223-6/+114
| | | | | | | This reverts commit r298465 as it breaks TestLLVM.TestHomeDirectory.test_tilde_home_directory. llvm-svn: 298509
* Break the cycle between Host and PluginProcessUtility.Zachary Turner2017-03-222-44/+0
| | | | | | | | | | | There are only two users of NativeRegisterContextRegisterInfo, and both are in process plugins. Moving this code from Host to Plugins/Process/Utility thus makes sense, and as it is the only dependency from Host -> PluginProcessUtility, it also breaks this cycle, reducing LLDB's overall cycle count from 45 to 44. llvm-svn: 298466
* Delete the remainder of platform specific code in FileSpec.Zachary Turner2017-03-223-114/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D31129 llvm-svn: 298465
* Move StringList from Core -> Utility.Zachary Turner2017-03-212-2/+2
| | | | llvm-svn: 298412
* Resubmit r298334 after fixing OSX build errors.Zachary Turner2017-03-217-183/+12
| | | | | | | Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
OpenPOWER on IntegriCloud