From a1e541bf9fe0253541e6460ed8866f1a4ce0c9dd Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 25 Mar 2016 01:57:14 +0000 Subject: Use Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. "." for "->".) This feature is controlled by an expression command option, a target property and the SBExpressionOptions setting. FixIt's are only applied to UserExpressions, not UtilityFunctions, those you have to get right when you make them. This is just a first stage. At present the fixits are applied silently. The next step is to tell the user about the applied fixit. llvm-svn: 264379 --- .../test/expression_command/fixits/main.cpp | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp') diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp b/lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp new file mode 100644 index 00000000000..371d8333763 --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp @@ -0,0 +1,25 @@ +#include + +struct SubStruct +{ + int a; + int b; +}; + +struct MyStruct +{ + int first; + struct SubStruct second; +}; + +int +main() +{ + struct MyStruct my_struct = {10, {20, 30}}; + struct MyStruct *my_pointer = &my_struct; + printf ("Stop here to evaluate expressions: %d %d %p\n", my_pointer->first, my_pointer->second.a, my_pointer); + return 0; +} + + + -- cgit v1.2.3