summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Core/FormatEntity.cpp2
-rw-r--r--lldb/test/lang/c/array_types/TestArrayTypes.py10
2 files changed, 9 insertions, 3 deletions
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index 19889ce4775..d67860fc1f8 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -1304,6 +1304,8 @@ FormatEntity::Format (const Entry &entry,
// Watch for the special "tid" format...
if (entry.printf_format == "tid")
{
+ // TODO(zturner): Rather than hardcoding this to be platform specific, it should be controlled by a
+ // setting and the default value of the setting can be different depending on the platform.
Target &target = thread->GetProcess()->GetTarget();
ArchSpec arch (target.GetArchitecture ());
llvm::Triple::OSType ostype = arch.IsValid() ? arch.GetTriple().getOS() : llvm::Triple::UnknownOS;
diff --git a/lldb/test/lang/c/array_types/TestArrayTypes.py b/lldb/test/lang/c/array_types/TestArrayTypes.py
index e5fdf291b16..6a5455524f1 100644
--- a/lldb/test/lang/c/array_types/TestArrayTypes.py
+++ b/lldb/test/lang/c/array_types/TestArrayTypes.py
@@ -130,10 +130,14 @@ class ArrayTypesTestCase(TestBase):
# Sanity check the print representation of thread.
thr = str(thread)
- if self.platformIsDarwin():
- tidstr = "tid = 0x%4.4x" % thread.GetThreadID()
- else:
+ # TODO(zturner): Whether the TID is printed in hex or decimal should be controlled by a setting,
+ # and this test should read the value of the setting. This check is currently hardcoded to
+ # match the check in Core/FormatEntity.cpp in the function FormatEntity::Format() for
+ # the Entry::Type::ThreadID case of the switch statement.
+ if self.getPlatform() == "linux" or self.getPlatform() == "freebsd":
tidstr = "tid = %u" % thread.GetThreadID()
+ else:
+ tidstr = "tid = 0x%4.4x" % thread.GetThreadID()
self.expect(thr, "Thread looks good with stop reason = breakpoint", exe=False,
substrs = [tidstr])
OpenPOWER on IntegriCloud