summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform
Commit message (Collapse)AuthorAgeFilesLines
...
* PlatformDarwinKernel maintains a list of kexts and kernelsJason Molenda2016-07-292-12/+148
| | | | | | | | | | | | | | | | | | | | | | | that it finds on the local computer in "well known" locations when we start up the darwin-kernel platform. It did not distinguish between kexts/kernels with dSYMs from others - when it needed a kernel/kext with a given UUID, it would grab the first one it finds. This change separates these into two vectors -- a collection of kexts and kernels with dSYMs next t othem, and a collection of kexts and kernels without dSYMs. When we have a bundle ID and uuid to search for, we first try the collections with dSYMs, and if that fails, then we try the collections that did not have dSYMs next to them. Often times we'll have a situation where a kext will be installed in multiple locations on a system, but only one of them will have a dSYM next to it, where the dev just copied it to a local directory. This fixes that problem, giving precedence to those binaries with debug information. llvm-svn: 277123
* Clean up vestigial remnants of locking primitivesSaleem Abdulrasool2016-07-281-1/+2
| | | | | | | | | | | | | | | | This finally removes the use of the Mutex and Condition classes. This is an intricate patch as the Mutex and Condition classes were tied together. Furthermore, many places had slightly differing uses of time values. Convert timeout values to relative everywhere to permit the use of std::chrono::duration, which is required for the use of std::condition_variable's timeout. Adjust all Condition and related Mutex classes over to std::{,recursive_}mutex and std::condition_variable. This change primarily comes at the cost of breaking the TracingMutex which was based around the Mutex class. It would be possible to write a wrapper to provide similar functionality, but that is beyond the scope of this change. llvm-svn: 277011
* Add check for non-null log instance in PlatformAndroid.Oleksiy Vyalov2016-07-211-1/+1
| | | | llvm-svn: 276303
* fix command-line LLDB so NSLog messages show upTodd Fiala2016-07-142-0/+28
| | | | | | | | | | | Changes to the underlying logging infrastructure in Fall 2016 Darwin OSes were no longer showing up NSLog messages in command-line LLDB. This change restores that functionality, and adds test cases to verify the new behavior. rdar://26732492 llvm-svn: 275472
* 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
* Use shell cat command as a workaround if ADB stat cannot lookup a file.Oleksiy Vyalov2016-07-083-14/+86
| | | | | | http://reviews.llvm.org/D22081 llvm-svn: 274895
* Respect ANDROID_SERIAL environment variable used by ADBLuke Drummond2016-07-071-6/+12
| | | | | | | | | | | When multiple Android devices are attached, the default behaviour of ADB is to resolve a device number based on the presence of ANDROID_SERIAL if the serial number is not explicitly passed by the -s parameter. This patch emulates that behaviour in lldb's ADB platform connector Differential Revision: http://reviews.llvm.org/D22052 llvm-svn: 274776
* Fix ADB client disconnect issues.Oleksiy Vyalov2016-07-064-25/+106
| | | | | | http://reviews.llvm.org/D22029 llvm-svn: 274638
* Add oat symbolization support for odex filesTamas Berghammer2016-07-061-2/+3
| | | | | | Differential revision: http://reviews.llvm.org/D22040 llvm-svn: 274635
* Fix for Windows builds.Adrian McCarthy2016-06-301-0/+6
| | | | llvm-svn: 274277
* Improve ADB utilization within Android platform.Oleksiy Vyalov2016-06-305-188/+242
| | | | | | http://reviews.llvm.org/D21770 llvm-svn: 274256
* Change PlatformDarwinKernel::GetSharedModule to be a little moreJason Molenda2016-06-271-3/+16
| | | | | | | | | | | | explicit in how it adds the kernel binary, to guard against the case where a kernel corefile might incorrectly include the kernel's UUID in it (so calling ::GetSharedModule may end up returning the global module cache's copy of the core file instead of adding the kerenl binary). <rdar://problem/26988816> llvm-svn: 273954
* Revert r273524, it may have been the cause of a linux testbot failureJason Molenda2016-06-234-6/+6
| | | | | | | | for TestNamespaceLookup.py; didn't see anything obviously wrong so I'll need to look at this more closely before re-committing. (passed OK on macOS ;) llvm-svn: 273531
* Do some minor renames of "Mac OS X" to "macOS".Jason Molenda2016-06-234-6/+6
| | | | | | | | | There's uses of "macosx" that will be more tricky to change, like in triples (e.g. "x86_64-apple-macosx10.11") - for now I'm just updating source comments and strings printed for humans. llvm-svn: 273524
* Add support to PlatformRemoteiOS, PlatformRemoteAppleWatch, andJason Molenda2016-06-143-0/+210
| | | | | | | | | | | | | | | | | | | | PlatformRemoteAppleTV to check the target.exec-search-paths directories for files after looking in the SDK. An additional wrinkle is that the remote file path may be something like ".../UIFoundation.framework/UIFoundation" and in target.exec-search-paths we will have "UIFoundation.framework". Looking for just the filename of the path is not sufficient - we need to also look for it by the parent directories because this may be a darwin bundle/framework like the UIFoundation example. We really need to make a PlatformRemoteAppleDevice and have PlatformRemoteiOS, PlatformRemoteAppleWatch, and PlatformRemoteAppleTV inherit from it. These three classes are 98% identical code. <rdar://problem/25976619> llvm-svn: 272635
* 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
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-185-7/+7
| | | | | | | | | | This is a pretty straightforward first pass over removing a number of uses of Mutex in favor of std::mutex or std::recursive_mutex. The problem is that there are interfaces which take Mutex::Locker & to lock internal locks. This patch cleans up most of the easy cases. The only non-trivial change is in CommandObjectTarget.cpp where a Mutex::Locker was split into two. llvm-svn: 269877
* Bump up adb timeout morePavel Labath2016-05-161-1/+1
| | | | | | still seeing very rare timeouts on the buildbot. llvm-svn: 269648
* Bump up timeout in AdbClientPavel Labath2016-05-051-1/+1
| | | | | | | now that the timeout actually means something, we see that sometimes adb is just really slow in replying to the DONE packet during file push. Give it more time to complete. llvm-svn: 268623
* Fix EOF handling in AdbClient (take 2)Pavel Labath2016-05-051-5/+16
| | | | | | | | | | | | | | Summary: AdbClient would spin in a loop in ReadAllBytes in case the remote end was closed before reading the requested number of bytes. Make sure we return an error in this case instead. Reviewers: ovyalov Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D19916 llvm-svn: 268617
* Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"Pavel Labath2016-05-031-11/+13
| | | | | | | This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to ConnectionGenericFileWindows). llvm-svn: 268384
* Add a read_full_buffer argument to ConnectionFileDescriptor::ReadPavel Labath2016-05-031-13/+11
| | | | | | | | | | | | | | | | | | | | | Summary: AdbClient was attempting to handle the case where the socket input arrived in pieces, but it was failing to handle the case where the connection was closed before that happened. In this case, it would just spin in an infinite loop calling Connection::Read. (This was also the cause of the spurious timeouts on the darwin->android buildbot. The exact cause of the premature EOF remains to be investigated, but is likely a server bug.) Since this wait-for-a-certain-number-of-bytes seems like a useful functionality to have, I am moving it (with the infinite loop fixed) to the Connection class, and adding an appropriate test for it. Reviewers: clayborg, zturner, ovyalov Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D19533 llvm-svn: 268380
* Support Linux on SystemZ as platformUlrich Weigand2016-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Linux on SystemZ: - A new ArchSpec value of eCore_s390x_generic - A new directory Plugins/ABI/SysV-s390x providing an ABI implementation - Register context support - Native Linux support including watchpoint support - ELF core file support - Misc. support throughout the code base (e.g. breakpoint opcodes) - Test case updates to support the platform This should provide complete support for debugging the SystemZ platform. Not yet supported are optional features like transaction support (zEC12) or SIMD vector support (z13). There is no instruction emulation, since our ABI requires that all code provide correct DWARF CFI at all PC locations in .eh_frame to support unwinding (i.e. -fasynchronous-unwind-tables is on by default). The implementation follows existing platforms in a mostly straightforward manner. A couple of things that are different: - We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers, since some registers (access register) reside at offsets in the user area that are multiples of 4, but the PTRACE_PEEKUSER interface only allows accessing aligned 8-byte blocks in the user area. Instead, we use a s390 specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that allows accessing a whole block of the user area in one go, so in effect allowing to treat parts of the user area as register sets. - SystemZ hardware does not provide any means to implement read watchpoints, only write watchpoints. In fact, we can only support a *single* write watchpoint (but this can span a range of arbitrary size). In LLDB this means we support only a single watchpoint. I've set all test cases that require read watchpoints (or multiple watchpoints) to expected failure on the platform. [ Note that there were two test cases that install a read/write watchpoint even though they nowhere rely on the "read" property. I've changed those to simply use plain write watchpoints. ] Differential Revision: http://reviews.llvm.org/D18978 llvm-svn: 266308
* In GDBRemoteCommunicationClient::GetHostInfo, don't set theJason Molenda2016-04-073-24/+0
| | | | | | | | | | | | | | | | | | os to "ios" or "macosx" if it is unspecified. For environments where there genuinely is no os, we don't want to errantly convert that to ios/macosx, e.g. bare board debugging. Change PlatformRemoteiOS, PlatformRemoteAppleWatch, and PlatformRemoteAppleTV to not create themselves if we have an unspecified OS. Same problem - these are not appropriate platforms for bare board debugging environments. Have Process::Attach's logging take place if either process or target logging is enabled. <rdar://problem/25592378> llvm-svn: 265732
* Add the same host logging that I added to PlatformRemoteiOS a fewJason Molenda2016-03-252-1/+154
| | | | | | | | months back to PlatformRemoteAppleTV and PlatformRemoteAppleWatch to help understand what's happening when lldb can't find binaries that it should be finding. llvm-svn: 264380
* [LLDB]{MIPS] Fix TestPlatformProcessConnect.pyMohit K. Bhakkad2016-03-224-18/+19
| | | | | | | | | | Patch by Nitesh Jain Reviewers: clayborg, labath. Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, lldb-commits. Differential Revision: http://reviews.llvm.org/D18082 llvm-svn: 264030
* 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
* Add an "offset" option to "break set -n" and "break set -f -l". Jim Ingham2016-03-091-0/+1
| | | | | | | | | | | | That way you can set offset breakpoints that will move as the function they are contained in moves (which address breakpoints can't do...) I don't align the new address to instruction boundaries yet, so you have to get this right yourself for now. <rdar://problem/13365575> llvm-svn: 263049
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-074-10/+10
| | | | | | | | | | | | | | 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 all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-2/+1
| | | | | | the right thing and break. llvm-svn: 261950
* Refactor GetSoftwareBreakpointTrapOpcodeAidan Dodds2016-02-228-249/+19
| | | | | | | | This patch aims to reduce the code duplication among all of the platforms in GetSoftwareBreakpointTrapOpcode by pushing all common code into the Platform base class. Differential Revision: http://reviews.llvm.org/D17395 llvm-svn: 261536
* Revert "Use BKPT instead of UDF for arm/thumb breakpoints"Tamas Berghammer2016-02-161-2/+4
| | | | | | | | | | | This reverts commit 293c18e067d663e0fe93e6f3d800c2a4bfada2b0. The BKPT instruction generates SIGBUS instead of SIGTRAP in the Linux kernel on Nexus 6 - 5.1.1 (kernel version 3.10.40). Revert the CL until we can figure out how can we hanble the SIGBUS or how to get back a SIGTRAP using the BKPT instruction. llvm-svn: 260969
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Use BKPT instead of UDF for arm/thumb breakpointsTamas Berghammer2016-02-101-4/+2
| | | | | | | | | The UDF instruction is deprecated in armv7 and in case of thumb2 instructions set it don't work well together with the IT instruction. Differential revision: http://reviews.llvm.org/D16853 llvm-svn: 260367
* 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-2810-163/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Modify "platform connect" to connect to processes as wellTamas Berghammer2015-12-086-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | 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-034-98/+27
| | | | | | | | | | 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-024-4/+254
| | | | | | | | | | | 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
* Add code to PlatformDarwin and HostInfoMacOSX so they return theJason Molenda2015-11-211-155/+168
| | | | | | | | | | | | correct OS type when running on an apple tv or apple watch. Also, in TargetList::CreateTargetInternal, check that a platform is returned by GetPlatformForArchitecture fallback instead of adding it to the vector of platforms unconditionally; we can end up crashing when we call a member function on it later. <rdar://problem/23601982>, <rdar://problem/21292886> llvm-svn: 253763
* Call Platform::SetHostPlatform in the NetBSD platform only on NetBSDEd Maste2015-11-201-0/+2
| | | | | | | | Patch by Kamil Rytarowski Differential Revision: http://reviews.llvm.org/D14876 llvm-svn: 253699
* I like how PlatformAndroid/PlatformLinux log when their platformsJason Molenda2015-11-198-0/+194
| | | | | | | try to CreateInstance, and log the results. I copied that for the Mac platforms. llvm-svn: 253538
* Move this back to a pid_t; this file is OSX only anyway, and the signedness ↵Enrico Granata2015-11-171-2/+2
| | | | | | of pid_t is actually a thing we want here llvm-svn: 253364
* Fix pessimizing moves. Found by clang.Davide Italiano2015-11-071-1/+1
| | | | llvm-svn: 252409
* Fix some Clang-tidy warnings and formatting in recently added code.Eugene Zelenko2015-11-074-137/+101
| | | | | | | | | | | Fixed Clang-tidy warnings: * modernize-use-override; * modernize-use-nullptr; * modernize-use-default; * readability-simplify-boolean-expr. llvm-svn: 252374
* Add PlatformRemoteAppleWatch (apple watch), PlatformRemoteAppleTV (apple tv),Jason Molenda2015-11-069-0/+3317
| | | | | | | PlatformAppleWatchSimulator (apple watch simulator), PlatformAppleTVSimulator (apple tv simulator). llvm-svn: 252251
* Fix cmake build on Mac OS X.Bruce Mitchener2015-11-051-0/+1
| | | | | | | PlatformDarwin uses Host/XML.h which needs to find libxml2, and so it needs to be told how to find the headers. llvm-svn: 252238
* Add support for the new (added last week) llvm::Triple::WatchOS and ::TvOSJason Molenda2015-11-052-1/+60
| | | | | | | | | | in places where we check for Triple::IOS. They're mostly the same as far as lldb is conerned. . Also add a base cass implementation for Process::IsAlive - Greg added this last year but it didn't get upstreamed. llvm-svn: 252227
* Let the process help figure out the Host OS if nobody elseJim Ingham2015-11-052-0/+67
| | | | | | can figure it out. llvm-svn: 252224
OpenPOWER on IntegriCloud