summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host
Commit message (Collapse)AuthorAgeFilesLines
...
* Transform ProcessLauncherLinux to ProcessLauncherPosixForkKamil Rytarowski2017-02-014-230/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Use ProcessLauncherPosixFork in Linux and NetBSD. Changes to ProcessLauncherLinux: - Limit personality.h and ASLR code to Linux. - Reuse portable ptrace(2) PT_TRACE_ME operation available on Linux and BSDs. - Limit ETXTBSY error path from execve(2) to Linux. - In LaunchProcess declaration change virtual to override. This code should be readily available for FreeBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, clayborg, labath, emaste Reviewed By: labath Subscribers: danalbert, srhines, mgorny, #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29347 llvm-svn: 293768
* [CMake] Fix broken NetBSD botsChris Bieneman2017-01-311-4/+5
| | | | | | http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/4558/steps/cmake%20local/logs/stdio llvm-svn: 293687
* [CMake] Add accurate dependency specificationsChris Bieneman2017-01-311-1/+20
| | | | | | | | | | | | | | | | | Summary: This patch adds accurate dependency specifications to the mail LLDB libraries and tools. In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way. For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up. Reviewers: labath, zturner Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell Differential Revision: https://reviews.llvm.org/D29333 llvm-svn: 293686
* Add NetBSD support in Host::GetCurrentThreadIDKamil Rytarowski2017-01-311-0/+6
| | | | | | | | | | | | | | | | | | | Summary: To retrieve the native thread ID there must be called _lwp_self(). Sponsored by <The NetBSD Foundation> Reviewers: joerg, clayborg, emaste, labath Reviewed By: joerg, clayborg, labath Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29264 llvm-svn: 293625
* Switch HostInfoNetBSD::GetProgramFileSpec to sysctl(7)Kamil Rytarowski2017-01-281-9/+9
| | | | | | | | | | | | | | | | | | | | | | Summary: Remove dependency on the proc (/proc) filesystem, which is optional. KERN_PROC_PATHNAME is available in NetBSD-current and will land NetBSD 8.0. Older stable versions of NetBSD will not be supported. Sponsored by <The NetBSD Foundation> Reviewers: emaste, joerg, labath, clayborg Reviewed By: clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D29089 llvm-svn: 293392
* Address post-commit review remarksPavel Labath2017-01-271-1/+1
| | | | | | | Tamas pointed out that the macro name I used in r293282 was too vague. Rename it to better reflect what it is used for. llvm-svn: 293287
* Refactor the android accept hackPavel Labath2017-01-271-5/+7
| | | | | | | | This moves the accept hack from the android toolchain file into LLDBConfig.cmake. This allows successful lldb android compilation without relying on our custom toolchain file. llvm-svn: 293281
* Replace chdir() usage with the llvm equivalent.Pavel Labath2017-01-251-9/+0
| | | | | | | This removes a hack in PosixApi.h, which tends to produce strange compile errors when it's included in the wrong order. llvm-svn: 293045
* Fix android build for r292935 (personality.h)Pavel Labath2017-01-241-5/+10
| | | | | | | | | | | It turns out things are not as simple as I hoped. sys/personality.h exists on all androids but it does not define the required symbols on all platform levels. Add a compile check for platform level to compile against both new and old android headers. llvm-svn: 292939
* include linux/personality.h on androidPavel Labath2017-01-241-0/+4
| | | | | | | sys/personality.h is present only since android platform level 21. The linux/ version is present everywhere. llvm-svn: 292935
* Include termios.h for definition of struct winsizePavel Labath2017-01-241-0/+1
| | | | | | | | | | On android API level 9 the header does not get included transitively. Include it directly. As far as I can see, all non-windows platforms should have this header. If that turns out to be incorrect, we can add some ifdefs around that. llvm-svn: 292931
* Replace getcwd with the llvm equivalentPavel Labath2017-01-231-25/+2
| | | | | | | | | | | | | | | | | | | | | Summary: getcwd() is not available (well.. um.. deprecated?) on windows, and the way PosixApi.h is providing it causes strange compile errors when it's included in the wrong order. The best way to avoid that is to just not use chdir. This replaces all uses of getcwd in generic code. There are still a couple of more uses, but these are in platform-specific code. chdir() is causing a similar problem, but for that there is no llvm equivalent for that (yet). Reviewers: zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28858 llvm-svn: 292795
* [cmake] Make lldb build with the android ndk toolchain filePavel Labath2017-01-171-9/+8
| | | | | | | | | | | | | | | | | Summary: The NDK cmake toolchain file defines CMAKE_SYSTEM_NAME=Android, so switch the build to use that. I have also updated the in-tree toolchain file to do that (instead of defining __ANDROID_NDK__), so it can still be used to build. After migrating the last bits of non-toolchainy bits out of the in-tree toolchain, I intend to delete it. Reviewers: tberghammer, danalbert Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D28775 llvm-svn: 292212
* Fix windows unit testsPavel Labath2017-01-161-1/+1
| | | | | | | | | The unit test I added in the previous commit discovered a bug in PrependPathComponent on windows -- it was calling SetFile with the host native path syntax, whereas it should be explicitly specifying the path syntax (as AppendPathComponent does). This fixes it. llvm-svn: 292106
* FileSpec: Fix PrependPathComponent("/")Pavel Labath2017-01-161-24/+22
| | | | | | | | | | | | | | | | Summary: PrependPathComponent was unconditionally inserting path separators between the path components. This is not correct if the prepended path is "/", which caused problems down the line. Fix the function to use the same algorithm as AppendPathComponent and add a test. This fixes one part of llvm.org/pr31611. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28677 llvm-svn: 292100
* Attempt to fix windows build for r291198Pavel Labath2017-01-061-0/+1
| | | | llvm-svn: 291233
* Consolidate file handle usage in Editline.cppPavel Labath2017-01-061-10/+37
| | | | | | | | | | | | | | | | | | | | Summary: To implement wide character reading, editline was mixing FILE*-based access with a Connection-based one (plus it did some selects on the raw FD), which is very fragile. Here, I replace it with one which uses only a Connection-based reads. The code is somewhat longer as I had to read characters one by one to detect the end of the multibyte sequence. I've verified that international characters still work in lldb command line on OSX. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D28356 llvm-svn: 291220
* Make lldb -Werror clean for -Wstring-conversionDavid Blaikie2017-01-061-8/+6
| | | | | | | | | Also found/fixed one bug identified by this warning in RenderScriptx86ABIFixups.cpp where a string literal was being used in an effort to provide a name for an instruction/register, but was instead being passed as the bool 'isVolatile' parameter. llvm-svn: 291198
* Add methods to enable using formatv syntax in LLDB.Zachary Turner2016-12-161-4/+47
| | | | | | | | | | | | | This adds formatv-backed formatting functions in various places in LLDB such as StreamString, logging, constructing error messages, etc. A couple of callsites are changed from Printf style syntax to formatv style syntax to illustrate its usage. Additionally, a FileSpec formatter is introduced so that FileSpecs can be formatted natively. Differential Revision: https://reviews.llvm.org/D27632 llvm-svn: 289922
* Fix build for mingw.Hafiz Abid Qadeer2016-12-154-13/+3
| | | | | | | | | | | | Summary: I was building lldb using cross mingw-w64 toolchain on Linux and observed some issues. This is first patch in the series to fix that build. It mostly corrects the case of include files and adjusts some #ifdefs from _MSC_VER to _WIN32 and vice versa. I built lldb on windows with VS after applying this patch to make sure it does not break the build there. Reviewers: zturner, labath, abidh Subscribers: ki.stfu, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D27759 llvm-svn: 289821
* Adopt PrettyStackTrace in LLDBSean Callanan2016-12-142-45/+0
| | | | | | | | | | LLDB needs some minor changes to adopt PrettyStackTrace after https://reviews.llvm.org/D27683. We remove our own SetCrashDescription() function and use LLVM-provided RAII objects instead. We also make sure LLDB doesn't define __crashtracer_info__ which would collide with LLVM's definition. Differential Revision: https://reviews.llvm.org/D27735 llvm-svn: 289711
* Remove superfluous android includePavel Labath2016-12-051-1/+0
| | | | | | | This file is not in the include path when building with a non-standalone toolchain. In does not seem to be necessary anyway. llvm-svn: 288674
* Replace __ANDROID_NDK__ with __ANDROID__Pavel Labath2016-12-024-9/+9
| | | | | | | | | | | | | | | | | | | | Summary: This replaces all the uses of the __ANDROID_NDK__ define with __ANDROID__. This is a preparatory step to remove our custom android toolchain file and rely on the standard android NDK one instead, which does not provide this define. Instead I rely, on __ANDROID__, which is set by the compiler. I haven't yet removed the cmake variable with the same name, as we will need to do something completely different there -- NDK toolchain defines CMAKE_SYSTEM_NAME to Android, while our current one pretends it's linux. Reviewers: tberghammer, zturner Subscribers: danalbert, srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D27305 llvm-svn: 288494
* Fix handling of consecutive slashes in FileSpec::GetNormalizedPath()Pavel Labath2016-11-301-1/+2
| | | | | | | | | | The core of the function was actually handling them correctly. However, the early exit was being too optimistic and did not give the function a chance to fire if the path did not contain dots as well. Fix that and add a couple of unit tests. llvm-svn: 288247
* [lldb] Fix typos in file headersAlexander Shaposhnikov2016-11-267-4/+31
| | | | | | | | | | | | | This diff fixes typos in file headers (incorrect file names). Test plan: Under llvm/tools/lldb/source: find ./* -type f | grep -e '\(cpp\|h\)$' | while read F; do B=$(basename $F); echo $F head -n 1 $F | grep -v $B | wc -l ; done Differential revision: https://reviews.llvm.org/D27115 llvm-svn: 287966
* Fix builds Windows and OSX builds after Connection refactor in r287922Pavel Labath2016-11-252-4/+8
| | | | | | | | | Switch various bits of platform-specific code to chrono that I did not notice when doing a linux build. This exposed a bug that ConnectionGenericFileWindows did not handle the magic UINT32_MAX timeout value (instead it waited for about an hour, which is close enough I guess). Fix that as well. llvm-svn: 287927
* Introduce Chrono to the Connection class. NFCI.Pavel Labath2016-11-252-10/+11
| | | | llvm-svn: 287922
* Make GetRegisterByName() take a StringRef.Zachary Turner2016-11-171-13/+11
| | | | | | | This one is fairly trivial and only really involves changing function signatures and a few simple call-sites. llvm-svn: 287266
* Convert Platform, Process, and Connection functions to StringRef.Zachary Turner2016-11-172-54/+52
| | | | | | All tests pass on Linux and Windows. llvm-svn: 287259
* Don't allow direct access to StreamString's internal buffer.Zachary Turner2016-11-163-8/+10
| | | | | | | | | | | | | | | This is a large API change that removes the two functions from StreamString that return a std::string& and a const std::string&, and instead provide one function which returns a StringRef. Direct access to the underlying buffer violates the concept of a "stream" which is intended to provide forward only access, and makes porting to llvm::raw_ostream more difficult in the future. Differential Revision: https://reviews.llvm.org/D26698 llvm-svn: 287152
* Remove TimeValue classPavel Labath2016-11-162-156/+0
| | | | | | | | | | | | | | | Summary: All usages have been replaced by appropriate std::chrono funcionality, and the class is now unused. The only used part of the cpp file is the DumpTimePoint function, which I have moved into the only caller (CommandObjectTarget.cpp). Reviewers: clayborg, zturner Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D26451 llvm-svn: 287096
* Fix uninitialized members.Sam McCall2016-11-151-4/+2
| | | | | | | | | | | | Summary: Fix uninitialized members. Reviewers: jingham Subscribers: jingham, lldb-commits Differential Revision: https://reviews.llvm.org/D26528 llvm-svn: 286947
* Make OptionParser::Parse() take StringRef.Zachary Turner2016-11-131-2/+3
| | | | llvm-svn: 286747
* Fix some use-after-frees that my last CL introduced.Zachary Turner2016-11-131-4/+2
| | | | llvm-svn: 286745
* Revert unwanted changes in lldb when updating llvm::Error()Mehdi Amini2016-11-112-6/+6
| | | | | | | | My script updated lldb::Errors, and I failed to fix it entirely before pushing. This restore everything in lldb as it was before r286561. llvm-svn: 286565
* Prevent at compile time converting from Error::success() to Expected<T>Mehdi Amini2016-11-118-16/+16
| | | | | | | | This would trigger an assertion at runtime otherwise. Differential Revision: https://reviews.llvm.org/D26482 llvm-svn: 286562
* Make the Error class constructor protectedMehdi Amini2016-11-1110-22/+22
| | | | | | | | | This is forcing to use Error::success(), which is in a wide majority of cases a lot more readable. Differential Revision: https://reviews.llvm.org/D26481 llvm-svn: 286561
* Remove TimeValue usage from lldb/HostPavel Labath2016-11-092-5/+1
| | | | llvm-svn: 286371
* Remove TimeValue usage from Core/ModulePavel Labath2016-11-091-21/+19
| | | | | | | | | | | | | | | | Summary: The only interesting part here is that TimePoint and TimeValue have different natural string representations, which affects "target modules list" output. It is now "2016-07-09 04:02:21.000000000", whereas previously in was "Sat Jul 9 04:02:21 2016". I wanted to check if we're OK with that. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26275 llvm-svn: 286349
* When deciding whether to use the source remapping dictionary from Jason Molenda2016-11-091-6/+13
| | | | | | | | | | a dSYM per-uuid plist, only use it when the DBGVersion key has a value of 2 or greater. <rdar://problem/28889578> <rdar://problem/29131339> llvm-svn: 286335
* Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-027-8/+7
| | | | | | | | | | Reviewers: zturner, labath Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: https://reviews.llvm.org/D26233 llvm-svn: 285855
* Find clang resource directory via *nix-style lookupChris Bieneman2016-11-022-21/+37
| | | | | | | | | | | | | | | | | Summary: This patch allows the Darwin build to fall back to to Posix-style lookups for the clang resource directory if the debugger library isn't inside a framework. The patch also includes a bit of refactoring and cleanup around the *nix resolution of the binary and lib directories to reuse the code instead of duplicating it. With this patch Darwin builds that don't build a framework only have 3 failing tests on my system (TestExec.py). Reviewers: zturner, labath, spyffe, tfiala Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26170 llvm-svn: 285838
* Fix RHEL 6 build with missing cerrno and some other Include What You Use ↵Eugene Zelenko2016-11-011-3/+6
| | | | | | | | warnings. Differential revision: https://reviews.llvm.org/D26171 llvm-svn: 285710
* Remove TimeValue usage from FileSpec.hPavel Labath2016-11-012-8/+10
| | | | | | | | | | | | | | | | | | | | | Summary: The only usage there was in GetModificationTime(). I also took the opportunity to move this function from FileSpec to the FileSystem class - since we are using FileSpecs to also represent remote files for which we cannot (easily) retrieve modification time, it makes sense to make the decision to get the modification time more explicit. The new function returns a llvm::sys::TimePoint<>. To aid the transition from TimeValue, I have added a constructor to it which enables implicit conversion from a time_point. Reviewers: zturner, clayborg Subscribers: mehdi_amini, tberghammer, danalbert, beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D25392 llvm-svn: 285702
* Improve ".." handling in FileSpec normalizationPavel Labath2016-10-311-99/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: .. handling for windows path was completely broken because the function was expecting \ as path separators, but we were passing it normalized file paths, where these have been replaced by forward slashes. Apart from this, the function was incorrect for posix paths as well in some corner cases, as well as being generally hard to follow. The corner cases were: - /../bar -> should be same as /bar - /bar/.. -> should be same as / (slightly dodgy as the former depends on /bar actually existing, but since we're doing it in an abstract way, I think the transformation is reasonable) I rewrite the function to fix these corner cases and handle windows paths more correctly. The function should now handle the posix paths (modulo symlinks, but we cannot really do anything about that without a real filesystem). For windows paths, there are a couple of corner cases left, mostly to do with drive letter handling, which cannot be fixed until the rest of the class understands drive letters better. Reviewers: clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D26081 llvm-svn: 285593
* When invoking Terminal, don't assume the default shellChris Bieneman2016-10-181-2/+2
| | | | | | | | | | | | | | | | | Summary: If a user has their shell set to a non-POSIX conferment shell the TestTerminal.py tests fail because the shell blurb constructed here may not work in their shell. In my specific case fish-shell (The Friendly Interactive Shell - http://fishshell.com) does not support $?, it instead uses $status (because it is friendly). This patch removes the assumption of your default shell by running the constructed bash command via "/bin/bash -c ...". This should be safer for users mutating their shell environment. Reviewers: tfiala Subscribers: joerg, lldb-commits Differential Revision: https://reviews.llvm.org/D25750 llvm-svn: 284552
* Fix build error on Android again.Zachary Turner2016-10-051-1/+1
| | | | | | This one was my fault since I can't compile Android. llvm-svn: 283414
* Convert some Args index-based iteration to range-style iteration.Zachary Turner2016-10-052-6/+4
| | | | | | | | | | | | | | This is better for a number of reasons. Mostly style, but also: 1) Signed-unsigned comparison warnings disappear since there is no loop index. 2) Iterating with the range-for style gives you back an entry that has more than just a const char*, so it's more efficient and more useful. 3) Makes code safter since the type system enforces that it's impossible to index out of bounds. llvm-svn: 283413
* Make lldb -Werror clean on Windows.Zachary Turner2016-10-0514-52/+57
| | | | | | Differential Revision: https://reviews.llvm.org/D25247 llvm-svn: 283344
* Fix FixupEnvironment on Android after the Args refactorTamas Berghammer2016-10-041-5/+6
| | | | llvm-svn: 283237
OpenPOWER on IntegriCloud