summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Start the refactoring of globbingEnrico Granata2015-02-201-0/+86
| | | | | | | | | | | | | - 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
* Close terminal after LaunchInTerminalTestCase testIlia K2015-02-111-0/+2
| | | | | | | | | | | | | | | | Summary: The test_launch_in_terminal test leaves a running terminal. This patch adds "exit" after debugging with eLaunchFlagLaunchInTTY flag. Reviewers: jingham, zturner, clayborg Reviewed By: clayborg Subscribers: emaste, vharron, lldb-commits, clayborg, jingham, zturner Differential Revision: http://reviews.llvm.org/D7468 llvm-svn: 228801
* Remove unused function:Greg Clayton2015-01-201-43/+0
| | | | | | | | | | | lldb::pid_t Host::LaunchApplication (const FileSpec &app_file_spec); This had use of a function FSPathMakeRef(const UInt8*, FSRef *, ...) that was deprecated in 10.8. Removing this fucntion since it wasn't used and was causing warnings. llvm-svn: 226608
* Fix a -Wnull-conversion warning.Nico Weber2015-01-151-1/+1
| | | | llvm-svn: 226181
* Fix needed for the new terminal test I previously checked in. It was ↵Greg Clayton2015-01-061-12/+17
| | | | | | crashing due to a NULL dereference. llvm-svn: 225316
* More fixes to ensure if we are asked to launch a x86_64h process on darwin, ↵Greg Clayton2015-01-061-1/+2
| | | | | | that darwin-debug knows what to do and how to handle it. llvm-svn: 225225
* Add support for embedding Clang compiler headersSean Callanan2014-12-051-0/+20
| | | | | | | | | like tgmath.h and stdarg.h into the LLDB installation, and then finding them through the Host infrastructure. Also add a script to actually do this on Mac OS X. llvm-svn: 223430
* Fixed more fallout from running the test suite remotely on iOS devices.Greg Clayton2014-11-171-11/+9
| | | | | | | | | | | | | | | | 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 always-true part of a conditional expression.Jason Molenda2014-10-171-1/+1
| | | | | | clang warning. llvm-svn: 220018
* Fix accidental over-checking of args in launcherXPCService.Jason Molenda2014-10-161-1/+1
| | | | llvm-svn: 219895
* Fix a potential null pointer deref & a potential memory leak,Jason Molenda2014-10-161-26/+54
| | | | | | | | also reformat to conform to the usual lldb coding conventions a little better. clang static analyzer fixit. llvm-svn: 219893
OpenPOWER on IntegriCloud