diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -1929,11 +1929,11 @@ if (is_deref_of_parent && epformat == eGetExpressionPathFormatDereferencePointers) { // this is the original format of GetExpressionPath() producing code like - // *(a_ptr).memberName, which is entirely fine, until you put this into + // (*a_ptr).memberName, which is entirely fine, until you put this into // StackFrame::GetValueForVariableExpressionPath() which prefers to see // a_ptr->memberName. the eHonorPointers mode is meant to produce strings // in this latter format - s.PutCString("*("); + s.PutCString("(*"); } ValueObject *parent = GetParent(); diff --git a/lldb/test/API/python_api/exprpath_synthetic/main.mm b/lldb/test/API/python_api/exprpath_synthetic/main.mm --- a/lldb/test/API/python_api/exprpath_synthetic/main.mm +++ b/lldb/test/API/python_api/exprpath_synthetic/main.mm @@ -5,8 +5,11 @@ { std::vector v{1,2,3,4,5}; NSArray *a = @[@"Hello",@"World",@"From Me"]; + int *p; return 0; //% v = self.frame().FindVariable("v"); v0 = v.GetChildAtIndex(0); s = lldb.SBStream(); v0.GetExpressionPath(s); //% self.runCmd("expr %s = 12" % s.GetData()); self.assertTrue(v0.GetValueAsUnsigned() == 12, "value change via expr failed") //% a = self.frame().FindVariable("a"); a1 = a.GetChildAtIndex(1); s = lldb.SBStream(); a1.GetExpressionPath(s); //% self.expect("po %s" % s.GetData(), substrs = ["World"]) + //% p = self.frame().GetValueForVariablePath("*p") + //% self.assertEqual(p.path, "(*p)") }