SBUnixSignals.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //===-- SBUnixSignals.h -----------------------------------------------*- C++
  2. //-*-===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef LLDB_API_SBUNIXSIGNALS_H
  10. #define LLDB_API_SBUNIXSIGNALS_H
  11. #include "lldb/API/SBDefines.h"
  12. namespace lldb {
  13. class LLDB_API SBUnixSignals {
  14. public:
  15. SBUnixSignals();
  16. SBUnixSignals(const lldb::SBUnixSignals &rhs);
  17. ~SBUnixSignals();
  18. const SBUnixSignals &operator=(const lldb::SBUnixSignals &rhs);
  19. void Clear();
  20. explicit operator bool() const;
  21. bool IsValid() const;
  22. const char *GetSignalAsCString(int32_t signo) const;
  23. int32_t GetSignalNumberFromName(const char *name) const;
  24. bool GetShouldSuppress(int32_t signo) const;
  25. bool SetShouldSuppress(int32_t signo, bool value);
  26. bool GetShouldStop(int32_t signo) const;
  27. bool SetShouldStop(int32_t signo, bool value);
  28. bool GetShouldNotify(int32_t signo) const;
  29. bool SetShouldNotify(int32_t signo, bool value);
  30. int32_t GetNumSignals() const;
  31. int32_t GetSignalAtIndex(int32_t index) const;
  32. protected:
  33. friend class SBProcess;
  34. friend class SBPlatform;
  35. SBUnixSignals(lldb::ProcessSP &process_sp);
  36. SBUnixSignals(lldb::PlatformSP &platform_sp);
  37. lldb::UnixSignalsSP GetSP() const;
  38. void SetSP(const lldb::UnixSignalsSP &signals_sp);
  39. private:
  40. lldb::UnixSignalsWP m_opaque_wp;
  41. };
  42. } // namespace lldb
  43. #endif // LLDB_API_SBUNIXSIGNALS_H