forked from qt-creator/qt-creator
debugger: move breakpoit tooltip from BreakpointData to BreakpointHandler
It also shows the response data.
This commit is contained in:
@@ -28,15 +28,9 @@
|
||||
**************************************************************************/
|
||||
|
||||
#include "breakpoint.h"
|
||||
#include "stackframe.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QtCore/QByteArray>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QDir>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
@@ -113,102 +107,6 @@ bool BreakpointData::setCondition(const QByteArray &cond)
|
||||
#undef SETIT
|
||||
|
||||
|
||||
static void formatAddress(QTextStream &str, quint64 address)
|
||||
{
|
||||
if (address) {
|
||||
str << "0x";
|
||||
str.setIntegerBase(16);
|
||||
str << address;
|
||||
str.setIntegerBase(10);
|
||||
}
|
||||
}
|
||||
|
||||
QString BreakpointData::toToolTip() const
|
||||
{
|
||||
QString t;
|
||||
switch (m_type) {
|
||||
case BreakpointByFileAndLine:
|
||||
t = tr("Breakpoint by File and Line");
|
||||
break;
|
||||
case BreakpointByFunction:
|
||||
t = tr("Breakpoint by Function");
|
||||
break;
|
||||
case BreakpointByAddress:
|
||||
t = tr("Breakpoint by Address");
|
||||
break;
|
||||
case Watchpoint:
|
||||
t = tr("Watchpoint");
|
||||
break;
|
||||
case UnknownType:
|
||||
t = tr("Unknown Breakpoint Type");
|
||||
}
|
||||
|
||||
QString rc;
|
||||
QTextStream str(&rc);
|
||||
str << "<html><body><table>"
|
||||
//<< "<tr><td>" << tr("Id:")
|
||||
//<< "</td><td>" << m_id << "</td></tr>"
|
||||
//<< "<tr><td>" << tr("State:")
|
||||
//<< "</td><td>" << m_state << "</td></tr>"
|
||||
//<< "<tr><td>" << tr("Engine:")
|
||||
//<< "</td><td>" << m_engine << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Marker File:")
|
||||
<< "</td><td>" << QDir::toNativeSeparators(m_markerFileName) << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Marker Line:")
|
||||
<< "</td><td>" << m_markerLineNumber << "</td></tr>"
|
||||
//<< "<tr><td>" << tr("Breakpoint Number:")
|
||||
//<< "</td><td>" << bpNumber << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Breakpoint Type:")
|
||||
<< "</td><td>" << t << "</td></tr>"
|
||||
<< "<tr><td>" << tr("State:")
|
||||
//<< "</td><td>" << bpState << "</td></tr>"
|
||||
<< "</table><br><hr><table>"
|
||||
<< "<tr><th>" << tr("Property")
|
||||
<< "</th><th>" << tr("Requested")
|
||||
<< "</th><th>" << tr("Obtained") << "</th></tr>"
|
||||
<< "<tr><td>" << tr("Internal Number:")
|
||||
//<< "</td><td>—</td><td>" << bpNumber << "</td></tr>"
|
||||
<< "<tr><td>" << tr("File Name:")
|
||||
<< "</td><td>" << QDir::toNativeSeparators(m_fileName)
|
||||
//<< "</td><td>" << QDir::toNativeSeparators(bpFileName) << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Function Name:")
|
||||
<< "</td><td>" << m_functionName // << "</td><td>" << bpFuncName << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Line Number:") << "</td><td>";
|
||||
if (m_lineNumber)
|
||||
str << m_lineNumber;
|
||||
//str << "</td><td>";
|
||||
//if (bpLineNumber)
|
||||
// str << bpLineNumber;
|
||||
str << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Breakpoint Address:")
|
||||
<< "</td><td>";
|
||||
formatAddress(str, m_address);
|
||||
str << "</td><td>";
|
||||
//formatAddress(str, bpAddress);
|
||||
//str << "</td></tr>"
|
||||
// << "<tr><td>" << tr("Corrected Line Number:")
|
||||
// << "</td><td>-</td><td>";
|
||||
//if (bpCorrectedLineNumber > 0) {
|
||||
// str << bpCorrectedLineNumber;
|
||||
// } else {
|
||||
// str << '-';
|
||||
// }
|
||||
str << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Condition:")
|
||||
// << "</td><td>" << m_condition << "</td><td>" << bpCondition << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Ignore Count:") << "</td><td>";
|
||||
if (m_ignoreCount)
|
||||
str << m_ignoreCount;
|
||||
str << "</td><td>";
|
||||
//if (bpIgnoreCount)
|
||||
// str << bpIgnoreCount;
|
||||
str << "</td></tr>"
|
||||
<< "<tr><td>" << tr("Thread Specification:")
|
||||
// << "</td><td>" << m_threadSpec << "</td><td>" << bpThreadSpec << "</td></tr>"
|
||||
<< "</table></body></html>";
|
||||
return rc;
|
||||
}
|
||||
|
||||
// Compare file names case insensitively on Windows.
|
||||
static inline bool fileNameMatch(const QString &f1, const QString &f2)
|
||||
{
|
||||
@@ -219,7 +117,7 @@ static inline bool fileNameMatch(const QString &f1, const QString &f2)
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BreakpointData::isLocatedAt(const QString &fileName, int lineNumber,
|
||||
bool BreakpointData::isLocatedAt(const QString &fileName, int lineNumber,
|
||||
bool useMarkerPosition) const
|
||||
{
|
||||
int line = useMarkerPosition ? m_markerLineNumber : m_lineNumber;
|
||||
|
||||
Reference in New Issue
Block a user