Files
clang-p2996/lldb/tools/debugserver/source/SysSignal.cpp
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** 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
2016-09-06 20:57:50 +00:00

96 lines
3.0 KiB
C++

//===-- SysSignal.cpp -------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Created by Greg Clayton on 6/18/07.
//
//===----------------------------------------------------------------------===//
#include "SysSignal.h"
#include <signal.h>
#include <stddef.h>
const char *SysSignal::Name(int signal) {
switch (signal) {
case SIGHUP:
return "SIGHUP"; // 1 hangup
case SIGINT:
return "SIGINT"; // 2 interrupt
case SIGQUIT:
return "SIGQUIT"; // 3 quit
case SIGILL:
return "SIGILL"; // 4 illegal instruction (not reset when caught)
case SIGTRAP:
return "SIGTRAP"; // 5 trace trap (not reset when caught)
case SIGABRT:
return "SIGABRT"; // 6 abort()
#if defined(_POSIX_C_SOURCE)
case SIGPOLL:
return "SIGPOLL"; // 7 pollable event ([XSR] generated, not supported)
#else // !_POSIX_C_SOURCE
case SIGEMT:
return "SIGEMT"; // 7 EMT instruction
#endif // !_POSIX_C_SOURCE
case SIGFPE:
return "SIGFPE"; // 8 floating point exception
case SIGKILL:
return "SIGKILL"; // 9 kill (cannot be caught or ignored)
case SIGBUS:
return "SIGBUS"; // 10 bus error
case SIGSEGV:
return "SIGSEGV"; // 11 segmentation violation
case SIGSYS:
return "SIGSYS"; // 12 bad argument to system call
case SIGPIPE:
return "SIGPIPE"; // 13 write on a pipe with no one to read it
case SIGALRM:
return "SIGALRM"; // 14 alarm clock
case SIGTERM:
return "SIGTERM"; // 15 software termination signal from kill
case SIGURG:
return "SIGURG"; // 16 urgent condition on IO channel
case SIGSTOP:
return "SIGSTOP"; // 17 sendable stop signal not from tty
case SIGTSTP:
return "SIGTSTP"; // 18 stop signal from tty
case SIGCONT:
return "SIGCONT"; // 19 continue a stopped process
case SIGCHLD:
return "SIGCHLD"; // 20 to parent on child stop or exit
case SIGTTIN:
return "SIGTTIN"; // 21 to readers pgrp upon background tty read
case SIGTTOU:
return "SIGTTOU"; // 22 like TTIN for output if (tp->t_local&LTOSTOP)
#if !defined(_POSIX_C_SOURCE)
case SIGIO:
return "SIGIO"; // 23 input/output possible signal
#endif
case SIGXCPU:
return "SIGXCPU"; // 24 exceeded CPU time limit
case SIGXFSZ:
return "SIGXFSZ"; // 25 exceeded file size limit
case SIGVTALRM:
return "SIGVTALRM"; // 26 virtual time alarm
case SIGPROF:
return "SIGPROF"; // 27 profiling time alarm
#if !defined(_POSIX_C_SOURCE)
case SIGWINCH:
return "SIGWINCH"; // 28 window size changes
case SIGINFO:
return "SIGINFO"; // 29 information request
#endif
case SIGUSR1:
return "SIGUSR1"; // 30 user defined signal 1
case SIGUSR2:
return "SIGUSR2"; // 31 user defined signal 2
default:
break;
}
return NULL;
}