summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-8/+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
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+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] Move EnumerateDirectory from FileSpec to FileSystem.Jonas Devlieghere2018-11-011-14/+13
| | | | | | | | | | | | | | This patch moves the EnumerateDirectory functionality and related enum and typedef from FileSpec to FileSystem. This is part of a set of patches that extracts file system related convenience methods from FileSpec. The long term goal is to remove this method altogether and use the iterators directly, but for introducing the VFS into LLDB this change is sufficient. Differential revision: https://reviews.llvm.org/D53785 llvm-svn: 345800
* Correct the pathname that PlatformDarwinKernel::ExamineKextForMatchingUUIDJason Molenda2018-06-191-1/+1
| | | | | | | | | | | passes to the recursive search function so we only recursively search the kext bundle directory, instead of its parent directory. <rdar://problem/41227170> Differential Revision: https://reviews.llvm.org/D48302 llvm-svn: 335079
* [Platform] Accept arbitrary kext variantsJonas Devlieghere2018-06-071-0/+3
| | | | | | | | | | | | | | | | | | | When loading kexts in PlatformDarwinKernel, we use the BundleID as the filename to to create shared modules. In GetSharedModule we call ExamineKextForMatchingUUID for any BundleID it finds that is a match, to see if the UUID is also a match. Until now we were using Host::ResolveExecutableInBundle which calls a CoreFoundation API to obtain the executable. However, it's possible that the executable has a variant suffix (e.g. foo_development) and these files were ignored. This patch replaces that call with logic that looks for all the binaries in the bundle. Because of the way ExamineKextForMatchingUUID works, it's fine to try to load executables that are not valid and we can just iterate over the list until we found a match. Differential revision: https://reviews.llvm.org/D47539 llvm-svn: 334205
* Enable ProcessMachCore plugin on non-apple platformsPavel Labath2018-05-221-0/+1
| | | | | | | | | | | | | | | | | | | Summary: The plugin already builds fine on other platforms (linux, at least). All that was necessary was to revitalize the hack in PlatformDarwinKernel (not a very pretty hack, but it gets us going at least). I haven't done a thorough investigation of the state of the plugin on other platforms, but at least the two core file tests we have seem to pass, so I enable them. Reviewers: JDevlieghere, jasonmolenda Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D47133 llvm-svn: 332997
* Rename Error -> Status.Zachary Turner2017-05-121-2/+2
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-221-1/+1
| | | | llvm-svn: 298536
* Resubmit FileSystem changes.Zachary Turner2017-03-081-8/+9
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-071-9/+8
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Use LLVM for all stat-related functionality.Zachary Turner2017-03-071-8/+9
| | | | | | | | | | This deletes LLDB's FileType enumeration and replaces all users, and all calls to functions that check whether a file exists etc with corresponding calls to LLVM. Differential Revision: https://reviews.llvm.org/D30624 llvm-svn: 297116
* Move classes from Core -> Utility.Zachary Turner2017-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-145/+156
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* Change the indexing done for kernel/kext directories to be recursive.Jason Molenda2016-08-051-66/+25
| | | | | | | | | | | | | | Also re-write how most of the directory indexing is done - as it has grown over the years, it has become a bit of a mess and was overdue for a cleanup. Most importantly, this allows you to specify a directory with the platform.plugin.darwin-kernel.kext-directories setting and now lldb will search for kexts and kernels in those directories recursively. <rdar://problem/20754467> llvm-svn: 277789
* PlatformDarwinKernel maintains a list of kexts and kernelsJason Molenda2016-07-291-2/+12
| | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r273524, it may have been the cause of a linux testbot failureJason Molenda2016-06-231-2/+2
| | | | | | | | 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-2/+2
| | | | | | | | | 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 for the new (added last week) llvm::Triple::WatchOS and ::TvOSJason Molenda2015-11-051-0/+8
| | | | | | | | | | 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
* Remove redundant virtual for member functions marked 'override'.David Blaikie2015-04-081-1/+1
| | | | llvm-svn: 234422
* Fix build on OS X after r233061Ilia K2015-03-241-0/+1
| | | | | | | | This includes following: # Add a missing Process argument when calling GetSharedModule in DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule # Fix PlatformDarwinKernel::GetSharedModule prototype llvm-svn: 233084
* When starting a kernel debug session (PlatformDarwinKernel), scanJason Molenda2015-01-291-8/+28
| | | | | | | | | | | | for executable binaries on the local filesystem so the user doesn't need to provide the path to the correct binary manually. Also have lldb search for kexts/the kernel in the current working directory in addition to all the usual places. <rdar://problem/18126501> llvm-svn: 227419
* Fixed compiler warnings for functions that weren't marked virtual and the ↵Greg Clayton2015-01-281-14/+15
| | | | | | functions didn't have "override" on them. llvm-svn: 227366
* Added support to Platform to indicate (1) whether theSean Callanan2014-12-051-0/+3
| | | | | | | | current platform supports Clang modules, and (2) what options to pass to Clang so it can load those Clang modules. llvm-svn: 223431
* Test suite runs better again after recent fixes that would select a platform ↵Greg Clayton2014-09-191-1/+1
| | | | | | | | | | | | | 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
* Change the way the m_trap_handlers Platform base class ivar is initialized;Jason Molenda2014-02-131-0/+3
| | | | | | | | add a new pure virtual CalculateTrapHandlerSymbolNames() that Platform subclasses must implement which fills in the function name list with any trap handlers that are expected on that platform. llvm-svn: 201364
* Fixed build break introduced by r181717Daniel Malea2013-05-131-0/+2
| | | | | | | - added missing ConstString header - moved "using lldb*" statements to OS-independent section llvm-svn: 181724
* <rdar://problem/13875830>Greg Clayton2013-05-131-1/+17
| | | | | | Unblock linux builds. The real fix for this is tracked by the above radar, but this temporary hack should fix things for now. llvm-svn: 181717
* <rdar://problem/13854277>Greg Clayton2013-05-101-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <rdar://problem/13594769> Main changes in this patch include: - cleanup plug-in interface and use ConstStrings for plug-in names - Modfiied the BSD Archive plug-in to be able to pick out the correct .o file when .a files contain multiple .o files with the same name by using the timestamp - Modified SymbolFileDWARFDebugMap to properly verify the timestamp on .o files it loads to ensure we don't load updated .o files and cause problems when debugging The plug-in interface changes: Modified the lldb_private::PluginInterface class that all plug-ins inherit from: Changed: virtual const char * GetPluginName() = 0; To: virtual ConstString GetPluginName() = 0; Removed: virtual const char * GetShortPluginName() = 0; - Fixed up all plug-in to adhere to the new interface and to return lldb_private::ConstString values for the plug-in names. - Fixed all plug-ins to return simple names with no prefixes. Some plug-ins had prefixes and most ones didn't, so now they all don't have prefixed names, just simple names like "linux", "gdb-remote", etc. llvm-svn: 181631
* Pass down the architecture of the module we're trying toJason Molenda2013-05-031-1/+1
| | | | | | | match when looking at kext on the local filesystem. <rdar://problem/13785112> llvm-svn: 180989
* Add support for Platform plugins to have settings.Jason Molenda2013-04-051-0/+7
| | | | | | | | | Add two initial settings for the PlatformDarwinKernel plugin, plugin.platform.darwin-kernel.search-locally-for-kexts [true|false] plugin.platform.darwin-kernel.kext-directories [directory list] llvm-svn: 178846
* Add a new PlatformDarwinKernel for kernel debugging. This PlatformJason Molenda2013-04-051-0/+176
plugin will index the kext bundles on the local filesystem when created. During a kernel debug session, when the DynamicLoader plugin needs to locate a kext by name like "com.apple.com.apple.filesystems.autofs", the Platform can quickly look for a UUID match in those kernel debug kit directories it previously indexed. I'm still working on profiling the performance impact of the inital kext bundle scan; there will likely need to be a switch to enable or disable this plugin's scan. This only affects Mac kernel debugging and the code is only built on Apple systems because of some use of low-level CoreFoundation to parse plists. <rdar://problem/13503583> llvm-svn: 178827
OpenPOWER on IntegriCloud