summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
* Renamed system plugin directory to address https://bugs.swift.org/browse/SR-1093Kate Stone2016-04-271-1/+1
| | | | llvm-svn: 267749
* Host: fix some -Wformat-pedantic warningsSaleem Abdulrasool2016-04-211-6/+6
| | | | | | Add explicit casts for function pointer to void * for %p conversion. NFC. llvm-svn: 267000
* llvm::sys::path::home_directory() relies on having "HOME" set in the ↵Greg Clayton2016-04-191-1/+15
| | | | | | | | | | environment and that might not always be set. Our FileSpec class uses this function to resolve any paths that start with "~/" on systems that support home directories as '~'. I have modified FileSpec::ResolveUsername (llvm::SmallVectorImpl<char> &path) to deal with the cases where llvm::sys::path::home_directory() returns false by digging a little further on unix systems and setting "HOME" in the environment so that subsequent calls to llvm::sys::path::home_directory() will succeed. I also added a test to ensure we don't regress. <rdar://problem/25342377> llvm-svn: 266832
* Fix Windows build.Chaoren Lin2016-04-191-0/+1
| | | | llvm-svn: 266702
* Support Linux on SystemZ as platformUlrich Weigand2016-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Linux on SystemZ: - A new ArchSpec value of eCore_s390x_generic - A new directory Plugins/ABI/SysV-s390x providing an ABI implementation - Register context support - Native Linux support including watchpoint support - ELF core file support - Misc. support throughout the code base (e.g. breakpoint opcodes) - Test case updates to support the platform This should provide complete support for debugging the SystemZ platform. Not yet supported are optional features like transaction support (zEC12) or SIMD vector support (z13). There is no instruction emulation, since our ABI requires that all code provide correct DWARF CFI at all PC locations in .eh_frame to support unwinding (i.e. -fasynchronous-unwind-tables is on by default). The implementation follows existing platforms in a mostly straightforward manner. A couple of things that are different: - We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers, since some registers (access register) reside at offsets in the user area that are multiples of 4, but the PTRACE_PEEKUSER interface only allows accessing aligned 8-byte blocks in the user area. Instead, we use a s390 specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that allows accessing a whole block of the user area in one go, so in effect allowing to treat parts of the user area as register sets. - SystemZ hardware does not provide any means to implement read watchpoints, only write watchpoints. In fact, we can only support a *single* write watchpoint (but this can span a range of arbitrary size). In LLDB this means we support only a single watchpoint. I've set all test cases that require read watchpoints (or multiple watchpoints) to expected failure on the platform. [ Note that there were two test cases that install a read/write watchpoint even though they nowhere rely on the "read" property. I've changed those to simply use plain write watchpoints. ] Differential Revision: http://reviews.llvm.org/D18978 llvm-svn: 266308
* FileSpec: make matching separator-agnostic againPavel Labath2016-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: In D18689, I removed the call to Normalize() in FileSpec::SetFile, because it no longer seemed needed, and it resolved a quirk in the FileSpec API (spec.GetCString() returnes a path with backslashes, but spec.GetDirectory().GetCString() has forward slashes). This turned out to be a problem because we would consider paths with different separators as different (which led to unresolved breakpoints for instance). Here, I am putting back in the call to Normalize() and adding a unittest for FileSpec::Equal. I am commenting out the GetDirectory unittests until we figure out the what is the expected behaviour here. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D19060 llvm-svn: 266286
* Revert to using libdispatch to reap threads on MacOSX. Code was accidentally ↵Greg Clayton2016-04-121-21/+33
| | | | | | | | checked in that is now reverted. <rdar://problem/25643874> llvm-svn: 266118
* Make FileSpec handling platform-independentPavel Labath2016-04-041-26/+100
| | | | | | | | | | | | | | | | | Summary: Even though FileSpec attempted to handle both kinds of path syntaxes (posix and windows) on both platforms, it relied on the llvm path library to do its work, whose behavior differed on different platforms. This led to subtle differences in FileSpec behavior between platforms. This replaces the pieces of the llvm library with our own implementations. The functions are simply copied from llvm, with #ifdefs replaced by runtime checks for ePathSyntaxWindows. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18689 llvm-svn: 265299
* Unicode support on Win32.Zachary Turner2016-03-2212-149/+378
| | | | | | | | | | | | | Win32 API calls that are Unicode aware require wide character strings, but LLDB uses UTF8 everywhere. This patch does conversions wherever necessary when passing strings into and out of Win32 API calls. Patch by Cameron Differential Revision: http://reviews.llvm.org/D17107 Reviewed By: zturner, amccarth llvm-svn: 264074
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-191-29/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* Fix null pointer "dereference" in DomainSocketPavel Labath2016-03-161-1/+1
| | | | | | offsetof is the official way to get the offset of a field in a structure. llvm-svn: 263637
* Remove unnecessary <limits> includes.Jim Ingham2016-03-151-2/+4
| | | | llvm-svn: 263588
* Fix a couple of cornercases in FileSpec + testsPavel Labath2016-03-111-24/+22
| | | | | | | | | | | | | | | | | | | Summary: This fixes a couple of corner cases in FileSpec, related to AppendPathComponent and handling of root directory (/) file spec. I add a bunch of unit tests for the new behavior. Summary of changes: FileSpec("/bar").GetCString(): before "//bar", after "/bar". FileSpec("/").CopyByAppendingPathComponent("bar").GetCString(): before "//bar", after "/bar". FileSpec("C:", ePathSyntaxWindows).CopyByAppendingPathComponent("bar").GetCString(): before "C:/bar", after "C:\bar". Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18044 llvm-svn: 263207
* Fixed the python interpreter so that it correctly inherits the top ↵Greg Clayton2016-03-101-51/+0
| | | | | | | | | | IOHandler's files instead of always using stdin/out/err. Removed lldb_private::File::Duplicate() and the copy constructor and the assignment operator that used to duplicate the file handles and made them private so no one uses them. Previously the lldb_private::File::Duplicate() function duplicated files that used file descriptors, (int) but not file streams (FILE *), so the lldb_private::File::Duplicate() function only worked some of the time. No one else excep thee ScriptInterpreterPython was using these functions, so that aren't needed nor desired. Previously every time you would drop into the python interpreter we would duplicate files, and now we avoid this file churn. <rdar://problem/24877720> llvm-svn: 263161
* Add support for reading line tables from PDB files.Zachary Turner2016-03-022-7/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | PDB is Microsoft's debug information format, and although we cannot yet generate it, we still must be able to consume it. Reason for this is that debug information for system libraries (e.g. kernel32, C Runtime Library, etc) only have debug info in PDB format, so in order to be able to support debugging of system code, we must support it. Currently this code should compile on every platform, but on non-Windows platforms the PDB plugin will return 0 capabilities, meaning that for now PDB is only supported on Windows. This may change in the future, but the API is designed in such a way that this will require few (if any) changes on the LLDB side. In the future we can just flip a switch and everything will work. This patch only adds support for line tables. It does not return information about functions, types, global variables, or anything else. This functionality will be added in a followup patch. Differential Revision: http://reviews.llvm.org/D17363 Reviewed by: Greg Clayton llvm-svn: 262528
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-262-20/+20
| | | | | | the right thing and break. llvm-svn: 261950
* Some fixes for case insensitive paths on Windows.Zachary Turner2016-02-241-53/+61
| | | | | | | | | | | | | | | | | | | Paths on Windows are not case-sensitive. Because of this, if a file is called main.cpp, you should be able to set a breakpoint on it by using the name Main.cpp. In an ideal world, you could just tell people to match the case, but in practice this can be a real problem as it requires you to know whether the person who compiled the program ran "clang++ main.cpp" or "clang++ Main.cpp", both of which would work, regardless of what the file was actually called. This fixes http://llvm.org/pr22667 Patch by Petr Hons Differential Revision: http://reviews.llvm.org/D17492 Reviewed by: zturner llvm-svn: 261771
* [linux] Remove all traces of signalfd(2)Pavel Labath2016-02-231-5/+0
| | | | | | | | | | | | | | | Summary: Signalfd is not used in the code anymore, and given that the same functionality can be achieved with the new MainLoop class, it's unlikely we will need it in the future. Remove all traces of it. Reviewers: tberghammer, ovyalov Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D17510 llvm-svn: 261631
* Don't use an atexit handler for cleaning up the temp directory.Zachary Turner2016-02-191-16/+17
| | | | | | Differential Revision: http://reviews.llvm.org/D17420 llvm-svn: 261353
* Make HostThread SetName work on OS X. GetName doesn't currently work, the ↵Jim Ingham2016-02-042-14/+10
| | | | | | | | | | | code that was in GetName actually got the queue name not the thread name and anyway didn't actually work to do that. So I just deleted it with a fixme. <rdar://problem/24487554> llvm-svn: 259818
* Fix an off-by-one in SocketTest::DecodeHostAndPortPavel Labath2016-02-031-1/+1
| | | | | | | 65535 is still a valid port. This should fix the android failures we were getting when we chose to connect over 65535 to the remote lldb-server. llvm-svn: 259638
* We try to avoid static objects. These are on the error path for unsupported ↵Jim Ingham2016-02-021-4/+4
| | | | | | | | features in the socket, so just returning freshly constructed objects is fine. llvm-svn: 259443
* Remove autoconf support from source directories.Eugene Zelenko2016-01-282-79/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Fix a problem where we were not calling fcntl() with the correct arguments ↵Enrico Granata2016-01-201-2/+2
| | | | | | | | | | | for F_DUPFD On Mac OS X, this was working just fine in debug builds (presumably, because the right value ended up being at the right location for the variadic ABI), but not in Release builds As a result, we were seeing failures with commands that set their own immediate output stream - only in Release builds, which always makes for a fun little investigation I have removed those fcntl() calls and replaced them with dup() calls. This fixes the issue in both Debug and Release builds llvm-svn: 258367
* Fix TestProcessLaunch for Python 3.Zachary Turner2016-01-131-2/+33
| | | | | | | | | | | | | | | | | | There were a number of problems preventing this from working: 1. The SWIG typemaps for converting Python lists to and from C++ arrays were not updated for Python 3. So they were doing things like PyString_Check instead of using the PythonString from PythonDataObjects. 2. ProcessLauncherWindows was ignoring the environment completely. So any test that involved launching an inferior with any kind of environment variable would have failed. 3. The test itself was using process.GetSTDOUT(), which isn't implemented on Windows. So this was changed to save the value of the environment variable in a local variable and have the debugger look at the value of the variable. llvm-svn: 257669
* Fix an issue where scripted commands would not actually print any of their ↵Enrico Granata2016-01-131-0/+9
| | | | | | | | output if an immediate output file was set in the result object via a Python file object Fixes rdar://24130303 llvm-svn: 257644
* Make the aarch64 lldb-server capable of debugging arm32 applicationsTamas Berghammer2016-01-111-1/+1
| | | | | | Differential revision: http://reviews.llvm.org/D15533 llvm-svn: 257322
* [Editline] Redesign automatic indentation fix command for robustnessKate Stone2015-12-141-20/+33
| | | | | | The FixIndentationCommand implementation has proven to be fragile across various libedit iterations. This patch reworks the command to use the same basic strategy as when moving between lines in a multi-line edit session: when indentation changes are required, exit line editing completely and restart with amended content. This approach won't be susceptible to subtle behavior differences libedit has introduced over time. llvm-svn: 255548
* Add code to PlatformDarwin and HostInfoMacOSX so they return theJason Molenda2015-11-211-0/+13
| | | | | | | | | | | | correct OS type when running on an apple tv or apple watch. Also, in TargetList::CreateTargetInternal, check that a platform is returned by GetPlatformForArchitecture fallback instead of adding it to the vector of platforms unconditionally; we can end up crashing when we call a member function on it later. <rdar://problem/23601982>, <rdar://problem/21292886> llvm-svn: 253763
* Fix an issue where LLDB would not launch argdumper correctly if there were ↵Enrico Granata2015-11-192-2/+5
| | | | | | spaces in the path to it llvm-svn: 253599
* Fix pessimizing moves. Found by clang.Davide Italiano2015-11-071-1/+1
| | | | llvm-svn: 252409
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-073-3/+3
| | | | | | | | | | | | | | | | | | Summary: Since this is within the lldb namespace, the compiler tries to export a symbol for it. Unfortunately, since it is inlined, the symbol is hidden and this results in a mess of warnings when building on OS X with cmake. Moving it to the lldb_private namespace eliminates that problem. Reviewers: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D14417 llvm-svn: 252396
* Jim thinks we shouldn't bother to pollute the svn repo with theseJason Molenda2015-11-061-2/+2
| | | | | | | internal details, so I'll pull it back to just our own branch of the sources. llvm-svn: 252254
* Update the invocation to dsymForUUID (a script plugin usedJason Molenda2015-11-051-2/+2
| | | | | | | | at Apple, called by the DebugSymbols private framework to find a dSYM for a UUID on mac) to include the latest args we need to use when looking for kernel binaries etc. llvm-svn: 252235
* LLDB needs a mutex around getopt_long_only() function calls to avoid ↵Jim Ingham2015-11-051-1/+3
| | | | | | | | multi-threading option parsing issues. <rdar://problem/17052381> llvm-svn: 252111
* Try a little harder to provide a legit CWD to argdumper if Jim Ingham2015-11-041-1/+19
| | | | | | the user hasn't provided one. llvm-svn: 252023
* Revert r251882 as it breaks the test suiteEnrico Granata2015-11-031-7/+1
| | | | llvm-svn: 251956
* Emit an error message if the current working directory does not exist when ↵Enrico Granata2015-11-031-1/+7
| | | | | | the user is trying to launch argdumper to do shell expansion llvm-svn: 251882
* Provide ADB port forwarding support for abstract sockets.Oleksiy Vyalov2015-11-031-23/+48
| | | | | | http://reviews.llvm.org/D14262 llvm-svn: 251879
* Calculate size of sockaddr_un manually for abstract sockets:Oleksiy Vyalov2015-11-021-8/+31
| | | | | | | - SUN_LEN doesn't work because strlen(sun_path) == 0 - sizeof(sockaddr_un) doesn't work on Android. llvm-svn: 251825
* Added real editline tests.Todd Fiala2015-10-301-0/+13
| | | | | | | | | These are two simple tests that make sure single line and multiline content are processed and received by Editline.cpp. Fancier tests to come... llvm-svn: 251681
* Rename argdumper to lldb-argdumperTodd Fiala2015-10-292-8/+8
| | | | | | http://reviews.llvm.org/D14169 llvm-svn: 251616
* Remove unused SUN_LEN macro for Android.Oleksiy Vyalov2015-10-281-7/+0
| | | | llvm-svn: 251563
* Fix editline unindentation code for more recent libedits.Todd Fiala2015-10-271-2/+5
| | | | | | | | This code was modifying the cursor and then expecting the editline API call to see the effect for the next operation. This is misusing the API. Newer editlines break on this code, fixed by this. llvm-svn: 251457
* Use accept4 workaround for MIPS Android build.Chaoren Lin2015-10-271-3/+3
| | | | | | | | | | | | Summary: Similar to http://reviews.llvm.org/rL242319, which was for ARM. Reviewers: chying, ovyalov Subscribers: aemerson, tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D14127 llvm-svn: 251439
* Add a file in Makefile build which is present in CMake build.Hafiz Abid Qadeer2015-10-271-0/+1
| | | | | | | Since 219143, this file is missing from Makefile build. Committed as obvious. llvm-svn: 251421
* Add Socket::Create factory method which uses socket protocol to find an ↵Oleksiy Vyalov2015-10-271-21/+41
| | | | | | | | appropriate implementation class. http://reviews.llvm.org/D14085 llvm-svn: 251417
* Add initial gmake glue for the NetBSD platformBruce Mitchener2015-10-242-0/+19
| | | | | | | | | | | | | | | | | Summary: These changes aren't everything what is needed for the autotools target, but it's significantly approaching it. These changes shouldn't effect the build process on other platforms. Patch by Kamil Rytarowski, thanks! Reviewers: joerg, brucem Subscribers: brucem, tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D13715 llvm-svn: 251171
* Add initial CMake glue for the NetBSD platformBruce Mitchener2015-10-241-0/+13
| | | | | | | | | | | | | | | | | Summary: These changes aren't everything what is needed for the CMake target, but it's significantly approaching it. These changes shouldn't effect the build process on other platforms. Patch by Kamil Rytarowski, thanks! Reviewers: joerg, brucem Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13711 llvm-svn: 251164
* Fix one more place where we were using the oldJason Molenda2015-10-231-7/+3
| | | | | | | name of the xpc service. <rdar://problem/23223624> llvm-svn: 251086
OpenPOWER on IntegriCloud