forked from qt-creator/qt-creator
debugger: silence debug output for unrecognized temporary breakpoints
This commit is contained in:
@@ -45,6 +45,8 @@
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QTimerEvent>
|
||||
|
||||
#define BREAK_ASSERT(cond, action) if (cond) {} else { action; }
|
||||
//#define BREAK_ASSERT(cond, action) QTC_ASSERT(cond, action)
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -271,7 +273,7 @@ const BreakpointParameters &BreakHandler::breakpointData(BreakpointId id) const
|
||||
{
|
||||
static BreakpointParameters dummy;
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return dummy);
|
||||
BREAK_ASSERT(it != m_storage.end(), return dummy);
|
||||
return it->data;
|
||||
}
|
||||
|
||||
@@ -396,7 +398,7 @@ void BreakHandler::updateMarkers()
|
||||
void BreakHandler::updateMarker(BreakpointId id)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
|
||||
QString markerFileName = it->markerFileName();
|
||||
int markerLineNumber = it->markerLineNumber();
|
||||
@@ -471,7 +473,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
|
||||
BreakpointId id = findBreakpointByIndex(mi);
|
||||
//qDebug() << "DATA: " << id << role << mi.column();
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return QVariant());
|
||||
BREAK_ASSERT(it != m_storage.end(), return QVariant());
|
||||
const BreakpointParameters &data = it->data;
|
||||
const BreakpointResponse &response = it->response;
|
||||
|
||||
@@ -611,7 +613,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
|
||||
type BreakHandler::getter(BreakpointId id) const \
|
||||
{ \
|
||||
ConstIterator it = m_storage.find(id); \
|
||||
QTC_ASSERT(it != m_storage.end(), \
|
||||
BREAK_ASSERT(it != m_storage.end(), \
|
||||
qDebug() << "ID" << id << "NOT KNOWN"; \
|
||||
return type()); \
|
||||
return it->data.getter; \
|
||||
@@ -621,7 +623,7 @@ type BreakHandler::getter(BreakpointId id) const \
|
||||
void BreakHandler::setter(BreakpointId id, const type &value) \
|
||||
{ \
|
||||
Iterator it = m_storage.find(id); \
|
||||
QTC_ASSERT(it != m_storage.end(), \
|
||||
BREAK_ASSERT(it != m_storage.end(), \
|
||||
qDebug() << "ID" << id << "NOT KNOWN"; return); \
|
||||
if (it->data.getter == value) \
|
||||
return; \
|
||||
@@ -650,14 +652,14 @@ PROPERTY(int, ignoreCount, setIgnoreCount)
|
||||
bool BreakHandler::isEnabled(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return false);
|
||||
BREAK_ASSERT(it != m_storage.end(), return false);
|
||||
return it->data.enabled;
|
||||
}
|
||||
|
||||
void BreakHandler::setEnabled(BreakpointId id, bool on)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
//qDebug() << "SET ENABLED: " << id << it->data.isEnabled() << on;
|
||||
if (it->data.enabled == on)
|
||||
return;
|
||||
@@ -673,14 +675,14 @@ void BreakHandler::setEnabled(BreakpointId id, bool on)
|
||||
bool BreakHandler::isTracepoint(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return false);
|
||||
BREAK_ASSERT(it != m_storage.end(), return false);
|
||||
return it->data.tracepoint;
|
||||
}
|
||||
|
||||
void BreakHandler::setTracepoint(BreakpointId id, bool on)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
if (it->data.tracepoint == on)
|
||||
return;
|
||||
it->data.tracepoint = on;
|
||||
@@ -697,7 +699,7 @@ void BreakHandler::setMarkerFileAndLine(BreakpointId id,
|
||||
const QString &fileName, int lineNumber)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
if (it->response.fileName == fileName && it->response.lineNumber == lineNumber)
|
||||
return;
|
||||
it->response.fileName = fileName;
|
||||
@@ -710,21 +712,21 @@ void BreakHandler::setMarkerFileAndLine(BreakpointId id,
|
||||
BreakpointState BreakHandler::state(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return BreakpointDead);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return BreakpointDead);
|
||||
return it->state;
|
||||
}
|
||||
|
||||
DebuggerEngine *BreakHandler::engine(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return 0);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return 0);
|
||||
return it->engine;
|
||||
}
|
||||
|
||||
void BreakHandler::setEngine(BreakpointId id, DebuggerEngine *value)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
QTC_ASSERT(it->state == BreakpointNew, qDebug() << id);
|
||||
QTC_ASSERT(!it->engine, qDebug() << id; return);
|
||||
it->engine = value;
|
||||
@@ -769,7 +771,7 @@ void BreakHandler::setState(BreakpointId id, BreakpointState state)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
//qDebug() << "BREAKPOINT STATE TRANSITION" << id << it->state << state;
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return);
|
||||
QTC_ASSERT(isAllowedTransition(it->state, state),
|
||||
qDebug() << "UNEXPECTED BREAKPOINT STATE TRANSITION"
|
||||
<< it->state << state);
|
||||
@@ -800,7 +802,7 @@ void BreakHandler::notifyBreakpointInsertOk(BreakpointId id)
|
||||
QTC_ASSERT(state(id) == BreakpointInsertProceeding, qDebug() << state(id));
|
||||
setState(id, BreakpointInserted);
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
}
|
||||
|
||||
void BreakHandler::notifyBreakpointInsertFailed(BreakpointId id)
|
||||
@@ -851,7 +853,7 @@ void BreakHandler::notifyBreakpointReleased(BreakpointId id)
|
||||
{
|
||||
//QTC_ASSERT(state(id) == BreakpointChangeProceeding, qDebug() << state(id));
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
it->state = BreakpointNew;
|
||||
it->engine = 0;
|
||||
it->response = BreakpointResponse();
|
||||
@@ -866,7 +868,7 @@ void BreakHandler::notifyBreakpointAdjusted(BreakpointId id,
|
||||
{
|
||||
QTC_ASSERT(state(id) == BreakpointInserted, qDebug() << state(id));
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
it->data = data;
|
||||
//if (it->needsChange())
|
||||
// setState(id, BreakpointChangeRequested);
|
||||
@@ -876,14 +878,14 @@ void BreakHandler::notifyBreakpointNeedsReinsertion(BreakpointId id)
|
||||
{
|
||||
QTC_ASSERT(state(id) == BreakpointChangeProceeding, qDebug() << state(id));
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
it->state = BreakpointInsertRequested;
|
||||
}
|
||||
|
||||
void BreakHandler::removeBreakpoint(BreakpointId id)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
switch (it->state) {
|
||||
case BreakpointInserted:
|
||||
setState(id, BreakpointRemoveRequested);
|
||||
@@ -965,8 +967,7 @@ void BreakHandler::breakByFunction(const QString &functionName)
|
||||
QIcon BreakHandler::icon(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(),
|
||||
qDebug() << "NO ICON FOR ID" << id;
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << "NO ICON FOR ID" << id;
|
||||
return pendingBreakpointIcon());
|
||||
return it->icon();
|
||||
}
|
||||
@@ -989,7 +990,7 @@ void BreakHandler::timerEvent(QTimerEvent *event)
|
||||
void BreakHandler::gotoLocation(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
DebuggerEngine *engine = debuggerCore()->currentEngine();
|
||||
if (it->data.type == BreakpointByAddress) {
|
||||
if (engine)
|
||||
@@ -1005,7 +1006,7 @@ void BreakHandler::updateLineNumberFromMarker(BreakpointId id, int lineNumber)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
it->response.pending = false;
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
if (it->response.lineNumber != lineNumber) {
|
||||
// FIXME: Should we tell gdb about the change?
|
||||
it->response.lineNumber = lineNumber;
|
||||
@@ -1057,14 +1058,14 @@ const BreakpointResponse &BreakHandler::response(BreakpointId id) const
|
||||
{
|
||||
static BreakpointResponse dummy;
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), qDebug() << id; return dummy);
|
||||
BREAK_ASSERT(it != m_storage.end(), qDebug() << id; return dummy);
|
||||
return it->response;
|
||||
}
|
||||
|
||||
bool BreakHandler::needsChange(BreakpointId id) const
|
||||
{
|
||||
ConstIterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return false);
|
||||
BREAK_ASSERT(it != m_storage.end(), return false);
|
||||
return it->needsChange();
|
||||
}
|
||||
|
||||
@@ -1072,7 +1073,7 @@ void BreakHandler::setResponse(BreakpointId id,
|
||||
const BreakpointResponse &response, bool takeOver)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
BreakpointItem &item = it.value();
|
||||
item.response = response;
|
||||
item.destroyMarker();
|
||||
@@ -1093,7 +1094,7 @@ void BreakHandler::setBreakpointData(BreakpointId id,
|
||||
const BreakpointParameters &data)
|
||||
{
|
||||
Iterator it = m_storage.find(id);
|
||||
QTC_ASSERT(it != m_storage.end(), return);
|
||||
BREAK_ASSERT(it != m_storage.end(), return);
|
||||
if (data == it->data)
|
||||
return;
|
||||
it->data = data;
|
||||
|
Reference in New Issue
Block a user