summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/UnixSignals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [NFC] Remove ASCII lines from commentsJonas Devlieghere2019-04-101-2/+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
* Resubmit "Don't include UnixSignals.h from Host."Zachary Turner2019-03-061-0/+7
| | | | | | | | This was reverted because it breaks the GreenDragon bot, but the reason for the breakage is lost, so I'm resubmitting this now so we can find out what the problem is. llvm-svn: 355528
* Revert "Don't include UnixSignals.h from Host."Davide Italiano2019-02-151-7/+0
| | | | | | It broke the modules green dragon buildbot. llvm-svn: 354177
* Don't include UnixSignals.h from Host.Zachary Turner2019-02-151-0/+7
| | | | | | | | | | | | | | | | | Host had a function to get the UnixSignals instance corresponding to the current host architecture. This means that Host had to include a file from Target. To break this dependency, just make this a static function directly in UnixSignals. We already have the function UnixSignals::Create(ArchSpec) anyway, so we just need to have UnixSignals::CreateForHost() which determines which value to pass for the ArchSpec. The goal here is to eventually break the Host->Target->Host circular dependency. Differential Revision: https://reviews.llvm.org/D57780 llvm-svn: 354168
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Change the default handling for SIGPIPE to pass/,no-stop/no-notify.Jim Ingham2018-10-121-1/+1
| | | | | | | | | Most of the time SIGPIPE is just annoying, and so we should pass it on silently it by default. <rdar://problem/39359145> llvm-svn: 344418
* Reflow paragraphs in comments.Adrian Prantl2018-04-301-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move ArchSpec to the Utility modulePavel Labath2017-11-131-1/+1
| | | | | | | | | | | | | The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module. This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h. llvm-svn: 318048
* Make LLDB skip server-client roundtrip for signals that don't require any ↵Eugene Zemtsov2017-03-071-0/+39
| | | | | | | | | | | | | | actions If QPassSignals packaet is supported by lldb-server, lldb-client will utilize it and ask the server to ignore signals that don't require stops or notifications. Such signals will be immediately re-injected into inferior to continue normal execution. Differential Revision: https://reviews.llvm.org/D30520 llvm-svn: 297231
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-061-269/+209
| | | | | | | | | | | | | | | | | | | | | | | *** 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
* [NFC] Darwin llgs support from Week of CodeTodd Fiala2016-09-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code represents the Week of Code work I did on bringing up lldb-server LLGS support for Darwin. It does not include the Xcode project changes needed, as we don't want to throw that switch until more support is implemented (i.e. this change is inert, no build systems use it yet. I've verified on Ubuntu 16.04, macOS Xcode and macOS cmake builds). This change does some minimal refactoring of code that is shared with the Linux LLGS portion, moving it from NativeProcessLinux into NativeProcessProtocol. That code is also used by NativeProcessDarwin. Current state on Darwin: * Process launching is implemented. (Attach is not). Launching on devices has not yet been tested (FBS/BKS might need a bit of work). * Inferior waitpid monitoring and communication of exit status via MainLoop callback is implemented. * Memory read/write, breakpoints, thread register context, etc. are not yet implemented. This impacts process stop/resume, as the initial launch suspended immediately starts the process up and running because it doesn't know it is supposed to remain stopped. * I implemented the equivalent of MachThreadList as NativeThreadListDarwin, in anticipation that we might want to factor out common parts into NativeThreadList{Protocol} and share some code here. After writing it, though, the fallout from merging Mach Task/Process into a single concept plus some other minor changes makes the whole NativeThreadListDarwin concept nothing more than dead weight. I am likely going to get rid of this class and just manage it directly in NativeProcessDarwin, much like I did for NativeProcessLinux. * There is a stub-out call for starting a STDIO thread. That will go away and adopt the MainLoop pselect-based IOObject reading. I am developing the fully-integrated changes in the following repo, which contains the necessary Xcode bits and the glue that enables lldb-debugserver on a macOS system: https://github.com/tfiala/lldb/tree/llgs-darwin This change also breaks out a few of the lldb-server tests into their own directory, and adds some $qHostInfo tests (not sure why I didn't write those tests back when I initially implemented that on the Linux side). llvm-svn: 280604
* Fix Clang-tidy modernize-use-nullptr warnings in some files in ↵Eugene Zelenko2016-02-181-37/+21
| | | | | | source/Target; other minor fixes. llvm-svn: 261242
* Target: fix -Wcast-qual warningSaleem Abdulrasool2016-01-221-1/+1
| | | | | | | We were unnecessarily stripping the const qualifier on the temporary variable. Restore the constness to avoid the warning. NFC. llvm-svn: 258547
* Welcome to NetBSD signalsKamil Rytarowski2015-12-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Signals 1-32 are matching the default UNIX platform. There are platform specific ones above 32. From the `/usr/include/sys/signal.h` header: ``` #define SIGPWR 32 /* power fail/restart (not reset when caught) */ #ifdef _KERNEL #define SIGRTMIN 33 /* Kernel only; not exposed to userland yet */ #define SIGRTMAX 63 /* Kernel only; not exposed to userland yet */ #endif ``` Reviewers: emaste, joerg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15482 llvm-svn: 255592
* Fix build and some warnings after r250798Tamas Berghammer2015-10-201-2/+2
| | | | llvm-svn: 250810
* [LLDB] Insert names with same signo as alias instead of a new entryMohit K. Bhakkad2015-10-201-41/+52
| | | | | | | | Reviewers: clayborg, labath. Subscribers: jaydeep, dsanders, bhushan, sagar, nitesh.jain, emaste,lldb-commits. Differential Revision: http://reviews.llvm.org/D13646 llvm-svn: 250801
* Refactor Unix signals.Chaoren Lin2015-07-141-5/+59
| | | | | | | | | | | | | | | | | | Summary: - Consolidate Unix signals selection in UnixSignals. - Make Unix signals available from platform. - Add jSignalsInfo packet to retrieve Unix signals from remote platform. - Get a copy of the platform signal for each remote process. - Update SB API for signals. - Update signal utility in test suite. Reviewers: ovyalov, clayborg Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11094 llvm-svn: 242101
* Moved Args::StringToXIntYZ to StringConvert::ToXIntYZVince Harron2015-01-151-2/+2
| | | | | | | | | | The refactor was motivated by some comments that Greg made http://reviews.llvm.org/D6918 and also to break a dependency cascade that caused functions linking in string->int conversion functions to pull in most of lldb llvm-svn: 226199
* Change the default handling for SIGALRM and SIGCHLD to not notify.Jim Ingham2013-10-281-2/+2
| | | | | | <rdar://problem/15208799> llvm-svn: 193530
* Fixed some issues with ARM backtraces by not processing any push/pop Greg Clayton2011-07-061-33/+33
| | | | | | | | | | | | | | instructions if they are conditional. Also fixed issues where the PC wasn't getting bit zero stripped for ARM targets when a stack frame was thumb. We now properly call through the GetOpcodeLoadAddress() functions to make sure the addresses are properly stripped for any targets that may decorate up their addresses. We now don't pass the SIGSTOP signals along. We can revisit this soon, but currently this was interfering with debugging some older ARM targets that don't have vCont support in the GDB server. llvm-svn: 134461
* Back up both the register AND the stop state when calling functions.Jim Ingham2011-01-201-1/+1
| | | | | | | Set the thread state to "bland" before calling functions so they don't inherit the pending signals and die. llvm-svn: 123869
* Change the default signal setting for SIBABRT to SUPPRESS the signal. Why?Greg Clayton2011-01-101-1/+1
| | | | | | | | | | | | | | | | When debugging, if an expression hits a SIGABRT, it the expression ends up completing and stopping due the the "SIGABRT". Then the next thing that runs (another expression, or continuing the program) ends up progating the SIGABRT and causing the parent processes to die. We should probably think of a different solution where we suppress any signal that resulted due to an expression, or we modifyin the UnixSignals class to contain a row for "suppress for expression". So the settings for SIGABRT are: suppress = true, stop = true, and notify = true. llvm-svn: 123157
* Fixed the UnixSignals class to be able to get a signal by name, short name, ↵Greg Clayton2010-10-151-44/+25
| | | | | | | | or signal number when using: int32_t UnixSignals::GetSignalNumberFromName (const char *name) const; llvm-svn: 116641
* Added short names and descriptions to the UnixSignals class. Also cleaned upGreg Clayton2010-10-151-108/+108
| | | | | | the code a bit. llvm-svn: 116561
* Fixed process.gdb-remote to be able to properly propagate the signals andGreg Clayton2010-10-091-32/+34
| | | | | | obey the UnixSignals table that we have in the process. llvm-svn: 116139
* Initial checkin of lldb code from internal Apple repo.Chris Lattner2010-06-081-0/+310
llvm-svn: 105619
OpenPOWER on IntegriCloud