summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/POSIX
Commit message (Collapse)AuthorAgeFilesLines
...
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-111-8/+8
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Make the Error class constructor protectedMehdi Amini2016-11-111-8/+8
| | | | | | | | | This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561
* UserExpression::Evaluate only returns a non-empty ValueObjectSPJim Ingham2016-11-071-2/+6
| | | | | | | | | | | | if it returns eExpressionCompleted. Don't try to get the error from the ValueObjectSP if that's not true. I just have a report of this from the field, I don't know how to make it fail yet. <rdar://problem/29113004> llvm-svn: 286170
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-062-1055/+869
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Decoupled Options from CommandInterpreter.Todd Fiala2016-08-111-1/+1
| | | | | | | | | | | | | | | | Options used to store a reference to the CommandInterpreter instance in the base Options class. This made it impossible to parse options independent of a CommandInterpreter. This change removes the reference from the base class. Instead, it modifies the options-parsing-related methods to take an ExecutionContext pointer, which the options may inspect if they need to do so. Closes https://reviews.llvm.org/D23416 Reviewers: clayborg, jingham llvm-svn: 278440
* dlopen & dlclose can't throw C++ or ObjC exceptions, so don't do the extra ↵Jim Ingham2016-08-111-0/+1
| | | | | | | | | | work of setting & deleting the breakpoints to watch for this. <rdar://problem/27780214> llvm-svn: 278305
* Increase "process load" timeoutPavel Labath2016-07-121-0/+1
| | | | | | | | | | Loading a dynamic library can take quite a long time, since it triggers a number of shared-library-event stops for dependent libraries. This is especially true for remote targets due to communication latency. Increase the default 500ms timeout to account for that. Committing as obvious. llvm-svn: 275185
* Revive the error message from "process load" and SBProcess::LoadImage.Jim Ingham2016-06-081-1/+1
| | | | | | | | | | | IsPointedCString has problems with ValueObjects of type eTypeHostAddress. We should figure out the right thing to do in that case, but the test is silly here because we're reading a type we've defined, so we know it is a const char *, and if the memory is good, we won't be able to read any characters, when we do ReadPointedString. <rdar://problem/26612812> llvm-svn: 272087
* This change introduces a "ExpressionExecutionThread" to the ThreadList. Jim Ingham2016-03-121-1/+1
| | | | | | | | | | | | | | | | | | | Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on behalf of the expression parser was using the currently selected thread. But sometimes, e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread we're running on, we instead set the context for the interpreter, and explicitly pass that to other callers. That wasn't getting communicated to these utility expressions, so they would run on some other thread instead, and that could cause a variety of subtle and hard to reproduce problems. I also went through the commands and cleaned up the use of GetSelectedThread. All those uses should have been trying the thread in the m_exe_ctx belonging to the command object first. It would actually have been pretty hard to get misbehavior in these cases, but for correctness sake it is good to make this usage consistent. <rdar://problem/24978569> llvm-svn: 263326
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-071-3/+3
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* Fix an issue where certain CommandObjects (or Options thereof) were being ↵Enrico Granata2016-02-062-23/+26
| | | | | | | | | | created once, bound to a specific CommandInterpreter (and hence a specific Debugger), and then cached for reuse across different Debugger instances Obviously, if the original Debugger goes away, those commands are holding on to now stale memory, which has the potential to cause crashes Fixes rdar://24460882 llvm-svn: 259964
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Modify "platform connect" to connect to processes as wellTamas Berghammer2015-12-082-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | The standard remote debugging workflow with gdb is to start the application on the remote host under gdbserver (e.g.: gdbserver :5039 a.out) and then connect to it with gdb. The same workflow is supported by debugserver/lldb-gdbserver with a very similar syntax but to access all features of lldb we need to be connected also to an lldb-platform instance running on the target. Before this change this had to be done manually with starting a separate lldb-platform on the target machine and then connecting to it with lldb before connecting to the process. This change modifies the behavior of "platform connect" with automatically connecting to the process instance if it was started by the remote platform. With this command replacing gdbserver in a gdb based worflow is usually as simple as replacing the command to execute gdbserver with executing lldb-platform. Differential revision: http://reviews.llvm.org/D14952 llvm-svn: 255016
* Add a new option to Platform::LoadImage to install the imageTamas Berghammer2015-12-082-5/+7
| | | | | | | | | | | | | | | | | | | | | This change introduce 3 different working mode for Platform::LoadImage depending on the file specs specified. * If only a remote file is specified then the remote file is loaded on the target (same behavior as before) * If only a local file is specified then the local file is installed to the current working directory and then loaded from there. * If both local and remote file is specified then the local file is installed to the specified location and then loaded from there. The same options are exposed on the SB API with a new method LoadImage method while the old signature presers its meaning. On the command line the installation of the shared library can be specified with the "--install" option of "process load". Differential revision: http://reviews.llvm.org/D15152 llvm-svn: 255014
* Remove some duplicated code from PlatformPOSIX/AndroidTamas Berghammer2015-12-032-5/+16
| | | | | | | | | | The code was duplicated to handle the custom symbol name for functions in libdl.so for android. This change modify the way we handle the issue to eliminate a lot of duplicated code. Differential revision: http://reviews.llvm.org/D15183 llvm-svn: 254608
* Fix "process load/unload" on androidTamas Berghammer2015-12-022-4/+156
| | | | | | | | | | | On android the symbols exposed by libdl (dlopen, dlclose, dlerror) prefixed by "__dl_". This change moves the handling of process load/unload to the platform object and override it for android to handle the special prefix. Differential revision: http://reviews.llvm.org/D11465 llvm-svn: 254504
* Fix Clang-tidy modernize-use-override warnings in ↵Eugene Zelenko2015-10-271-17/+13
| | | | | | source/Plugins/LanguageRuntime and Platform; other minor fixes. llvm-svn: 251374
* Revert "Clang module compilation options need to be per-platform."Adrian McCarthy2015-10-262-68/+1
| | | | | | | | This reverts commit r251340. Breaks the Windows build because Windows doesn't have getuid. The fix is not obvious. llvm-svn: 251354
* Clang module compilation options need to be per-platform.Sean Callanan2015-10-262-1/+68
| | | | | | | | On UNIX (but not Darwin) the username needs to be respected when creating a temporary module directory, so that different users don't pollute each others' module caches. llvm-svn: 251340
* Silence -Wqual-cast warnings from GCC 5.2Saleem Abdulrasool2015-10-181-3/+6
| | | | | | | | There were a number of const qualifiers being cast away which caused warnings. This cluttered the output hiding real errors. Silence them by explicit casting. NFC. llvm-svn: 250662
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Refactor Unix signals.Chaoren Lin2015-07-142-3/+11
| | | | | | | | | | | | | | | | | | 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
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-292-45/+46
| | | | | | | | | | | | | | | | | 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
* Fixed a ton of gcc compile warningsVince Harron2015-05-131-3/+3
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Fix -Wformat-pedantic warningsDavid Blaikie2015-04-081-3/+2
| | | | llvm-svn: 234429
* Remove "virtual" and add "override" to all virtual functions.Greg Clayton2015-03-121-22/+22
| | | | llvm-svn: 231991
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-102-1/+18
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Don't #include FormatManager.h from Debugger.hZachary Turner2015-03-031-0/+1
| | | | | | | | Debugger.h is a huge file that gets included everywhere, and FormatManager.h brings in a ton of unnecessary stuff and doesn't even use anything from it in the header. llvm-svn: 231161
* Make PlatformPOSIX::KillProcess to delegate to a remote platform if connected.Oleksiy Vyalov2015-02-172-0/+15
| | | | | | http://reviews.llvm.org/D7660 llvm-svn: 229577
* Make "process attach" command to support attaching to remote process in case ↵Oleksiy Vyalov2015-02-031-2/+6
| | | | | | | | if selected platform allows this. http://reviews.llvm.org/D7358 llvm-svn: 227899
* This patch gets remote-linux platform able to run processesVince Harron2015-01-211-76/+0
| | | | | | | | | | | | | | | | Make sure the selected platform is always used Make sure that the host uses the connect://hostname to connect to both the lldb-platform and the lldb-gdbserver rather than what the platform reports as the hostname of the lldb-gdbserver Make sure that lldb-platform uses the IP address on it's connection back to the host instead of the hostname that the host sends to it when launching lldb-gdbserver with the remote host information Tested on OSX and Linux llvm-svn: 226712
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-172-8/+4
| | | | | | | | | | | | | | | | Fixed include: - Change Platform::ResolveExecutable(...) to take a ModuleSpec instead of a FileSpec + ArchSpec to help resolve executables correctly when we have just a path + UUID (no arch). - Add the ability to set the listener in SBLaunchInfo and SBAttachInfo in case you don't want to use the debugger as the default listener. - Modified all places that use the SBLaunchInfo/SBAttachInfo and the internal ProcessLaunchInfo/ProcessAttachInfo to not take a listener as a parameter since it is in the launch/attach info now - Load a module's sections by default when removing a module from a target. Since we create JIT modules for expressions and helper functions, we could end up with stale data in the section load list if a module was removed from the target as the section load list would still have entries for the unloaded module. Target now has the following functions to help unload all sections a single or multiple modules: size_t Target::UnloadModuleSections (const ModuleList &module_list); size_t Target::UnloadModuleSections (const lldb::ModuleSP &module_sp); llvm-svn: 222167
* Fix a bunch of [-Werror,-Winconsistent-missing-override] errors.Eric Christopher2014-11-041-21/+22
| | | | llvm-svn: 221231
* Enable local llgs debugging on Linux when the use-llgs-for-local setting is ↵Todd Fiala2014-10-102-0/+100
| | | | | | | | | | | | | | | | | | | enabled. See http://reviews.llvm.org/D5695 for details. This change does the following: Enable lldb-gdbserver (llgs) usage for local-process Linux debugging. To turn on local llgs debugging support, which is disabled by default, enable this setting: (lldb) settings set platform.plugin.linux.use-llgs-for-local true Adds a stream-based Dump() function to FileAction. Pushes some platform methods that Linux (and FreeBSD) will want to share with MacOSX from PlatformDarwin into PlatformPOSIX. Reviewed by Greg Clayton. llvm-svn: 219457
* Moved PlatformDarwin::GetEnvironment() to PlatformPOSIX to fix Linux/llgs issue.Todd Fiala2014-09-242-0/+15
| | | | | | | | | | | | | | | | | See http://reviews.llvm.org/D5486 for more details. I was tracking a problem where llgs on linux would not pick up any environment variables. On OSX there is a virtual function PlatformDarwin::GetEnvironment() which correctly sets up the list of environment variables. On linux llgs it defaults to a base class default implementation which clears the list. I moved the OSX implementation down to PlatformPOSIX. This fixes my problem on linux still works properly on OSX. Change by Shawn Best. Slight tweak to convert 'virtual' to 'override' in PlatformDarwin.h virtual method override by Todd. Tested: Ubuntu 14.04 x86_64, cmake/ninja build + tests. MacOSX 10.9.5 x86_64, Xcode 6.1 Beta build + tests. llvm-svn: 218424
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+1
| | | | | | | | | | | | | if a "file a.out" auto selected a different platform than the selected one. Changes include: - fix it so you can select the "host" platform using "platform select host" - change all callbacks that create platforms to returns shared pointers - fix TestImageListMultiArchitecture.py to restore the "host" platform by running "platform select host" - Add a new "PlatformSP Platform::Find(const ConstString &name)" method to get a cached platform - cache platforms that are created and re-use them instead of always creating a new one llvm-svn: 218145
* Listen to the return value of the Platform::WriteFile() call within ↵Greg Clayton2014-09-181-2/+20
| | | | | | PlatformPOSIX::PutFile() in case we write less than we wanted to. Also adjust the input stream's offset in such cases. llvm-svn: 217999
* Move FileSystem functions out of Host and into their own classes.Zachary Turner2014-08-151-18/+15
| | | | | | | | | | | | | | | | More specifically, this change can be summarized as follows: 1) Makes an lldbHostPosix library which contains code common to all posix platforms. 2) Creates Host/FileSystem.h which defines a common FileSystem interface. 3) Implements FileSystem.h in Host/windows and Host/posix. 4) Creates Host/FileCache.h, implemented in Host/common, which defines a class useful for storing handles to open files needed by the debugger. Differential Revision: http://reviews.llvm.org/D4889 llvm-svn: 215775
* Fix a bug where SetFilePermissions was calling MakeDirectory.Zachary Turner2014-08-091-1/+1
| | | | | | This appears to have been a copy / paste error. llvm-svn: 215265
* Enable lldb-platform exe support for Linux.Todd Fiala2014-07-222-2/+220
| | | | | | | | | | | | | | This change enables lldb-platform for Linux. In addition, it does the following: * fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths. * adds more logging and comments around lldb-platform startup and remote lldb-platform usage. * refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX. This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet). FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits. * teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts. llvm-svn: 213707
* Change the way the m_trap_handlers Platform base class ivar is initialized;Jason Molenda2014-02-132-1/+8
| | | | | | | | add a new pure virtual CalculateTrapHandlerSymbolNames() that Platform subclasses must implement which fills in the function name list with any trap handlers that are expected on that platform. llvm-svn: 201364
* The Platform base class now maintains a list of trap handlersJason Molenda2014-02-131-0/+1
| | | | | | | | | | | | | | | | aka asynchronous signal handlers, which subclasses should fill in as appropriate. For most Unix user process environments, the one entry in this list is _sigtramp. For bare-board and kernel environments, there will be different sets of trap handlers. The unwinder needs to know when a frame is a trap handler because the rules it enforces for the frame "above" the trap handler is different from most middle-of-the-stack frames. <rdar://problem/15835846> llvm-svn: 201300
* Replace the last auto_ptr by unique_ptrJean-Daniel Dupas2013-12-061-1/+1
| | | | llvm-svn: 196625
* Expose SBPlatform through the public API.Greg Clayton2013-11-202-71/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example code: remote_platform = lldb.SBPlatform("remote-macosx"); remote_platform.SetWorkingDirectory("/private/tmp") debugger.SetSelectedPlatform(remote_platform) connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); err = remote_platform.ConnectRemote(connect_options) if err.Success(): print >> result, 'Connected to remote platform:' print >> result, 'hostname: %s' % (remote_platform.GetHostname()) src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False) dst = lldb.SBFileSpec() # copy src to platform working directory since "dst" is empty err = remote_platform.Install(src, dst); if err.Success(): print >> result, '%s installed successfully' % (src) else: print >> result, 'error: failed to install "%s": %s' % (src, err) Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories. The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform. The API in SBPlatform is subject to change and will be getting many new functions. llvm-svn: 195273
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-251-5/+5
| | | | llvm-svn: 191367
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-264-0/+671
Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
OpenPOWER on IntegriCloud