forked from qt-creator/qt-creator
debugger: show at least "elide" markers for thread ids
Task-number: QTCREATORBUG-6110 Change-Id: I439fc6463c42fce134646c620ac19a5c533217fe Reviewed-on: http://codereview.qt-project.org/5123 Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
@@ -178,7 +178,7 @@ QVariant ThreadsHandler::headerData
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case ThreadData::IdColumn:
|
case ThreadData::IdColumn:
|
||||||
return QString(QLatin1String(" ") + tr("Id"));
|
return QString(QLatin1String(" ") + tr("Id") + QLatin1String(" "));
|
||||||
case ThreadData::FunctionColumn:
|
case ThreadData::FunctionColumn:
|
||||||
return tr("Function");
|
return tr("Function");
|
||||||
case ThreadData::FileColumn:
|
case ThreadData::FileColumn:
|
||||||
|
|||||||
@@ -1997,19 +1997,25 @@ namespace qthread {
|
|||||||
class Thread : public QThread
|
class Thread : public QThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Thread(int id) : m_id(id) {}
|
Thread() {}
|
||||||
|
|
||||||
|
void setId(int id) { m_id = id; }
|
||||||
|
|
||||||
void run()
|
void run()
|
||||||
{
|
{
|
||||||
int j = 2;
|
int j = 2;
|
||||||
++j;
|
++j;
|
||||||
for (int i = 0; i != 100000; ++i) {
|
for (int i = 0; i != 1000; ++i) {
|
||||||
//sleep(1);
|
//sleep(1);
|
||||||
std::cerr << m_id;
|
std::cerr << m_id;
|
||||||
}
|
}
|
||||||
if (m_id == 2) {
|
if (m_id == 2) {
|
||||||
++j;
|
++j;
|
||||||
}
|
}
|
||||||
|
if (m_id == 3) {
|
||||||
|
BREAK_HERE;
|
||||||
|
dummyStatement(this);
|
||||||
|
}
|
||||||
std::cerr << j;
|
std::cerr << j;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2019,15 +2025,19 @@ namespace qthread {
|
|||||||
|
|
||||||
void testQThread()
|
void testQThread()
|
||||||
{
|
{
|
||||||
Thread thread1(1);
|
//return;
|
||||||
Thread thread2(2);
|
const int N = 14;
|
||||||
thread1.setObjectName("This is the first thread");
|
Thread thread[N];
|
||||||
thread2.setObjectName("This is another thread");
|
for (int i = 0; i != N; ++i) {
|
||||||
thread1.start();
|
thread[i].setId(i);
|
||||||
thread2.start();
|
thread[i].setObjectName("This is thread #" + QString::number(i));
|
||||||
thread1.wait();
|
thread[i].start();
|
||||||
thread2.wait();
|
}
|
||||||
dummyStatement(&thread1);
|
BREAK_HERE;
|
||||||
|
for (int i = 0; i != N; ++i) {
|
||||||
|
thread[i].wait();
|
||||||
|
}
|
||||||
|
dummyStatement(&thread);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3689,7 +3699,7 @@ int main(int argc, char *argv[])
|
|||||||
qsharedpointer::testQSharedPointer();
|
qsharedpointer::testQSharedPointer();
|
||||||
qstringlist::testQStringList();
|
qstringlist::testQStringList();
|
||||||
testQScriptValue(argc, argv);
|
testQScriptValue(argc, argv);
|
||||||
//qthread::testQThread();
|
qthread::testQThread();
|
||||||
qvariant::testQVariant();
|
qvariant::testQVariant();
|
||||||
qvector::testQVector();
|
qvector::testQVector();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user