[Lldb-commits] [lldb] 8c3a6fe - Fix a mistyping introduced with the new container command.

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 5 09:42:12 PDT 2022


Author: Jim Ingham
Date: 2022-04-05T09:42:05-07:00
New Revision: 8c3a6fe37fc36537b939ea75a59fb2d5963246fb

URL: https://github.com/llvm/llvm-project/commit/8c3a6fe37fc36537b939ea75a59fb2d5963246fb
DIFF: https://github.com/llvm/llvm-project/commit/8c3a6fe37fc36537b939ea75a59fb2d5963246fb.diff

LOG: Fix a mistyping introduced with the new container command.

I also added a call to help in the test which was crashing before
the test, and not after.

Added: 
    

Modified: 
    lldb/source/Interpreter/CommandInterpreter.cpp
    lldb/test/API/commands/command/container/TestContainerCommands.py

Removed: 
    


################################################################################
diff  --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index f9ba5c3d2a2ea..760a33ac09295 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1445,7 +1445,7 @@ void CommandInterpreter::GetHelp(CommandReturnObject &result,
     result.AppendMessage("Current user-defined container commands:");
     result.AppendMessage("");
     max_len = FindLongestCommandWord(m_user_mw_dict);
-    for (pos = m_user_dict.begin(); pos != m_user_mw_dict.end(); ++pos) {
+    for (pos = m_user_mw_dict.begin(); pos != m_user_mw_dict.end(); ++pos) {
       OutputFormattedHelpText(result.GetOutputStream(), pos->first, "--",
                               pos->second->GetHelp(), max_len);
     }

diff  --git a/lldb/test/API/commands/command/container/TestContainerCommands.py b/lldb/test/API/commands/command/container/TestContainerCommands.py
index 3bfb3ec62ad63..7fcb361d50da0 100644
--- a/lldb/test/API/commands/command/container/TestContainerCommands.py
+++ b/lldb/test/API/commands/command/container/TestContainerCommands.py
@@ -69,7 +69,9 @@ def container_add(self):
         self.expect("test-multi test-multi-sub welcome friend", "Used the new command class",
                     substrs=["Hello friend, welcome again to LLDB"])
         self.expect("apropos welcome", "welcome should show up in apropos", substrs=["A docstring for the second Welcome"])
-        
+        self.expect("help test-multi test-multi-sub welcome", "welcome should show up in help", substrs=["A docstring for the second Welcome"])
+        self.expect("help", "test-multi should show up in help", substrs=["test-multi"])
+                    
         # Now switch the default and make sure we can now delete w/o the overwrite option:
         self.runCmd("settings set interpreter.require-overwrite 0")
         self.runCmd("command script add -c welcome.WelcomeCommand test-multi test-multi-sub welcome")


        


More information about the lldb-commits mailing list