summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
Commit message (Collapse)AuthorAgeFilesLines
* [lldb][NFC] Use static_cast instead of reinterpret_cast where possibleRaphael Isemann2020-01-071-2/+2
| | | | | | | | | | | | | | Summary: There are a few places in LLDB where we do a `reinterpret_cast` for conversions that we could also do with `static_cast`. This patch moves all this code to `static_cast`. Reviewers: shafik, JDevlieghere, labath Reviewed By: labath Subscribers: arphaman, usaxena95, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D72161
* [lldb] Fix macOS build by replacing nullptr with FileSpec()Raphael Isemann2019-12-041-1/+1
| | | | | Before we had a implicit conversion from nullptr to FileSpec which was thankfully removed.
* Fix typeo in CPU_TYPE_ARM64_32 for older SDKs.Jason Molenda2019-10-311-1/+1
|
* Add arm64_32 support to lldb, an ILP32 codegen Jason Molenda2019-10-162-1/+17
| | | | | | | | | | that runs on arm64 ISA targets, specifically Apple watches. Differential Revision: https://reviews.llvm.org/D68858 llvm-svn: 375032
* ProcessInstanceInfoMatch: Don't match processes with no name if a name match ↵Pavel Labath2019-10-111-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | was requested, take 2 Summary: The previous attempt at making nameless process not match when searching for a given name failed because the macos implementation was depending on this detail in its partial matching strategy. Doing partial matching to avoid expensive lookups is a perfectly valid thing to do, the way it was implemented seems somewhat unexpected. This patch implements it differently by providing special methods in the ProcessInstanceInfoMatch which match only a subset of fields, and changes mac host code to use those instead. Then, it re-applies r373925 to get make the ProcessInstanceInfoMatch with a name *not* match a nameless process. Reviewers: JDevlieghere, teemperor, jingham Subscribers: wallace, lldb-commits Differential Revision: https://reviews.llvm.org/D68631 llvm-svn: 374529
* [Host] Return status directly from RunShellCommandJonas Devlieghere2019-10-041-4/+2
| | | | | | Thanks for catching this, Pavel! llvm-svn: 373783
* [Host] Don't discard return value from RunShellCommandJonas Devlieghere2019-10-041-3/+8
| | | | | | | The recent change to expand arguments with the user's shell sometimes caused a timeout and the error was not propagated. llvm-svn: 373776
* [ARM64] XPC services are unsupported on device.Davide Italiano2019-10-021-2/+2
| | | | | | | | While around, clean up support for a 8 years old OS. <rdar://problem/55916729> llvm-svn: 373510
* [Utility] Replace `lldb_private::CleanUp` by `llvm::scope_exit`Jonas Devlieghere2019-09-101-4/+6
| | | | | | | | | This removes the CleanUp class and replaces its usages with llvm's ScopeExit, which has similar semantics. Differential revision: https://reviews.llvm.org/D67378 llvm-svn: 371474
* Upstream macCatalyst support in debugserver and the macOS dynamic loaderAdrian Prantl2019-09-041-11/+20
| | | | | | | | | | | plugin. Unfortunately the test is currently XFAILed because of missing changes to the clang driver. Differential Revision: https://reviews.llvm.org/D67124 llvm-svn: 370931
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-242-27/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* [Host] Fix out-of-line definition of StartMonitoringChildProcessJonas Devlieghere2019-07-081-1/+1
| | | | llvm-svn: 365344
* Change LaunchThread interface to return an expected.Jonas Devlieghere2019-07-051-3/+6
| | | | | | | | | Change the interface to return an expected, instead of taking a Status pointer. Differential revision: https://reviews.llvm.org/D64163 llvm-svn: 365226
* Fix integer literals which are cast to boolJonas Devlieghere2019-05-241-1/+1
| | | | | | | | | This change replaces built-in types that are implicitly converted to booleans. Differential revision: https://reviews.llvm.org/D62284 llvm-svn: 361580
* Mark private unimplemented functions as deletedJonas Devlieghere2019-05-151-2/+2
| | | | | | | Applies modernize-use-equals-delete to the LLDB code base and removes the now redundant comments. llvm-svn: 360751
* [Host] Clean up dependencies of HostMacOSXObjCXXAlex Langford2019-05-071-4/+0
| | | | llvm-svn: 360178
* Hide stderr output from lldb-argdumperAdrian Prantl2019-04-241-1/+4
| | | | | | | | | | | | | Under very specific circumstances the default shell /bin/sh might print stuff to stderr before launching lldb-argdumper, which then confuses the JSON parser. This patch suppresses stderr output from lldb-argdumper to avoid this situation. rdar://problem/50149390 Differential Revision: https://reviews.llvm.org/D61101 llvm-svn: 359156
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-1014-92/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* Move ProcessInfo from Host to Utility.Zachary Turner2019-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | There are set of classes in Target that describe the parameters of a process - e.g. it's PID, name, user id, and similar. However, since it is a bare description of a process and contains no actual functionality, there's nothing specifically that makes this appropriate for being in Target -- it could just as well be describing a process on the host, or some hypothetical virtual process that doesn't even exist. To cement this, I'm moving these classes to Utility. It's possible that we can find a better place for it in the future, but as it is neither Host specific nor Target specific, Utility seems like the most appropriate place for the time being. After this there is only 2 remaining references to Target from Host, which I'll address in a followup. Differential Revision: https://reviews.llvm.org/D58842 llvm-svn: 355342
* Move Host/Symbols.cpp to Symbols/LocateSymbolFile.cppZachary Turner2019-02-271-654/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Given that we have a target named Symbols, one wonders why a file named Symbols.cpp is not in this target. To be clear, the functions exposed from this file are really focused on *locating* a symbol file on a given host, which is where the ambiguity comes in. However, it makes more sense conceptually to be in the Symbols target. While some of the specific places to search for symbol files might change depending on the Host, this is not inherently true in the same way that, for example, "accessing the file system" or "starting threads" is fundamentally dependent on the Host. PDBs, for example, recently became a reality on non-Windows platforms, and it's theoretically possible that DSYMs could become a thing on non MacOSX platforms (maybe in a remote debugging scenario). Other types of symbol files, such as DWO, DWP, etc have never been tied to any Host platform anyway. After this patch, there is only one remaining dependency from Host to Target. Differential Revision: https://reviews.llvm.org/D58730 llvm-svn: 355032
* Move FileAction, ProcessInfo and ProcessLaunchInfo from Target to HostPavel Labath2019-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: These classes describe the details of the process we are about to launch, and so they are naturally used by the launching code in the Host module. Previously they were present in Target because that is the most important (but by far not the only) user of the launching code. Since the launching code has other customers, must of which do not care about Targets, it makes sense to move these classes to the Host layer, next to the launching code. This move reduces the number of times that Target is included from host to 8 (it used to be 14). Reviewers: zturner, clayborg, jingham, davide, teemperor Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D56602 llvm-svn: 353047
* [Reproducers] Add file providerJonas Devlieghere2019-01-291-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the file provider which is responsible for capturing files used by LLDB. When capturing a reproducer, we use a file collector that is very similar to the one used in clang. For every file that we touch, we add an entry with a mapping from its virtual to its real path. When we decide to generate a reproducer we copy over the files and their permission into to reproducer folder. When replaying a reproducer, we load the VFS mapping and instantiate a RedirectingFileSystem. The latter will transparently use the files available in the reproducer. I've tested this on two macOS machines with an artificial example. Still, it is very likely that I missed some places where we (still) use native file system calls. I'm hoping to flesh those out while testing with more advanced examples. However, I will fix those things in separate patches. Differential revision: https://reviews.llvm.org/D54617 llvm-svn: 352538
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1918-72/+54
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix stack-buffer-overflow in lldb_private::Host::FindProcesses (2/2)Jonas Devlieghere2018-12-211-2/+2
| | | | | | This fixes the second call at line 640 that I missed in r349858. llvm-svn: 349869
* Fix stack-buffer-overflow in lldb_private::Host::FindProcessesJonas Devlieghere2018-12-201-1/+1
| | | | | | | Found by the address sanitizer on GreenDragon: http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/1628/console llvm-svn: 349858
* Simplify Boolean expressionsJonas Devlieghere2018-12-154-13/+11
| | | | | | | | | | | This patch simplifies boolean expressions acorss LLDB. It was generated using clang-tidy with the following command: run-clang-tidy.py -checks='-*,readability-simplify-boolean-expr' -format -fix $PWD Differential revision: https://reviews.llvm.org/D55584 llvm-svn: 349215
* [Host] Use FileSystem wrapperJonas Devlieghere2018-12-101-10/+8
| | | | | | | Fixes Host.mm to use the FileSystem class instead of making native calls to check if a file exists. llvm-svn: 348779
* Remove header grouping comments.Jonas Devlieghere2018-11-112-8/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* [FileSystem] Add convenience method to check for directories.Jonas Devlieghere2018-11-083-4/+4
| | | | | | | | | | | Replace calls to LLVM's is_directory with calls to LLDB's FileSytem class. For this I introduced a new convenience method that, like the other methods, takes either a path or filespec. This still uses the LLVM functions under the hood. Differential revision: https://reviews.llvm.org/D54135 llvm-svn: 346375
* [FileSystem] Move path resolution logic out of FileSpecJonas Devlieghere2018-11-013-27/+39
| | | | | | | | | This patch removes the logic for resolving paths out of FileSpec and updates call sites to rely on the FileSystem class instead. Differential revision: https://reviews.llvm.org/D53915 llvm-svn: 345890
* [FileSystem] Remove Exists() from FileSpecJonas Devlieghere2018-11-012-9/+14
| | | | | | | | | This patch removes the Exists method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53845 llvm-svn: 345854
* [FileSystem] Remove ResolveExecutableLocation() from FileSpecJonas Devlieghere2018-11-011-2/+3
| | | | | | | | | This patch removes the ResolveExecutableLocation method from FileSpec and updates its uses with calls to the FileSystem. Differential revision: https://reviews.llvm.org/D53834 llvm-svn: 345853
* Upstreaming the BridgeOS device support and the Jason Molenda2018-10-111-0/+3
| | | | | | | | | | | | | | | LC_BUILD_VERSION load command handling - this commit is a combination of patches by Adrian Prantl and myself. llvm::Triple::BridgeOS isn't defined yet, so all references to that are currently commented out. Also update Xcode project file to build the NativePDB etc plugins. <rdar://problem/43353615> llvm-svn: 344209
* Move SafeMachO from Utility to HostPavel Labath2018-09-122-3/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: One of the conclusions of the discussion on D49740 was that SafeMachO is better off in the Host module (as that's the only place which should include mach/machine.h, which is what this header is working around). Also, Utility, which is the only module which cannot include Host, should not be doing anything with object file formats. This patch implements that move, and also removes any unneded includes of that file. I've verified that MacOS still compiles after this. Reviewers: jingham, zturner, teemperor Subscribers: fedor.sergeev, lldb-commits Differential Revision: https://reviews.llvm.org/D50383 llvm-svn: 342050
* [cmake] Remove unused ${LLDB_PLUGINS} dependency from our Objective-C++ ↵Raphael Isemann2018-07-231-1/+0
| | | | | | | | | | | | | | | | | | | | CMake config Summary: LLDB_PLUGINS doesn't exist as a variable, so this line doesn't add any dependencies and is just confusing. It seems this slipped in from the gdb-remote CMake I was using as a CMake template. The gdb-remote CMake itself is using a local LLDB_PLUGINS variable, so that code is fine. Reviewers: davide Reviewed By: davide Subscribers: davide, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D49695 llvm-svn: 337741
* Fix macos build for r335244Pavel Labath2018-06-211-2/+2
| | | | | | | | | I've made the code accept only 16 byte UUIDs, which is technically not NFC (previously it would also accept 20 byte ones, but use only the first 16 bytes), but this should be more correct as mac UUIDs are always 16 byte long. llvm-svn: 335247
* Remove dependency from Host to pythonPavel Labath2018-06-201-34/+0
| | | | | | | | | | | | | | | | Summary: The only reason python was used in the Host module was to compute the python path. I resolve this the same way as D47384 did for clang, by moving the path computation into the python plugin and modifying SBHostOS class to call into this module for ePathTypePythonDir. Reviewers: zturner, jingham, davide Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D48215 llvm-svn: 335104
* Replace HostInfo::GetLLDBPath with specific functionsPavel Labath2018-06-192-14/+12
| | | | | | | | | | | | | | | | | | | | | Summary: Instead of a function taking an enum value determining which path to return, we now have a suite of functions, each returning a single path kind. This makes it easy to move the python-path function into a specific plugin in a follow-up commit. All the users of GetLLDBPath were converted to call specific functions instead. Most of them were hard-coding the enum value anyway, so this conversion was simple. The only exception was SBHostOS, which I've changed to use a switch on the incoming enum value. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D48272 llvm-svn: 335052
* Fix macosx build broken by the VersionTuple refactorPavel Labath2018-06-181-6/+3
| | | | | | | | | | I actually did check that macos builds before committing, but this error was in conditionally compiled code that did not seem to be used on my machine. I also fix a typo in the previous speculative NetBSD patch. llvm-svn: 334955
* Use llvm::VersionTuple instead of manual version marshallingPavel Labath2018-06-181-16/+5
| | | | | | | | | | | | | | | | | | Summary: This has multiple advantages: - we need only one function argument/instance variable instead of three - no need to default initialize variables - no custom parsing code - VersionTuple has comparison operators, which makes version comparisons much simpler Reviewers: zturner, friss, clayborg, jingham Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D47889 llvm-svn: 334950
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-133-11/+20
| | | | | | | | | | | | | | | | SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
* Fix macos xcode build.Jason Molenda2018-06-131-5/+5
| | | | llvm-svn: 334662
* Fix/unify the spelling of Objective-C.Adrian Prantl2018-06-131-1/+1
| | | | llvm-svn: 334614
* Add modules support for lldb headers in include/Raphael Isemann2018-06-134-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a modulemap which allows compiling the lldb headers into C++ modules (for example in builds with LLVM_ENABLE_MODULES=On). Even though most of the affected code has been cleaned up to work with the more strict C++ module semantics, there are still some workarounds left in the current modulemap (the most obvious one is the big `lldb` wrapper module). It also moves the Obj-C++ files in lldb to their own subdirectories. This was necessary because we need to filter out the modules flags for this code. Note: With the latest clang and libstdc++ it seems necessary to have a STL C++ module to get a working LLVM_ENABLE_MODULES build for lldb. Otherwise clang will falsely detect ODR violations in the textually included STL code inside the lldb modules. Reviewers: aprantl, bruno Reviewed By: aprantl, bruno Subscribers: mgorny, yamaguchi, v.g.vassilev, lldb-commits Differential Revision: https://reviews.llvm.org/D47929 llvm-svn: 334611
* Document how lldb uses the DBGSourcePathRemapping Jason Molenda2018-06-111-2/+7
| | | | | | | source path remapping src/dest path pairs with respect to the DBGVersion number in the plist. llvm-svn: 334442
* Delete some dead codeAlex Langford2018-06-081-180/+0
| | | | llvm-svn: 334320
* Remove dependency from Host to clang.Zachary Turner2018-06-041-80/+0
| | | | | | | | | | Host depended on clang because HostInfo had a function to get the directory where clang was installed. We move this over to the clang expression parser plugin where it's more at home. Differential Revision: https://reviews.llvm.org/D47384 llvm-svn: 333933
* HostInfoMacOSX: Support finding the clang resource directory within CLTools.Adrian Prantl2018-05-251-9/+13
| | | | | | rdar://problem/40537961 llvm-svn: 333248
* Reapply "Remove Process references from the Host module"Pavel Labath2018-05-151-9/+5
| | | | | | This re-lands r332250/D46395, after fixing Mac build errors. llvm-svn: 332353
* Revert "Remove Process references from the Host module"Pavel Labath2018-05-141-5/+10
| | | | | | | | | | The first fix wasn't enough, there is still a missing ProcessInstanceInfo include in Host.mm. I won't be able to test a fix before leaving work, so I am reverting both commits. This reverts commit r332250 and the subsequent fix attempt. llvm-svn: 332261
OpenPOWER on IntegriCloud