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
This commit is contained in:
Zachary Turner 2015-08-18 22:25:40 +00:00
parent dc9dadf683
commit 913f776ff9
2 changed files with 9 additions and 3 deletions
lldb
source/Core
test/lang/c/array_types

View File

@ -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;

View File

@ -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])