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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

167 lines
5.5 KiB
OpenEdge ABL
Raw Normal View History

//===-- SWIG interface for SBExpressionOptions -----------------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
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;
2012-10-17 06:58:25 +08:00
%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;
2012-10-17 06:58:25 +08:00
%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;
%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 expression 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 expressions. 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);
2015-05-28 06:32:39 +08:00
%feature("docstring", "Gets the prefix to use for this expression.") GetPrefix;
const char *
GetPrefix () const;
%feature("docstring", "Sets the prefix to use for this expression. This prefix gets inserted after the 'target.expr-prefix' prefix contents, but before the wrapped expression function body.") SetPrefix;
void
SetPrefix (const char *prefix);
%feature("docstring", "Sets whether to auto-apply fix-it hints to the expression being evaluated.") SetAutoApplyFixIts;
void
SetAutoApplyFixIts(bool b = true);
%feature("docstring", "Gets whether to auto-apply fix-it hints to an expression.") GetAutoApplyFixIts;
bool
GetAutoApplyFixIts();
[lldb] Add option to retry Fix-Its multiple times to failed expressions Summary: Usually when Clang emits an error Fix-It it does two things. It emits the diagnostic and then it fixes the currently generated AST to reflect the applied Fix-It. While emitting the diagnostic is easy to implement, fixing the currently generated AST is often tricky. That causes that some Fix-Its just keep the AST as-is or abort the parsing process entirely. Once the parser stopped, any Fix-Its for the rest of the expression are not detected and when the user manually applies the Fix-It, the next expression will just produce a new Fix-It. This is often occurring with quickly made Fix-Its that are just used to bridge temporary API changes and that often are not worth implementing a proper API fixup in addition to the diagnostic. To still give some kind of reasonable user-experience for users that have these Fix-Its and rely on them to fix their expressions, this patch adds the ability to retry parsing with applied Fix-Its multiple time to give the normal Fix-It experience where things Clang knows how to fix are not causing actual expression error (at least when automatically applying Fix-Its is activated). The way this is implemented is just by having another setting in the expression options that specify how often we should try applying Fix-Its and then reparse the expression. The default setting is still 1 for everyone so this should not affect the speed in which we fail to parse expressions. Reviewers: jingham, JDevlieghere, friss, shafik Reviewed By: shafik Subscribers: shafik, abidh Differential Revision: https://reviews.llvm.org/D77214
2020-04-06 17:08:12 +08:00
%feature("docstring", "Sets how often LLDB should retry applying fix-its to an expression.") SetRetriesWithFixIts;
void
SetRetriesWithFixIts(uint64_t retries);
%feature("docstring", "Gets how often LLDB will retry applying fix-its to an expression.") GetRetriesWithFixIts;
uint64_t
GetRetriesWithFixIts();
bool
GetTopLevel();
void
SetTopLevel(bool b = true);
%feature("docstring", "Gets whether to JIT an expression if it cannot be interpreted.") GetAllowJIT;
bool
GetAllowJIT();
%feature("docstring", "Sets whether to JIT an expression if it cannot be interpreted.") SetAllowJIT;
void
SetAllowJIT(bool allow);
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