summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/netbsd
Commit message (Collapse)AuthorAgeFilesLines
* [lldb] [Host/netbsd] Set Arg0 for 'platform process list -v'Michał Górny2019-10-251-0/+1
| | | | Differential Revision: https://reviews.llvm.org/D69400
* Move ProcessInfo from Host to Utility.Zachary Turner2019-03-041-1/+5
| | | | | | | | | | | | | | | | | | | | | There are set of classes in Target that describe the parameters of a process - e.g. it's PID, name, user id, and similar. However, since it is a bare description of a process and contains no actual functionality, there's nothing specifically that makes this appropriate for being in Target -- it could just as well be describing a process on the host, or some hypothetical virtual process that doesn't even exist. To cement this, I'm moving these classes to Utility. It's possible that we can find a better place for it in the future, but as it is neither Host specific nor Target specific, Utility seems like the most appropriate place for the time being. After this there is only 2 remaining references to Target from Host, which I'll address in a followup. Differential Revision: https://reviews.llvm.org/D58842 llvm-svn: 355342
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-192-8/+6
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove header grouping comments.Jonas Devlieghere2018-11-111-4/+0
| | | | | | | | This patch removes the comments grouping header includes. They were added after running IWYU over the LLDB codebase. However they add little value, are often outdates and burdensome to maintain. llvm-svn: 346626
* Fix NetBSD build after "Move path resolution logic out of FileSpec"Kamil Rytarowski2018-11-042-2/+2
| | | | | | D53915 llvm-svn: 346100
* Fix macosx build broken by the VersionTuple refactorPavel Labath2018-06-181-1/+1
| | | | | | | | | | I actually did check that macos builds before committing, but this error was in conditionally compiled code that did not seem to be used on my machine. I also fix a typo in the previous speculative NetBSD patch. llvm-svn: 334955
* Fix netbsd build broken by r334950Pavel Labath2018-06-181-1/+2
| | | | | | This also includes one more build fix for windows. llvm-svn: 334953
* Use llvm::VersionTuple instead of manual version marshallingPavel Labath2018-06-181-10/+5
| | | | | | | | | | | | | | | | | | Summary: This has multiple advantages: - we need only one function argument/instance variable instead of three - no need to default initialize variables - no custom parsing code - VersionTuple has comparison operators, which makes version comparisons much simpler Reviewers: zturner, friss, clayborg, jingham Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D47889 llvm-svn: 334950
* [FileSpec] Make style argument mandatory for SetFile. NFCJonas Devlieghere2018-06-132-2/+3
| | | | | | Fix SetFile uses in hosts that I missed in r334663. llvm-svn: 334664
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is intended as a clean up after the big clang-format commit (r280751), which unfortunately resulted in many of the comment paragraphs in LLDB being very hard to read. FYI, the script I used was: import textwrap import commands import os import sys import re tmp = "%s.tmp"%sys.argv[1] out = open(tmp, "w+") with open(sys.argv[1], "r") as f: header = "" text = "" comment = re.compile(r'^( *//) ([^ ].*)$') special = re.compile(r'^((([A-Z]+[: ])|([0-9]+ )).*)|(.*;)$') for line in f: match = comment.match(line) if match and not special.match(match.group(2)): # skip intentionally short comments. if not text and len(match.group(2)) < 40: out.write(line) continue if text: text += " " + match.group(2) else: header = match.group(1) text = match.group(2) continue if text: filled = textwrap.wrap(text, width=(78-len(header)), break_long_words=False) for l in filled: out.write(header+" "+l+'\n') text = "" out.write(line) os.rename(tmp, sys.argv[1]) Differential Revision: https://reviews.llvm.org/D46144 llvm-svn: 331197
* Delete some unused #includes of CleanUp.h, NFCVedant Kumar2018-02-231-1/+0
| | | | llvm-svn: 325847
* Remove unused includes from the Host modulePavel Labath2018-01-241-1/+0
| | | | llvm-svn: 323340
* Remove Platform references from the Host modulePavel Labath2018-01-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These were used by Host::LaunchProcess to "resolve" the executable it was about to launch. The only parts of Platform::ResolveExecutable, which seem to be relevant here are the FileSpec::ResolvePath and ResolveExecutableLocation calls. The rest (most) of that function deals with selecting an architecture out of a fat binary and making sure we are able to create a Module with that slice. These are reasonable actions when selecting a binary to debug, but not for a generic process launching framework (it's technically even wrong because we should be able to launch a binary with execute permissions only, but trying to parse such file will obviously fail). I remove the platform call by inlining the relevant FileSpec calls and ignoring the rest of the Platform::ResolveExecutable code. The architecture found by the slice-searching code is being ignored already anyway, as we use the one specified in the LaunchInfo, so the only effect of this should be a different error message in case the executable does not contain the requested architecture -- before we would get an error message from the Platform class, but now we will get an error from the actual posix_spawn syscall (this is only relevant on mac, as it's the only target supporting fat binaries). Launching targets for debugging should not be affected as here the executable is pre-resolved at the point when the Target is created. Reviewers: jingham, clayborg Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D41902 llvm-svn: 322935
* Add Utility/Environment class for handling... environmentsPavel Labath2018-01-101-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There was some confusion in the code about how to represent process environment. Most of the code (ab)used the Args class for this purpose, but some of it used a more basic StringList class instead. In either case, the fact that the underlying abstraction did not provide primitive operations for the typical environment operations meant that even a simple operation like checking for an environment variable value was several lines of code. This patch adds a separate Environment class, which is essentialy a llvm::StringMap<std::string> in disguise. To standard StringMap functionality, it adds a couple of new functions, which are specific to the environment use case: - (most important) envp conversion for passing into execve() and likes. Instead of trying to maintain a constantly up-to-date envp view, it provides a function which creates a envp view on demand, with the expectation that this will be called as the very last thing before handing the value to the system function. - insert(StringRef KeyEqValue) - splits KeyEqValue into (key, value) pair and inserts it into the environment map. - compose(value_type KeyValue) - takes a map entry and converts in back into "KEY=VALUE" representation. With this interface most of the environment-manipulating code becomes one-liners. The only tricky part was maintaining compatibility in SBLaunchInfo, which expects that the environment entries are accessible by index and that the returned const char* is backed by the launch info object (random access into maps is hard and the map stores the entry in a deconstructed form, so we cannot just return a .c_str() value). To solve this, I have the SBLaunchInfo convert the environment into the "envp" form, and use it to answer the environment queries. Extra code is added to make sure the envp version is always in sync. (This also improves the layering situation as Args was in the Interpreter module whereas Environment is in Utility.) Reviewers: zturner, davide, jingham, clayborg Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D41359 llvm-svn: 322174
* Remove dead Core/StreamFile includesPavel Labath2017-06-301-6/+3
| | | | llvm-svn: 306817
* Rename Error -> Status.Zachary Turner2017-05-121-3/+3
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* Correct environ parsing on NetBSDKamil Rytarowski2017-04-071-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This replaces old code in Host::GetEnvironment for NetBSD with the version from Linux. This makes parsing environment variables correctly. It also fixes programs that depend on the variables like curses(3) applications. Long term this function should be moved to Process Plugin, as currently env variables are not available with remote debugging. Other BSDs might want to catch up after this change. Tested with NetBSD top(1). Sponsored by <The NetBSD Foundation> Reviewers: emaste, labath, joerg, kettenis Reviewed By: emaste Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D31784 llvm-svn: 299783
* Remove dead include <sys/user.h> from the NetBSD code.Kamil Rytarowski2017-03-291-3/+1
| | | | llvm-svn: 298970
* Delete some dead code in HostInfo.Zachary Turner2017-03-211-4/+0
| | | | llvm-svn: 298335
* Move GetAuxvData from Host to relevant process pluginsPavel Labath2017-03-171-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: GetAuxvData was causing dependencies from host to target and linux process modules. It also does not fit netbsd use case, as there we can only read the auxiliary vector with ptrace, which is better done in the process plugin, with the other ptrace calls. I resolve these issues by moving the freebsd and linux versions into the relevant process plugins. In case of linux, this required adding an interface in NativeProcessProtocol. The empty definitions on other platforms can simply be removed. To get the code compiling I had to add ProcessGdbRemote -> ProcessLinux dependency, which was not caught before because we depended on it transitively. Reviewers: zturner, emaste Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31031 llvm-svn: 298066
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-171-43/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Delete LLDB's code for getting / setting thread name.Zachary Turner2017-03-041-26/+0
| | | | | | | This is now functionality in LLVM, and all callers have already been updated to use the LLVM functions. llvm-svn: 296946
* Move DataBuffer / DataExtractor and friends from Core -> Utility.Zachary Turner2017-03-041-3/+3
| | | | llvm-svn: 296943
* Move Log from Core -> Utility.Zachary Turner2017-03-031-1/+1
| | | | | | | | | All references to Host and Core have been removed, so this class can now safely be lowered into Utility. Differential Revision: https://reviews.llvm.org/D30559 llvm-svn: 296909
* Remove dependencies from Utility to Core and Target.Zachary Turner2017-02-141-1/+1
| | | | | | | | | | With this patch, the only dependency left is from Utility to Host. After this is broken, Utility will finally be standalone. Differential Revision: https://reviews.llvm.org/D29909 llvm-svn: 295088
* Move classes from Core -> Utility.Zachary Turner2017-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | This moves the following classes from Core -> Utility. ConstString Error RegularExpression Stream StreamString The goal here is to get lldbUtility into a state where it has no dependendencies except on itself and LLVM, so it can be the starting point at which to start untangling LLDB's dependencies. These are all low level and very widely used classes, and previously lldbUtility had dependencies up to lldbCore in order to use these classes. So moving then down to lldbUtility makes sense from both the short term and long term perspective in solving this problem. Differential Revision: https://reviews.llvm.org/D29427 llvm-svn: 293941
* 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
* Unbreak the NetBSD build after recent changesKamil Rytarowski2016-09-201-1/+1
| | | | | | | | Similar to r281922 "Try to fix freebsd and android builds." Replace .AppendArgument(cstr) with .AppendArgument(llvm::StringRef(cstr)) llvm-svn: 282032
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-064-309/+267
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* Remove autoconf support from source directories.Eugene Zelenko2016-01-281-14/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-071-1/+1
| | | | | | | | | | | | | | | | | | 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
* Add initial gmake glue for the NetBSD platformBruce Mitchener2015-10-241-0/+14
| | | | | | | | | | | | | | | | | 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
* Preliminary NetBSD supportBruce Mitchener2015-10-134-0/+479
Summary: This adds platform code without the cmake/gmake glue to the existing infrastructure. The missing and incompatibility ptrace(2) bits (existing in FreeBSD) are under active research and development and will be submitted once verified to work. This code was tested to build and run on NetBSD-current/amd64. Proper build scripts will be integrated separately as a new commit. Reviewers: joerg Subscribers: tfiala, brucem, labath, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D13334 llvm-svn: 250146
OpenPOWER on IntegriCloud