[nemiver] Restart without exception (Closes: #634406)



commit 85609edb2922ff8c206e34cff57daea60e4110c5
Author: Dodji Seketeli <dodji seketeli org>
Date:   Tue Nov 9 12:32:03 2010 +0100

    Restart without exception (Closes: #634406)
    
    	* src/persp/dbgperspective/nmv-dbg-perspective.cc
    	(delete_visual_breakpoint): Do not throw an exception when we
    	can't get the source editor of a given breakpoint. That just
    	likely mean 1/it's an in-asm breakpoint 2/we haven't disassembled
    	that part yet.

 src/persp/dbgperspective/nmv-dbg-perspective.cc |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/src/persp/dbgperspective/nmv-dbg-perspective.cc b/src/persp/dbgperspective/nmv-dbg-perspective.cc
index c0709e3..11d44c5 100644
--- a/src/persp/dbgperspective/nmv-dbg-perspective.cc
+++ b/src/persp/dbgperspective/nmv-dbg-perspective.cc
@@ -6997,18 +6997,25 @@ void
 DBGPerspective::delete_visual_breakpoint (map<int, IDebugger::Breakpoint>::iterator &a_i)
 {
     SourceEditor *source_editor = 0;
-    
-    if (!a_i->second.file_full_name ().empty ()) {
-        get_source_editor_from_path (a_i->second.file_full_name ());
-        if (!source_editor) {
+
+    UString file_name = a_i->second.file_name ();
+    if (file_name.empty ())
+        file_name = a_i->second.file_full_name ();
+    if (!file_name.empty ()) {
+        get_source_editor_from_path (file_name);
+        if (!source_editor)
             source_editor =
-                get_source_editor_from_path (a_i->second.file_full_name (),
+                get_source_editor_from_path (file_name,
                                              true);
-        }
     } else {
         source_editor = get_source_editor_from_path (get_asm_title ());
     }
-    THROW_IF_FAIL (source_editor);
+
+    if (source_editor == 0)
+        // This can happen for a BP with no debug info, but for which
+        // we haven't done any disassembling yet.
+        return;
+
     switch (source_editor->get_buffer_type ()) {
     case SourceEditor::BUFFER_TYPE_ASSEMBLY:
         source_editor->remove_visual_breakpoint_from_address



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]