summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix more functions in Args to use StringRef.Zachary Turner2016-09-191-2/+2
| | | | | | | | | | | | | | | This patch also marks the const char* versions as =delete to prevent their use. This has the potential to cause build breakages on some platforms which I can't compile. I have tested on Windows, Linux, and OSX. Best practices for fixing broken callsites are outlined in Args.h in a comment above the deleted function declarations. Eventually we can remove these =delete declarations, but for now they are important to make sure that all implicit conversions from const char * are manually audited to make sure that they do not invoke a conversion from nullptr. llvm-svn: 281919
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-067-760/+680
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Remove Android.hPavel Labath2016-08-081-4/+2
| | | | | | | It only contained a reimplementation of std::to_string, which I have replaced with usages of pre-existing llvm::to_string (also, injecting members into the std namespace is evil). llvm-svn: 278000
* Unify process launching code on linuxPavel Labath2016-07-211-0/+213
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've had two copies of code for launching processes: - one in NativeProcessLinux, used for launching debugged processes - one in ProcessLauncherAndroid, used on android for launching all other kinds of processes These have over time acquired support for various launch options, but neither supported all of them. I now replace them with a single implementation ProcessLauncherLinux, which supports all the options the individual versions supported and set it to be used to launch all processes on linux. This also works around the ETXTBSY issue on android when the process is started from the platform instance, as that used to go through the version which did not contain the workaround. Reviewers: tberghammer Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: https://reviews.llvm.org/D22457 llvm-svn: 276288
* Add logging to Linux Host::GetProcessAndStatInfo.Oleksiy Vyalov2016-07-121-4/+16
| | | | llvm-svn: 275198
* Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093Kate Stone2016-04-271-1/+1
| | | | llvm-svn: 267749
* Add support for abstract domain sockets.Oleksiy Vyalov2015-10-221-0/+31
| | | | | | http://reviews.llvm.org/D13970 llvm-svn: 251034
* ArchSpec: fix unintentional promotion of unspecified unknowns to specified ↵Todd Fiala2015-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | unknowns * ArchSpec::MergeFrom() would erroneously promote an unspecified unknown to a specified unknown when both the ArchSpec and the merged in ArchSpec were both unspecified unknowns. This no longer happens, which fixes issues with global module cache lookup in some situations. * Added ArchSpec::DumpTriple(Stream&) that now properly prints unspecified unknowns as '*' and specified unknows as 'unknown'. This makes it trivial to tell the difference between the two. Converted printing code over ot using DumpTriple() rather than building from scratch. * Fixed up a couple places that were not guaranteeing that an unspecified unknown was recorded as such. llvm-svn: 250253
* Do not use pthread_setname_np() if we don't have GLIBC or Android.Vasileios Kalintiris2015-09-221-0/+5
| | | | | | | | | | | | | | | Summary: pthread_setname_np() is a nonstandard GNU extension and isn't available in every C library. Check before it's usage that GLIBC is available or that we are targeting Android. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13019 llvm-svn: 248280
* Remove unused header <execinfo.h>.Vasileios Kalintiris2015-09-221-3/+0
| | | | llvm-svn: 248268
* Check for GLIBC before including execinfo.hVasileios Kalintiris2015-09-221-1/+1
| | | | | | | | | | Reviewers: ovyalov, clayborg Subscribers: tberghammer, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D13016 llvm-svn: 248256
* [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
* Refactor Unix signals.Chaoren Lin2015-07-141-22/+1
| | | | | | | | | | | | | | | | | | Summary: - Consolidate Unix signals selection in UnixSignals. - Make Unix signals available from platform. - Add jSignalsInfo packet to retrieve Unix signals from remote platform. - Get a copy of the platform signal for each remote process. - Update SB API for signals. - Update signal utility in test suite. Reviewers: ovyalov, clayborg Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11094 llvm-svn: 242101
* Add a missing headerPavel Labath2015-06-301-0/+1
| | | | llvm-svn: 241056
* [linux] Use cmake to detect support process_vm_readv (bug #23918)Pavel Labath2015-06-291-0/+29
| | | | | | | | | | | | | | | | | | Summary: Some old linux versions do not have process_vm_readv function defined. Even older versions do not have even the __NR_process_vm_readv syscall number. We use cmake to detect these situations and fallback appropriately: in the first case, we can issue the syscall manually, while it the latter case, we need to drop fast memory read support completely. Test Plan: linux test suite passes Reviewers: ovyalov, Eugene.Zelenko Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10727 llvm-svn: 240927
* [LLDB][MIPS] Getting correct signals for MIPS HostMohit K. Bhakkad2015-06-101-3/+16
| | | | | | | | | | Patch by Nitesh Jain Reviewers: clayborg, ovyalov. Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, lldb-commits. Differential Revision: http://reviews.llvm.org/D10180 llvm-svn: 239463
* Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.Chaoren Lin2015-06-091-1/+1
| | | | | | | | | | | | | | | | | Summary: `IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths are sometimes appended to other directories, not just the cwd. Plus, the new name is shorter. Also added `IsAbsolute` for completeness. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10262 llvm-svn: 239419
* Move several plugin to its own namespaceTamas Berghammer2015-03-312-7/+7
| | | | | | | | | | | | | Affected paths: * Plugins/Platform/Android/* * Plugins/Platform/Linux/* * Plugins/Platform/gdb-server/* * Plugins/Process/Linux/* * Plugins/Process/gdb-remote/* Differential revision: http://reviews.llvm.org/D8654 llvm-svn: 233679
* ComputeSupportExeDirectory for LinuxChaoren Lin2015-03-241-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes http://reviews.llvm.org/D8511 The original method of using dladdr() could return the incorrect relative path if not dynamically linked against liblldb and the working directory has changed. This is not a problem when built with python, since ScriptInterpreterPython::InitializePrivate calls HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, ...) and caches the correct path before any changes to the working directory. The /proc/self/exe approach fails if run using Python, but works for all other cases (including for android, which doesn't have dladdr()). So if we combine the two, we should reasonably cover all corner cases. Reviewers: vharron, ovyalov, clayborg Reviewed By: ovyalov, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8570 llvm-svn: 233129
* Reverted r232883 due to failing tests.Vince Harron2015-03-221-2/+4
| | | | llvm-svn: 232904
* Fix ComputeSupportExeDirectory for Linux (merge with Android).Chaoren Lin2015-03-211-4/+2
| | | | | | | | | | | | | | | | | Summary: ComputeSupportExeDirectory relied on ComputeSharedLibraryDirectory which was not always reliable. Using procfs seems to be the best way to deal with it on Linux (since it's already done on Android, might as well merge it). Reviewers: ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8511 llvm-svn: 232883
* Fix missing data in GetProcessInfo on linuxTamas Berghammer2015-03-131-0/+2
| | | | | | | | | Fill in the missing part of the architecture in GetProcessInfo from the HostArchitecture (e.g. Environment). Differential revision: http://reviews.llvm.org/D8292 llvm-svn: 232157
* Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner2015-03-061-22/+0
| | | | | | | | | | | | This removes Host::Backtrace from the codebase, and changes all call sites to use llvm::sys::PrintStackTrace(). This makes the functionality available for all platforms, and even for platforms which currently had a supported implementation of Host::Backtrace, this patch should enable richer information in stack traces, such as file and line number information, as well as giving it the ability to unwind through inlined functions. llvm-svn: 231511
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-1/+1
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
* Start the refactoring of globbingEnrico Granata2015-02-201-0/+5
| | | | | | | | | | | | | - Add Host::GlobArguments() to perform local-globbing I implemented this on OSX and Windows in terms of argdumper (Windows implementation is essentially the same as the OSX version + a change in binary name and some string magic) Other platforms did not specifically chime in, so I left it unimplemented for them for the time being. Please feel free to fill in the blanks - Add Platform::GlobArguments() to support remote-globbing For now, no feature change here - but now we have infrastructure to help GDBRemote targets to support globbing - and patches to that effect will follow No visible feature change llvm-svn: 230065
* Remove an unused variable found with a Clang warning.Chandler Carruth2015-02-131-1/+0
| | | | llvm-svn: 229083
* Failsafe directory for shared objects and support executables.Chaoren Lin2015-02-101-0/+9
| | | | llvm-svn: 228716
* Fixed bugs in the multi-threaded access in HostInfoBase. Prior to this fix, ↵Greg Clayton2015-02-031-25/+21
| | | | | | | | | | static bool variables were used but this is not sufficient. We now use std::call_once in all places where the previous static bool code was used to try to implement thread safety. This was causing code that opened multiple targets to try and get a path to debugserver from the GDB remote communication class, and it would get the LLDB path and some instances would return empty strings and it would cause debugserver to not be found. <rdar://problem/18756927> llvm-svn: 227935
* Add Linux support for HostInfo::GetOSBuildString and ↵Oleksiy Vyalov2014-12-091-0/+29
| | | | | | HostInfo::GetOSKernelDescription. llvm-svn: 223737
* LLGS Android target support - for Andy Chien : http://reviews.llvm.org/D6166Shawn Best2014-11-081-0/+3
| | | | llvm-svn: 221570
* Enable llgs to build against experimental Android AOSP ↵Todd Fiala2014-09-271-0/+6
| | | | | | | | | | | | lldb/llvm/clang/compiler-rt repos. See http://reviews.llvm.org/D5495 for more details. These are changes that are part of an effort to support building llgs, within the AOSP source tree, using the Android.mk build system, when using the llvm/clang/lldb git repos from AOSP replaced with the experimental ones currently in github.com/tfiala/aosp-{llvm,clang,lldb,compiler-rt}. llvm-svn: 218568
* Create a HostThread abstraction.Zachary Turner2014-09-094-25/+82
| | | | | | | | | | | | | This patch moves creates a thread abstraction that represents a thread running inside the LLDB process. This is a replacement for otherwise using lldb::thread_t, and provides a platform agnostic interface to managing these threads. Differential Revision: http://reviews.llvm.org/D5198 Reviewed by: Jim Ingham llvm-svn: 217460
* Consolidate UnixSignals setting/getting in Process.Todd Fiala2014-08-291-0/+9
| | | | | | | | | | | | | | | | See http://reviews.llvm.org/D5108 for details. This change does the following: * eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter. * replaces the Process UnixSignals storage with a shared pointer. * adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used. * adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant. * replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process. This change also enables some future patches that will enable llgs to be used for local Linux debugging. llvm-svn: 216748
* Change back all paths returns for lldb::PathType enumerations from ↵Greg Clayton2014-08-251-5/+4
| | | | | | HostInfo::GetLLDBPath() to return the directories in the FileSpec.m_directory field to match previous implementations. This change previously broke some path stuff in upstream branches. llvm-svn: 216398
* Move the rest of the HostInfo functions over.Zachary Turner2014-08-211-0/+19
| | | | | | | | | This should bring HostInfo up to 99% completion. The remainder of code in Host will be split into instantiatable classes representing host processes, threads, dynamic libraries, and process launching strategies. llvm-svn: 216230
* Fix compile error on Linux due to previous commit.Zachary Turner2014-08-211-0/+1
| | | | llvm-svn: 216227
* Convert static constructors to be explicitly initialized at startupZachary Turner2014-08-211-13/+36
| | | | llvm-svn: 216197
* Move Host::GetLLDBPath to HostInfo.Zachary Turner2014-08-211-0/+27
| | | | | | | | This continues the effort to get Host code moved over to HostInfo, and removes many more instances of preprocessor defines along the way. llvm-svn: 216195
* Move Host::GetArchitecture to HostInfo::GetArchitecture.Zachary Turner2014-08-201-0/+23
| | | | | | | | As a side effect, this patch also eliminates all of the preprocessor conditionals previously used to implement GetArchitecture(). llvm-svn: 216074
* Move some Host logic into HostInfo class.Zachary Turner2014-08-192-133/+149
| | | | | | | | | | | | | | | | | | This patch creates a HostInfo class, a static class used to answer basic queries about the host platform. As part of this change, some functionality is moved from Host to HostInfo, and relevant fixups are performed in the rest of the codebase. This is part of a larger effort to isolate more code in the Host layer into platform-specific groups, to make it easier to make platform specific changes for a particular Host without breaking other hosts. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4963 llvm-svn: 215992
* In the CMake build, convert lldbHost to be a single static library.Zachary Turner2014-08-151-5/+0
| | | | | | | | | Previously lldbHost was built as multiple static libraries such as lldbHostCommon, lldbHostLinux, etc. With this patch, the CMake build produces only a single static library, lldbHost, whose file set is dynamically created based on the platform. llvm-svn: 215792
* Fix typos.Bruce Mitchener2014-07-011-2/+2
| | | | llvm-svn: 212132
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-0/+6
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Factored out Linux proc file reading into separate class.Todd Fiala2014-06-301-62/+7
| | | | | | | | | | | | | Both NativeProcessLinux (in llgs branch) and Linux Host.cpp had similar code to handle /proc file reading. I factored that out into a new Linux-specific ProcFileReader class and added a method that the llgs branch will use for line-by-line parsing. This change also adds numerous Linux-specific files to Xcode that were missing from the Xcode project files. Related to https://github.com/tfiala/lldb/issues/27 llvm-svn: 212015
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-1/+1
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* Enable Linux distribution in vendor portion of host triple.Todd Fiala2014-01-171-0/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change does the following: * enables building lldb-gdbserver on linux_x86-64 platforms. Note - it builds but it has several run-time issues where many gdb remote protocol features are not properly implemented yet. I'm working on these one at a time. * lldb-gdbserver: does not enable the eLaunchFlagDebug launch flag on Linux. Currently the POSIX launch routine will assert if that flag is passed in, presumably because that launch mode is not yet available. This prevents lldb-gdbserver from asserting the moment it launches the debuggee process. * Adds ConstString& Host::GetDistributionId () This method is defined to return an empty result on all platforms except for Linux. On Linux, it makes one attempt to execute 'lsb_release -i' (both /usr/bin/lsb_release, where it appears on ubuntu, and /bin/lsb_release, where it appears on fedora if the redhat-lsb package is installed). If lsb_release is not found in either of those locations, or if 'lsb_release -i' does not return the first line starting with "Distributor ID:\t", then the distribution id is empty. The method will lower-case the id and replace whitespace with underscores. * Modify Host::GetArchitecture () so that linux replaces an unknown vendor portion with the results of GetDistributionId () if that is non-empty. This shows up now in qHostInfo remote packet responses and on the lldb host side. Tested with ubuntu and fedora (the latter both with the default of not having lsb_release installed, and with having lsb_release installed via the redhat-lsb package). Examples of triples on Linux after this change: # x86_64 Unbuntu 12.04 LTS: x86_64-ubuntu-linux-gnu # x86_64 Fedora 20 Desktop with redhat-lsb package installed x86_64-fedora-linux-gnu # x86_64 Fedora 20 Desktop without redhat-lsb-core installed # (i.e. no /bin/lsb_release available) # same as before the change x86_64--linux-gnu Note I intend to have Android respond with: {arch}-android-linux when I get to implementing Android lldb-gdbserver support. llvm-svn: 199510
* Add error checking to 'cmd' buffer as it may not be available (ie. in the ↵Matt Kopec2013-10-091-10/+13
| | | | | | case of exec). llvm-svn: 192318
* Fix OS Version reporting bug detected by TestPlatform for some Linux 3.x ↵Daniel Malea2013-09-271-1/+8
| | | | | | | | kernels that do not report the update version - should resolve the current failure on the Linux clang buildbot llvm-svn: 191568
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-251-5/+5
| | | | llvm-svn: 191367
* Enable Host::LaunchProcess on LinuxDaniel Malea2013-08-271-8/+0
| | | | | | | - move LaunchProcessPosixSpawn() and Host::LaunchProcess() from freebsd host plugin to common (linux/freebsd section) - modify MonitorChildProcessThreadFunction to use pid_t from sys/types.h to avoid Linux/FreeBSD/Mac warnings when calling waitpid() llvm-svn: 189404
OpenPOWER on IntegriCloud