summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-03-25 01:57:14 +0000
committerJim Ingham <jingham@apple.com>2016-03-25 01:57:14 +0000
commita1e541bf9fe0253541e6460ed8866f1a4ce0c9dd (patch)
treecabc44445df6df157522ea33af070393120e295e /lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp
parent68f56243563417be95e7ef6936f7b7fc9dedf580 (diff)
downloadbcm5719-llvm-a1e541bf9fe0253541e6460ed8866f1a4ce0c9dd.tar.gz
bcm5719-llvm-a1e541bf9fe0253541e6460ed8866f1a4ce0c9dd.zip
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. <rdar://problem/25351938> llvm-svn: 264379
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/expression_command/fixits/main.cpp25
1 files changed, 25 insertions, 0 deletions
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 <stdio.h>
+
+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;
+}
+
+
+
OpenPOWER on IntegriCloud