summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/FreeBSD
Commit message (Collapse)AuthorAgeFilesLines
* Fix process launch failure on FreeBSD after r365761Dimitry Andric2019-10-102-26/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After rLLDB365761, and with `LLVM_ENABLE_ABI_BREAKING_CHECKS` enabled, launching any process on FreeBSD crashes lldb with: ``` Expected<T> must be checked before access or destruction. Expected<T> value was in success state. (Note: Expected<T> values in success mode must still be checked prior to being destroyed). ``` This is because `m_operation_thread` and `m_monitor_thread` were wrapped in `llvm::Expected<>`, but this requires the objects to be correctly initialized before accessing them. To fix the crashes, use `llvm::Optional<>` for the members (as indicated by labath), and use local variables to store the return values of `LaunchThread` and `StartMonitoringChildProcess`. Then, only assign to the member variables after checking if the return values indicated success. Reviewers: devnexen, emaste, MaskRay, mgorny Reviewed By: devnexen Subscribers: jfb, labath, krytarowski, lldb-commits Differential Revision: https://reviews.llvm.org/D68723 llvm-svn: 374444
* [NFC] Fix typo in the "kind" description for the software single-step breakpointTatyana Krasnukha2019-09-241-1/+1
| | | | llvm-svn: 372763
* Obliterate LLDB_CONFIGURATION_BUILDANDINTEGRATIONPavel Labath2019-09-051-6/+0
| | | | | | | | | | | | | | Summary: With the XCode project gone, there doesn't seem to be anything setting this macro anymore -- and the macro wasn't doing much anyway. Reviewers: jingham, sgraenitz Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D66742 llvm-svn: 371018
* [Logging] Replace Log::Printf with LLDB_LOG macro (NFC)Jonas Devlieghere2019-07-243-91/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces explicit calls to log::Printf with the new LLDB_LOGF macro. The macro is similar to LLDB_LOG but supports printf-style format strings, instead of formatv-style format strings. So instead of writing: if (log) log->Printf("%s\n", str); You'd write: LLDB_LOG(log, "%s\n", str); This change was done mechanically with the command below. I replaced the spurious if-checks with vim, since I know how to do multi-line replacements with it. find . -type f -name '*.cpp' -exec \ sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" + Differential revision: https://reviews.llvm.org/D65128 llvm-svn: 366936
* [LLDB] Fix FreeBSD build.David Carlier2019-07-112-19/+24
| | | | | | | | | | | | To align with the LaunchThread change. Reviewers: MaskRay, mgorny Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D64398 llvm-svn: 365761
* Remove null checks of results of new expressionsPavel Labath2019-07-015-5/+5
| | | | | | | | operator new doesn't return a null pointer, even if one turns off exceptions (it calls std::terminate instead). Therefore, all of this is dead code. llvm-svn: 364744
* [LLDB] Fix FreeBSD buildDavid Carlier2019-06-121-1/+1
| | | | | | | | | | | | The auxiliary vector method had the wrong signature. Reviewers: MaskRay, teemperor, aadsm Reviewed By: MaskRay, teemperor Differential Revision: https://reviews.llvm.org/D63187 llvm-svn: 363135
* Add support to read aux vector valuesAntonio Afonso2019-06-112-3/+3
| | | | | | | | | | | | | | | | | | | | Summary: This is the second patch to improve module loading in a series that started here (where I explain the motivation and solution): https://reviews.llvm.org/D62499 I need to read the aux vector to know where the r_debug map with the loaded libraries are. The AuxVector class was made generic so it could be reused between the POSIX-DYLD plugin and NativeProcess*. The class itself ended up in the ProcessUtility plugin. Reviewers: clayborg, xiaobai, labath, JDevlieghere Reviewed By: clayborg, labath, JDevlieghere Subscribers: emaste, JDevlieghere, mgorny, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62500 llvm-svn: 363098
* Simplify ArchSpec::IsMIPS()Fangrui Song2019-05-161-5/+1
| | | | llvm-svn: 360865
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-105-43/+0
| | | | | | | | | | | | | | | | | | | | | | | A lot of comments in LLDB are surrounded by an ASCII line to delimit the begging and end of the comment. Its use is not really consistent across the code base, sometimes the lines are longer, sometimes they are shorter and sometimes they are omitted. Furthermore, it looks kind of weird with the 80 column limit, where the comment actually extends past the line, but not by much. Furthermore, when /// is used for Doxygen comments, it looks particularly odd. And when // is used, it incorrectly gives the impression that it's actually a Doxygen comment. I assume these lines were added to improve distinguishing between comments and code. However, given that todays editors and IDEs do a great job at highlighting comments, I think it's worth to drop this for the sake of consistency. The alternative is fixing all the inconsistencies, which would create a lot more churn. Differential revision: https://reviews.llvm.org/D60508 llvm-svn: 358135
* [lldb] Add missing EINTR handlingMichal Gorny2019-03-211-1/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D59606 llvm-svn: 356703
* Bring Doxygen comment syntax in sync with LLVM coding style.Adrian Prantl2019-03-114-30/+30
| | | | | | This changes '@' prefix to '\'. llvm-svn: 355841
* Replace 'ap' with 'up' suffix in variable names. (NFC)Jonas Devlieghere2019-02-133-15/+15
| | | | | | | | | | | | | | | | | The `ap` suffix is a remnant of lldb's former use of auto pointers, before they got deprecated. Although all their uses were replaced by unique pointers, some variables still carried the suffix. In r353795 I removed another auto_ptr remnant, namely redundant calls to ::get for unique_pointers. Jim justly noted that this is a good opportunity to clean up the variable names as well. I went over all the changes to ensure my find-and-replace didn't have any undesired side-effects. I hope I didn't miss any, but if you end up at this commit doing a git blame on a weirdly named variable, please know that the change was unintentional. llvm-svn: 353912
* [LLDB] FreeBSD suppress compilation warningDavid Carlier2019-01-311-1/+1
| | | | | | | | | | | | Reviewers: labath, teemperor Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D57506 M source/Plugins/Process/FreeBSD/ProcessMonitor.cpp llvm-svn: 352744
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1919-76/+57
| | | | | | | | | | | | | | | | | 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-116-19/+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
* [FileSystem] Add convenience method to check for directories.Jonas Devlieghere2018-11-081-2/+1
| | | | | | | | | | | Replace calls to LLVM's is_directory with calls to LLDB's FileSytem class. For this I introduced a new convenience method that, like the other methods, takes either a path or filespec. This still uses the LLVM functions under the hood. Differential revision: https://reviews.llvm.org/D54135 llvm-svn: 346375
* [LLDB] Fix FreeBSD/Darwin buildDavid Carlier2018-11-041-4/+6
| | | | | | | | | | Reviewers: JDevlieghere, tatyana-krasnukha Reviwed By: tatyana-krasnukha Differential Revision: https://reviews.llvm.org/D54084 llvm-svn: 346109
* [FileSystem] Move path resolution logic out of FileSpecJonas Devlieghere2018-11-011-2/+1
| | | | | | | | | This patch removes the logic for resolving paths out of FileSpec and updates call sites to rely on the FileSystem class instead. Differential revision: https://reviews.llvm.org/D53915 llvm-svn: 345890
* [FileSystem] Fix typo in ProcessFreeBSDJonas Devlieghere2018-11-011-1/+1
| | | | llvm-svn: 345860
* [FileSystem] Fix Exists call sitesJonas Devlieghere2018-11-011-1/+2
| | | | | | | There were some calls left to Exists() on non-darwin platforms (Windows, Linux and FreeBSD) that weren't yet updated to use the FileSystem. llvm-svn: 345857
* Replace boolean parameter with enum value according r342633Tatyana Krasnukha2018-09-251-2/+2
| | | | llvm-svn: 342998
* Move RegisterValue,Scalar,State from Core to UtilityPavel Labath2018-08-078-12/+12
| | | | | | | | | | | | | These three classes have no external dependencies, but they are used from various low-level APIs. Moving them down to Utility improves overall code layering (although it still does not break any particular dependency completely). The XCode project will need to be updated after this change. Differential Revision: https://reviews.llvm.org/D49740 llvm-svn: 339127
* [windows] LLDB shows the wrong values when register read is executed at a ↵Stella Stamenova2018-07-101-8/+8
| | | | | | | | | | | | | | | | | | | frame other than zero Summary: This is a clean version of the change suggested here: https://bugs.llvm.org/show_bug.cgi?id=37495 The main change is to follow the same pattern as non-windows targets and use an unwinder object to retrieve the register context. I also changed a couple of the comments to actually log, so that issues with unsupported scenarios can be tracked down more easily. Lastly, ClearStackFrames is implemented in the base class, so individual thread implementations don't have to override it. Reviewers: asmith, zturner, aleksandr.urakov Reviewed By: aleksandr.urakov Subscribers: emaste, stella.stamenova, tatyana-krasnukha, llvm-commits Differential Revision: https://reviews.llvm.org/D49111 llvm-svn: 336732
* Change AddressClass type from 'enum' to 'enum class'.Tatyana Krasnukha2018-06-261-3/+3
| | | | | | If we have a function with signature f(addr_t, AddressClass), it is easy to muddle up the order of arguments without any warnings from compiler. 'enum class' prevents passing integer in place of AddressClass and vice versa. llvm-svn: 335599
* Normalize some lldb #include statements.James Y Knight2018-05-224-7/+3
| | | | | | | | | | | Most non-local includes of header files living under lldb/sources/ were specified with the full path starting after sources/. However, in a few instances, other sub-directories were added to include paths, or Normalize those few instances to follow the style used by the rest of the codebase, to make it easier to understand. llvm-svn: 333035
* Enable AUTOBRIEF in doxygen configuration.Adrian Prantl2018-05-025-43/+42
| | | | | | | | | | | | | | This brings the LLDB configuration closer to LLVM's and removes visual clutter in the source code by removing the @brief commands from comments. This patch also reflows the paragraphs in all doxygen comments. See also https://reviews.llvm.org/D46290. Differential Revision: https://reviews.llvm.org/D46321 llvm-svn: 331373
* Reflow paragraphs in comments.Adrian Prantl2018-04-306-88/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* FreeBSD: propagate error to user if memory access failsEd Maste2018-04-211-2/+6
| | | | | | | | | | Previously, an attempt to read an unreadable address reported zeros. Now, if DoReadMemory or DoWriteMemory encounters error then return 0 (bytes read or written) so that the error is reported to the user. llvm.org/pr37190 llvm-svn: 330500
* Another attempt to fix FreeBsd buildPavel Labath2018-01-103-18/+13
| | | | | | | | | | the previous fix did not work because of different const qualifications on the envp pointer. This should resolve that (and remove a couple of const_casts in the process). llvm-svn: 322187
* Fix windows and freebsd builds for r322174 (Environment)Pavel Labath2018-01-101-3/+2
| | | | llvm-svn: 322176
* Fix FreeBSD build broken by r320966Pavel Labath2017-12-181-25/+22
| | | | llvm-svn: 320969
* Move PseudoTerminal to the lldb_private namespacePavel Labath2017-12-111-1/+1
| | | | | | | lldb_utility doesn't make sense, as it is no longer even living in the "utility" module. llvm-svn: 320346
* Kill struct IOVECPavel Labath2017-12-012-0/+5
| | | | | | | | | | | struct iovec is used as an interface to system (posix) api's. As such, we shouldn't be using it in os-independent code, and we shouldn't be defining our own iovec replacements. Fortunately, its usage was not very widespread, so the removal was very easy -- I simply moved a couple declarations into os-specific code. llvm-svn: 319536
* Fix netbsd, freebsd and osx builds for ArchSpec movePavel Labath2017-11-131-1/+1
| | | | llvm-svn: 318052
* [FreeBSD] Remove more dead code. NFCI.Davide Italiano2017-10-241-26/+0
| | | | llvm-svn: 316530
* Report inferior signals as signals, not exceptions, on FreeBSDEd Maste2017-08-104-50/+12
| | | | | | | | | | | | | | | | | | | | | This is the FreeBSD equivalent of r238549. This serves 2 purposes: * LLDB should handle inferior process signals SIGSEGV/SIGILL/SIGBUS/ SIGFPE the way it is suppose to be handled. Prior to this fix these signals will neither create a coredump, nor exit from the debugger or work for signal handling scenario. * eInvalidCrashReason need not report "unknown crash reason" if we have a valid si_signo llvm.org/pr23699 Patch by Karnajit Wangkhem Differential Revision: https://reviews.llvm.org/D35223 llvm-svn: 310591
* Use llvm::sys::RetryAfterSignal instead of a manual while errno!=EINTR loopPavel Labath2017-07-031-18/+6
| | | | | | | | | | Reviewers: zturner, eugene, krytarowski Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D33831 llvm-svn: 307009
* replace uses of strerror with llvm::sys::StrErrorPavel Labath2017-06-061-4/+3
| | | | | | | | strerror is not thread-safe. llvm's StrError tries hard to retrieve the string in a thread-safe way and falls back to strerror only if it does not have another way. llvm-svn: 304795
* FreeBSD ProcessMonitor: map TRAP_CAP to a trace trapEd Maste2017-05-261-0/+4
| | | | | | | | | | | | In the absense of a more specific handler for TRAP_CAP (generated by ENOTCAPABLE or ECAPMODE while in capability mode) treat it as a trace trap. Obtained from FreeBSD r318884. We should later add an option to have LLDB control the trapcap procctl (as with ASLR), as well as report a specific stop reason. For now this change eliminates an assertion failure from LLDB. llvm-svn: 303965
* Rename Error -> Status.Zachary Turner2017-05-129-108/+110
| | | | | | | | | | | | | | | 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
* Remove Plugins/Process/POSIX from include_directoriesPavel Labath2017-04-115-20/+8
| | | | | | | | | | | | | | | | Summary: The files there can always be referred to using their full path, which is what most of the code has been doing already, so this makes the situation more consistent. Also fix the the code in the FreeBSD plugin to use the new paths. Reviewers: eugene, emaste Subscribers: lldb-commits, kettenis, mgorny, krytarowski Differential Revision: https://reviews.llvm.org/D31877 llvm-svn: 299933
* Try to fix FreeBSD build after IWYU changes.Zachary Turner2017-04-061-0/+1
| | | | llvm-svn: 299719
* Fix a typo introduce in r299200.Nitesh Jain2017-04-051-1/+1
| | | | llvm-svn: 299527
* [LLDB][MIPS] Core Dump Support.Nitesh Jain2017-03-311-0/+3
| | | | | | | | | | Reviewers: labath, emaste Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D30457 llvm-svn: 299200
* Move FileSpec from Host -> Utility.Zachary Turner2017-03-222-2/+2
| | | | llvm-svn: 298536
* Fix FreeBSD build broken by r298066Pavel Labath2017-03-171-2/+4
| | | | llvm-svn: 298069
* Move GetAuxvData from Host to relevant process pluginsPavel Labath2017-03-171-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* One more attempt to fix FreeBSDPavel Labath2017-03-171-0/+4
| | | | | | | | It seems sysctl.h is not self-contained, as I get missing symbols in the header itself now. I am going to include all files that the file I moved this from included, and hope that is enough. llvm-svn: 298063
* Speculative build fix for FreeBSDPavel Labath2017-03-171-1/+3
| | | | | | broken by r298058. llvm-svn: 298061
OpenPOWER on IntegriCloud