summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-08-18 22:25:40 +0000
committerZachary Turner <zturner@google.com>2015-08-18 22:25:40 +0000
commit913f776ff9b1ca1ee8875a9dba7f6e633932b4da (patch)
treebfdd608b4b3b00e8f74d1842ed5cb58a1ccc0aee
parentdc9dadf68388a7277c9d729bb77222149c282302 (diff)
downloadbcm5719-llvm-913f776ff9b1ca1ee8875a9dba7f6e633932b4da.tar.gz
bcm5719-llvm-913f776ff9b1ca1ee8875a9dba7f6e633932b4da.zip
Fix TestArrayTypes on Windows.
Whether or not frames print their tid in hex or decimal is apparently hardcoded to depend on the operating system. For now a comment was added that this should be changed to a more sane check (for example a setting), and the OS check is updated to do the right thing for Windows. llvm-svn: 245371
-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