Skip to content

Commit ae22396

Browse files
Merge pull request llvm#2412 from adrian-prantl/disable-plugin-warning
Revert "Print a warning when stopped in a frame LLDB has no plugin for."
2 parents 0b13bae + d38405a commit ae22396

File tree

7 files changed

+6
-62
lines changed

7 files changed

+6
-62
lines changed

lldb/include/lldb/Target/Process.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class ProcessProperties : public Properties {
8686
bool GetDetachKeepsStopped() const;
8787
void SetDetachKeepsStopped(bool keep_stopped);
8888
bool GetWarningsOptimization() const;
89-
bool GetWarningsUnsupportedLanguage() const;
9089
bool GetStopOnExec() const;
9190
std::chrono::seconds GetUtilityExpressionTimeout() const;
9291
bool GetOSPluginReportsAllThreads() const;
@@ -394,7 +393,6 @@ class Process : public std::enable_shared_from_this<Process>,
394393
/// Process warning types.
395394
enum Warnings {
396395
eWarningsOptimization = 1,
397-
eWarningsUnsupportedLanguage = 2,
398396
eWarningsSwiftImport
399397
};
400398

@@ -1343,12 +1341,6 @@ class Process : public std::enable_shared_from_this<Process>,
13431341
void PrintWarningCantLoadSwiftModule(const Module &module,
13441342
std::string details);
13451343

1346-
/// Print a user-visible warning about a function written in a
1347-
/// language that this version of LLDB doesn't support.
1348-
///
1349-
/// \see PrintWarningOptimization
1350-
void PrintWarningUnsupportedLanguage(const SymbolContext &sc);
1351-
13521344
virtual bool GetProcessInfo(ProcessInstanceInfo &info);
13531345

13541346
/// Get the exit status for a process.

lldb/source/Target/Process.cpp

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,6 @@ bool ProcessProperties::GetWarningsOptimization() const {
259259
nullptr, idx, g_process_properties[idx].default_uint_value != 0);
260260
}
261261

262-
bool ProcessProperties::GetWarningsUnsupportedLanguage() const {
263-
const uint32_t idx = ePropertyWarningUnsupportedLanguage;
264-
return m_collection_sp->GetPropertyAtIndexAsBoolean(
265-
nullptr, idx, g_process_properties[idx].default_uint_value != 0);
266-
}
267-
268262
bool ProcessProperties::GetStopOnExec() const {
269263
const uint32_t idx = ePropertyStopOnExec;
270264
return m_collection_sp->GetPropertyAtIndexAsBoolean(
@@ -5925,6 +5919,9 @@ void Process::PrintWarning(uint64_t warning_type, const void *repeat_key,
59255919
StreamSP stream_sp = GetTarget().GetDebugger().GetAsyncOutputStream();
59265920
if (!stream_sp)
59275921
return;
5922+
if (warning_type == eWarningsOptimization && !GetWarningsOptimization()) {
5923+
return;
5924+
}
59285925

59295926
if (repeat_key != nullptr) {
59305927
WarningsCollection::iterator it = m_warnings_issued.find(warning_type);
@@ -5949,11 +5946,8 @@ void Process::PrintWarning(uint64_t warning_type, const void *repeat_key,
59495946
}
59505947

59515948
void Process::PrintWarningOptimization(const SymbolContext &sc) {
5952-
if (!GetWarningsOptimization())
5953-
return;
5954-
if (!sc.module_sp)
5955-
return;
5956-
if (!sc.module_sp->GetFileSpec().GetFilename().IsEmpty() && sc.function &&
5949+
if (GetWarningsOptimization() && sc.module_sp &&
5950+
!sc.module_sp->GetFileSpec().GetFilename().IsEmpty() && sc.function &&
59575951
sc.function->GetIsOptimized()) {
59585952
PrintWarning(Process::Warnings::eWarningsOptimization, sc.module_sp.get(),
59595953
"%s was compiled with optimization - stepping may behave "
@@ -5969,25 +5963,6 @@ void Process::PrintWarningCantLoadSwiftModule(const Module &module,
59695963
module.GetFileSpec().GetCString(), details.c_str());
59705964
}
59715965

5972-
void Process::PrintWarningUnsupportedLanguage(const SymbolContext &sc) {
5973-
if (!GetWarningsUnsupportedLanguage())
5974-
return;
5975-
if (!sc.module_sp)
5976-
return;
5977-
LanguageType language = sc.GetLanguage();
5978-
if (language == eLanguageTypeUnknown)
5979-
return;
5980-
auto type_system_or_err = sc.module_sp->GetTypeSystemForLanguage(language);
5981-
if (auto err = type_system_or_err.takeError()) {
5982-
llvm::consumeError(std::move(err));
5983-
PrintWarning(Process::Warnings::eWarningsUnsupportedLanguage,
5984-
sc.module_sp.get(),
5985-
"This version of LLDB has no plugin for the %s language. "
5986-
"Inspection of frame variables will be limited.\n",
5987-
Language::GetNameForLanguageType(language));
5988-
}
5989-
}
5990-
59915966
bool Process::GetProcessInfo(ProcessInstanceInfo &info) {
59925967
info.Clear();
59935968

lldb/source/Target/TargetProperties.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,6 @@ let Definition = "process" in {
227227
def WarningOptimization: Property<"optimization-warnings", "Boolean">,
228228
DefaultTrue,
229229
Desc<"If true, warn when stopped in code that is optimized where stepping and variable availability may not behave as expected.">;
230-
def WarningUnsupportedLanguage: Property<"unsupported-language-warnings", "Boolean">,
231-
DefaultTrue,
232-
Desc<"If true, warn when stopped in code that is written in a source language that LLDB does not support.">;
233230
def StopOnExec: Property<"stop-on-exec", "Boolean">,
234231
Global,
235232
DefaultTrue,

lldb/source/Target/Thread.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,10 @@ void Thread::FrameSelectedCallback(StackFrame *frame) {
326326
if (!frame)
327327
return;
328328

329-
if (frame->HasDebugInformation() &&
330-
(GetProcess()->GetWarningsOptimization() ||
331-
GetProcess()->GetWarningsUnsupportedLanguage())) {
329+
if (frame->HasDebugInformation() && GetProcess()->GetWarningsOptimization()) {
332330
SymbolContext sc =
333331
frame->GetSymbolContext(eSymbolContextFunction | eSymbolContextModule);
334332
GetProcess()->PrintWarningOptimization(sc);
335-
GetProcess()->PrintWarningUnsupportedLanguage(sc);
336333
}
337334
SymbolContext msc = frame->GetSymbolContext(eSymbolContextModule);
338335
if (msc.module_sp)

lldb/test/Shell/Process/Inputs/true.c

Lines changed: 0 additions & 3 deletions
This file was deleted.

lldb/test/Shell/Process/Optimization.test

Lines changed: 0 additions & 6 deletions
This file was deleted.

lldb/test/Shell/Process/UnsupportedLanguage.test

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)