summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
...
* Adding CMake build system to LLDB. Some known issues remain:Daniel Malea2013-02-215-0/+33
| | | | | | | | | | | | | | - 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
* Added a host call to get the number of CPUs. It should work on all POSIX ↵Greg Clayton2013-02-171-23/+72
| | | | | | unixes, linux and Windows. llvm-svn: 175405
* 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-254-12/+12
| | | | | | | | | | | | 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
* Add initial support to trace spawned threads in a process on Linux.Matt Kopec2013-01-081-7/+12
| | | | llvm-svn: 171864
* Fix lldb -P on LinuxDaniel Malea2013-01-041-8/+12
| | | | | | | | - now prints the correct PYTHONPATH - update dotest.py to use lldb -P result correctly - resolves TestPublicAPIHeaders test failure (on Linux) llvm-svn: 171558
* 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
* <rdar://problem/12446222>Enrico Granata2012-12-191-1/+34
| | | | | | | | | | | Implement the ability for Python commands to be interrupted by pressing CTRL+C Also add a new Mutex subclass that attempts to be helpful for debugging by logging actions performed on it FYI of all interested - there is a separate deadlocking issue related to how LLDB dispatches CTRL+C that might cause LLDB to deadlock upon pressing CTRL+C while in a Python command. This is not a regression, and was just previously masked by us not even trying to bail out of Python commands, so that it would not be clear from a user perspective whether we were deadlocked or stuck in an inconsistent state within the Python interpreter. llvm-svn: 170612
* 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
* More Linux warnings fixes (remove default labels as needed):Daniel Malea2012-12-073-8/+0
| | | | | | | | - as per http://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations Patch by Matt Kopec! llvm-svn: 169633
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* Save and restore terminal state when lldb is suspended with SIGTSTP and ↵Jim Ingham2012-11-301-0/+9
| | | | | | | | | resumed with SIGCONT. Readline & gdb have a bunch of code to handle older UNIX'es with other job control mechanisms. I didn't try to replicate that. llvm-svn: 169032
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-293-8/+8
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Linux fix: remove reference to cellspu (backend removed in llvm r167984)Daniel Malea2012-11-191-1/+0
| | | | llvm-svn: 168322
* Fix a little think-o. In FileSpec::operator== we were trying to figure out ↵Jim Ingham2012-11-031-1/+1
| | | | | | | | | | | whether the rhs file was resolved or not by comparing the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name. We really meant to compare it with the rhs FileSpec's directory name... <rdar://problem/12438838> llvm-svn: 167349
* Caught two cases where we were passing a Stream* without checking for NULLEnrico Granata2012-11-031-4/+7
| | | | llvm-svn: 167342
* 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
* Fixed File::SeekFromEnd() to use SEEK_END insted of SEEK_CUR.Greg Clayton2012-10-301-1/+1
| | | | llvm-svn: 167025
* <rdar://problem/12462048>Greg Clayton2012-10-182-1/+25
| | | | | | | | | | <rdar://problem/12068650> More fixes to how we handle paths that are used to create a target. This modification centralizes the location where and how what the user specifies gets resolved. Prior to this fix, the TargetList::CreateTarget variants took a FileSpec object which meant everyone had the opportunity to resolve the path their own way. Now both CreateTarget variants take a "const char *use_exe_path" which allows the TargetList::CreateTarget to centralize where the resolving happens and "do the right thing". llvm-svn: 166186
* <rdar://problem/12462048>Greg Clayton2012-10-171-2/+1
| | | | | | | | | | | | | | | | | | | LLDB changes argv[0] when debugging a symlink. Now we have the notion of argv0 in the target settings: target.arg0 (string) = There is also the program argument that are separate from the first argument that have existed for a while: target.run-args (arguments) = When running "target create <exe>", we will place the untouched "<exe>" into target.arg0 to ensure when we run, we run with what the user typed. This has been added to the ProcessLaunchInfo and all other needed places so we always carry around the: - resolved executable path - argv0 - program args Some systems may not support separating argv0 from the resolved executable path and the ProcessLaunchInfo needs to carry all of this information along so that each platform can make that decision. llvm-svn: 166137
* Patch from Andrew Kaylor that centralized where the info for:Greg Clayton2012-10-121-12/+0
| | | | | | | | | ConstString Host::GetVendorString(); ConstString Host::GetOSString(); comes from. It now all comes from the Host::GetArchitecture (eSystemDefaultArchitecture) like the Apple build was doing to minimize the number of places that need to be updated when Host::GetArchitecture () is called. llvm-svn: 165805
* Patch from Andrew Kaylor that fixes Linux default host triple values.Greg Clayton2012-10-111-0/+5
| | | | llvm-svn: 165728
* Patch from Dan Malea to fix a build break I introduced yesterday.Jason Molenda2012-10-091-1/+1
| | | | | | Thanks again Dan! llvm-svn: 165519
* 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
* Symbols::LocateMacOSXFilesUsingDebugSymbols() - perform tildeJason Molenda2012-10-051-1/+1
| | | | | | expansion on the dSYM path we find if it starts with a tilde. llvm-svn: 165299
* Change DynamicLoaderDarwinKernel::OSKextLoadedKextSummary to useJason Molenda2012-10-021-3/+3
| | | | | | | | | | | | | | | | | the Symbols::LocateExecutableObjectFile method to locate kexts and kernels instead of copying them out of the memory of the remote system. This is the fix for <rdar://problem/12416384>. Fix a variable shadowing problem in Symbols::LocateMacOSXFilesUsingDebugSymbols which caused the symbol rich executable binaries to not be found even if they were listed in the dSYM Info.plist. Change Symbols::DownloadObjectAndSymbolFile to ignore dsymForUUID's negative cache - this is typically being called by the user and we should try even if there's a incorrect entry in the negative cache. llvm-svn: 165061
* Implementing plugins that provide commands.Enrico Granata2012-09-281-0/+27
| | | | | | | | | | | | | | | | | | | This checkin adds the capability for LLDB to load plugins from external dylibs that can provide new commands It exports an SBCommand class from the public API layer, and a new SBCommandPluginInterface There is a minimal load-only plugin manager built into the debugger, which can be accessed via Debugger::LoadPlugin. Plugins are loaded from two locations at debugger startup (LLDB.framework/Resources/PlugIns and ~/Library/Application Support/LLDB/PlugIns) and more can be (re)loaded via the "plugin load" command For an example of how to make a plugin, refer to the fooplugin.cpp file in examples/plugins/commands Caveats: Currently, the new API objects and features are not exposed via Python. The new commands can only be "parsed" (i.e. not raw) and get their command line via a char** parameter (we do not expose our internal Args object) There is no unloading feature, which can potentially lead to leaks if you overwrite the commands by reloading the same or different plugins There is no API exposed for option parsing, which means you may need to use getopt or roll-your-own llvm-svn: 164865
* Wrapped up the work I am going to do for now for the "add-dsym" or "target ↵Greg Clayton2012-09-271-42/+123
| | | | | | | | | | | | | | | | | | | | symfile add" command. We can now do: Specify a path to a debug symbols file: (lldb) add-dsym <path-to-dsym> Go and download the dSYM file for the "libunc.dylib" module in your target: (lldb) add-dsym --shlib libunc.dylib Go and download the dSYM given a UUID: (lldb) add-dsym --uuid <UUID> Go and download the dSYM file for the current frame: (lldb) add-dsym --frame llvm-svn: 164806
* Added the ability to download a symboled executable and symbol file given a ↵Greg Clayton2012-09-274-14/+149
| | | | | | UUID. llvm-svn: 164753
* Bump to lldb-168, debugserver-193.Jason Molenda2012-09-202-2/+2
| | | | llvm-svn: 164291
* <rdar://problem/12219840>Greg Clayton2012-09-181-1/+7
| | | | | | Don't leak mach ports when calling "mach_thread_self()". llvm-svn: 164152
* Stop using the "%z" size_t modifier and cast all size_t values to uint64_t. ↵Greg Clayton2012-09-181-1/+1
| | | | | | Some platforms don't support this modification. llvm-svn: 164148
* <rdar://problem/11374963>Greg Clayton2012-09-141-3/+13
| | | | | | When attaching on ARM hosted debuggers we were incorrectly setting the triple to "arm-apple-ios". This was happening because in the post attach code, we would lookup the process info through the platform, and if successful, we would get the architecture of the process. This code uses sysctl() calls, but we can only get the CPU type, not the subtype, so we would get ARM for CPU type and nothing for the cpu subtype, so this would map to "arm-apple-ios". I fixed the code to get the cpu subtype from "hw.cpusubtype" which is what we really want for ARM, and not the architecture is already correct. "add-dsym" then works like a charm. I also improved the command output when the architecture changes to show the entire triple instead of just the arch name. llvm-svn: 163868
* <rdar://problem/11374963>Greg Clayton2012-09-122-7/+14
| | | | | | Partial fix for the above radar where we now resolve dsym mach-o files within the dSYM bundle when using "add-dsym" through the platform. llvm-svn: 163676
* Some more typing-related fixes.Filipe Cabecinhas2012-09-111-4/+4
| | | | llvm-svn: 163641
* Patch from Andrew Kaylor for linux:Greg Clayton2012-09-071-0/+6
| | | | | | | | | | | | | | | The attached patch adds support for debugging 32-bit processes when running a 64-bit lldb on an x86_64 Linux system. Making this work required two basic changes: 1) Getting lldb to report that it could debug 32-bit processes 2) Changing an assumption about how ptrace works when debugging cross-platform For the first change, I took a conservative approach and only enabled this for x86_64 Linux platforms. It may be that the change I made in Host.cpp could be extended to other 64-bit Linux platforms, but I'm not familiar enough with the other platforms to know for sure. For the second change, the Linux ProcessMonitor class was assuming that ptrace(PTRACE_[PEEK|POKE]DATA...) would read/write a "word" based on the child process word size. However, the ptrace documentation says that the "word" size read or written is "determined by the OS variant." I verified experimentally that when ptracing a 32-bit child from a 64-bit parent a 64-bit word is read or written. llvm-svn: 163398
* OptionValueFileSpec had an accessor to read the contents of the file and ↵Greg Clayton2012-08-302-3/+33
| | | | | | return the data. This can end up being used to get the string contents of a text file and could end up not being NULL terminated. I added accessors to get the file contents raw, or with a null terminator. Added the needed calls to make this happen in the FileSpec and File classes. llvm-svn: 162921
* <rdar://problem/11757916>Greg Clayton2012-08-292-9/+33
| | | | | | | | | | | | Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes: - Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file". - modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly - Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was. - modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile() Cleaned up header includes a bit as well. llvm-svn: 162860
* Reimplemented the code that backed the "settings" in lldb. There were many ↵Greg Clayton2012-08-221-7/+1
| | | | | | | | | | | | | issues with the previous implementation: - no setting auto completion - very manual and error prone way of getting/setting variables - tons of code duplication - useless instance names for processes, threads Now settings can easily be defined like option values. The new settings makes use of the "OptionValue" classes so we can re-use the option value code that we use to set settings in command options. No more instances, just "does the right thing". llvm-svn: 162366
* rdar://problem/11324515Johnny Chen2012-08-221-2/+6
| | | | | | | 'add-dsym' (aka 'target symbols add') should display error messages when dsym file is not found or the dsym uuid does not match any existing modules. Add TestAddDsymCommand.py test file. llvm-svn: 162332
* Updating Xcode project version numbers for lldb-165 and debugserver-192Sean Callanan2012-08-072-2/+2
| | | | llvm-svn: 161374
* Updating Xcode project version numbers for lldb-164 and debugserver-191Sean Callanan2012-08-022-2/+2
| | | | llvm-svn: 161209
* Make glibc and its developers happy. Circumvent the lack of strlcat in glibc.Filipe Cabecinhas2012-07-301-1/+3
| | | | llvm-svn: 160979
* Fixed ePathTypePythonDir for Linux and FreeBSD (at least). This works for ↵Filipe Cabecinhas2012-07-301-3/+7
| | | | | | non-installed compilations. I will test further. llvm-svn: 160963
* Updating Xcode project version numbers for lldb-163 and debugserver-190Sean Callanan2012-07-262-2/+2
| | | | llvm-svn: 160770
* Call "drain" on the auto release pool as it will do the right thing for both ↵Greg Clayton2012-07-171-5/+1
| | | | | | GC and non-GC apps. It will also quiet the static analyzer. llvm-svn: 160390
OpenPOWER on IntegriCloud