[Lldb-commits] [lldb] r204534 - If a single step ends on a breakpoint, it should be reported as a breakpoint hit

Jim Ingham jingham at apple.com
Fri Mar 21 17:44:41 PDT 2014


Author: jingham
Date: Fri Mar 21 19:44:41 2014
New Revision: 204534

URL: http://llvm.org/viewvc/llvm-project?rev=204534&view=rev
Log:
If a single step ends on a breakpoint, it should be reported as a breakpoint hit
even though the underlying exception is a trace exception.

<rdar://problem/15243355>

Modified:
    lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp

Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=204534&r1=204533&r2=204534&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Fri Mar 21 19:44:41 2014
@@ -363,20 +363,30 @@ StopInfoMachException::CreateStopReasonW
                     if (exc_code == 1) // EXC_I386_SGL
                     {
                         if (!exc_sub_code)
-                            return StopInfo::CreateStopReasonToTrace(thread);
-
-                        // It's a watchpoint, then.
-                        // The exc_sub_code indicates the data break address.
-                        lldb::WatchpointSP wp_sp;
-                        if (target)
-                            wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
-                        if (wp_sp && wp_sp->IsEnabled())
                         {
-                            // Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
-                            // Set the hardware index if that's the case.
-                            if (exc_data_count >=3)
-                                wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
-                            return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_sp->GetID());
+                            // This looks like a plain trap.
+                            // Have to check if there is a breakpoint here as well.  When you single-step onto a trap,
+                            // the single step stops you not to trap.  Since we also do that check below, let's just use
+                            // that logic.
+                            is_actual_breakpoint = true;
+                            is_trace_if_actual_breakpoint_missing = true;
+                        }
+                        else
+                        {
+
+                            // It's a watchpoint, then.
+                            // The exc_sub_code indicates the data break address.
+                            lldb::WatchpointSP wp_sp;
+                            if (target)
+                                wp_sp = target->GetWatchpointList().FindByAddress((lldb::addr_t)exc_sub_code);
+                            if (wp_sp && wp_sp->IsEnabled())
+                            {
+                                // Debugserver may piggyback the hardware index of the fired watchpoint in the exception data.
+                                // Set the hardware index if that's the case.
+                                if (exc_data_count >=3)
+                                    wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
+                                return StopInfo::CreateStopReasonWithWatchpointID(thread, wp_sp->GetID());
+                            }
                         }
                     }
                     else if (exc_code == 2 ||   // EXC_I386_BPT





More information about the lldb-commits mailing list