summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
Commit message (Collapse)AuthorAgeFilesLines
...
* Mutatis mutandis for char * -> StringRef. Jim Ingham2016-09-231-6/+6
| | | | llvm-svn: 282311
* Fixed the build by changing a couple of const char *s to StringRefs.Sean Callanan2016-09-192-4/+6
| | | | llvm-svn: 281943
* I had a problem with one SDK where dispatch_release was actually aJason Molenda2016-09-081-1/+1
| | | | | | | | macro, so writing ::dispatch_release did not work as expected. Remove the global anon namespace :: designation; the header will get us the correct declaration. llvm-svn: 280903
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0619-3267/+2870
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Garbage collection is not around anymore, we can remove our support for it.Greg Clayton2016-08-081-17/+1
| | | | llvm-svn: 278064
* Add support for an additional dictionary in the per-arch plistsJason Molenda2016-07-261-0/+62
| | | | | | | | | | | | | | | | | | | | | that may be embedded in the Contents/Resources subdir of a dSYM bundle. These allow for the specification of a build-time path to debug-time path remapping for source files. Files may be built in /BuildDirectory/sources/project-100 but when the debugger is run, they're actually found via ~sources/project-100 - this plist allows for that remapping through the DBGBuildSourcePath and DBGSourcePath keys. This patch adds support for a new DBGSourcePathRemapping dictionary in the plist where the keys are the build-time paths and the values are the debug-time paths that they should be remapped to. There are instances were we have multiple possible build-time paths that need to be included, so the dictionary was required. <rdar://problem/26725174> llvm-svn: 276729
* make macOS 'launch in terminal' bring terminal to the front during launchTodd Fiala2016-07-181-0/+1
| | | | | | rdar://25235812 llvm-svn: 275885
* Revert r273524, it may have been the cause of a linux testbot failureJason Molenda2016-06-231-1/+1
| | | | | | | | 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-231-1/+1
| | | | | | | | | 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
* remove use of Mutex in favour of std::{,recursive_}mutexSaleem Abdulrasool2016-05-181-6/+6
| | | | | | | | | | 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
* Generalize child process monitoring functionsPavel Labath2016-05-111-8/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: This replaces the C-style "void *" baton of the child process monitoring functions with a more C++-like API taking a std::function. The motivation for this was that it was very difficult to handle the ownership of the object passed into the callback function -- each caller ended up implementing his own way of doing it, some doing it better than others. With the new API, one can just pass a smart pointer into the callback and all of the lifetime management will be handled automatically. This has enabled me to simplify the rather complicated handshake in Host::RunShellCommand. I have left handling of MonitorDebugServerProcess (my original motivation for this change) to a separate commit to reduce the scope of this change. Reviewers: clayborg, zturner, emaste, krytarowski Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D20106 llvm-svn: 269205
* Host: fix some -Wformat-pedantic warningsSaleem Abdulrasool2016-04-211-6/+6
| | | | | | Add explicit casts for function pointer to void * for %p conversion. NFC. llvm-svn: 267000
* Revert to using libdispatch to reap threads on MacOSX. Code was accidentally ↵Greg Clayton2016-04-121-21/+33
| | | | | | | | checked in that is now reverted. <rdar://problem/25643874> llvm-svn: 266118
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-191-29/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* Make HostThread SetName work on OS X. GetName doesn't currently work, the ↵Jim Ingham2016-02-042-14/+10
| | | | | | | | | | | code that was in GetName actually got the queue name not the thread name and anyway didn't actually work to do that. So I just deleted it with a fixme. <rdar://problem/24487554> llvm-svn: 259818
* Add code to PlatformDarwin and HostInfoMacOSX so they return theJason Molenda2015-11-211-0/+13
| | | | | | | | | | | | 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
* Fix an issue where LLDB would not launch argdumper correctly if there were ↵Enrico Granata2015-11-191-1/+4
| | | | | | spaces in the path to it llvm-svn: 253599
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-071-1/+1
| | | | | | | | | | | | | | | | | | Summary: Since this is within the lldb namespace, the compiler tries to export a symbol for it. Unfortunately, since it is inlined, the symbol is hidden and this results in a mess of warnings when building on OS X with cmake. Moving it to the lldb_private namespace eliminates that problem. Reviewers: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D14417 llvm-svn: 252396
* Jim thinks we shouldn't bother to pollute the svn repo with theseJason Molenda2015-11-061-2/+2
| | | | | | | internal details, so I'll pull it back to just our own branch of the sources. llvm-svn: 252254
* Update the invocation to dsymForUUID (a script plugin usedJason Molenda2015-11-051-2/+2
| | | | | | | | at Apple, called by the DebugSymbols private framework to find a dSYM for a UUID on mac) to include the latest args we need to use when looking for kernel binaries etc. llvm-svn: 252235
* Try a little harder to provide a legit CWD to argdumper if Jim Ingham2015-11-041-1/+19
| | | | | | the user hasn't provided one. llvm-svn: 252023
* Revert r251882 as it breaks the test suiteEnrico Granata2015-11-031-7/+1
| | | | llvm-svn: 251956
* Emit an error message if the current working directory does not exist when ↵Enrico Granata2015-11-031-1/+7
| | | | | | the user is trying to launch argdumper to do shell expansion llvm-svn: 251882
* Rename argdumper to lldb-argdumperTodd Fiala2015-10-291-4/+4
| | | | | | http://reviews.llvm.org/D14169 llvm-svn: 251616
* Fix one more place where we were using the oldJason Molenda2015-10-231-7/+3
| | | | | | | name of the xpc service. <rdar://problem/23223624> llvm-svn: 251086
* Move the launch-as-root xpc service from lldb to xcode, toJason Molenda2015-10-228-463/+16
| | | | | | | | | | | make it easier to run hand-built lldb roots and retain those entitlements. This is currently only used by Xcode; command line lldb doesn't expose the SBLaunchInfo::SetUserID() launch option. <rdar://problem/23154486> llvm-svn: 250981
* Re-commit the (fixed) changes from r248985 which were reverted by PavelJason Molenda2015-10-081-116/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when they introduced android testsuite regressions. Pavel has run the testsuite against the updated patch and it completes cleanly now. The original commit message: Fixing a subtle issue on Mac OS X systems with dSYMs (possibly introduced by r235737 but I didn't look into it too closely). A dSYM can have a per-UUID plist in it which tells lldb where to find an executable binary for the dSYM (DBGSymbolRichExecutable) - other information can be included in this plist, like how to remap the source file paths from their build pathnames to their long-term storage pathnames. This per-UUID plist is a unusual; it is used probably exclusively inside apple with our build system. It is not created by default in normal dSYMs. The problem was like this: 1. lldb wants to find an executable, given only a UUID (this happens when lldb is doing cross-host debugging and doesn't have a copy of the target system's binaries) 2. It eventually calls LocateMacOSXFilesUsingDebugSymbols which does a spotlight search for the dSYM on the local system, and failing that, tries the DBGShellCommands command to find the dSYM. 3. It gets a dSYM. It reads the per-UUID plist in the dSYM. The dSYM has a DBGSymbolRichExecutable kv pair pointing to the binary on a network filesystem. 4. Using the binary on the network filesystem, lldb now goes to find the dSYM. 5. It starts by looking for a dSYM next to the binary it found. 6. lldb is now reading the dSYM over a network filesystem, ignoring the one it found on its local filesystem earlier. Everything still *works* but it's much slower. This would be a tricky one to write up in a testsuite case; you really need the binary to not exist on the local system. And LocateMacOSXFilesUsingDebugSymbols will only compile on Mac OS X - even if I found a way to write up a test case, it would not run anywhere but on a mac. One change Greg wanted while I was touching this code was to have LocateMacOSXFilesUsingDebugSymbols (which could be asked to find a binary OR find a dSYM) to instead return a ModuleSpec with the sum total of everything it could find. This change of passing around a ModuleSpec instead of a FileSpec was percolated up into ModuleList::GetSharedModule. The changes to LocateMacOSXFilesUsingDebugSymbols look larger than they really are - there's a lot of simple whitespace changes in there. I ran the testsuites on mac, no new regressions introduced <rdar://problem/21993813> llvm-svn: 249755
* Revert "Fixing a subtle issue on Mac OS X systems with dSYMs..."Pavel Labath2015-10-011-94/+116
| | | | | | | This reverts commit r248985, as it was breaking all remote expression-evaluating tests (on android at least). llvm-svn: 248995
* Fixing a subtle issue on Mac OS X systems with dSYMs (possiblyJason Molenda2015-10-011-116/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduced by r235737 but I didn't look into it too closely). A dSYM can have a per-UUID plist in it which tells lldb where to find an executable binary for the dSYM (DBGSymbolRichExecutable) - other information can be included in this plist, like how to remap the source file paths from their build pathnames to their long-term storage pathnames. This per-UUID plist is a unusual; it is used probably exclusively inside apple with our build system. It is not created by default in normal dSYMs. The problem was like this: 1. lldb wants to find an executable, given only a UUID (this happens when lldb is doing cross-host debugging and doesn't have a copy of the target system's binaries) 2. It eventually calls LocateMacOSXFilesUsingDebugSymbols which does a spotlight search for the dSYM on the local system, and failing that, tries the DBGShellCommands command to find the dSYM. 3. It gets a dSYM. It reads the per-UUID plist in the dSYM. The dSYM has a DBGSymbolRichExecutable kv pair pointing to the binary on a network filesystem. 4. Using the binary on the network filesystem, lldb now goes to find the dSYM. 5. It starts by looking for a dSYM next to the binary it found. 6. lldb is now reading the dSYM over a network filesystem, ignoring the one it found on its local filesystem earlier. Everything still *works* but it's much slower. This would be a tricky one to write up in a testsuite case; you really need the binary to not exist on the local system. And LocateMacOSXFilesUsingDebugSymbols will only compile on Mac OS X - even if I found a way to write up a test case, it would not run anywhere but on a mac. One change Greg wanted while I was touching this code was to have LocateMacOSXFilesUsingDebugSymbols (which could be asked to find a binary OR find a dSYM) to instead return a ModuleSpec with the sum total of everything it could find. This change of passing around a ModuleSpec instead of a FileSpec was percolated up into ModuleList::GetSharedModule. The changes to LocateMacOSXFilesUsingDebugSymbols look larger than they really are - there's a lot of simple whitespace changes in there. I ran the testsuites on mac, no new regressions introduced <rdar://problem/21993813> llvm-svn: 248985
* Fix tests on cmake-based OS X after rL248338Todd Fiala2015-09-241-0/+37
| | | | | | | | | | | | | | | See: https://llvm.org/bugs/show_bug.cgi?id=24926 for details. On OS X, when LLDB.framework is not part of the lldb.dylib path, the supporting executable path is resolved to be the bin directory sitting next to the lib directory with the dylib lives. Not a perfect solution, but we also can't base it on the executable path since both Python and the lldb driver can be the executable. llvm-svn: 248545
* Improve error reporting for failing to find argdumper.Bruce Mitchener2015-09-241-2/+2
| | | | | | | | | | Reviewers: tfiala, granata.enrico, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13125 llvm-svn: 248466
* execinfo.h isn't needed on Mac OS X for Host.mm.Bruce Mitchener2015-09-241-1/+0
| | | | | | | | | | | | Summary: This is no longer needed as this file no longer calls backtrace(). Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13049 llvm-svn: 248457
* Remove more uses of raw_svector_ostream::flush() call following r244928.Yaron Keren2015-08-131-1/+0
| | | | llvm-svn: 244936
* Bump the version # in the xcode proj file from major number 340 to 350.Jason Molenda2015-08-042-2/+2
| | | | | | The SB API for major version 340 won't be changing any more. llvm-svn: 243943
* Convert the ScriptInterpreter system to a plugin-based one.Zachary Turner2015-07-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Previously embedded interpreters were handled as ad-hoc source files compiled into source/Interpreter. This made it hard to disable a specific interpreter, or to add support for other interpreters and allow the developer to choose which interpreter(s) were enabled for a particular build. This patch converts script interpreters over to a plugin-based system. Script interpreters now live in source/Plugins/ScriptInterpreter, and the canonical LLDB interpreter, ScriptInterpreterPython, is moved there as well. Any new code interfacing with the Python C API must live in this location from here on out. Additionally, generic code should never need to reference or make assumptions about the presence of a specific interpreter going forward. Differential Revision: http://reviews.llvm.org/D11431 Reviewed By: Greg Clayton llvm-svn: 243681
* Add some initial logging for when lldb is searching for binaries,Jason Molenda2015-07-251-0/+76
| | | | | | | | | dSYMs, or reading binaries out of memory to the 'Host' log channel. There's more to be done here, both for Mac and for other platforms, but the initial set of new loggings are useful enough to check in at this point. llvm-svn: 243200
* Make sure we resolve ~ in paths coming from the plist in a dSYM before ↵Jim Ingham2015-07-241-30/+7
| | | | | | | | | | | | adding them to the path remappings. Also don't add the paths to the path mapping when DebugSymbols tells up about files, since we'll just do that again when we read in the dSYM. <rdar://problem/21986208> llvm-svn: 243181
* Correctly get the arguments and environment, even for processes that have a ↵Greg Clayton2015-07-201-9/+12
| | | | | | | | | | large amount or arguments and/or environment variables. We previously passed in a 8192 byte buffer but this wasn't large enough. We now calculate the size we need and then add 128 to it and get the environment. If we pass exactly the number of bytes it says is needs, the sysctl() returns junk. Adding 1 seemed to do the trick, but to err on the side of caution, I added a few bytes more. <rdar://problem/21883842> llvm-svn: 242729
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-26/+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
* Fix a variety of typos.Bruce Mitchener2015-06-181-1/+1
| | | | | | No functional change. llvm-svn: 239995
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-291-3/+3
| | | | | | | | | | | | | | | | | 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
* Re-add #include "lldb-python.h" back in two places.Zachary Turner2015-05-291-0/+2
| | | | | | | Fixing these two instances will require some work, so for now I'm adding these 2 includes back to get the build working. llvm-svn: 238587
* Don't #include "lldb-python.h" from anywhere.Zachary Turner2015-05-291-2/+0
| | | | | | | | | | | | | Since interaction with the python interpreter is moving towards being more isolated, we won't be able to include this header from normal files anymore, all includes of it should be localized to the python library which will live under source/bindings/API/Python after a future patch. None of the files that were including this header actually depended on it anyway, so it was just a dead include in every single instance. llvm-svn: 238581
* Look for both .debug and dsym debugging symbol information for stripped ↵Robert Flack2015-04-241-319/+46
| | | | | | | | | | | | | | | | | executable. Currently Symbols::LocateExecutableSymbolFile on MacOSX only looks for external dsym debugging information, however if running on a stripped dwarf executable it should also check for a .debug file as well. Test Plan: ./dotest.py $DOTEST_OPTS -t -p TestSharedLibStrippedSymbols.py This test now passes when running a remote Mac -> Linux test, and still passes running locally on Mac or locally on Linux. Differential Revision: http://reviews.llvm.org/D9174 llvm-svn: 235737
* Fix a bug where argdumper would not launch inferiors correctly in the ↵Enrico Granata2015-04-171-9/+4
| | | | | | | | presence of arguments of the form word1\ word2 (vs. the quoted form "word1 word2") Fixes rdar://20493444 llvm-svn: 235157
* Move some functions from source/lldb.cpp to Utility.Zachary Turner2015-03-181-0/+1
| | | | | | | | | | Specifically, there were some functions for converting enums to strings and a function for matching a string using a specific matching algorithm. This moves those functions to more appropriate headers in lldb/Utility and updates references to include the new headers. llvm-svn: 232673
* Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner2015-03-061-19/+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
* Bump major vers # in xcode project file from 330 to 340.Jason Molenda2015-03-062-2/+2
| | | | llvm-svn: 231441
* Fix FileSpec::GetPath to return null-terminated stringsIlia K2015-02-271-32/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end. It could have happened if the size of buffer for path was less than actual path. Test case: ``` FileSpec test("/path/to/file", false); char buf[]="!!!!!!"; test.GetPath(buf, 3); ``` Before fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/pa!!!" ``` After fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/p" ``` Reviewers: zturner, abidh, clayborg Reviewed By: abidh, clayborg Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh Differential Revision: http://reviews.llvm.org/D7553 llvm-svn: 230787
* Rename the "glob arguments" feature to "shell expand arguments"Enrico Granata2015-02-201-12/+12
| | | | | | This should not bring any feature change, except changing names of things here and there llvm-svn: 230077
OpenPOWER on IntegriCloud