summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/linux/Host.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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
* [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
* Move several plugin to its own namespaceTamas Berghammer2015-03-311-6/+6
| | | | | | | | | | | | | 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
* 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
* 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-091-25/+0
| | | | | | | | | | | | | 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
* Move some Host logic into HostInfo class.Zachary Turner2014-08-191-133/+0
| | | | | | | | | | | | | | | | | | 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
* 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
* 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
* Fix Linux Host::GetCurrentThreadID() to return real tid (not pthread_t).Michael Sartain2013-08-011-9/+8
| | | | | | | This fixes threadname logging (--thread-name) Add "-t" to TestLogging.py script to enable threadsafe and disable threadname logging llvm-svn: 187599
* Optimize Host::GetThreadName() to read from /proc/$TID per Matt's suggestion.Michael Sartain2013-07-311-27/+10
| | | | | CR: mkopec llvm-svn: 187542
* Set thread names on FreeBSDEd Maste2013-07-251-26/+1
| | | | | | | Also move the logic to shorten thread names from linux/Host.cpp to a new SetShortThreadName as both FreeBSD and Linux need the functionality. llvm-svn: 187149
* simple plugin now works with Linux fix assert in SetPluginInfo implement ↵Michael Sartain2013-07-171-3/+20
| | | | | | | | Linux ePathTypeLLDBSystemPlugins and ePathTypeLLDBUserPlugins implement Linux Host::Backtrace and Host::GetEnvironment add .gnu_debugdata comment Differential Revision: http://llvm-reviews.chandlerc.com/D1159 llvm-svn: 186475
* Commit Timothee Besset's patch to update Host/linux/Host.cpp to keep upJason Molenda2013-07-151-1/+1
| | | | | | with the changes in r186211. llvm-svn: 186299
* Add support for listing inferior thread names on Linux.Matt Kopec2013-07-101-0/+34
| | | | llvm-svn: 186033
* Add ability to attach/detach to multi-threaded inferiors on Linux.Matt Kopec2013-05-311-0/+31
| | | | | | All running threads will be detected and stopped on attach and all threads get resumed on detach. llvm-svn: 183049
* ObjectFileELF::GetModuleSpecifications on Linux should work now.Michael Sartain2013-05-231-3/+31
| | | | | | | Which means "platform process list" should work and list the architecture. We are now parsing the elf build-id if it exists, which should allow us to load stripped symbols (looking at that next). llvm-svn: 182610
* test commitMichael Sartain2013-05-171-0/+1
| | | | llvm-svn: 182064
* Implement "platform process list" on LinuxDaniel Malea2013-05-151-42/+249
| | | | | | | | | - read process information from /proc - resolves llvm.org/pr14541 :) Patch by Mike Sartain! llvm-svn: 181904
* Add setting of lldb thread names on Linux.Matt Kopec2013-05-131-1/+48
| | | | | | Patch by Mike Sartain. llvm-svn: 181722
* Adding support for process attach by pid on Linux.Andrew Kaylor2013-05-071-23/+97
| | | | llvm-svn: 181374
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-1/+1
| | | | | | the macros and just use C++11. llvm-svn: 179805
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-1/+1
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-1/+1
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* This patch combines common code from Linux and FreeBSD intoJohnny Chen2012-01-051-0/+53
| | | | | | | | | | a new POSIX platform. It also contains fixes for 64bit FreeBSD. The patch is based on changes by Mark Peek <mp@FreeBSD.org> and "K. Macy" <kmacy@freebsd.org> in their github repo located at https://github.com/fbsd/lldb. llvm-svn: 147609
* API fix and missing headers.Johnny Chen2011-05-191-0/+10
| | | | | | | | | | | | | | Host.cpp was missing Error.h and the implementation of LaunchProcess. Once againg I have added a "fake" implementation waiting for a real one. Fixed the call GetAddressRange to reflect the new interface in DynamicLoaderLinuxDYLD.cpp. Added string.h to ARM_DWARF_Registers.cpp that is needed for ::memset. Signed-off-by: Johnny Chen <johnny.chen@apple.com> llvm-svn: 131695
* linux: add Host/linux subdirectoryStephen Wilson2011-03-231-0/+35
| | | | | | | Start putting linux specific host code in its own directory. For now, just implement Host::GetOSVersion. llvm-svn: 128133
* Patch from Jay Cornwall that modifies the LLDB "Host" layer to reuse moreGreg Clayton2010-09-071-749/+0
| | | | | | code between linux, darwin and BSD. llvm-svn: 113263
* Remove a deadlock condition. A bit of explanation is needed: When calling Greg Clayton2010-07-231-1/+0
| | | | | | | | | | | | | | | ThreadCancel in Host::WillTerminate g_monitor_thread may be blocked on a call to pthread_cond_wait (for example, line 640). Now, by default, when a cancellation request is serviced g_monitor_thread will again own the mutex guarding the condition variable it was waiting on. This causes the call to SetValue in Host::WillTerminate to hit a deadlock. The call to SetValue does not appear to be needed, so removing it solves the issue. Patch from Stephen Wilson. llvm-svn: 109228
* Implement GetProgramFileSpec().Eli Friedman2010-07-021-17/+4
| | | | llvm-svn: 107502
* Add hacky, incomplete Linux host implementation; barely enough to allowEli Friedman2010-07-021-0/+763
compiling lldb. Someone else might try to improve it, though. :) llvm-svn: 107501
OpenPOWER on IntegriCloud