Skip to content

Commit 481e613

Browse files
delcyphergithub-actions[bot]
authored andcommitted
Automerge: [LLDB] Add log channel for InstrumentationRuntime plugins (#168508)
This patch adds `LLDBLog::InstrumentationRuntime` as a log channel to provide an appropriate channel for instrumentation runtime plugins as previously one did not exist. A small use of the channel is added to illustrate its use. The logging added is not intended to be comprehensive. This is primarily motivated by an `-fbounds-safety` instrumentation plugin (swiftlang/llvm-project#11835). rdar://164920875
2 parents e3e3930 + 46565f3 commit 481e613

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

lldb/include/lldb/Utility/LLDBLog.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ enum class LLDBLog : Log::MaskType {
5050
OnDemand = Log::ChannelFlag<31>,
5151
Source = Log::ChannelFlag<32>,
5252
Disassembler = Log::ChannelFlag<33>,
53-
LLVM_MARK_AS_BITMASK_ENUM(Disassembler),
53+
InstrumentationRuntime = Log::ChannelFlag<34>,
54+
LLVM_MARK_AS_BITMASK_ENUM(InstrumentationRuntime),
5455
};
5556

5657
LLVM_ENABLE_BITMASK_ENUMS_IN_NAMESPACE();

lldb/source/Plugins/InstrumentationRuntime/Utility/ReportRetriever.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,11 @@ bool ReportRetriever::NotifyBreakpointHit(ProcessSP process_sp,
207207
return false;
208208

209209
StructuredData::ObjectSP report = RetrieveReportData(process_sp);
210-
if (!report || report->GetType() != lldb::eStructuredDataTypeDictionary)
210+
if (!report || report->GetType() != lldb::eStructuredDataTypeDictionary) {
211+
LLDB_LOGF(GetLog(LLDBLog::InstrumentationRuntime),
212+
"ReportRetriever::RetrieveReportData() failed");
211213
return false;
214+
}
212215

213216
std::string description = FormatDescription(report);
214217

lldb/source/Utility/LLDBLog.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ static constexpr Log::Category g_categories[] = {
6767
{{"disassembler"},
6868
{"log disassembler related activities"},
6969
LLDBLog::Disassembler},
70+
{{"instrumentation-runtime"},
71+
{"log instrumentation runtime plugin related activities"},
72+
LLDBLog::InstrumentationRuntime},
7073
};
7174

7275
static Log::Channel g_log_channel(g_categories,

0 commit comments

Comments
 (0)