[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: [kdevelop] debuggers/gdb: Show "catch throw" for exceptions with missing 'original-location'
From: Kevin Funk <krf () gmx ! de>
Date: 2014-02-14 12:44:19
Message-ID: 4437185.yzsRDCFKHb () kerberos
[Download RAW message or body]
Am Freitag, 14. Februar 2014, 12:29:42 schrieb Vlas Puhov:
> 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)) {
Cool, thanks for double-checking!
That also needs to be backported to 4.6 (that's where I originally fixed the
issue)
--
Kevin Funk
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic