SBExpressionOptions.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //===-- SBExpressionOptions.h -----------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLDB_API_SBEXPRESSIONOPTIONS_H
  9. #define LLDB_API_SBEXPRESSIONOPTIONS_H
  10. #include "lldb/API/SBDefines.h"
  11. #include <vector>
  12. namespace lldb {
  13. class LLDB_API SBExpressionOptions {
  14. public:
  15. SBExpressionOptions();
  16. SBExpressionOptions(const lldb::SBExpressionOptions &rhs);
  17. ~SBExpressionOptions();
  18. const SBExpressionOptions &operator=(const lldb::SBExpressionOptions &rhs);
  19. bool GetCoerceResultToId() const;
  20. void SetCoerceResultToId(bool coerce = true);
  21. bool GetUnwindOnError() const;
  22. void SetUnwindOnError(bool unwind = true);
  23. bool GetIgnoreBreakpoints() const;
  24. void SetIgnoreBreakpoints(bool ignore = true);
  25. lldb::DynamicValueType GetFetchDynamicValue() const;
  26. void SetFetchDynamicValue(
  27. lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
  28. uint32_t GetTimeoutInMicroSeconds() const;
  29. // Set the timeout for the expression, 0 means wait forever.
  30. void SetTimeoutInMicroSeconds(uint32_t timeout = 0);
  31. uint32_t GetOneThreadTimeoutInMicroSeconds() const;
  32. // Set the timeout for running on one thread, 0 means use the default
  33. // behavior. If you set this higher than the overall timeout, you'll get an
  34. // error when you try to run the expression.
  35. void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
  36. bool GetTryAllThreads() const;
  37. void SetTryAllThreads(bool run_others = true);
  38. bool GetStopOthers() const;
  39. void SetStopOthers(bool stop_others = true);
  40. bool GetTrapExceptions() const;
  41. void SetTrapExceptions(bool trap_exceptions = true);
  42. void SetLanguage(lldb::LanguageType language);
  43. void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton);
  44. bool GetGenerateDebugInfo();
  45. void SetGenerateDebugInfo(bool b = true);
  46. bool GetSuppressPersistentResult();
  47. void SetSuppressPersistentResult(bool b = false);
  48. const char *GetPrefix() const;
  49. void SetPrefix(const char *prefix);
  50. void SetAutoApplyFixIts(bool b = true);
  51. bool GetAutoApplyFixIts();
  52. void SetRetriesWithFixIts(uint64_t retries);
  53. uint64_t GetRetriesWithFixIts();
  54. bool GetTopLevel();
  55. void SetTopLevel(bool b = true);
  56. // Gets whether we will JIT an expression if it cannot be interpreted
  57. bool GetAllowJIT();
  58. // Sets whether we will JIT an expression if it cannot be interpreted
  59. void SetAllowJIT(bool allow);
  60. protected:
  61. lldb_private::EvaluateExpressionOptions *get() const;
  62. lldb_private::EvaluateExpressionOptions &ref() const;
  63. friend class SBFrame;
  64. friend class SBValue;
  65. friend class SBTarget;
  66. private:
  67. // This auto_pointer is made in the constructor and is always valid.
  68. mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_up;
  69. };
  70. } // namespace lldb
  71. #endif // LLDB_API_SBEXPRESSIONOPTIONS_H