llvm-project/lldb/scripts/interface/SBExpressionOptions.i

131 lines
4.2 KiB
OpenEdge ABL
Raw Normal View History

//===-- SWIG interface for SBExpressionOptions -----------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
namespace lldb {
%feature("docstring",
"A container for options to use when evaluating expressions."
) SBExpressionOptions;
class SBExpressionOptions
{
friend class SBFrame;
friend class SBValue;
public:
SBExpressionOptions();
SBExpressionOptions (const lldb::SBExpressionOptions &rhs);
~SBExpressionOptions();
bool
2012-10-17 06:58:25 +08:00
GetCoerceResultToId () const;
%feature("docstring", "Sets whether to coerce the expression result to ObjC id type after evaluation.") SetCoerceResultToId;
void
2012-10-17 06:58:25 +08:00
SetCoerceResultToId (bool coerce = true);
bool
2012-10-17 06:58:25 +08:00
GetUnwindOnError () const;
%feature("docstring", "Sets whether to unwind the expression stack on error.") SetUnwindOnError;
void
SetUnwindOnError (bool unwind = true);
bool
GetIgnoreBreakpoints () const;
%feature("docstring", "Sets whether to ignore breakpoint hits while running expressions.") SetUnwindOnError;
void
SetIgnoreBreakpoints (bool ignore = true);
lldb::DynamicValueType
2012-10-17 06:58:25 +08:00
GetFetchDynamicValue () const;
2012-10-17 06:58:25 +08:00
%feature("docstring", "Sets whether to cast the expression result to its dynamic type.") SetFetchDynamicValue;
2012-10-17 06:58:25 +08:00
void
SetFetchDynamicValue (lldb::DynamicValueType dynamic = lldb::eDynamicCanRunTarget);
uint32_t
2012-10-17 06:58:25 +08:00
GetTimeoutInMicroSeconds () const;
2012-10-17 06:58:25 +08:00
%feature("docstring", "Sets the timeout in microseconds to run the expression for. If try all threads is set to true and the expression doesn't complete within the specified timeout, all threads will be resumed for the same timeout to see if the expresson will finish.") SetTimeoutInMicroSeconds;
void
2012-10-17 06:58:25 +08:00
SetTimeoutInMicroSeconds (uint32_t timeout = 0);
uint32_t
GetOneThreadTimeoutInMicroSeconds () const;
%feature("docstring", "Sets the timeout in microseconds to run the expression on one thread before either timing out or trying all threads.") SetTimeoutInMicroSeconds;
void
SetOneThreadTimeoutInMicroSeconds (uint32_t timeout = 0);
bool
2012-10-17 06:58:25 +08:00
GetTryAllThreads () const;
2012-10-17 06:58:25 +08:00
%feature("docstring", "Sets whether to run all threads if the expression does not complete on one thread.") SetTryAllThreads;
void
2012-10-17 06:58:25 +08:00
SetTryAllThreads (bool run_others = true);
bool
GetStopOthers () const;
%feature("docstring", "Sets whether to stop other threads at all while running expressins. If false, TryAllThreads does nothing.") SetTryAllThreads;
void
SetStopOthers (bool stop_others = true);
bool
GetTrapExceptions () const;
%feature("docstring", "Sets whether to abort expression evaluation if an exception is thrown while executing. Don't set this to false unless you know the function you are calling traps all exceptions itself.") SetTryAllThreads;
void
SetTrapExceptions (bool trap_exceptions = true);
Initial merge of some of the iOS 8 / Mac OS X Yosemite specific lldb support. I'll be doing more testing & cleanup but I wanted to get the initial checkin done. This adds a new SBExpressionOptions::SetLanguage API for selecting a language of an expression. I added adds a new SBThread::GetInfoItemByPathString for retriving information about a thread from that thread's StructuredData. I added a new StructuredData class for representing key-value/array/dictionary information (e.g. JSON formatted data). Helper functions to read JSON and create a StructuredData object, and to print a StructuredData object in JSON format are included. A few Cocoa / Cocoa Touch data formatters were updated by Enrico to track changes in iOS 8 / Yosemite. Before we query a thread's extended information, the system runtime may provide hints to the remote debug stub that it will use to retrieve values out of runtime structures. I added a new SystemRuntime method AddThreadExtendedInfoPacketHints which allows the SystemRuntime to add key-value type data to the initial request that we send to the remote stub. The thread-format formatter string can now retrieve values out of a thread's extended info structured data. The default thread-format string picks up two of these - thread.info.activity.name and thread.info.trace_messages. I added a new "jThreadExtendedInfo" packet in debugserver; I will add documentation to the lldb-gdb-remote.txt doc soon. It accepts JSON formatted arguments (most importantly, "thread":threadnum) and it returns a variety of information regarding the thread to lldb in JSON format. This JSON return is scanned into a StructuredData object that is associated with the thread; UI layers can query the thread's StructuredData to see if key-values are present, and if so, show them to the user. These key-values are likely to be specific to different targets with some commonality among many targets. For instance, many targets will be able to advertise the pthread_t value for a thread. I added an initial rough cut of "thread info" command which will print the information about a thread from the jThreadExtendedInfo result. I need to do more work to make this format reasonably. Han Ming added calls into the pmenergy and pmsample libraries if debugserver is run on Mac OS X Yosemite to get information about the inferior's power use. I added support to debugserver for gathering the Genealogy information about threads, if it exists, and returning it in the jThreadExtendedInfo JSON result. llvm-svn: 210874
2014-06-13 10:37:02 +08:00
%feature ("docstring", "Sets the language that LLDB should assume the expression is written in") SetLanguage;
void
SetLanguage (lldb::LanguageType language);
bool
GetGenerateDebugInfo ();
%feature("docstring", "Sets whether to generate debug information for the expression and also controls if a SBModule is generated.") SetGenerateDebugInfo;
void
SetGenerateDebugInfo (bool b = true);
bool
GetSuppressPersistentResult ();
%feature("docstring", "Sets whether to produce a persistent result that can be used in future expressions.") SetSuppressPersistentResult;
void
SetSuppressPersistentResult (bool b = false);
protected:
SBExpressionOptions (lldb_private::EvaluateExpressionOptions &expression_options);
lldb_private::EvaluateExpressionOptions *
get () const;
lldb_private::EvaluateExpressionOptions &
ref () const;
private:
// This auto_pointer is made in the constructor and is always valid.
mutable std::unique_ptr<lldb_private::EvaluateExpressionOptions> m_opaque_ap;
};
} // namespace lldb