[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevelop] debuggers/gdb: Show "catch throw" for exceptions with missing 'original-location'
From:       Vlas Puhov <vlas.puhov () mail ! ru>
Date:       2014-02-14 12:29:42
Message-ID: E1WEHtm-0007oN-QQ () scm ! kde ! org
[Download RAW message or body]

Git commit 0ecf3aace37417c8daef9e0ed961030c92226b82 by Vlas Puhov.
Committed on 14/02/2014 at 12:20.
Pushed by vpuhov into branch 'master'.

Show "catch throw" for exceptions with missing 'original-location'
field.

This could happen with gdb 7.7.
Note that if there be more cases with missing 'original-location'
field, we should show the breakpoint's address then (even though
it's not so useful, but it's better then showing nothing at all...)

M  +18   -2    debuggers/gdb/breakpointcontroller.cpp

http://commits.kde.org/kdevelop/0ecf3aace37417c8daef9e0ed961030c92226b82

diff --git a/debuggers/gdb/breakpointcontroller.cpp \
b/debuggers/gdb/breakpointcontroller.cpp index 3a42253..744e750 100644
--- a/debuggers/gdb/breakpointcontroller.cpp
+++ b/debuggers/gdb/breakpointcontroller.cpp
@@ -258,6 +258,12 @@ void \
BreakpointController::handleBreakpointListInitial(const GDBMI::ResultRecord \
} else if (location == b->location()) {  updateBreakpoint = b;
                     }
+                }else if (mi_b.hasField("what") && mi_b["what"].literal() \
== "exception throw") { +                    if (b->expression() == "catch \
throw") { +                        updateBreakpoint = b;
+                    }
+                }else{
+                    kWarning() << "That's too bad, breakpoint doesn't \
contain \"original-location\" field ";  }
             }
             if (updateBreakpoint) break;
@@ -326,10 +332,17 @@ void \
BreakpointController::sendMaybe(KDevelop::Breakpoint* breakpoint)  } else {
                     location = breakpoint->location();
                 }
-                debugSession()->addCommandToFront(
+                if (breakpoint->expression() == "catch throw") {
+                    debugSession()->addCommand(
+                    new GDBCommand(GDBMI::NonMI,
+                                location));
+                    breakpoint->setDeleted();
+                }else{
+                   debugSession()->addCommandToFront(
                     new GDBCommand(BreakInsert,
                                 quoteExpression(location),
                                 new InsertedHandler(this, breakpoint)));
+                }
                 addedCommand = true;
             } else {
                 QString opt;
@@ -477,9 +490,12 @@ void BreakpointController::update(KDevelop::Breakpoint \
                *breakpoint, const GDBMI:
                 breakpoint->setData(KDevelop::Breakpoint::LocationColumn, \
unquoteExpression(location));  }
         }
+    } else if (b.hasField("what") && b["what"].literal() == "exception \
throw") { +        breakpoint->setExpression("catch throw");
+    } else {
+        kWarning() << "That's too bad, breakpoint doesn't contain \
\"original-location\" field ";  }
 
-
     if (!m_dirty[breakpoint].contains(KDevelop::Breakpoint::ConditionColumn)
                
         && !m_errors[breakpoint].contains(KDevelop::Breakpoint::ConditionColumn))
  {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic