[Lldb-commits] [PATCH] D25947: Merge Linux and FreeBSD arm64 register contexts

2016-11-24 Thread Ed Maste via lldb-commits
emaste added a comment.

The tests are not in great shape on FreeBSD/arm64 today, but look roughly 
equivalent with and without this patch.

At https://reviews.llvm.org/rL287887:

  ===
  Test Result Summary
  ===
  Test Methods:   1148
  Reruns:   16
  Success: 302
  Expected Failure: 35
  Failure:  80
  Error:26
  Exceptional Exit: 98
  Unexpected Success:1
  Skip:600
  Timeout:   6
  Expected Timeout:  0

With the patch applied:

  ===
  Test Result Summary
  ===
  Test Methods:   1147
  Reruns:   16
  Success: 299
  Expected Failure: 35
  Failure:  80
  Error:26
  Exceptional Exit:100
  Unexpected Success:1
  Skip:600
  Timeout:   6
  Expected Timeout:  0


https://reviews.llvm.org/D25947



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287883 - Enable TestRegisterVariables for some configurations

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 08:54:53 2016
New Revision: 287883

URL: http://llvm.org/viewvc/llvm-project?rev=287883=rev
Log:
Enable TestRegisterVariables for some configurations

It consistently passes for linux-clang-i386, and linux-gcc-x86_64.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py?rev=287883=287882=287883=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
 Thu Nov 24 08:54:53 2016
@@ -99,11 +99,8 @@ class RegisterVariableTestCase(TestBase)
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAll(compiler="clang", compiler_version=['<', '3.5'])
-@expectedFailureAll(compiler="clang", archs=["i386"])
-@expectedFailureAll(
-compiler="gcc", compiler_version=[
-'>=', '4.8.2'], archs=[
-"i386", "x86_64"])
+@expectedFailureAll(compiler="gcc", compiler_version=[
+'>=', '4.8.2'], archs=["i386"])
 def test_and_run_command(self):
 """Test expressions on register values."""
 


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287881 - Enable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_command

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 08:41:36 2016
New Revision: 287881

URL: http://llvm.org/viewvc/llvm-project?rev=287881=rev
Log:
Enable WatchpointPythonCommandTestCase-test_continue_in_watchpoint_command

This test passes consistently on linux, so I am removing the overall XFAIL. If 
it
fails on your configuration, please put a targeted xfail instead (i'll add them
my self if I get any breakage emails).

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py?rev=287881=287880=287881=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
 Thu Nov 24 08:41:36 2016
@@ -107,8 +107,6 @@ class WatchpointPythonCommandTestCase(Te
 
 @skipIfFreeBSD  # timing out on buildbot
 @expectedFailureAll(
-bugnumber="llvm.org/pr28055: continue in watchpoint commands disables 
the watchpoint, ")
-@expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
 # Watchpoints not supported


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287880 - Use more chrono in AdbClient

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 08:11:47 2016
New Revision: 287880

URL: http://llvm.org/viewvc/llvm-project?rev=287880=rev
Log:
Use more chrono in AdbClient

This refactors AdbClient interface in terms of std::chrono.

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

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=287880=287879=287880=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Thu Nov 24 
08:11:47 2016
@@ -383,10 +383,10 @@ Error AdbClient::internalShell(const cha
   return Error();
 }
 
-Error AdbClient::Shell(const char *command, uint32_t timeout_ms,
+Error AdbClient::Shell(const char *command, milliseconds timeout,
std::string *output) {
   std::vector output_buffer;
-  auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
+  auto error = internalShell(command, timeout, output_buffer);
   if (error.Fail())
 return error;
 
@@ -395,10 +395,10 @@ Error AdbClient::Shell(const char *comma
   return error;
 }
 
-Error AdbClient::ShellToFile(const char *command, uint32_t timeout_ms,
+Error AdbClient::ShellToFile(const char *command, milliseconds timeout,
  const FileSpec _file_spec) {
   std::vector output_buffer;
-  auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
+  auto error = internalShell(command, timeout, output_buffer);
   if (error.Fail())
 return error;
 

Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.h?rev=287880=287879=287880=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.h (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.h Thu Nov 24 08:11:47 
2016
@@ -94,9 +94,10 @@ public:
 
   Error DeletePortForwarding(const uint16_t local_port);
 
-  Error Shell(const char *command, uint32_t timeout_ms, std::string *output);
+  Error Shell(const char *command, std::chrono::milliseconds timeout,
+  std::string *output);
 
-  Error ShellToFile(const char *command, uint32_t timeout_ms,
+  Error ShellToFile(const char *command, std::chrono::milliseconds timeout,
 const FileSpec _file_spec);
 
   std::unique_ptr GetSyncService(Error );

Modified: lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp?rev=287880=287879=287880=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/PlatformAndroid.cpp Thu Nov 24 
08:11:47 2016
@@ -28,6 +28,7 @@
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_android;
+using namespace std::chrono;
 
 static uint32_t g_initialize_count = 0;
 static const unsigned int g_android_default_cache_size =
@@ -230,7 +231,7 @@ Error PlatformAndroid::GetFile(const Fil
   char cmd[PATH_MAX];
   snprintf(cmd, sizeof(cmd), "cat '%s'", source_file);
 
-  return adb.ShellToFile(cmd, 6 /* ms */, destination);
+  return adb.ShellToFile(cmd, minutes(1), destination);
 }
 
 Error PlatformAndroid::PutFile(const FileSpec ,
@@ -288,7 +289,7 @@ uint32_t PlatformAndroid::GetSdkVersion(
   std::string version_string;
   AdbClient adb(m_device_id);
   Error error =
-  adb.Shell("getprop ro.build.version.sdk", 5000 /* ms */, 
_string);
+  adb.Shell("getprop ro.build.version.sdk", seconds(5), _string);
   version_string = llvm::StringRef(version_string).trim().str();
 
   if (error.Fail() || version_string.empty()) {
@@ -327,7 +328,7 @@ Error PlatformAndroid::DownloadSymbolFil
   AdbClient adb(m_device_id);
   std::string tmpdir;
   Error error = adb.Shell("mktemp --directory --tmpdir /data/local/tmp",
-  5000 /* ms */, );
+  seconds(5), );
   if (error.Fail() || tmpdir.empty())
 return Error("Failed to generate temporary directory on the device (%s)",
  error.AsCString());
@@ -338,7 +339,7 @@ Error PlatformAndroid::DownloadSymbolFil
   tmpdir_remover(, [this, ](std::string *s) {
 StreamString command;
 command.Printf("rm -rf %s", s->c_str());
-Error error = adb.Shell(command.GetData(), 5000 /* ms */, nullptr);
+Error error = adb.Shell(command.GetData(), seconds(5), nullptr);
 
 Log 

[Lldb-commits] [lldb] r287879 - Use chrono in AdbClient

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 08:03:57 2016
New Revision: 287879

URL: http://llvm.org/viewvc/llvm-project?rev=287879=rev
Log:
Use chrono in AdbClient

This refactors the class implementations to use chrono. I'll follow this up with
a refactor of the class interface.

Modified:
lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp
lldb/trunk/source/Plugins/Platform/Android/AdbClient.h

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=287879=287878=287879=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.cpp Thu Nov 24 
08:03:57 2016
@@ -41,10 +41,11 @@
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::platform_android;
+using namespace std::chrono;
 
 namespace {
 
-const std::chrono::seconds kReadTimeout(8);
+const seconds kReadTimeout(8);
 const char *kOKAY = "OKAY";
 const char *kFAIL = "FAIL";
 const char *kDATA = "DATA";
@@ -64,7 +65,6 @@ const char *kSocketNamespaceAbstract = "
 const char *kSocketNamespaceFileSystem = "localfilesystem";
 
 Error ReadAllBytes(Connection , void *buffer, size_t size) {
-  using namespace std::chrono;
 
   Error error;
   ConnectionStatus status;
@@ -263,23 +263,22 @@ Error AdbClient::ReadMessage(std::vector
 }
 
 Error AdbClient::ReadMessageStream(std::vector ,
-   uint32_t timeout_ms) {
-  auto start = std::chrono::steady_clock::now();
+   milliseconds timeout) {
+  auto start = steady_clock::now();
   message.clear();
 
   Error error;
   lldb::ConnectionStatus status = lldb::eConnectionStatusSuccess;
   char buffer[1024];
   while (error.Success() && status == lldb::eConnectionStatusSuccess) {
-auto end = std::chrono::steady_clock::now();
-uint32_t elapsed_time =
-std::chrono::duration_cast(end - start)
-.count();
-if (elapsed_time >= timeout_ms)
+auto end = steady_clock::now();
+auto elapsed = end - start;
+if (elapsed >= timeout)
   return Error("Timed out");
 
-size_t n = m_conn->Read(buffer, sizeof(buffer),
-1000 * (timeout_ms - elapsed_time), status, 
);
+size_t n = m_conn->Read(
+buffer, sizeof(buffer),
+duration_cast(timeout - elapsed).count(), status, 
);
 if (n > 0)
   message.insert(message.end(), [0], [n]);
   }
@@ -350,7 +349,7 @@ Error AdbClient::ReadAllBytes(void *buff
   return ::ReadAllBytes(*m_conn, buffer, size);
 }
 
-Error AdbClient::internalShell(const char *command, uint32_t timeout_ms,
+Error AdbClient::internalShell(const char *command, milliseconds timeout,
std::vector _buf) {
   output_buf.clear();
 
@@ -368,7 +367,7 @@ Error AdbClient::internalShell(const cha
   if (error.Fail())
 return error;
 
-  error = ReadMessageStream(output_buf, timeout_ms);
+  error = ReadMessageStream(output_buf, timeout);
   if (error.Fail())
 return error;
 
@@ -387,7 +386,7 @@ Error AdbClient::internalShell(const cha
 Error AdbClient::Shell(const char *command, uint32_t timeout_ms,
std::string *output) {
   std::vector output_buffer;
-  auto error = internalShell(command, timeout_ms, output_buffer);
+  auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
   if (error.Fail())
 return error;
 
@@ -399,7 +398,7 @@ Error AdbClient::Shell(const char *comma
 Error AdbClient::ShellToFile(const char *command, uint32_t timeout_ms,
  const FileSpec _file_spec) {
   std::vector output_buffer;
-  auto error = internalShell(command, timeout_ms, output_buffer);
+  auto error = internalShell(command, milliseconds(timeout_ms), output_buffer);
   if (error.Fail())
 return error;
 
@@ -477,9 +476,7 @@ Error AdbClient::SyncService::internalPu
   return Error("Failed to send file chunk: %s", error.AsCString());
   }
   error = SendSyncRequest(
-  kDONE, std::chrono::duration_cast(
- 
FileSystem::GetModificationTime(local_file).time_since_epoch())
- .count(),
+  kDONE, llvm::sys::toTimeT(FileSystem::GetModificationTime(local_file)),
   nullptr);
   if (error.Fail())
 return error;

Modified: lldb/trunk/source/Plugins/Platform/Android/AdbClient.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/Android/AdbClient.h?rev=287879=287878=287879=diff
==
--- lldb/trunk/source/Plugins/Platform/Android/AdbClient.h (original)
+++ lldb/trunk/source/Plugins/Platform/Android/AdbClient.h Thu Nov 24 08:03:57 
2016
@@ -10,21 +10,14 @@
 #ifndef liblldb_AdbClient_h_
 #define liblldb_AdbClient_h_
 
-// C Includes
-
-// C++ 

[Lldb-commits] [lldb] r287867 - Attempt to fix freebsd build after r287864

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 05:22:43 2016
New Revision: 287867

URL: http://llvm.org/viewvc/llvm-project?rev=287867=rev
Log:
Attempt to fix freebsd build after r287864

the chrono library there uses long long as the underlying chrono type, but
defines int64_t as long (or the other way around, I am not sure). In any case,
this caused the implicit conversion to not trigger. This should address that.

Also fix up the relevant unit test.

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h?rev=287867=287866=287867=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h Thu 
Nov 24 05:22:43 2016
@@ -57,9 +57,9 @@ template 
 class Timeout : public llvm::Optional> {
 private:
   template  using Dur = std::chrono::duration;
-  template 
+  template 
   using EnableIf = std::enable_if<
-  std::is_convertible,
+  std::is_convertible,
   std::chrono::duration>::value>;
 
   using Base = llvm::Optional;
@@ -68,12 +68,15 @@ public:
   Timeout(llvm::NoneType none) : Base(none) {}
   Timeout(const Timeout ) = default;
 
-  template ::type>
+  template ::type>
   Timeout(const Timeout )
   : Base(other ? Base(Dur(*other)) : llvm::None) {}
 
-  template ::type>
-  Timeout(const Dur ) : Base(Dur(other)) {}
+  template ::type>
+  Timeout(const std::chrono::duration )
+  : Base(Dur(other)) {}
 };
 
 class GDBRemoteCommunication : public Communication {

Modified: lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h?rev=287867=287866=287867=diff
==
--- lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h (original)
+++ lldb/trunk/unittests/Process/gdb-remote/GDBRemoteTestUtils.h Thu Nov 24 
05:22:43 2016
@@ -36,10 +36,9 @@ struct MockServer : public GDBRemoteComm
   }
 
   PacketResult GetPacket(StringExtractorGDBRemote ) {
-const unsigned timeout_usec = 100; // 1s
 const bool sync_on_timeout = false;
-return WaitForPacketWithTimeoutMicroSecondsNoLock(response, timeout_usec,
-  sync_on_timeout);
+return WaitForPacketNoLock(response, std::chrono::seconds(1),
+   sync_on_timeout);
   }
 
   using GDBRemoteCommunicationServer::SendOKResponse;


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26971: Introduce chrono to more gdb-remote functions

2016-11-24 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL287864: Introduce chrono to more gdb-remote functions 
(authored by labath).

Changed prior to commit:
  https://reviews.llvm.org/D26971?vs=79050=79203#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D26971

Files:
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
  lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
  
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
  lldb/trunk/tools/lldb-server/lldb-platform.cpp

Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -926,8 +926,8 @@
   bool done = false;
   Error error;
   while (true) {
-const PacketResult result =
-GetPacketAndSendResponse(0, error, interrupt, done);
+const PacketResult result = GetPacketAndSendResponse(
+std::chrono::microseconds(0), error, interrupt, done);
 if (result == PacketResult::ErrorReplyTimeout)
   break; // No more packets in the queue
 
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -53,6 +53,29 @@
 
 class ProcessGDBRemote;
 
+template 
+class Timeout : public llvm::Optional> {
+private:
+  template  using Dur = std::chrono::duration;
+  template 
+  using EnableIf = std::enable_if<
+  std::is_convertible,
+  std::chrono::duration>::value>;
+
+  using Base = llvm::Optional;
+
+public:
+  Timeout(llvm::NoneType none) : Base(none) {}
+  Timeout(const Timeout ) = default;
+
+  template ::type>
+  Timeout(const Timeout )
+  : Base(other ? Base(Dur(*other)) : llvm::None) {}
+
+  template ::type>
+  Timeout(const Dur ) : Base(Dur(other)) {}
+};
+
 class GDBRemoteCommunication : public Communication {
 public:
   enum {
@@ -226,16 +249,15 @@
   PacketResult SendPacketNoLock(llvm::StringRef payload);
 
   PacketResult ReadPacket(StringExtractorGDBRemote ,
-  uint32_t timeout_usec, bool sync_on_timeout);
+  Timeout timeout, bool sync_on_timeout);
 
   // Pop a packet from the queue in a thread safe manner
   PacketResult PopPacketFromQueue(StringExtractorGDBRemote ,
-  uint32_t timeout_usec);
+  Timeout timeout);
 
-  PacketResult
-  WaitForPacketWithTimeoutMicroSecondsNoLock(StringExtractorGDBRemote ,
- uint32_t timeout_usec,
- bool sync_on_timeout);
+  PacketResult WaitForPacketNoLock(StringExtractorGDBRemote ,
+   Timeout timeout,
+   bool sync_on_timeout);
 
   bool CompressionIsEnabled() {
 return m_compression_type != CompressionType::None;
Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
===
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -20,8 +20,9 @@
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_gdb_remote;
+using namespace std::chrono;
 
-static const std::chrono::seconds kInterruptTimeout(5);
+static const seconds kInterruptTimeout(5);
 
 /
 // GDBRemoteClientBase //
@@ -51,18 +52,13 @@
   OnRunPacketSent(true);
 
   for (;;) {
-PacketResult read_result = ReadPacket(
-response,
-std::chrono::duration_cast(kInterruptTimeout)
-.count(),
-false);
+PacketResult read_result = ReadPacket(response, kInterruptTimeout, false);
 switch (read_result) {
 case PacketResult::ErrorReplyTimeout: {
   std::lock_guard lock(m_mutex);
   if (m_async_count == 0)
 continue;
-  if (std::chrono::steady_clock::now() >=
-  m_interrupt_time + kInterruptTimeout)
+  if (steady_clock::now() >= m_interrupt_time + kInterruptTimeout)
 return eStateInvalid;
 }
 case 

[Lldb-commits] [lldb] r287864 - Introduce chrono to more gdb-remote functions

2016-11-24 Thread Pavel Labath via lldb-commits
Author: labath
Date: Thu Nov 24 04:54:49 2016
New Revision: 287864

URL: http://llvm.org/viewvc/llvm-project?rev=287864=rev
Log:
Introduce chrono to more gdb-remote functions

Summary:
This replaces the usage of raw integers with duration classes in the gdb-remote
packet management functions. The values are still converted back to integers 
once
they go into the generic Communication class -- that I am leaving to a separate
change.

The changes are mostly straight-forward (*), the only tricky part was
representation of infinite timeouts.

Currently, we use UINT32_MAX to denote infinite timeout. This is not well suited
for duration classes, as they tend to do arithmetic on the values, and the
identity of the MAX value can easily get lost (e.g.
microseconds(seconds(UINT32_MAX)).count() != UINT32_MAX). We cannot use zero to
represent infinity (as Listener classes do) because we already use it to do
non-blocking polling reads. For this reason, I chose to have an explicit value
for infinity.

The way I achieved that is via llvm::Optional, and I think it reads quite
natural. Passing llvm::None as "timeout" means "no timeout", while passing zero
means "poll". The only tricky part is this breaks implicit conversions (seconds
are implicitly convertible to microseconds, but Optional cannot be
easily converted into Optional). For this reason I added a special
class Timeout, inheriting from Optional, and enabling the necessary conversions
one would normally expect.

(*) The other tricky part was GDBRemoteCommunication::PopPacketFromQueue, which
was needlessly complicated. I've simplified it, but that one is only used in
non-stop mode, and so is untested.

Reviewers: clayborg, zturner, jingham

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D26971

Modified:
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h

lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
lldb/trunk/tools/lldb-server/lldb-platform.cpp

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp?rev=287864=287863=287864=diff
==
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp 
(original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp Thu 
Nov 24 04:54:49 2016
@@ -20,8 +20,9 @@
 using namespace lldb;
 using namespace lldb_private;
 using namespace lldb_private::process_gdb_remote;
+using namespace std::chrono;
 
-static const std::chrono::seconds kInterruptTimeout(5);
+static const seconds kInterruptTimeout(5);
 
 /
 // GDBRemoteClientBase //
@@ -51,18 +52,13 @@ StateType GDBRemoteClientBase::SendConti
   OnRunPacketSent(true);
 
   for (;;) {
-PacketResult read_result = ReadPacket(
-response,
-
std::chrono::duration_cast(kInterruptTimeout)
-.count(),
-false);
+PacketResult read_result = ReadPacket(response, kInterruptTimeout, false);
 switch (read_result) {
 case PacketResult::ErrorReplyTimeout: {
   std::lock_guard lock(m_mutex);
   if (m_async_count == 0)
 continue;
-  if (std::chrono::steady_clock::now() >=
-  m_interrupt_time + kInterruptTimeout)
+  if (steady_clock::now() >= m_interrupt_time + kInterruptTimeout)
 return eStateInvalid;
 }
 case PacketResult::Success:
@@ -188,11 +184,7 @@ GDBRemoteClientBase::SendPacketAndWaitFo
 
   const size_t max_response_retries = 3;
   for (size_t i = 0; i < max_response_retries; ++i) {
-packet_result = ReadPacket(
-response, std::chrono::duration_cast(
-  GetPacketTimeout())
-  .count(),
-true);
+packet_result = ReadPacket(response, GetPacketTimeout(), true);
 // Make sure we received a response
 if (packet_result != PacketResult::Success)
   return packet_result;
@@ -232,7 +224,7 @@ bool GDBRemoteClientBase::SendvContPacke
   OnRunPacketSent(true);
 
   // wait for the response to the vCont
-  if (ReadPacket(response, UINT32_MAX, false) == PacketResult::Success) {
+  if (ReadPacket(response, llvm::None, false) == PacketResult::Success) {
 if (response.IsOKResponse())
   return true;
   }
@@ -254,8 +246,7 @@ bool GDBRemoteClientBase::ShouldStop(con
   // additional packet to make sure the packet sequence does not get
   // skewed.
   StringExtractorGDBRemote 

[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-24 Thread Howard Hellyer via lldb-commits
hhellyer added a comment.

@labath - Yes sorry about that. To be safe I did the "honest" thing of using 
arc to pull down the patch from phabriactor and then arc commit to land it to 
make sure I committed exactly what was reviewed. Somewhere in that it lost the 
contents of the core files and just created empty files for them.  :-(


https://reviews.llvm.org/D26676



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D26676: Patch for lldb bug 26322 “core load hangs”

2016-11-24 Thread Pavel Labath via lldb-commits
labath added a comment.

Oh, you fixed it. Thank you. :)


https://reviews.llvm.org/D26676



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D27085: [LLDB][MIPS] Fix TestMultipleHits for MIPS

2016-11-24 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Thank you.


https://reviews.llvm.org/D27085



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r287862 - Remove \x13 (^S) character that was likely added by mistake.

2016-11-24 Thread Adrian Kuegel via lldb-commits
Author: akuegel
Date: Thu Nov 24 04:01:34 2016
New Revision: 287862

URL: http://llvm.org/viewvc/llvm-project?rev=287862=rev
Log:
Remove \x13 (^S) character that was likely added by mistake.

r287386 added a \x13 character inside a string literal. Most likely this
was by mistake, so remove it.

Differential Revision: https://reviews.llvm.org/D26973

Modified:
lldb/trunk/source/Commands/CommandObjectThread.cpp

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=287862=287861=287862=diff
==
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Nov 24 04:01:34 2016
@@ -979,7 +979,7 @@ public:
 "current or specified thread.  Stops when returning from "
 "the current function as a safety measure.  "
 "The target line number(s) are given as arguments, and if more 
than one"
-" is provided, stepping will stop when the first one is hit.",
+" is provided, stepping will stop when the first one is hit.",
 nullptr,
 eCommandRequiresThread | eCommandTryTargetAPILock |
 eCommandProcessMustBeLaunched | eCommandProcessMustBePaused),


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D27088: [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPS

2016-11-24 Thread Nitesh Jain via lldb-commits
nitesh.jain created this revision.
nitesh.jain added reviewers: clayborg, labath, zturner.
nitesh.jain added subscribers: jaydeep, bhushan, slthakur, lldb-commits.

In case of MIPS, the floating point register size is based on FR bit of status 
register(SR) (https://reviews.llvm.org/rL277343). In this patch, we update 
reg_info["bitsize"] based on SR.FR bit.


https://reviews.llvm.org/D27088

Files:
  packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py


Index: packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -12,6 +12,7 @@
 
 from __future__ import print_function
 
+import struct
 
 import unittest2
 import gdbremote_testcase
@@ -565,6 +566,26 @@
 # Verify the response length.
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
+triple = lldb.DBG.GetSelectedPlatform().GetTriple()
+
+if re.match("^mips",triple):
+if reg_info["name"] == "sr":
+split_triple = triple.split("--",1)
+if split_triple[0] == "mips64el" or split_triple == 
"mipsel":
+# In case of little endian
+# first decode the HEX ASCII bytes and then reverse it
+# to get actual value of SR register  
+p_response = "".join(reversed([p_response[i:i+2] for i 
in range(0,
+ len(p_response),2)]))
+# Check for SR.FR bit
+# if SR.FR(26) == 0 && reg_info["format"] == "float"
+# then reg_info["bitsize"] = 32
+sr_value = int(p_response,16)
+flag = 1
+flag = (sr_value >> 26) & flag
+
+if reg_info["format"] == "float" and (flag != 1):
+reg_info["bitsize"] = 32
 self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
 
 # Increment loop


Index: packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -12,6 +12,7 @@
 
 from __future__ import print_function
 
+import struct
 
 import unittest2
 import gdbremote_testcase
@@ -565,6 +566,26 @@
 # Verify the response length.
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
+triple = lldb.DBG.GetSelectedPlatform().GetTriple()
+
+if re.match("^mips",triple):
+if reg_info["name"] == "sr":
+split_triple = triple.split("--",1)
+if split_triple[0] == "mips64el" or split_triple == "mipsel":
+# In case of little endian
+# first decode the HEX ASCII bytes and then reverse it
+# to get actual value of SR register  
+p_response = "".join(reversed([p_response[i:i+2] for i in range(0,
+ len(p_response),2)]))
+# Check for SR.FR bit
+# if SR.FR(26) == 0 && reg_info["format"] == "float"
+# then reg_info["bitsize"] = 32
+sr_value = int(p_response,16)
+flag = 1
+flag = (sr_value >> 26) & flag
+
+if reg_info["format"] == "float" and (flag != 1):
+reg_info["bitsize"] = 32
 self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
 
 # Increment loop
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits