summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/posix
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix null pointer "dereference" in DomainSocketPavel Labath2016-03-161-1/+1
| | | | | | offsetof is the official way to get the offset of a field in a structure. llvm-svn: 263637
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-16/+18
| | | | | | the right thing and break. llvm-svn: 261950
* Provide ADB port forwarding support for abstract sockets.Oleksiy Vyalov2015-11-031-23/+48
| | | | | | http://reviews.llvm.org/D14262 llvm-svn: 251879
* Calculate size of sockaddr_un manually for abstract sockets:Oleksiy Vyalov2015-11-021-8/+31
| | | | | | | - SUN_LEN doesn't work because strlen(sun_path) == 0 - sizeof(sockaddr_un) doesn't work on Android. llvm-svn: 251825
* Remove unused SUN_LEN macro for Android.Oleksiy Vyalov2015-10-281-7/+0
| | | | llvm-svn: 251563
* Add support for abstract domain sockets.Oleksiy Vyalov2015-10-222-8/+54
| | | | | | http://reviews.llvm.org/D13970 llvm-svn: 251034
* Add domain socket support to gdb-remote protocol and lldb-server.Oleksiy Vyalov2015-10-211-16/+5
| | | | | | http://reviews.llvm.org/D13881 llvm-svn: 250933
* Split Socket class into Tcp/Udp/DomainSocket subclasses.Oleksiy Vyalov2015-10-152-4/+101
| | | | | | http://reviews.llvm.org/D13754 llvm-svn: 250474
* Make uses of /dev/null portable across OSes.Zachary Turner2015-10-141-0/+3
| | | | | | | | | Most platforms have "/dev/null". Windows has "nul". Instead of hardcoding the string /dev/null at various places, make a constant that contains the correct value depending on the platform, and use that everywhere instead. llvm-svn: 250331
* Support RHEL 7 and similar systems that use architecture-specific Python lib ↵Todd Fiala2015-10-121-0/+15
| | | | | | | | dirs This change commits: http://reviews.llvm.org/D13625 llvm-svn: 250093
* Moved ResolveSymbolicLink() to the FileSystem where it belongs, thanksSean Callanan2015-09-181-0/+22
| | | | | | | | zturner! http://reviews.llvm.org/D12984 llvm-svn: 248055
* Remove unused modules from module cache.Oleksiy Vyalov2015-09-181-0/+10
| | | | | | http://reviews.llvm.org/D12971 llvm-svn: 248017
* The pipe2(2) call is supported on NetBSDEd Maste2015-09-141-2/+2
| | | | | | | | Patch by Kamil Rytarowski. Differential Revision: http://reviews.llvm.org/D12746 llvm-svn: 247568
* NetBSD doesn't provide struct statfs, make use of struct statvfsStephane Sezer2015-09-091-0/+22
| | | | | | | | | | | | Reviewers: joerg, sas Subscribers: labath, lldb-commits Differential Revision: http://reviews.llvm.org/D12661 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 247115
* Prevent from a redefinition of _GLIBCXX_USE_NANOSLEEPStephane Sezer2015-09-091-0/+2
| | | | | | | | | | | | | | Summary: Build warning caught on NetBSD. Reviewers: joerg, sas Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12662 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 247114
* Make UriParser to support [$HOSTNAME] notation.Oleksiy Vyalov2015-08-201-4/+14
| | | | | | http://reviews.llvm.org/D12025 llvm-svn: 245639
* Remove raw_svector_ostream::flush() call following r244928.Yaron Keren2015-08-131-1/+0
| | | | llvm-svn: 244935
* Fix for build errors on arm-linux-gnueabi-gccOmair Javaid2015-08-091-0/+4
| | | | | | http://reviews.llvm.org/D11256 llvm-svn: 244419
* Convert the ScriptInterpreter system to a plugin-based one.Zachary Turner2015-07-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | Previously embedded interpreters were handled as ad-hoc source files compiled into source/Interpreter. This made it hard to disable a specific interpreter, or to add support for other interpreters and allow the developer to choose which interpreter(s) were enabled for a particular build. This patch converts script interpreters over to a plugin-based system. Script interpreters now live in source/Plugins/ScriptInterpreter, and the canonical LLDB interpreter, ScriptInterpreterPython, is moved there as well. Any new code interfacing with the Python C API must live in this location from here on out. Additionally, generic code should never need to reference or make assumptions about the presence of a specific interpreter going forward. Differential Revision: http://reviews.llvm.org/D11431 Reviewed By: Greg Clayton llvm-svn: 243681
* Add UNUSED_IF_ASSERT_DISABLED and apply it.Bruce Mitchener2015-07-241-1/+1
| | | | | | | | | | | | | | | Summary: This replaces (void)x; usages where they x was subsequently involved in an assertion with this macro to make the intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11451 llvm-svn: 243074
* Revert "Add Pipe::WriteWithTimeout method"Pavel Labath2015-07-211-10/+6
| | | | | | | | I have observed an increased flakyness in the buildbots. I suspect something was relying on the fact that Pipe::Write had an implicit timeout of 1s, which this commit has removed. Reverting while I investigate. llvm-svn: 242767
* Add Pipe::WriteWithTimeout methodPavel Labath2015-07-211-6/+10
| | | | | | | | | | | | | | | | | | Summary: This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously, zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe consistent with the Communication/Connection classes. For blocking operatios with infinite timeout, I introduce a special constant for this purpose. Reviewers: ovyalov, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11358 llvm-svn: 242764
* [MainLoop] Fix assertion failurePavel Labath2015-07-171-2/+2
| | | | | | | | | Upon connection termination the waitable handle of an IOObject gets reset to an invalid handle. This caused a problem since we used the object->GetWaitableHandle as a key to the set of registered events. The fix is to use something more immutable as a key: we make a copy of the original waitable handle, instead of holding onto the IOObject. llvm-svn: 242515
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-14/+0
| | | | | | | | | | | | Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames. Reviewers: labath Subscribers: emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11154 llvm-svn: 242196
* Introduce a MainLoop class and switch llgs to use itPavel Labath2015-07-131-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first part of our effort to make llgs single threaded. Currently, llgs consists of about three threads and the synchronisation between them is a major source of latency when debugging linux and android applications. In order to be able to go single threaded, we must have the ability to listen for events from multiple sources (primarily, client commands coming over the network and debug events from the inferior) and perform necessary actions. For this reason I introduce the concept of a MainLoop. A main loop has the ability to register callback's which will be invoked upon receipt of certain events. MainLoopPosix has the ability to listen for file descriptors and signals. For the moment, I have merely made the GDBRemoteCommunicationServerLLGS class use MainLoop instead of waiting on the network socket directly, but the other threads still remain. In the followup patches I indend to migrate NativeProcessLinux to this class and remove the remaining threads. Reviewers: ovyalov, clayborg, amccarth, zturner, emaste Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11066 llvm-svn: 242018
* Avoid a recursive function call that could run LLDB out of file descriptors ↵Greg Clayton2015-06-291-18/+34
| | | | | | | | | | | | | | | | | in FileSystem::DeleteDirectory(...). Fixes include: - use FileSystem::Unlink() instead of a direct call to ::unlink(...) when deleting files when iterating through the current directory - save directories from current directory in a list and iterate through those _after_ the current directory has been iterated - Use new FileSpec::ForEachItemInDirectory() instead of manually iterating across directories with opendir()/readdir()/closedir() We should switch all code over to using FileSpec::ForEachItemInDirectory(...) in the near future and get rid of FileSpec::EnumerateDirectory(). This is a follow up patch to: http://reviews.llvm.org/D10787 llvm-svn: 240978
* Replace `rm -rf` with more portable implementation.Chaoren Lin2015-06-271-5/+20
| | | | | | | | | | Reviewers: clayborg, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10787 llvm-svn: 240895
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-293-57/+47
| | | | | | | | | | | | | | | | | Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604
* Re-add #include "lldb-python.h" back in two places.Zachary Turner2015-05-291-0/+1
| | | | | | | Fixing these two instances will require some work, so for now I'm adding these 2 includes back to get the build working. llvm-svn: 238587
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Did some cleanup to stop us from leaking Pipe file descriptors.Greg Clayton2015-05-231-0/+3
| | | | | | | | | | The main issue was the Communication::Disconnect() was calling its Connection::Disconnect() but this wouldn't release the pipes that the ConnectionFileDescriptor was using. We also have someone that is holding a strong reference to the Process so that when you re-run, target replaces its m_process_sp, but it doesn't get destructed because someone has a strong reference to it. I need to track that down. But, even if we have a strong reference to the a process that is outstanding, we need to call Process::Finalize() to have it release as much of its resources as possible to avoid memory bloat. Removed the ProcessGDBRemote::SetExitStatus() override and replaced it with ProcessGDBRemote::DidExit(). Now we aren't leaking file descriptors and the stand alone test suite should run much better. llvm-svn: 238089
* Get lldb-server building on android-9Vince Harron2015-05-121-1/+25
| | | | | | Build lldb-server with an android-9 sysroot. llvm-svn: 237078
* Use hard links to link sysroot files within ModuleCache.Oleksiy Vyalov2015-05-081-0/+9
| | | | | | http://reviews.llvm.org/D9587 llvm-svn: 236917
* Use file locks to synchronize access to ModuleCache.Oleksiy Vyalov2015-05-071-0/+77
| | | | | | http://reviews.llvm.org/D9056 llvm-svn: 236736
* Support remote-android with multiple connected devices.Chaoren Lin2015-05-011-0/+8
| | | | | | | | | | | | | | | | | | Summary: This change introduces a new URL scheme for `platform connect`: ``` adb://device-id:port ``` Reviewers: vharron, tberghammer, clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9358 llvm-svn: 236321
* PosixPipes should not be copyable but should be movable.Chaoren Lin2015-05-011-1/+19
| | | | | | | | | | | | | | Summary: This addresses Oleksiy's comment in D9307. Reviewers: clayborg, ovyalov Reviewed By: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9405 llvm-svn: 236320
* Add file descriptor constructor for PipePosix.Chaoren Lin2015-04-291-13/+4
| | | | llvm-svn: 236133
* Add an unnamed pipe fail-safe to launching lldb-gdbserver.Chaoren Lin2015-04-271-0/+9
| | | | | | | | | | | | | | | | | | Summary: Currently, launching lldb-gdbserver from platform on Android requires root for mkfifo() and an explicit TMPDIR variable. This should remove both requirements. Test Plan: Successfully launched lldb-gdbserver on a non-rooted Android device. Reviewers: tberghammer, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9307 llvm-svn: 235940
* Fix LLDB ARM build error on ubuntu precise with gcc4.7Omair Javaid2015-04-271-1/+1
| | | | | | Differential revision: http://reviews.llvm.org/D9100 llvm-svn: 235865
* ConnectionFileDescriptor::BytesAvailable reading too many command bytesVince Harron2015-04-201-4/+7
| | | | | | | | | | | | | | ConnectionFileDescriptor::BytesAvailable was reading multiple command bytes from the command pipe but only processing the first. This change only allows one byte to be read at a time, ensuring that all get handled. This isn't known to cause any bugs, but it might cause current/future bugs. Differential Revision: http://reviews.llvm.org/D9098 llvm-svn: 235322
* Fix bug where an additional O packet is sent after inferior exits.Chaoren Lin2015-04-071-2/+6
| | | | | | | | | | | | | | | | | Summary: ConnectionFileDescriptor::Read was returning eConnectionStatusError instead of 0 on m_shutting_down, which caused the caller to think that some number of bytes were read. Reviewers: jingham, vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8850 llvm-svn: 234341
* Allow multiple simultaneous connections to platform.Robert Flack2015-03-251-9/+22
| | | | | | | | | | | | | Adds the --server argument to lldb-server platform which when specified will allow multiple simultaneous connections by forking off to handle each individual connection. This will allow us to run the remote tests in parallel. Test Plan: Run: lldb-server platform --listen *:1234 --server Connect from multiple lldb clients simultaneously. I will also test running the test suite remotely with multiple simultaneous jobs. Differential Revision: http://reviews.llvm.org/D8452 llvm-svn: 233185
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-181-1/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Fix FileSpec::GetPath to return null-terminated stringsIlia K2015-02-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end. It could have happened if the size of buffer for path was less than actual path. Test case: ``` FileSpec test("/path/to/file", false); char buf[]="!!!!!!"; test.GetPath(buf, 3); ``` Before fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/pa!!!" ``` After fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/p" ``` Reviewers: zturner, abidh, clayborg Reviewed By: abidh, clayborg Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh Differential Revision: http://reviews.llvm.org/D7553 llvm-svn: 230787
* Fix typo that breaks FileSystem::IsLocalVince Harron2015-02-241-1/+1
| | | | llvm-svn: 230312
* Compile fix for FileSystem::IsLocal on LinuxVince Harron2015-02-241-2/+25
| | | | llvm-svn: 230311
* Avoid crashing by not mmap'ing files on network mounted file systems.Greg Clayton2015-02-231-0/+12
| | | | | | | | | | | | | | | | | | | | This is implemented by making a new FileSystem function: bool FileSystem::IsLocal(const FileSpec &spec) Then using this in a new function: DataBufferSP FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const; This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function. <rdar://problem/19470249> llvm-svn: 230283
* Introduce FileSystem::CalculateMD5AsString that supports any platform and ↵Oleksiy Vyalov2015-02-201-27/+0
| | | | | | | | make existing FileSystem::CalculateMD5 to use it. http://reviews.llvm.org/D7771 llvm-svn: 230036
* Fix warning about the use of mktemp and make platform agnostic by adding and ↵Oleksiy Vyalov2015-02-051-0/+35
| | | | | | | | using PipeBase::CreateWithUniqueName - on behalf of flackr. http://reviews.llvm.org/D7348 llvm-svn: 228307
* Added Connection::GetURI()Vince Harron2015-01-171-7/+43
| | | | | | | | | | | | | This function returns a URI of the resource that the connection is connected to. This is especially important for connections established by accepting a connection from a remote host. Also added implementations for ConnectionMachPort, ConnectionSharedMemory, Also fixed up some documentation in Connection::Write Renamed ConnectionFileDescriptorPosix::SocketListen to ConnectionFileDescriptorPosix::SocketListenAndAccept Fixed a log message in Socket.cpp Differential Review: http://reviews.llvm.org/D7026 llvm-svn: 226362
OpenPOWER on IntegriCloud