Skip to content

Commit d64c6cf

Browse files
Merge pull request #9731 from adrian-prantl/verbose-types
[lldb] Move some less-used log messages into the verbose types log
2 parents 774571a + 9fa75f7 commit d64c6cf

File tree

4 files changed

+16
-24
lines changed

4 files changed

+16
-24
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -892,10 +892,10 @@ bool SwiftLanguageRuntimeImpl::AddModuleToReflectionContext(
892892
return false;
893893
}
894894
bool found = HasReflectionInfo(obj_file);
895-
LLDB_LOG(GetLog(LLDBLog::Types), "{0} reflection metadata in \"{1}\"",
896-
found ? "Adding" : "No",
897-
module_sp->GetObjectName() ? module_sp->GetObjectName()
898-
: obj_file->GetFileSpec().GetFilename());
895+
LLDB_LOGV(GetLog(LLDBLog::Types), "{0} reflection metadata in \"{1}\"",
896+
found ? "Adding" : "No",
897+
module_sp->GetObjectName() ? module_sp->GetObjectName()
898+
: obj_file->GetFileSpec().GetFilename());
899899
if (!found)
900900
return true;
901901

lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3108,9 +3108,9 @@ SwiftASTContext::CreateInstance(const SymbolContext &sc,
31083108
swift_ast_sp->RegisterSectionModules(*cur_module_sp, module_names);
31093109
if (GetLog(LLDBLog::Types)) {
31103110
std::string spacer(indent, '-');
3111-
LOG_PRINTF(GetLog(LLDBLog::Types), "+%s Dependency scan: %s",
3112-
spacer.c_str(),
3113-
cur_module_sp->GetSpecificationDescription().c_str());
3111+
LOG_VERBOSE_PRINTF(
3112+
GetLog(LLDBLog::Types), "+%s Dependency scan: %s", spacer.c_str(),
3113+
cur_module_sp->GetSpecificationDescription().c_str());
31143114
}
31153115
if (auto object = cur_module_sp->GetObjectFile()) {
31163116
FileSpecList file_list;
@@ -3124,9 +3124,9 @@ SwiftASTContext::CreateInstance(const SymbolContext &sc,
31243124
} else {
31253125
if (GetLog(LLDBLog::Types)) {
31263126
std::string spacer(indent, '-');
3127-
LOG_PRINTF(GetLog(LLDBLog::Types),
3128-
"+%s Could not find %s in images", spacer.c_str(),
3129-
fs.GetPath().c_str());
3127+
LOG_VERBOSE_PRINTF(GetLog(LLDBLog::Types),
3128+
"+%s Could not find %s in images",
3129+
spacer.c_str(), fs.GetPath().c_str());
31303130
}
31313131
}
31323132
}

lldb/test/API/lang/swift/reflection_loading/TestSwiftReflectionLoading.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ def test(self):
1414
"""Test that reflection metadata is imported"""
1515
self.build()
1616

17-
log = self.getBuildArtifact("types.log")
18-
self.runCmd('log enable lldb types -f "%s"' % log)
17+
types_log = self.getBuildArtifact("types.log")
18+
self.runCmd('log enable lldb types -v -f "%s"' % types_log)
1919

2020
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
2121
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'),
@@ -26,14 +26,6 @@ def test(self):
2626
lldbutil.check_variable(self, var_c_x, value="23")
2727

2828
# Scan through the types log.
29-
import io
30-
logfile = io.open(log, "r", encoding='utf-8')
31-
found_exe = 0
32-
found_lib = 0
33-
for line in logfile:
34-
if re.search(r'Adding reflection metadata in .*a\.out', line):
35-
found_exe += 1
36-
if re.search(r'Adding reflection metadata in .*dynamic_lib', line):
37-
found_lib += 1
38-
self.assertEqual(found_exe, 1)
39-
self.assertEqual(found_lib, 1)
29+
self.filecheck('platform shell cat "%s"' % types_log, __file__)
30+
# CHECK: {{Adding reflection metadata in .*a\.out}}
31+
# CHECK: {{Adding reflection metadata in .*dynamic_lib}}

lldb/test/API/lang/swift/reflection_only/TestSwiftReflectionOnly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test(self):
1818
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'),
1919
extra_images=['dynamic_lib'])
2020
log = self.getBuildArtifact('types.log')
21-
self.expect('log enable lldb types -f ' + log)
21+
self.expect('log enable lldb types -v -f ' + log)
2222

2323
check_var = lldbutil.check_variable
2424
frame = thread.frames[0]

0 commit comments

Comments
 (0)