[Lldb-commits] [lldb] r287274 - Fix step-over when SymbolContext.function is missing and symbol is present.

Sam McCall via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 17 14:29:31 PST 2016


Author: sammccall
Date: Thu Nov 17 16:29:31 2016
New Revision: 287274

URL: http://llvm.org/viewvc/llvm-project?rev=287274&view=rev
Log:
Fix step-over when SymbolContext.function is missing and symbol is present.

Summary:
Fix step-over when SymbolContext.function is missing and symbol is present.

With targets from our build configuration,
ThreadPlanStepOverRange::IsEquivalentContext fails to fire for relevant frames,
leading to ShouldStop() returning true prematurely.

The frame's SymbolContext, and m_addr_context have:
  - comp_unit set and matching
  - function = nullptr
  - symbol set and matching (but this is never checked)
My naive guess is that the context should be equivalent in this case :-)

Reviewers: jingham

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D26804

Modified:
    lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp

Modified: lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp?rev=287274&r1=287273&r2=287274&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverRange.cpp Thu Nov 17 16:29:31 2016
@@ -107,21 +107,22 @@ bool ThreadPlanStepOverRange::IsEquivale
   // the .o file from the
   // inlined range, so I left that out too...
   if (m_addr_context.comp_unit) {
-    if (m_addr_context.comp_unit == context.comp_unit) {
-      if (m_addr_context.function &&
-          m_addr_context.function == context.function) {
-        // It is okay to return to a different block of a straight function, we
-        // only have to
-        // be more careful if returning from one inlined block to another.
-        if (m_addr_context.block->GetInlinedFunctionInfo() == nullptr &&
-            context.block->GetInlinedFunctionInfo() == nullptr)
-          return true;
-
-        if (m_addr_context.block && m_addr_context.block == context.block)
-          return true;
-      }
+    if (m_addr_context.comp_unit != context.comp_unit)
+      return false;
+    if (m_addr_context.function) {
+      if (m_addr_context.function != context.function)
+        return false;
+      // It is okay to return to a different block of a straight function, we
+      // only have to
+      // be more careful if returning from one inlined block to another.
+      if (m_addr_context.block->GetInlinedFunctionInfo() == nullptr &&
+          context.block->GetInlinedFunctionInfo() == nullptr)
+        return true;
+      return m_addr_context.block == context.block;
     }
-  } else if (m_addr_context.symbol && m_addr_context.symbol == context.symbol) {
+  }
+  // Fall back to symbol if we have no decision from comp_unit/function/block.
+  if (m_addr_context.symbol && m_addr_context.symbol == context.symbol) {
     return true;
   }
   return false;




More information about the lldb-commits mailing list