[Lldb-commits] [lldb] r274215 - Correct watchpoint size test failure on certain devices
Author: omjavaid Date: Thu Jun 30 02:09:46 2016 New Revision: 274215 URL: http://llvm.org/viewvc/llvm-project?rev=274215&view=rev Log: Correct watchpoint size test failure on certain devices I overlooked the possibility of certain targets translating increment statement into a read and write. In this case we replace increment statement with an assignment. Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c?rev=274215&r1=274214&r2=274215&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/main.c Thu Jun 30 02:09:46 2016 @@ -27,7 +27,7 @@ int main(int argc, char** argv) { { printf("About to write byteArray[%d] ...\n", i); // About to write byteArray pad0++; -byteArray[i]++; +byteArray[i] = 7; pad1++; localByte = byteArray[i]; // Here onwards we should'nt be stopped in loop byteArray[i]++; @@ -41,7 +41,7 @@ int main(int argc, char** argv) { { printf("About to write wordArray[%d] ...\n", i); // About to write wordArray pad0++; -wordArray[i]++; +wordArray[i] = 7; pad1++; localWord = wordArray[i]; // Here onwards we should'nt be stopped in loop wordArray[i]++; @@ -55,7 +55,7 @@ int main(int argc, char** argv) { { printf("About to write dwordArray[%d] ...\n", i); // About to write dwordArray pad0++; -dwordArray[i]++; +dwordArray[i] = 7; pad1++; localDword = dwordArray[i]; // Here onwards we shouldn't be stopped in loop dwordArray[i]++; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20464: [LLDB][MIPS] Check if libatomic needs to be specified explicitly.
nitesh.jain added a comment. In http://reviews.llvm.org/D20464#470527, @Eugene.Zelenko wrote: > This change broke standalone build. Looks like check which should set > HAVE_CXX_ATOMICS64_WITHOUT_LIB was not performed. > > I build LLDB with LLVM STL which doesn't have libatomic. The CheckAtomic.cmake module (http://reviews.llvm.org/D20896) in llvm will set HAVE_CXX_ATOMICS64_WITHOUT_LIB to true if atomics work without the library. Please can you check whether it is set to true in your case ? Thanks Repository: rL LLVM http://reviews.llvm.org/D20464 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21770: Improve ADB utilization within Android platform
ovyalov added a comment. If you okay with that I'd like to submit this CL as-is and come up with unit test with a separate change list. http://reviews.llvm.org/D21770 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D21770: Improve ADB utilization within Android platform
labath accepted this revision. labath added a comment. This revision is now accepted and ready to land. ok, sounds good. http://reviews.llvm.org/D21770 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D21898: Enable test log collection from remote debug servers (take 2)
labath created this revision. labath added a reviewer: tfiala. labath added a subscriber: lldb-commits. This is a slightly reworked version of D16322, which I had reverted because it did not do what it advertised. Differences from the previous version are: - moved the code for cleaning up the remote working dir to a later point as it was removing the log file before we could get to it. - specialised log downloading code for gdb-remote tests is not needed, as this will cover that use case as well. http://reviews.llvm.org/D21898 Files: packages/Python/lldbsuite/test/lldbtest.py packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py Index: packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py === --- packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py +++ packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py @@ -78,7 +78,6 @@ TestBase.setUp(self) self.setUpBaseLogging() -self._remote_server_log_file = None self.debug_monitor_extra_args = [] self._pump_queues = socket_packet_pump.PumpQueues() @@ -114,12 +113,6 @@ def tearDown(self): self._pump_queues.verify_queues_empty() -if self._remote_server_log_file is not None: -lldb.remote_platform.Get(lldb.SBFileSpec(self._remote_server_log_file), -lldb.SBFileSpec(self.getLocalServerLogFile())) -lldb.remote_platform.Run(lldb.SBPlatformShellCommand("rm " + self._remote_server_log_file)) -self._remote_server_log_file = None - self.logger.removeHandler(self._verbose_log_handler) self._verbose_log_handler = None TestBase.tearDown(self) @@ -133,7 +126,6 @@ if lldb.remote_platform: log_file = lldbutil.join_remote_paths(lldb.remote_platform.GetWorkingDirectory(), "server.log") -self._remote_server_log_file = log_file else: log_file = self.getLocalServerLogFile() Index: packages/Python/lldbsuite/test/lldbtest.py === --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -583,24 +583,26 @@ else: categories = "default" -if channel == "gdb-remote": +if channel == "gdb-remote" and lldb.remote_platform is None: # communicate gdb-remote categories to debugserver os.environ["LLDB_DEBUGSERVER_LOG_FLAGS"] = categories self.ci.HandleCommand(log_enable + channel_with_categories, self.res) if not self.res.Succeeded(): raise Exception('log enable failed (check LLDB_LOG_OPTION env variable)') # Communicate log path name to debugserver & lldb-server -server_log_path = "{}-server.log".format(log_basename) -open(server_log_path, 'w').close() -os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path +# For remote debugging, these variables need to be set when starting the platform +# instance. +if lldb.remote_platform is None: +server_log_path = "{}-server.log".format(log_basename) +open(server_log_path, 'w').close() +os.environ["LLDB_DEBUGSERVER_LOG_FILE"] = server_log_path -# Communicate channels to lldb-server -os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels) +# Communicate channels to lldb-server +os.environ["LLDB_SERVER_LOG_CHANNELS"] = ":".join(lldbtest_config.channels) -if len(lldbtest_config.channels) == 0: -return +self.addTearDownHook(self.disableLogChannelsForCurrentTest) def disableLogChannelsForCurrentTest(self): # close all log files that we opened @@ -611,6 +613,42 @@ if not self.res.Succeeded(): raise Exception('log disable failed (check LLDB_LOG_OPTION env variable)') +# Retrieve the server log (if any) from the remote system. It is assumed the server log +# is writing to the "server.log" file in the current test directory. This can be +# achieved by setting LLDB_DEBUGSERVER_LOG_FILE="server.log" when starting remote +# platform. If the remote logging is not enabled, then just let the Get() command silently +# fail. +if lldb.remote_platform: +lldb.remote_platform.Get(lldb.SBFileSpec("server.log"), +lldb.SBFileSpec(self.getLogBasenameForCurrentTest()+"-server.log")) + +def setPlatformWorkingDir(self): +if not lldb.remote_platform or not configuration.lldb_platform_working_dir: +return + +remote_test_dir = lldbutil.join_remote_paths( +configuration.lldb_platform_working_dir, +self.getArchitecture(), +
[Lldb-commits] [lldb] r274254 - Removed the redundant "%d errors parsing expression" error. Nobody keeps score.
Author: spyffe Date: Thu Jun 30 13:00:32 2016 New Revision: 274254 URL: http://llvm.org/viewvc/llvm-project?rev=274254&view=rev Log: Removed the redundant "%d errors parsing expression" error. Nobody keeps score. Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py?rev=274254&r1=274253&r2=274254&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py Thu Jun 30 13:00:32 2016 @@ -36,9 +36,9 @@ class MiVarTestCase(lldbmi_testcase.MiTe # Print non-existant variable self.runCmd("-var-create var1 * undef") -self.expect("\^error,msg=\"error: use of undeclared identifier \'undef\'nerror: 1 error parsing expressionn\"") +self.expect("\^error,msg=\"error: use of undeclared identifier \'undef\'n\"") self.runCmd("-data-evaluate-expression undef") -self.expect("\^error,msg=\"error: use of undeclared identifier \'undef\'nerror: 1 error parsing expressionn\"") +self.expect("\^error,msg=\"error: use of undeclared identifier \'undef\'n\"") # Print global "g_MyVar", modify, delete and create again self.runCmd("-data-evaluate-expression g_MyVar") Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp?rev=274254&r1=274253&r2=274254&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp Thu Jun 30 13:00:32 2016 @@ -511,8 +511,6 @@ ClangUserExpression::Parse(DiagnosticMan m_fixed_text = fixed_expression.substr(fixed_start, fixed_end - fixed_start); } } -diagnostic_manager.Printf(eDiagnosticSeverityError, "%u error%s parsing expression", num_errors, - num_errors == 1 ? "" : "s"); ResetDeclMap(); // We are being careful here in the case of breakpoint conditions. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp?rev=274254&r1=274253&r2=274254&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp Thu Jun 30 13:00:32 2016 @@ -115,9 +115,6 @@ ClangUtilityFunction::Install(Diagnostic if (num_errors) { -diagnostic_manager.Printf(eDiagnosticSeverityError, "%d error%s parsing expression", num_errors, - num_errors == 1 ? "" : "s"); - ResetDeclMap(); return false; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r274256 - Improve ADB utilization within Android platform.
Author: ovyalov Date: Thu Jun 30 13:10:27 2016 New Revision: 274256 URL: http://llvm.org/viewvc/llvm-project?rev=274256&view=rev Log: Improve ADB utilization within Android platform. http://reviews.llvm.org/D21770 Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp lldb/trunk/source/Plugins/Platform/Android/AdbClient.h lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=274256&r1=274255&r2=274256&view=diff == --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Thu Jun 30 13:10:27 2016 @@ -8,19 +8,20 @@ //===--===// // Other libraries and framework includes +#include "AdbClient.h" + +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/Support/FileUtilities.h" + #include "lldb/Core/DataBuffer.h" #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/DataEncoder.h" #include "lldb/Core/DataExtractor.h" #include "lldb/Core/StreamString.h" +#include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" -#include "llvm/ADT/STLExtras.h" -#include "llvm/Support/FileUtilities.h" - -// Project includes -#include "AdbClient.h" #include @@ -53,6 +54,35 @@ const uint32_t kDefaultMode = 0100770; / const char * kSocketNamespaceAbstract = "localabstract"; const char * kSocketNamespaceFileSystem = "localfilesystem"; +Error +ReadAllBytes (Connection &conn, void *buffer, size_t size) +{ +using namespace std::chrono; + +Error error; +ConnectionStatus status; +char *read_buffer = static_cast(buffer); + +auto now = steady_clock::now(); +const auto deadline = now + kReadTimeout; +size_t total_read_bytes = 0; +while (total_read_bytes < size && now < deadline) +{ +uint32_t timeout_usec = duration_cast(deadline - now).count(); +auto read_bytes = +conn.Read(read_buffer + total_read_bytes, size - total_read_bytes, timeout_usec, status, &error); +if (error.Fail ()) +return error; +total_read_bytes += read_bytes; +if (status != eConnectionStatusSuccess) +break; +now = steady_clock::now(); +} +if (total_read_bytes < size) +error = Error("Unable to read requested number of bytes. Connection status: %d.", status); +return error; +} + } // namespace Error @@ -82,11 +112,15 @@ AdbClient::CreateByDeviceID(const std::s return error; } +AdbClient::AdbClient () {} + AdbClient::AdbClient (const std::string &device_id) : m_device_id (device_id) { } +AdbClient::~AdbClient() {} + void AdbClient::SetDeviceID (const std::string &device_id) { @@ -103,7 +137,8 @@ Error AdbClient::Connect () { Error error; -m_conn.Connect ("connect://localhost:5037", &error); +m_conn.reset (new ConnectionFileDescriptor); +m_conn->Connect ("connect://localhost:5037", &error); return error; } @@ -131,6 +166,9 @@ AdbClient::GetDevices (DeviceIDList &dev for (const auto device: devices) device_list.push_back (device.split ('\t').first); +// Force disconnect since ADB closes connection after host:devices +// response is sent. +m_conn.reset (); return error; } @@ -181,10 +219,10 @@ AdbClient::DeletePortForwarding (const u } Error -AdbClient::SendMessage (const std::string &packet, const bool reconnect) +AdbClient::SendMessage (const std::string &packet) { Error error; -if (reconnect) +if (!m_conn || !m_conn->IsConnected()) { error = Connect (); if (error.Fail ()) @@ -196,11 +234,11 @@ AdbClient::SendMessage (const std::strin ConnectionStatus status; -m_conn.Write (length_buffer, 4, status, &error); +m_conn->Write (length_buffer, 4, status, &error); if (error.Fail ()) return error; -m_conn.Write (packet.c_str (), packet.size (), status, &error); +m_conn->Write (packet.c_str (), packet.size (), status, &error); return error; } @@ -251,7 +289,7 @@ AdbClient::ReadMessageStream (std::vecto if (elapsed_time >= timeout_ms) return Error("Timed out"); -size_t n = m_conn.Read(buffer, sizeof(buffer), 1000 * (timeout_ms - elapsed_time), status, &error); +size_t n = m_conn->Read(buffer, sizeof(buffer), 1000 * (timeout_ms - elapsed_time), status, &error); if (n > 0)
Re: [Lldb-commits] [PATCH] D21770: Improve ADB utilization within Android platform
ovyalov closed this revision. ovyalov added a comment. Files: /lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp /lldb/trunk/source/Plugins/Platform/Android/AdbClient.h /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.h /lldb/trunk/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp Users: ovyalov (Author) http://reviews.llvm.org/rL274256 http://reviews.llvm.org/D21770 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [PATCH] D21906: Skip TestDisassembleRawData when remote
fjricci created this revision. fjricci added reviewers: clayborg, zturner, spyffe. fjricci added a subscriber: lldb-commits. As this test will create a new target, it will cause all following tests to fail when running in platform mode, if the new target does not match the existing architecture (for example, x86 vs x86_64). http://reviews.llvm.org/D21906 Files: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py Index: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py === --- packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -19,6 +19,7 @@ @add_test_categories(['pyapi']) @no_debug_info_test +@skipIfRemote def test_disassemble_raw_data(self): """Test disassembling raw bytes with the API.""" # Create a target from the debugger. Index: packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py === --- packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py +++ packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py @@ -19,6 +19,7 @@ @add_test_categories(['pyapi']) @no_debug_info_test +@skipIfRemote def test_disassemble_raw_data(self): """Test disassembling raw bytes with the API.""" # Create a target from the debugger. ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r274277 - Fix for Windows builds.
Author: amccarth Date: Thu Jun 30 15:55:50 2016 New Revision: 274277 URL: http://llvm.org/viewvc/llvm-project?rev=274277&view=rev Log: Fix for Windows builds. Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp?rev=274277&r1=274276&r2=274277&view=diff == --- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original) +++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Thu Jun 30 15:55:50 2016 @@ -29,6 +29,12 @@ #include #include +// On Windows, transitive dependencies pull in , which defines a +// macro that clashes with a method name. +#ifdef SendMessage +#undef SendMessage +#endif + using namespace lldb; using namespace lldb_private; using namespace lldb_private::platform_android; ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D20464: [LLDB][MIPS] Check if libatomic needs to be specified explicitly.
Eugene.Zelenko added a comment. I see HAVE_CXX_ATOMICS64_WITHOUT_LIB messages during LLVM Cmake run, but I don't see such message during LLDB CMake run. Is this value is supposed to be read form LLVM CMake cache? Repository: rL LLVM http://reviews.llvm.org/D20464 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] LLVM buildmaster will be restarted around 5 PM today
Hello everyone, LLVM buildmaster will be restarted around 5 PM Pacific time today. Thank you for understanding. Thanks Galina ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits