1 //===-- ExpressionSourceCode.h ----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ExpressionSourceCode_h
11 #define liblldb_ExpressionSourceCode_h
13 #include "lldb/lldb-enumerations.h"
17 namespace lldb_private
20 class ExecutionContext;
22 class ExpressionSourceCode
25 static const char * g_expression_prefix;
27 static ExpressionSourceCode *CreateWrapped (const char *prefix,
30 return new ExpressionSourceCode ("$__lldb_expr",
36 static ExpressionSourceCode *CreateUnwrapped (const char *name,
39 return new ExpressionSourceCode (name,
45 bool NeedsWrapping () const
50 const char *GetName () const
52 return m_name.c_str();
55 bool GetText (std::string &text,
56 lldb::LanguageType wrapping_language,
58 ExecutionContext &exe_ctx) const;
60 // Given a string returned by GetText, find the beginning and end of the body passed to CreateWrapped.
61 // Return true if the bounds could be found. This will also work on text with FixItHints applied.
63 GetOriginalBodyBounds(std::string transformed_text,
64 lldb::LanguageType wrapping_language,
69 ExpressionSourceCode (const char *name,
86 } // namespace lldb_private