summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Platform.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use %HOME%/.lldb/module_cache as a default module cache directory.Oleksiy Vyalov2015-10-011-8/+15
| | | | | | http://reviews.llvm.org/D13323 llvm-svn: 249040
* Fix TestLoadUnload.test_load_unload for android API > 21Tamas Berghammer2015-09-041-1/+4
| | | | | | | | | | | | * Change Module::MatchesModuleSpec to return true in case the file spec in the specified module spec matches with the platform file spec, but not with the local file spec * Change the module_resolver used when resolving a remote shared module to always set the platform file spec to the file spec requested Differential revision: http://reviews.llvm.org/D12601 llvm-svn: 246852
* Add functionality to the platforms to figure out the proper name for a ↵Enrico Granata2015-08-271-0/+6
| | | | | | | | | | | | | | | | dynamic library on the system given a basename This will do things like, given mylibrary, return libmylibrary.dylib on OSX mylibrary.dll on Windows and so on for other platforms It is currently implemented for Windows, Darwin, and Linux. Other platforms should fill in accordingly llvm-svn: 246131
* Download symbol file for .oat files on androidTamas Berghammer2015-08-121-2/+12
| | | | | | | | | | | | | On android .oat files (compiled java code) don't have symbol information but on SDK 23+ it can be generated by the oatdump tool (based on the dex information). This CL adds logic to download this information and store it in the module cache. Differential revision: http://reviews.llvm.org/D11936 llvm-svn: 244738
* Refactor Unix signals.Chaoren Lin2015-07-141-0/+16
| | | | | | | | | | | | | | | | | | 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
* Avoid going through Platform when creating a NativeProcessProtocol instancePavel Labath2015-07-091-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit avoids the Platform instance when spawning or attaching to a process in lldb-server. Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason for this is that I believe that NativeProcessProtocol should be decoupled from the Platform (after all, it always knows which platform it is running on, unlike the rest of lldb). Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ greatly from the platform actions of the lldb client, so I think the separation makes sense. After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable method, which needs additional refactoring. This is a resubmit of r241672, after it was reverted due to build failueres on non-linux platforms. Reviewers: ovyalov, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10996 llvm-svn: 241796
* Revert r241672, which breaks the OS X build by introducing a dependency onSean Callanan2015-07-081-0/+21
| | | | | | | | | | | | | | | | platform-specific symbols that are not implemented on OS X. The build error that caused this is Undefined symbols for architecture x86_64: "lldb_private::NativeProcessProtocol::Attach(unsigned long long, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::AttachToProcess(unsigned long long) in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o) "lldb_private::NativeProcessProtocol::Launch(lldb_private::ProcessLaunchInfo&, lldb_private::NativeProcessProtocol::NativeDelegate&, std::__1::shared_ptr<lldb_private::NativeProcessProtocol>&)", referenced from: lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::LaunchProcess() in liblldb-core.a(GDBRemoteCommunicationServerLLGS.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) llvm-svn: 241688
* Avoid going through Platform when creating a NativeProcessProtocol instancePavel Labath2015-07-081-21/+0
| | | | | | | | | | | | | | | | | | | | | Summary: This commit avoids the Platform instance when spawning or attaching to a process in lldb-server. Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason for this is that I believe that NativeProcessProtocol should be decoupled from the Platform (after all, it always knows which platform it is running on, unlike the rest of lldb). Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ greatly from the platform actions of the lldb client, so I think the separation makes sense. After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable method, which needs additional refactoring. Reviewers: ovyalov, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10996 llvm-svn: 241672
* [LLDB][MIPS] Getting correct flags for MIPSMohit K. Bhakkad2015-06-301-1/+1
| | | | | | | | | | Patch by Nitesh Jain Reviewers: clayborg, ovyalov, emaste. Subscribers: jaydeep, bhushan, dsanders, mohit.bhakkad, sagar, labath, tberghammer, lldb-commits. Differential Revision: http://reviews.llvm.org/D10685 llvm-svn: 241045
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-291-51/+52
| | | | | | | | | | | | | | | | | 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
* Have Platform::KillProcess try to use the process plugin first.Zachary Turner2015-05-131-3/+21
| | | | llvm-svn: 237280
* Windows: fix bug in getcwd() and add chdir().Ted Woodward2015-05-121-5/+0
| | | | | | | | | | | | | | | | | Summary: GetCurrentDirectory() returns the number of characters copied; 0 is a failure, not a success. Add implementation for chdir(). Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9300 llvm-svn: 237162
* Convert mmap options for target in InferiorCallMmap.Robert Flack2015-05-091-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the MAP_PRIVATE and MAP_ANON options to the target platform constants (on which the call runs) rather than using those of the compiled host. Test Plan: Run test suite, the following tests requiring memory allocation / JIT support begin passing when running mac -> linux: Test11588.py TestAnonymous.py TestBreakpointConditions.py TestCPPStaticMethods.py TestCStrings.py TestCallStdStringFunction.py TestDataFormatterCpp.py TestDataFormatterStdList.py TestExprDoesntBlock.py TestExprHelpExamples.py TestFunctionTypes.py TestPrintfAfterUp.py TestSBValuePersist.py TestSetValues.py Differential Revision: http://reviews.llvm.org/D9511 llvm-svn: 236933
* Use file locks to synchronize access to ModuleCache.Oleksiy Vyalov2015-05-071-9/+1
| | | | | | http://reviews.llvm.org/D9056 llvm-svn: 236736
* Add Modulecache::GetAndPut method which wraps sequence of Get and Put (if ↵Oleksiy Vyalov2015-04-151-56/+23
| | | | | | | | module wasn't found in cache) calls. http://reviews.llvm.org/D9013 llvm-svn: 235011
* Use Android device serial number instead of hostname as a target identifier ↵Oleksiy Vyalov2015-03-251-3/+9
| | | | | | | | within module cache. http://reviews.llvm.org/D8597 llvm-svn: 233202
* Fix ModuleCache usage in Platform - ask remote platform for module's ↵Oleksiy Vyalov2015-03-241-54/+69
| | | | | | | | ModuleSpec beforehand so we can look for a module by UUID locally without need to download it. http://reviews.llvm.org/D8557 llvm-svn: 233136
* Fetch module specification from remote process alsoTamas Berghammer2015-03-241-6/+22
| | | | | | | | | | | | | Previously the remote module sepcification was fetched only from the remote platform. With this CL if we have a remote process then we ask it if it have any information from a given module. It is required because on android the dynamic linker only reports the name of the SO file and the platform can't always find it without a full path (the process can do it based on /proc/<pid>/maps). Differential revision: http://reviews.llvm.org/D8547 llvm-svn: 233061
* Extend Platform(s) in order to cache remote executables using ModuleCache ↵Oleksiy Vyalov2015-03-131-0/+37
| | | | | | | | and make POSIX dynamic loader to use this flow when attaching to a remote target. http://reviews.llvm.org/D8306 llvm-svn: 232194
* Make ModuleCache::Get to return instantiated ModuleSP instance so already ↵Oleksiy Vyalov2015-03-121-21/+8
| | | | | | | | created in-memory instance can be returned instead of creating a new one. http://reviews.llvm.org/D8270 llvm-svn: 232075
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-10/+266
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Don't #include ClangPersistentVariables.h from Process.hZachary Turner2015-03-031-0/+1
| | | | | | | Nothing from this header file was even being referenced in Process.h anyway, so it was a completely unnecessary include. llvm-svn: 231131
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-5/+5
| | | | | | 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-80/+10
| | | | | | | | | | | | | - 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
* A few minor path fixes for Windows.Zachary Turner2015-02-181-1/+7
| | | | | | | | | | | | When launching argdumper, there are a few problems with the current logic. First, on Windows, the file is called argdumper.exe, not argdumper. Second, Windows paths have backslashes in them, and JSON treats <backslash><char> as an escape sequence. To fix the second problem, on Windows we convert backslashes to forward slashes, since backslash isn't a valid filename character anyway this shouldn't be a problem. llvm-svn: 229784
* Use CloseOnExec in Platform::PutFilePavel Labath2015-02-171-2/+3
| | | | | | | | | | | | | | Summary: This does not fix any outstanding issue that I know of, but there is no reason these files should _not_ have CloseOnExec. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7694 llvm-svn: 229506
* Add Initialize/Terminate method to Platform base pluginTamas Berghammer2015-02-121-1/+22
| | | | | | | | | | | | | Platform holds a smart pointer to each platform object created in a static variable what cause the platform destructors called only on program exit when other static variables are not availables. With this change the destructors are called on lldb_private::Terminate() + Fix DebuggerRefCount handling in ScriptInterpreterPython Differential Revision: http://reviews.llvm.org/D7590 llvm-svn: 228944
* Add a "launch with globber" mode that lets you launch a process after having ↵Enrico Granata2015-02-101-0/+79
| | | | | | globbed the command line arguments via argdumper instead of routing via /bin/sh llvm-svn: 228658
* Extend SBPlatform with capability to launch/terminate a process remotely. ↵Oleksiy Vyalov2015-02-041-0/+14
| | | | | | | | Integrate this change into test framework in order to spawn processes on a remote target. http://reviews.llvm.org/D7263 llvm-svn: 228230
* Make one mutex for the lldb_private::Platform class that can be used to ↵Greg Clayton2015-02-021-5/+5
| | | | | | | | protect with modifying member variables. This mutex is designed to be used for simple modifications, so the lock should be taken, modify the member variable and released. We need to make sure this isn't used with any code that cause code to rely or reenter on another thread. Partial fix for: <rdar://problem/19575304> llvm-svn: 227855
* Fix the -*-version-min option to not try and use the current OS version for ↵Greg Clayton2015-01-221-1/+1
| | | | | | iOS and the simulator since llvm/clang will assert and kill LLDB. llvm-svn: 226846
* This patch gets remote-linux platform able to run processesVince Harron2015-01-211-1/+58
| | | | | | | | | | | | | | | | 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
* Added support to Platform to indicate (1) whether theSean Callanan2014-12-051-0/+14
| | | | | | | | current platform supports Clang modules, and (2) what options to pass to Clang so it can load those Clang modules. llvm-svn: 223431
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-171-9/+7
| | | | | | | | | | | | | | | | 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
* Remove LLDB_DEFAULT_SHELL #define, and determine this at runtime.Zachary Turner2014-10-201-1/+5
| | | | | | | Differential Revision: http://reviews.llvm.org/D5805 Reviewed by: Greg Clayton llvm-svn: 220217
* logging: added more logging to the Target/Platform launch & attach sequence.Todd Fiala2014-10-091-1/+38
| | | | llvm-svn: 219377
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-83/+123
| | | | | | | | | | | | | 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
* Clean-up warnings on Linux/GCCDavid Majnemer2014-09-161-0/+1
| | | | llvm-svn: 217862
* remove a couple of default cases from switchesSaleem Abdulrasool2014-09-081-1/+0
| | | | | | | | | This cleans up a couple of warnings [-Wcovered-switch-default] from the build by removing the default case from a couple of switches which are fully covered. This is generally better as it will help identify when a new item is added to the enumeration but the use sites are not updated. llvm-svn: 217376
* Move GetUsername and GetGroupname to HostInfoPosixZachary Turner2014-08-211-2/+6
| | | | llvm-svn: 216210
* Move Host::GetArchitecture to HostInfo::GetArchitecture.Zachary Turner2014-08-201-1/+1
| | | | | | | | 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-191-7/+16
| | | | | | | | | | | | | | | | | | 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 order for the debug script filename to be valid as a module name, LLDB ↵Enrico Granata2014-08-161-1/+1
| | | | | | does some textual replacements. However, if one were unaware of this, they might name their script using the 'untampered' file name and they would get no feedback about it. Add logic to LLDB to make sure we tell people about those changes if it turns out they might need to know. Fixes rdar://14310572 llvm-svn: 215798
* Move FileSystem functions out of Host and into their own classes.Zachary Turner2014-08-151-7/+8
| | | | | | | | | | | | | | | | 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
* Revert "Fix broken tests due to new error output."Zachary Turner2014-07-091-7/+7
| | | | | | | This reverts commit ec7c94f8e6860968d384b578e5564a9c55c80b4a and re-enables OptionValidators. llvm-svn: 212627
* Fix broken tests due to new error output.Todd Fiala2014-07-081-7/+7
| | | | | | | | | | | This reverses out the options validators changes. We'll get these back in once the changes to the output can be resolved. Restores broken tests on FreeBSD, Linux, MacOSX. Changes reverted: r212500, r212317, r212290. llvm-svn: 212543
* Adds the notion of an OptionValidator.Zachary Turner2014-07-031-7/+7
| | | | | | | | | | | | | | | | | | The purpose of the OptionValidator is to determine, based on some arbitrary set of conditions, whether or not a command option is valid for a given debugger state. An example of this might be to selectively disable or enable certain command options that don't apply to a particular platform. This patch contains no functional change, and does not actually make use of an OptionValidator for any purpose yet. A follow-up patch will begin to add the logic and users of OptionValidator. Reviewed by: Greg Clayton, Jim Ingham Differential Revision: http://reviews.llvm.org/D4369 llvm-svn: 212290
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-301-3/+22
| | | | | | | | | | | | | | | | | | | | | 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
* Fix Windows warnings.Todd Fiala2014-05-281-0/+3
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* Add a lock ivar to the Platform so that multiple TargetsJason Molenda2014-05-231-3/+8
| | | | | | | | trying to populate the list of trap handler names at the same time don't conflict with one another. <rdar://problem/17011969> llvm-svn: 209563
OpenPOWER on IntegriCloud