llvm-project/lldb/scripts
Greg Clayton 4e1042e1bf Allow expresions to have unique expression prefixes:
expr_options = lldb.SBExpressionOptions()
expr_options.SetPrefix('''
struct Foo {
   int a;
   int b;
   int c;
}
'''
expr_result = frame.EvaluateExpression ("Foo foo = { 1, 2, 3}; foo", expr_options)

This fixed a current issue with ptr_refs, cstr_refs and malloc_info so that they can work. If expressions define their own types and then return expression results that use those types, those types get copied into the target's AST context so they persist and the expression results can be still printed and used in future expressions. Code was added to the expression parser to copy the context in which types are defined if they are used as the expression results. So in the case of types defined by expressions, they get defined in a lldb_expr function and that function and _all_ of its statements get copied. Many types of statements are not supported in this copy (array subscript, lambdas, etc) so this causes expressions to fail as they can't copy the result types. To work around this issue I have added code that allows expressions to specify an expression specific prefix. Then when you evaluate the expression you can pass the "expr_options" and have types that can be correctly copied out into the target. I added this as a way to work around an issue, but I also think it is nice to be allowed to specify an expression prefix that can be reused by many expressions, so this feature is very useful.

<rdar://problem/21130675>

llvm-svn: 238365
2015-05-27 22:32:39 +00:00
..
Python Add language option in -gdb-show command (MI) 2015-04-28 12:51:16 +00:00
interface Allow expresions to have unique expression prefixes: 2015-05-27 22:32:39 +00:00
CMakeLists.txt Start to share SWIG interface files between languages. 2015-04-24 00:38:53 +00:00
Makefile Fix configure & make build with python disabled 2014-09-09 04:52:37 +00:00
build-lldb-llvm-clang <rdar://problem/10507811> 2012-01-04 22:56:43 +00:00
build-llvm.pl include compiler-rt in build-llvm.pl 2014-10-11 00:53:32 +00:00
build-swig-wrapper-classes.sh Linux buildbot fix: detect swig tool from PATH in shell script (before searching hardcoded directories) 2012-11-28 23:49:11 +00:00
buildSwigWrapperClasses.py Start to share SWIG interface files between languages. 2015-04-24 00:38:53 +00:00
buildbot.py Added a buildbot script that automatically checks 2011-10-14 21:43:51 +00:00
checkpoint-llvm.pl Fix typos. 2014-07-01 21:22:11 +00:00
disasm-gdb-remote.pl Fix typos. 2014-07-01 21:22:11 +00:00
finish-swig-wrapper-classes.sh Fixed Makefile-based install to place python packages in the LLDB install tree. 2013-12-06 23:16:23 +00:00
finishSwigWrapperClasses.py Start to share SWIG interface files between languages. 2015-04-24 00:38:53 +00:00
generate-vers.pl Make lldb build with Makefiles on OS X. 2014-01-18 08:05:32 +00:00
install-lldb.sh
install_custom_python.py Making linking against Python simpler on Windows. 2015-04-10 22:58:56 +00:00
lldb.swig Add language option in -gdb-show command (MI) 2015-04-28 12:51:16 +00:00
package-clang-headers.py If constructed llvm_build_dir doesn't exist, retry as an iphoneos path. 2015-02-21 06:13:51 +00:00
sed-sources Fix typos. 2014-07-01 21:22:11 +00:00
shush Several improvements to the shush script 2015-01-16 23:16:22 +00:00
utilsArgsParse.py Remove non-standard Environment header section 2015-03-23 17:57:42 +00:00
utilsDebug.py Remove non-standard Environment header section 2015-03-23 17:57:42 +00:00
utilsOsType.py Fix Darwin and FreeBSD OS type detection 2014-11-17 15:40:18 +00:00
verify_api.py Added the ability to verify the LLDB API on MacOSX using a script. Usage is: 2012-08-30 21:21:24 +00:00