From kde-commits Fri Feb 14 12:44:19 2014 From: Kevin Funk Date: Fri, 14 Feb 2014 12:44:19 +0000 To: kde-commits Subject: Re: [kdevelop] debuggers/gdb: Show "catch throw" for exceptions with missing 'original-location' Message-Id: <4437185.yzsRDCFKHb () kerberos> X-MARC-Message: https://marc.info/?l=kde-commits&m=139238186902102 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