summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
* Creates a socket host object.Zachary Turner2014-08-064-11/+697
| | | | | | | | | | | | | | | | | | This patch moves the logic of many common socket operations into its own class lldb_private::Socket. It then modifies the ConnectionFileDescriptor class, and a few users of that class, to use this new Socket class instead of hardcoding socket logic directly. Finally, this patch creates a common interface called IOObject for any objects that support reading and writing, so that endpoints such as sockets and files can be treated the same. Differential Revision: http://reviews.llvm.org/D4641 Reviewed by: Todd Fiala, Greg Clayton llvm-svn: 214984
* 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
* Resolve the executable _before_ we try to get the module specifications.Greg Clayton2014-07-291-0/+11
| | | | | | | | Also fixed the host 32 and 64 bit arch to return "x86_64-apple-macosx" again instead of "x86_64-apple-" (unspecified OS) after recent changes. <rdar://problem/17845078> llvm-svn: 214223
* [Windows] Delegate str[n]casecmp to the appropriate MSVCRT func.Zachary Turner2014-07-291-19/+2
| | | | llvm-svn: 214197
* Fix compile error on Windows.Zachary Turner2014-07-291-1/+1
| | | | | | | A piece of a future patch accidentally made it in, this simply fixes the error. llvm-svn: 214161
* Use llvm Support functions to get the user's home directory.Zachary Turner2014-07-281-0/+18
| | | | | | | | | | | Assuming that the user's home directory is at ~ is incorrect on Windows. This patch delegates the request to LLVM's support library, which already provides a cross-platform implementation of this function. Differential Revision: http://reviews.llvm.org/D4674 llvm-svn: 214093
* Fix configure/make builds on MacOSX.Todd Fiala2014-07-241-0/+3
| | | | | | Change by Keno Fischer. llvm-svn: 213904
* Enable lldb-platform exe support for Linux.Todd Fiala2014-07-221-0/+23
| | | | | | | | | | | | | | This change enables lldb-platform for Linux. In addition, it does the following: * fixes Host::GetLLDBPath() to work on Linux/*BSD for ePathTypeSupportExecutableDir-relative paths. * adds more logging and comments around lldb-platform startup and remote lldb-platform usage. * refactors lldb-platform remote-* support for Darwin and Linux into PlatformPOSIX. This, in theory, is the bulk of what is needed for *BSD to make remote connections to lldb-platform as well (although I haven't tested that yet). FreeBSD can make similar changes to their Platform* as was made here for PlatformLinux to pick up the rest of the bits. * teaches GDBRemoteCommunication to use lldb-gdbserver for non-Apple hosts. llvm-svn: 213707
* Host: Fix a pointer-to-function to void-pointer castDavid Majnemer2014-07-221-1/+2
| | | | | | | | | | | | reinterpret_cast may not convert a pointer-to-function to a void-pointer. Take a detour through intptr_t and *then* convert to a pointer-to-function. This silences a warning emitted by GCC when building LLDB. Differential Revision: http://reviews.llvm.org/D4631 llvm-svn: 213693
* Make lldb -P work on Windows.Zachary Turner2014-07-182-1/+19
| | | | | | | | | | | | | | lldb -P, which outputs its python path, works by using Host-layer facilities to get information about the loaded python module. This Host functionality was unimplemented on Windows, so this patch implements it. Additionally, it removes a pexpect dependency from the test runner and uses an equivalent invocation of subprocess. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4548 llvm-svn: 213410
* Fixing warnings shouldn't introduce a crasher.Greg Clayton2014-07-181-1/+3
| | | | | | | | Fix the warning the correct way without making things crash when ENABLE_MUTEX_ERROR_CHECKING is non enabled. <rdar://problem/17703039> llvm-svn: 213394
* Add Host::MAX_THREAD_NAME_LENGTH constant.Todd Fiala2014-07-161-0/+9
| | | | | | | | | | | | | | | This value gets set to a max uint32_t value when there is no known limit; otherwise, it is set to a value appropriate for the platform. For the moment, only Linux, FreeBSD and NetBSD set it to 16. All other platforms set it to the max uint32_t value. Modifies the Process private state thread names to fit within a 16-character limit when the max thread name length is <= 16. These guarantee that the thread names can be distinguished within the first 16 characters. Prior to this change, those threads had names in the final dotted name segment that were not distinguishable within the first 16 characters. llvm-svn: 213183
* lldb.LLDB_ARCH_DEFAULT now works correctly on Macs with haswell enabled kernels.Greg Clayton2014-07-141-9/+15
| | | | | | <rdar://problem/17604133> llvm-svn: 213004
* Fix tests broken by the OptionValidator changes.Zachary Turner2014-07-091-1/+16
| | | | | | | | | | | | | | | | | | | | | | | The getopt library has a structure called option (lowercase). We have a structure called Option (uppercase). previously the two structures had exactly the same definitions, and we were doing a C-style cast of an Option* to an option*. C-style casts don't bother to warn you when you cast to unrelated types, but in the original OptionValidator patch I modified the definition of Option. This patch fixes the errors by building an array of option structures and filling it out the correct way before passing it to the getopt library. This also fixes one other source of test failures: an uninitialized read that occurs due to not initializing a field of the OptionDefinition. Reviewed By: Todd Fiala Differential Revision: http://reviews.llvm.org/D4425 llvm-svn: 212628
* __arm64__ and __aarch64__ #ifdef adjustmentsTodd Fiala2014-07-093-10/+10
| | | | | | | | 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
* Implment "platform process list" for Windows.Zachary Turner2014-07-082-2/+125
| | | | | | | | | | | | | | | | | | This patch implements basic functionality of the "platform process list" command for Windows. Currently this has the following limitations. * Certain types of filtering are not enabled (e.g. filtering by architecture with -a), although most filters work. * The username of the process is not yet obtained. * Using -v to list verbose information generates an error. * The architecture column displays the entire triple, leading to misaligned formatting of the printed table. Reviewed by: Greg Clayton Differential Revision: http://reviews.llvm.org/D4413 llvm-svn: 212510
* Fix compilation errors introduced by host Pipe abstractionZachary Turner2014-07-031-6/+5
| | | | | | on Windows. llvm-svn: 212255
* Add host layer support for pipes.Greg Clayton2014-07-022-0/+173
| | | | | | | | | | | Windows does support pipes, but they do so in a slightly different way. Added a Host layer which abstracts the use of pipes into a new Pipe class that everyone can use. Windows benefits include: - Being able to interrupt running processes when IO is directly hooked up - being able to interrupt long running python scripts - being able to interrupt anything based on ConnectionFileDescriptor llvm-svn: 212220
* 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-014-10/+10
| | | | llvm-svn: 212132
* Add lldb-gdbserver support for Linux x86_64.Todd Fiala2014-06-3012-0/+1692
| | | | | | | | | | | | | | | | | | | | | This change brings in lldb-gdbserver (llgs) specifically for Linux x86_64. (More architectures coming soon). Not every debugserver option is covered yet. Currently the lldb-gdbserver command line can start unattached, start attached to a pid (process-name attach not supported yet), or accept lldb attaching and launching a process or connecting by process id. The history of this large change can be found here: https://github.com/tfiala/lldb/tree/dev-tfiala-native-protocol-linux-x86_64 Until mid/late April, I was not sharing the work and continued to rebase it off of head (developed via id tfiala@google.com). I switched over to user todd.fiala@gmail.com in the middle, and once I went to github, I did merges rather than rebasing so I could share with others. llvm-svn: 212069
* Factored out Linux proc file reading into separate class.Todd Fiala2014-06-301-62/+7
| | | | | | | | | | | | | Both NativeProcessLinux (in llgs branch) and Linux Host.cpp had similar code to handle /proc file reading. I factored that out into a new Linux-specific ProcFileReader class and added a method that the llgs branch will use for line-by-line parsing. This change also adds numerous Linux-specific files to Xcode that were missing from the Xcode project files. Related to https://github.com/tfiala/lldb/issues/27 llvm-svn: 212015
* lldb: remove adhoc implementation of array_sizeofSaleem Abdulrasool2014-06-272-3/+5
| | | | | | | | Replace adhoc inline implementation of llvm::array_lengthof in favour of the implementation in LLVM. This is simply a cleanup change, no functional change intended. llvm-svn: 211868
* 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
* Windows fix: Condition::Wait returned failure when it actually succeeded ↵Colin Riley2014-06-031-1/+1
| | | | | | (SleepConditionVariableCS returns non-zero for success) llvm-svn: 210104
* Fix most of the remaining Windows build warnings.Todd Fiala2014-06-021-1/+6
| | | | | | | | See http://reviews.llvm.org/D3944 for more details. Change by Zachary Turner. llvm-svn: 210035
* Don't use libc's "char *basename(char *)" or "char *dirname(char *)" as they ↵Greg Clayton2014-05-301-35/+8
| | | | | | | | | | are not thread safe. I switched the lldb_private::FileSpec code over to use "llvm::StringRef llvm::sys::path::filename(llvm::StringRef)" for basename() and "llvm::StringRef llvm::sys::path::parent_path(llvm::StringRef)" for dirname(). <rdar://problem/16870083> llvm-svn: 209917
* 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
* Fix Windows warnings.Todd Fiala2014-05-281-0/+1
| | | | | | | | | | This fixes a number of trivial warnings in the Windows build. This is part of a larger effort to make the Windows build warning-free. See http://reviews.llvm.org/D3914 for more details. Change by Zachary Turner llvm-svn: 209749
* Implement Host::GetThreadName for FreeBSDEd Maste2014-05-211-0/+29
| | | | llvm-svn: 209312
* "process kill" and "process detach" were causing double prompts or prompts ↵Greg Clayton2014-05-081-46/+35
| | | | | | | | that would overwrite each other. Fixed now. <rdar://problem/16547729> llvm-svn: 208369
* control-D on empty line to quit lldb stopped working in Release builds on ↵Greg Clayton2014-05-061-1/+2
| | | | | | | | MacOSX. <rdar://problem/16822217> llvm-svn: 208117
* Use posix_spawn on NetBSD as well.Joerg Sonnenberger2014-05-021-6/+6
| | | | llvm-svn: 207864
* EOF is outside the value range of char on architectures with unsignedJoerg Sonnenberger2014-05-021-1/+1
| | | | | | char like ARM. Check for EOF explicitly. llvm-svn: 207859
* Fixed CTRL+C related issues:Greg Clayton2014-05-021-27/+65
| | | | | | | | | | | | - CTRL+C wasn't clearing the command in lldb - CTRL+C doesn't work in python macros in lldb - Ctrl+C no longer interrupts the running process that you attach to <rdar://problem/15949205> <rdar://problem/16778652> <rdar://problem/16774411> llvm-svn: 207816
* Since one or more Editline instances of the same kind (lldb commands, ↵Greg Clayton2014-04-251-57/+157
| | | | | | | | expressions, etc) can exist at once, they should all shared a ref counted history object. Now they do. llvm-svn: 207293
* Change the default key bindings for multi-line mode:Greg Clayton2014-04-231-2/+3
| | | | | | | Up/down arrows select next/prev line in multi-line mode CTRL+N and CTRL+P do next/prev history llvm-svn: 207033
* Fixed a case where if someone added a "bind -v" to their ~/.editrc file, key ↵Greg Clayton2014-04-231-6/+18
| | | | | | | | | | mappings would get messed up. I fixed this by only doing el_set(e, EL_BIND, ...) calls before sourcing the .editrc files. <rdar://problem/16614095> llvm-svn: 207005
* sweep up -Wformat warnings from gccSaleem Abdulrasool2014-04-041-11/+7
| | | | | | | This is a purely mechanical change explicitly casting any parameters for printf style conversion. This cleans up the warnings emitted by gcc 4.8 on Linux. llvm-svn: 205607
* 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
* Use getpgid() with waitpid() in case the process pgid is not equal to its ↵Andrew MacPherson2014-04-021-1/+1
| | | | | | pid, as is the case with a forked subprocess. Also a couple of fixes for unit test failures from Todd Fiala. llvm-svn: 205405
* sanitise sign comparisonsSaleem Abdulrasool2014-04-024-12/+14
| | | | | | | | 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
* Add mips64 to the list of 64-bit Host architecturesEd Maste2014-04-011-0/+1
| | | | llvm-svn: 205333
* lldb arm64 import.Jason Molenda2014-03-293-10/+34
| | | | | | | | | | | | | | | | 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
* Add the "lldb_complete" .editrc command back in case veteran users of LLDB ↵Greg Clayton2014-03-261-1/+2
| | | | | | | | had .editrc key mappings in their ~/.editrc. <rdar://problem/16279283> llvm-svn: 204870
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-3/+66
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* Change the type in va_arg call from char to int.Hafiz Abid Qadeer2014-03-201-1/+1
| | | | | | It is supposed to take fully promoted types. llvm-svn: 204336
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-202-29/+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
OpenPOWER on IntegriCloud