Skip to content

Conversation

JDevlieghere
Copy link
Member

@JDevlieghere JDevlieghere commented Oct 13, 2025

Actually emit a warning, rather than an error, when there's an .lldbinit file in the current directly. Currently, the message is prepended by "error" which looks rather odd, as the warning refers to itself as a warning.

Actually emit a warning, rather than an error, when there's an .lldbinit
file in the current directly. Currently, the message is prepended by
"error" which looks rather odd, as the warning refer to itself as a
warning.
@llvmbot
Copy link
Member

llvmbot commented Oct 13, 2025

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

Actually emit a warning, rather than an error, when there's an .lldbinit file in the current directly. Currently, the message is prepended by "error" which looks rather odd, as the warning refer to itself as a warning.


Full diff: https://github.com/llvm/llvm-project/pull/163265.diff

2 Files Affected:

  • (modified) lldb/source/Interpreter/CommandInterpreter.cpp (+1-1)
  • (modified) lldb/test/Shell/Driver/LocalLLDBInit.test (+1-1)
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index d909c5650c95b..ffcc9ceeb2a93 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2591,7 +2591,7 @@ void CommandInterpreter::SourceInitFileCwd(CommandReturnObject &result) {
         llvm::sys::path::parent_path(home_init_file.GetPath())) {
       result.SetStatus(eReturnStatusSuccessFinishNoResult);
     } else {
-      result.AppendError(InitFileWarning);
+      result.AppendWarning(InitFileWarning);
     }
   }
   }
diff --git a/lldb/test/Shell/Driver/LocalLLDBInit.test b/lldb/test/Shell/Driver/LocalLLDBInit.test
index 5db545e7ec561..2aa8c527929f9 100644
--- a/lldb/test/Shell/Driver/LocalLLDBInit.test
+++ b/lldb/test/Shell/Driver/LocalLLDBInit.test
@@ -9,7 +9,7 @@
 # RUN: env HOME=%t.home %lldb-init -local-lldbinit -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=ALLOWINIT --check-prefix=NOINIT
 # RUN: %lldb -o 'settings show frame-format' 2>&1 | FileCheck %s --check-prefix=NOINIT --check-prefix=CHECK
 
-# WARNINIT: There is a .lldbinit file in the current directory which is not being read.
+# WARNINIT: warning: There is a .lldbinit file in the current directory which is not being read.
 # NOINIT-NOT: There is a .lldbinit file in the current directory which is not being read.
 # CHECK-NOT: bogus
 # ALLOWINIT: name 'prlnt' is not defined

Copy link
Collaborator

@jimingham jimingham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is clearly a warning not an error.

@JDevlieghere JDevlieghere merged commit bf6880c into llvm:main Oct 13, 2025
12 checks passed
@JDevlieghere JDevlieghere deleted the lldbinit-warning branch October 13, 2025 22:43
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
Actually emit a warning, rather than an error, when there's an .lldbinit
file in the current directly. Currently, the message is prepended by
"error" which looks rather odd, as the warning refers to itself as a
warning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants