[Lldb-commits] [lldb] r282128 - fix Args function broken in r281942

Todd Fiala via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 21 17:59:23 PDT 2016


Author: tfiala
Date: Wed Sep 21 19:59:23 2016
New Revision: 282128

URL: http://llvm.org/viewvc/llvm-project?rev=282128&view=rev
Log:
fix Args function broken in r281942

The method was hard-coded to check only the 0th element of the array.
This manifested as NSLog messages behaving incorrectly on macOS.
(This is independent of the broken DarwinLog feature).

Modified:
    lldb/trunk/source/Interpreter/Args.cpp

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=282128&r1=282127&r2=282128&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Wed Sep 21 19:59:23 2016
@@ -1002,7 +1002,7 @@ bool Args::ContainsEnvironmentVariable(l
 
   // Check each arg to see if it matches the env var name.
   for (size_t i = 0; i < GetArgumentCount(); ++i) {
-    auto arg_value = llvm::StringRef::withNullAsEmpty(GetArgumentAtIndex(0));
+    auto arg_value = llvm::StringRef::withNullAsEmpty(GetArgumentAtIndex(i));
 
     llvm::StringRef name, value;
     std::tie(name, value) = arg_value.split('=');




More information about the lldb-commits mailing list