diff --git a/src/plugins/debugger/stackframe.cpp b/src/plugins/debugger/stackframe.cpp
index fd5043b9aab..3c348ada039 100644
--- a/src/plugins/debugger/stackframe.cpp
+++ b/src/plugins/debugger/stackframe.cpp
@@ -88,18 +88,25 @@ QString StackFrame::toToolTip() const
const QString filePath = QDir::toNativeSeparators(file);
QString res;
QTextStream str(&res);
- str << "
"
- << "| " << tr("Address:") << " | 0x";
- str.setIntegerBase(16);
- str << address;
+ str << "";
+ if (address) {
+ str << "| " << tr("Address:") << " | 0x";
+ str.setIntegerBase(16);
+ str << address;
+ }
str.setIntegerBase(10);
- str << " | "
- << "| " << tr("Function:") << " | " << function << " | "
- << "| " << tr("File:") << " | " << filePath << " | "
- << "| " << tr("Line:") << " | " << line << " | "
- << "| " << tr("From:") << " | " << from << " | "
- << "| " << tr("To:") << " | " << to << " | "
- << " ";
+ str << " |
";
+ if (!function.isEmpty())
+ str << "| " << tr("Function:") << " | " << function << " |
";
+ if (!file.isEmpty())
+ str << "| " << tr("File:") << " | " << filePath << " |
";
+ if (line != -1)
+ str << "| " << tr("Line:") << " | " << line << " |
";
+ if (!from.isEmpty())
+ str << "| " << tr("From:") << " | " << from << " |
";
+ if (!to.isEmpty())
+ str << "| " << tr("To:") << " | " << to << " |
";
+ str << "
";
return res;
}