debugger: don't duplicated "full name" information in break response

Less information to keep in sync.

Change-Id: Icd862bbf8965eefd8ea3ad17b6f574b1f85bb8d2
Reviewed-on: http://codereview.qt.nokia.com/1069
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
hjk
2011-07-04 13:37:01 +02:00
committed by hjk
parent cfcb07bb0c
commit 885df811c4
5 changed files with 14 additions and 14 deletions

View File

@@ -1269,10 +1269,10 @@ const BreakpointResponse &BreakHandler::response(BreakpointModelId id) const
{
static BreakpointResponse dummy;
ConstIterator it = m_storage.find(id);
BREAK_ASSERT(it != m_storage.end(),
qDebug() << "NO RESPONSE FOR " << id; return dummy);
if (it == m_storage.end())
if (it == m_storage.end()) {
qDebug() << "NO RESPONSE FOR " << id;
return dummy;
}
return it->response;
}

View File

@@ -317,8 +317,6 @@ QString BreakpointResponse::toString() const
ts << " Number: " << id.toString();
if (pending)
ts << " [pending]";
if (!fullName.isEmpty())
ts << " FullName: " << fullName;
if (!functionName.isEmpty())
ts << " Function: " << functionName;
if (multiple)
@@ -334,7 +332,6 @@ void BreakpointResponse::fromParameters(const BreakpointParameters &p)
{
BreakpointParameters::operator=(p);
id = BreakpointResponseId();
fullName.clear();
multiple = false;
correctedLineNumber = 0;
hitCount = 0;

View File

@@ -246,7 +246,6 @@ public:
BreakpointResponseId id; //!< Breakpoint number assigned by the debugger engine.
bool pending; //!< Breakpoint not fully resolved.
int hitCount; //!< Number of times this has been hit.
QString fullName; //!< Full file name acknowledged by the debugger engine.
bool multiple; //!< Happens in constructors/gdb.
int correctedLineNumber; //!< Line number as seen by gdb.
};

View File

@@ -151,7 +151,6 @@ QDataStream &operator<<(QDataStream &stream, const BreakpointResponse &s)
stream << s.condition;
stream << s.ignoreCount;
stream << s.fileName;
stream << s.fullName;
stream << s.lineNumber;
//stream << s.bpCorrectedLineNumber;
stream << s.threadSpec;
@@ -169,7 +168,6 @@ QDataStream &operator>>(QDataStream &stream, BreakpointResponse &s)
stream >> s.condition;
stream >> s.ignoreCount;
stream >> s.fileName;
stream >> s.fullName;
stream >> s.lineNumber;
//stream >> s.bpCorrectedLineNumber;
stream >> s.threadSpec;

View File

@@ -2504,13 +2504,19 @@ void GdbEngine::handleBreakInsert1(const GdbResponse &response)
BreakHandler *handler = breakHandler();
BreakpointModelId id = response.cookie.value<BreakpointModelId>();
if (response.resultClass == GdbResultDone) {
const GdbMi bkpt = response.data.findChild("bkpt");
const BreakpointResponseId rid(bkpt.findChild("number").data());
// The result is a list with the first entry marked "bkpt"
// and "unmarked" rest. The "bkpt" one seems to always be
// the "main" entry. Use the "main" entry to retrieve the
// already known data from the BreakpointManager, and then
// iterate over all items to update main- and sub-data.
const GdbMi mainbkpt = response.data.findChild("bkpt");
QByteArray nr = mainbkpt.findChild("number").data();
BreakpointResponseId rid(nr);
if (!isHiddenBreakpoint(rid)) {
BreakpointResponse br = handler->response(id);
foreach (const GdbMi bkpt, response.data.children()) {
QByteArray nr = bkpt.findChild("number").data();
BreakpointResponseId rid(nr);
nr = bkpt.findChild("number").data();
rid = BreakpointResponseId(nr);
if (nr.contains('.')) {
// A sub-breakpoint.
BreakpointResponse sub;
@@ -2519,7 +2525,7 @@ void GdbEngine::handleBreakInsert1(const GdbResponse &response)
sub.type = br.type;
handler->insertSubBreakpoint(id, sub);
} else {
// A primary breakpoint.
// A (the?) primary breakpoint.
updateResponse(br, bkpt);
br.id = rid;
handler->setResponse(id, br);