summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
Commit message (Collapse)AuthorAgeFilesLines
* Now that setting an architecture from a mach-o CPU type and subtype doesn't ↵Greg Clayton2014-08-021-0/+2
| | | | | | set the OS type, make sure to set it. llvm-svn: 214600
* __arm64__ and __aarch64__ #ifdef adjustmentsTodd Fiala2014-07-092-9/+9
| | | | | | | | Change by Paul Osmialowski See http://reviews.llvm.org/D4379 for details. llvm-svn: 212583
* Simplify Host::GetOSVersion() on macosx.Jean-Daniel Dupas2014-07-081-46/+7
| | | | | | It removes usage of the deprecated function CFURLCreateDataAndPropertiesFromResource(). llvm-svn: 212552
* Removing Carbon dependency by removing obsolete code.Jean-Daniel Dupas2014-07-021-93/+0
| | | | | | | The only part using Carbon is a function in Host.mm used to open a file in Xcode. That code is broken and it is no longer useful as Xcode supports LLDB natively. llvm-svn: 212208
* Fix typos.Bruce Mitchener2014-07-011-5/+5
| | | | llvm-svn: 212132
* Added an option to turn OFF the "detach on error" behavior that was addedJim Ingham2014-06-251-1/+1
| | | | | | | | to debugserver when launching processes. <rdar://problem/16216199> llvm-svn: 211658
* Rework fix in r201744. You really DO need to waitpid twice to get theJim Ingham2014-06-241-1/+6
| | | | | | | | | | | process fully reaped. The race & bad behavior was because we were letting the reaping thread in LLDB to also set the Process exit status, so debugserver would sometimes be shut down before it got a chance to report the exit status, and then we got confused. <rdar://problem/16555850> llvm-svn: 211636
* iOS simulator cleanup to make sure we use "*-apple-ios" for iOS simulator ↵Greg Clayton2014-05-291-7/+31
| | | | | | | | | | | | | | | | | | apps and binaries. Changes include: - ObjectFileMachO can now determine if a binary is "*-apple-ios" or "*-apple-macosx" by checking the min OS and SDK load commands - ArchSpec now says "<arch>-apple-macosx" is equivalent to "<arch>-apple-ios" since the simulator mixes and matches binaries (some from the system and most from the iOS SDK). - Getting process inforamtion on MacOSX now correctly classifies iOS simulator processes so they have "*-apple-ios" architectures in the ProcessInstanceInfo - PlatformiOSSimulator can now list iOS simulator processes correctly instead of showing nothing by using: (lldb) platform select ios-simulator (lldb) platform process list - debugserver can now properly return "*-apple-ios" for the triple in the process info packets for iOS simulator executables - GDBRemoteCommunicationClient now correctly passes along the triples it gets for process info by setting the OS in the llvm::Triple correctly <rdar://problem/17060217> llvm-svn: 209852
* Workaround for collision between enum members in LLVM's MachO.h and system ↵Jim Ingham2014-04-021-1/+1
| | | | | | | | | | headers on Mac OS X (in particular mach/machine.h). <rdar://problem/16494607> llvm-svn: 205480
* sanitise sign comparisonsSaleem Abdulrasool2014-04-021-5/+5
| | | | | | | | This is a mechanical change addressing the various sign comparison warnings that are identified by both clang and gcc. This helps cleanup some of the warning spew that occurs during builds. llvm-svn: 205390
* lldb arm64 import.Jason Molenda2014-03-292-8/+32
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-24/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* build: fix libxml2 detection via CMakeSaleem Abdulrasool2014-03-141-1/+1
| | | | | | | | | | | | | | | | | libxml2's include path was unconditionally set to /usr/include/libxml2. This would work previously, however, Mavericks removed the /usr/include directory. Since LLDB already requires clang, which via LLVM's build infrastructure searches for libxml2, we have a proper include path for libxml2. If LIBXML2_FOUND is set, do not touch the libxml2 search path. Instead, allow the clang's definition to propagate throughout the LLVM build. Otherwise, switch to find_package(LibXml2) as clang does. This will ensure that the correct path is used for libxml2 irrespective of the platform. Furthermore, treat libxml2 as a system provided library. It is not part of the LLVM source base so it is of little value to enable all warnings on its headers. This unifies the treatment of libxml2 across clang and LLDB. llvm-svn: 203955
* <rdar://problem/15996848>Han Ming Ong2014-02-103-4/+49
| | | | | | | Made sure we pass along the file action paths for stdin/stdout/stderr to the XPC service. [Reviewed by Greg Clayton] llvm-svn: 201103
* Unify OS X/POSIX/Linux Host spawn support.Todd Fiala2014-01-231-218/+1
| | | | | | | | | | | | | | | This fixes a bug under Linux where spawning a process via Host::LaunchProcess was disabling all blockable signals on the launched process. This caused strange behavior when attempting to kill the lldb-gdbserver process, as the child generally would not die unless killed with a non-blockable signal (e.g. 'kill -9'). This change moves several functions out of macosx/Host.mm into common/Host.cpp. In addition, two functions that needed to work across common/Host.cpp and macosx/Host.mm were moved into the Host.h header file. llvm-svn: 199856
* Add support for Haswell on x86_64.Greg Clayton2014-01-221-2/+4
| | | | | | <rdar://problem/15312873> llvm-svn: 199854
* Update the lldb version number in the xcode project files from 310.99.0 to ↵Jason Molenda2014-01-102-2/+2
| | | | | | 320.99.0. llvm-svn: 198917
* Only check os version for POSIX_SPAWN_CLOEXEC_DEFAULT on desktop builds of LLDB.Greg Clayton2014-01-081-1/+1
| | | | llvm-svn: 198800
* Fixed a kernel panic that would occur if you debug anything on MacOSX 10.7 ↵Greg Clayton2014-01-081-43/+72
| | | | | | or earlier due to the use of the POSIX_SPAWN_CLOEXEC_DEFAULT attribute flag that closes all file descriptors on exec. We now dyamically detect the OS version and do the right thing. llvm-svn: 198776
* <rdar://problem/15639995>Han Ming Ong2013-12-191-19/+8
| | | | | | Allow the root XPC launcher to launch any target as root. llvm-svn: 197634
* Remove useless includesJean-Daniel Dupas2013-12-121-3/+0
| | | | llvm-svn: 197147
* Enable POSIX_SPAWN_CLOEXEC_DEFAULT (a darwin specific flag) when available ↵Greg Clayton2013-12-041-4/+4
| | | | | | when using posix_spawn to spawn processes to close all file handles. llvm-svn: 196404
* Expose SBPlatform through the public API.Greg Clayton2013-11-201-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example code: remote_platform = lldb.SBPlatform("remote-macosx"); remote_platform.SetWorkingDirectory("/private/tmp") debugger.SetSelectedPlatform(remote_platform) connect_options = lldb.SBPlatformConnectOptions("connect://localhost:1111"); err = remote_platform.ConnectRemote(connect_options) if err.Success(): print >> result, 'Connected to remote platform:' print >> result, 'hostname: %s' % (remote_platform.GetHostname()) src = lldb.SBFileSpec("/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework", False) dst = lldb.SBFileSpec() # copy src to platform working directory since "dst" is empty err = remote_platform.Install(src, dst); if err.Success(): print >> result, '%s installed successfully' % (src) else: print >> result, 'error: failed to install "%s": %s' % (src, err) Implemented many calls needed in lldb-platform to be able to install a directory that contains symlinks, file and directories. The remote lldb-platform can now launch GDB servers on the remote system so that remote debugging can be spawned through the remote platform when connected to a remote platform. The API in SBPlatform is subject to change and will be getting many new functions. llvm-svn: 195273
* <rdar://problem/14701270>Han Ming Ong2013-09-231-4/+5
| | | | | | When logged in as root, just launch debugserver regularly. llvm-svn: 191230
* Fix some names in the wake of my Mach-O changes to LLVM.Charles Davis2013-08-272-22/+21
| | | | llvm-svn: 189317
* merge lldb-platform-work branch (and assorted fixes) into trunkDaniel Malea2013-08-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This merge brings in the improved 'platform' command that knows how to interface with remote machines; that is, query OS/kernel information, push and pull files, run shell commands, etc... and implementation for the new communication packets that back that interface, at least on Darwin based operating systems via the POSIXPlatform class. Linux support is coming soon. Verified the test suite runs cleanly on Linux (x86_64), build OK on Mac OS X Mountain Lion. Additional improvements (not in the source SVN branch 'lldb-platform-work'): - cmake build scripts for lldb-platform - cleanup test suite - documentation stub for qPlatform_RunCommand - use log class instead of printf() directly - reverted work-in-progress-looking changes from test/types/TestAbstract.py that work towards running the test suite remotely. - add new logging category 'platform' Reviewers: Matt Kopec, Greg Clayton Review: http://llvm-reviews.chandlerc.com/D1493 llvm-svn: 189295
* Fixed a potential crash in the GetOSVersion codeSean Callanan2013-07-231-1/+1
| | | | | | caused by a CFStringRef going out of scope. llvm-svn: 186912
* Bump version number to 310.99.0.Jason Molenda2013-07-152-2/+2
| | | | llvm-svn: 186304
* Add support for listing inferior thread names on Linux.Matt Kopec2013-07-101-0/+33
| | | | llvm-svn: 186033
* <rdar://problem/14083928>Enrico Granata2013-06-061-0/+6
| | | | | | Making sure that if you invoke LLDB as lldb ./someBinary you can then launch the inferior with process launch —tty llvm-svn: 183453
* <rdar://problem/13752848>Han Ming Ong2013-05-311-0/+2
| | | | | | Add 'JoinExistingSession' to XPC for root debugging. llvm-svn: 183037
* Remove the UUID::GetAsCString() method which required a buffer to save the Jason Molenda2013-05-031-11/+7
| | | | | | | UUID string in; added UUID::GetAsString() which returns the uuid string in a std::string. Updated callers to use the new method. llvm-svn: 181078
* Cleanup logging to use the new "std::string FileSpec::GetPath()" function. ↵Greg Clayton2013-04-291-3/+2
| | | | | | | | | | | Also added a similar function for modules: std::string Module::GetSpecificationDescription () const; This returns the module as "/usr/lib/libfoo.dylib" for normal files (calls "std::string FileSpec::GetPath()" on m_file) but it also might include the object name in case the module is for a .o file in a BSD archive ("/usr/lib/libfoo.a(bar.o)"). Cleaned up necessary logging code to use it. llvm-svn: 180717
* More CMake fixes for OS X.Filipe Cabecinhas2013-04-251-1/+9
| | | | llvm-svn: 180243
* <rdar://problem/13665446>Greg Clayton2013-04-241-0/+26
| | | | | | Pass the user set target.env-vars when launching through a terminal. llvm-svn: 180201
* <rdar://problem/13521159>Greg Clayton2013-03-271-18/+18
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Initial checkin of a new project: LLDB Performance Testing InfrastructureEnrico Granata2013-03-082-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very basic implementation of a library that easily allows to drive LLDB.framework to write test cases for performance This is separate from the LLDB testsuite in test/ in that: a) this uses C++ instead of Python to avoid measures being affected by SWIG b) this is in very early development and needs lots of tweaking before it can be considered functionally complete c) this is not meant to test correctness but to help catch performance regressions There is a sample application built against the library (in darwin/sketch) that uses the famous sample app Sketch as an inferior to measure certain basic parameters of LLDB's behavior. The resulting output is a PLIST much like the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <array> <dict> <key>fetch-frames</key> <real>0.13161715522222225</real> </dict> <dict> <key>file-line-bkpt</key> <real>0.029111678750000002</real> </dict> <dict> <key>fetch-modules</key> <real>0.00026376766666666668</real> </dict> <dict> <key>fetch-vars</key> <real>0.17820429311111111</real> </dict> <dict> <key>run-expr</key> <real>0.029676525769230768</real> </dict> </array> </plist> Areas for improvement: - code cleanups (I will be out of the office for a couple days this coming week, but please keep ideas coming!) - more metrics and test cases - better error checking This toolkit also comprises a simple event-loop-driven controller for LLDB, similar yet much simpler to what the Driver does to implement the lldb command-line tool. llvm-svn: 176715
* Updated Apple LLDB version to lldb-300.99.0. AlsoSean Callanan2013-03-072-2/+2
| | | | | | | updated the build system to support the new Apple LLDB versioning scheme. llvm-svn: 176662
* <rdar://problem/13119170>Han Ming Ong2013-03-061-0/+30
| | | | | | Reap the child process (debugserver) when it is done. llvm-svn: 176594
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-211-0/+6
| | | | | | | | | | | | | | - generate-vers.pl has to be called by cmake to generate the version number - parallel builds not yet supported; dependency on clang must be explicitly specified Tested on Linux. - Building on Mac will require code-signing logic to be implemented. - Building on Windows will require OS-detection logic and some selective directory inclusion Thanks to Carlo Kok (who originally prepared these CMakefiles for Windows) and Ben Langmuir who ported them to Linux! llvm-svn: 175795
* Fixed a crash when we didn't get a plist but triedSean Callanan2013-02-081-1/+1
| | | | | | | | to pass it to CFGetTypeID() anyway. <rdar://problem/13181904> llvm-svn: 174772
* <rdar://problem/13092722>Greg Clayton2013-02-011-12/+0
| | | | | | | | | | Fix in loading mach files from memory when using DynamicLoaderMacOSXDYLD. Removed the uuid mismatch warning that could be spit out and any time during debugging and removed the test case that was looking for that. Currently the "add-dsym" or "target symbols add" command will report an error when the UUID's don't match. Be more careful when checking and resolving section + offset addresses to make sure none of the base addresses are invalid. llvm-svn: 174222
* <rdar://problem/13069948>Greg Clayton2013-01-252-7/+7
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* Fixed a bug where we could accept the wrongSean Callanan2012-12-211-1/+1
| | | | | | | | slice of a fat dSYM in certain cases. <rdar://problem/12921206> llvm-svn: 170926
* Fixed two conditionals that I accidentallySean Callanan2012-12-141-2/+2
| | | | | | | | reversed in r170152. <rdar://problem/12886584> llvm-svn: 170256
* Removed the == and != operators from ArchSpec, sinceSean Callanan2012-12-131-3/+3
| | | | | | | | | | | | equality can be strict or loose and we want code to explicitly choose one or the other. Also renamed the Compare function to IsEqualTo, to avoid confusion. <rdar://problem/12856749> llvm-svn: 170152
* Removed debugging code.Han Ming Ong2012-12-111-1/+0
| | | | llvm-svn: 169799
* <rdar://problem/12850287>Han Ming Ong2012-12-101-20/+33
| | | | | | When there is XPC connection error, we will report it now. llvm-svn: 169787
* Change the MacOSX Symbols::DownloadObjectAndSymbolFile to look upJason Molenda2012-10-301-3/+19
| | | | | | | | | "~rc" via getpwnam() instead of doing tilde expansion and doing soft-link dereferencing via realpath() - if we're pointing to a softlink, leave it as-is. <rdar://problem/12597698> llvm-svn: 167052
* Add a parameter to Symbols::DownloadObjectAndSymbolFile() to controlJason Molenda2012-10-091-2/+38
| | | | | | | | | | | | | | | | | | | whether we try to call an external program to load symbols unconditionally, or if we check the user's preferences before calling it. ProcessMachCore now sets CanJIT to false - we can't execute code in a core file. DynamicLoaderDarwinKernel::OSKextLoadedKextSummary::LoadImageUsingMemoryModule changed to load the kernel from an on-disk file if at all possible. Don't load the kext binaries out of memory from the remote systems - their linkedit doesn't seem to be in a good state and we'll error out down in SymbolVendorMacOSX if we try to use the in-memory images. Call Symbols::DownloadObjectAndSymbolFile to get the kext/kernel binary -- the external program may be able to give us a file path on the local filesystem instead of reading the binary / dSYM over a network drive every time. Fall back to calling Target::GetSharedModule() like before if DownloadObjectAndSymbolFile fails. llvm-svn: 165471
OpenPOWER on IntegriCloud