[Lldb-commits] [lldb] r123306 - /lldb/trunk/source/Target/Process.cpp

Stephen Wilson wilsons at start.ca
Tue Jan 11 20:20:03 PST 2011


Author: wilsons
Date: Tue Jan 11 22:20:03 2011
New Revision: 123306

URL: http://llvm.org/viewvc/llvm-project?rev=123306&view=rev
Log:
Log diagnostic when setting software breakpoints only on failure.

Previously we would be posting a "FAILED" message to the log channel even when
the operation succeeded.

Also, take this opportunity to add braces thus eliminating an "ambiguous else"
compiler warning.


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

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=123306&r1=123305&r2=123306&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Tue Jan 11 22:20:03 2011
@@ -1080,7 +1080,7 @@
         else
             error.SetErrorString("Unable to read memory at breakpoint address.");
     }
-    if (log)
+    if (log && error.Fail())
         log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- FAILED: %s",
                      bp_site->GetID(),
                      (uint64_t)bp_addr,
@@ -2628,13 +2628,14 @@
             // Right now this is the only way to tell we've timed out...
             // We should interrupt the process here...
             // Not really sure what to do if Halt fails here...
-            if (log)
+            if (log) {
                 if (try_all_threads)
                     log->Printf ("Running function with timeout: %d timed out, trying with all threads enabled.",
                                  single_thread_timeout_usec);
                 else
                     log->Printf ("Running function with timeout: %d timed out, abandoning execution.", 
                                  single_thread_timeout_usec);
+            }
             
             if (exe_ctx.process->Halt().Success())
             {





More information about the lldb-commits mailing list