<div dir="ltr">Hi Jim,<div><br></div><div>This breaks about 12 tests on Windows.  The patch looks simple, but this isn't really my area, is there anything I can give you to help diagnose what might be wrong?  The following tests fail:</div><div><br></div><div><div>FAIL: LLDB (suite) :: Test-rdar-9974002.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div><span style="line-height:1.5">FAIL: LLDB (suite) :: TestDataFormatterHexCaps.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</span><br></div><div>FAIL: LLDB (suite) :: TestDataFormatterNamedSummaries.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestDataFormatterPythonSynth.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestDataFormatterSynth.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestDiamond.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestFormatPropagation.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestFrames.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestInlineStepping.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestSBData.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestStepNoDebug.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div><div>FAIL: LLDB (suite) :: TestThreadJump.py (Windows zturner-win81 8 6.2.9200 AMD64 Intel64 Family 6 Model 45 Stepping 7, GenuineIntel)</div></div><div><br></div><div>And here's the error I get from one of the failing tests, although I don't know how much insight it provides.  </div><div><br></div><div><div>Traceback (most recent call last):</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 536, in wrapper</div><div>    return func(self, *args, **kwargs)</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 2228, in dwarf_test_method</div><div>    return attrvalue(self)</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\lldbtest.py", line 608, in wrapper</div><div>    func(*args, **kwargs)</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\step-avoids-no-debug\TestStepNoDebug.py", line 41, in test_step_in_with_python</div><div>    self.do_step_in_past_nodebug()</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\step-avoids-no-debug\TestStepNoDebug.py", line 105, in do_step_in_past_nodebug</div><div>    self.hit_correct_line ("intermediate_return_value = called_from_nodebug_actual(some_value)")</div><div>  File "D:\src\llvm\tools\lldb\packages\Python\lldbsuite\test\functionalities\step-avoids-no-debug\TestStepNoDebug.py", line 57, in hit_correct_line</div><div>    self.assertTrue (cur_line == target_line, "Stepped to line %d instead of expected %d with pattern '%s'."%(cur_line, target_line, pattern))</div><div>AssertionError: False is not True : Stepped to line 0 instead of expected 19 with pattern 'intermediate_return_value = called_from_nodebug_actual(some_value)'.</div><div>Config=i686-d:\src\llvmbuild\ninja_release\bin\clang.exe</div><div>Session info generated @ Thu Nov 12 15:44:43 2015</div><div>To rerun this test, issue the following command from the 'test' directory:</div></div><div><br></div><div>If it's not obvious what the problem is, can we revert this until we figure it out and then reland it?<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 12, 2015 at 2:34 PM Jim Ingham via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: jingham<br>
Date: Thu Nov 12 16:32:09 2015<br>
New Revision: 252963<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=252963&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=252963&view=rev</a><br>
Log:<br>
Another little stepping optimization: if any of the source step commands are running through a range<br>
of addresses, and the range has no branches, instead of running to the last instruction and<br>
single-stepping over that, run to the first instruction after the end of the range.  If there<br>
are no branches in the current range, then the bytes right after it have to be in the current<br>
function, and have to be instructions not data in code, so this is safe.  And it cuts down one<br>
extra stepi per source range step.<br>
<br>
Incidentally, this also works around a bug in the llvm Intel assembler where it treats the "rep"<br>
prefix as a separate instruction from the repeated instruction.  If that were at the end of a<br>
line range, then we would put a trap in place of the repeated instruction, which is undefined<br>
behavior.  Current processors just ignore the repetition in this case, which changes program behavior.<br>
Since there would never be a line range break after the rep prefix, always doing the range stepping<br>
to the beginning of the new range avoids this problem.<br>
<br>
<rdar://problem/23461686><br>
<br>
Modified:<br>
    lldb/trunk/source/Target/ThreadPlanStepRange.cpp<br>
<br>
Modified: lldb/trunk/source/Target/ThreadPlanStepRange.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=252963&r1=252962&r2=252963&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepRange.cpp?rev=252963&r1=252962&r2=252963&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/ThreadPlanStepRange.cpp (original)<br>
+++ lldb/trunk/source/Target/ThreadPlanStepRange.cpp Thu Nov 12 16:32:09 2015<br>
@@ -390,12 +390,19 @@ ThreadPlanStepRange::SetNextBranchBreakp<br>
         if (branch_index == UINT32_MAX)<br>
         {<br>
             branch_index = instructions->GetSize() - 1;<br>
+            InstructionSP last_inst = instructions->GetInstructionAtIndex(branch_index);<br>
+            size_t last_inst_size = last_inst->GetOpcode().GetByteSize();<br>
+            run_to_address = last_inst->GetAddress();<br>
+            run_to_address.Slide(last_inst_size);<br>
+        }<br>
+        else if (branch_index - pc_index > 1)<br>
+        {<br>
+            run_to_address = instructions->GetInstructionAtIndex(branch_index)->GetAddress();<br>
         }<br>
<br>
-        if (branch_index - pc_index > 1)<br>
+        if (run_to_address.IsValid())<br>
         {<br>
             const bool is_internal = true;<br>
-            run_to_address = instructions->GetInstructionAtIndex(branch_index)->GetAddress();<br>
             m_next_branch_bp_sp = GetTarget().CreateBreakpoint(run_to_address, is_internal, false);<br>
             if (m_next_branch_bp_sp)<br>
             {<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>