Re: [Lldb-commits] [PATCH] D18082: [LLDB]{MIPS] Fix TestPlatformProcessConnect.py

2016-03-14 Thread Pavel Labath via lldb-commits
labath accepted this revision.
labath added a comment.

Looks great. Thank you.


Repository:
  rL LLVM

http://reviews.llvm.org/D18082



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


Re: [Lldb-commits] [PATCH] D18096: accept any build-id length between 4 and 20 bytes inclusive

2016-03-14 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.
labath accepted this revision.
labath added a reviewer: labath.
labath added a comment.
This revision is now accepted and ready to land.

I think that's fine (you may want to add a note about the crc to the comment).


http://reviews.llvm.org/D18096



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


[Lldb-commits] [PATCH] D18140: [test] Persist packets between expect_gdbremote_sequence invocations

2016-03-14 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added a reviewer: tfiala.
labath added a subscriber: lldb-commits.

Some tests (Hc_then_Csignal_signals_correct_thread, at least) were sending a 
"continue" packet in
one expect_gdbremote_sequence invocation, and "expecting" the stop-reply in 
another call. This
posed a problem, because the were packets were not persisted between the two 
invocations, and if
the stub was exceptionally fast to respond, the packet would be received in the 
first invocation
(where it would be ignored) and then the second invocation would fail because 
it could not find
the packet.

Since doing matching in two invocations seems like a reasonable use of the 
packet pump, instead
of fixing the test, I make sure the packet_pump supports this usage by making 
the list of
captured packets persistent.

http://reviews.llvm.org/D18140

Files:
  packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  packages/Python/lldbsuite/test/tools/lldb-server/lldbgdbserverutils.py
  packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py

Index: packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py
===
--- packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py
+++ packages/Python/lldbsuite/test/tools/lldb-server/socket_packet_pump.py
@@ -26,6 +26,33 @@
 print(codecs.encode(the_queue.get(True), "string_escape"))
 print("\n")
 
+class PumpQueues(object):
+def __init__(self):
+self._output_queue = queue.Queue()
+self._packet_queue = queue.Queue()
+
+def output_queue(self):
+return self._output_queue
+
+def packet_queue(self):
+return self._packet_queue
+
+def verify_queues_empty(self):
+# Warn if there is any content left in any of the queues.
+# That would represent unmatched packets.
+if not self.output_queue().empty():
+print("warning: output queue entries still exist:")
+_dump_queue(self.output_queue())
+print("from here:")
+traceback.print_stack()
+
+if not self.packet_queue().empty():
+print("warning: packet queue entries still exist:")
+_dump_queue(self.packet_queue())
+print("from here:")
+traceback.print_stack()
+
+
 class SocketPacketPump(object):
 """A threaded packet reader that partitions packets into two streams.
 
@@ -40,18 +67,17 @@
 
 _GDB_REMOTE_PACKET_REGEX = re.compile(r'^\$([^\#]*)#[0-9a-fA-F]{2}')
 
-def __init__(self, pump_socket, logger=None):
+def __init__(self, pump_socket, pump_queues, logger=None):
 if not pump_socket:
 raise Exception("pump_socket cannot be None")
 
-self._output_queue = queue.Queue()
-self._packet_queue = queue.Queue()
 self._thread = None
 self._stop_thread = False
 self._socket = pump_socket
 self._logger = logger
 self._receive_buffer = ""
 self._accumulated_output = ""
+self._pump_queues = pump_queues
 
 def __enter__(self):
 """Support the python 'with' statement.
@@ -66,20 +92,6 @@
 Shut down the pump thread."""
 self.stop_pump_thread()
 
-# Warn if there is any content left in any of the queues.
-# That would represent unmatched packets.
-if not self.output_queue().empty():
-print("warning: output queue entries still exist:")
-_dump_queue(self.output_queue())
-print("from here:")
-traceback.print_stack()
-
-if not self.packet_queue().empty():
-print("warning: packet queue entries still exist:")
-_dump_queue(self.packet_queue())
-print("from here:")
-traceback.print_stack()
-
 def start_pump_thread(self):
 if self._thread:
 raise Exception("pump thread is already running")
@@ -92,12 +104,6 @@
 if self._thread:
 self._thread.join()
 
-def output_queue(self):
-return self._output_queue
-
-def packet_queue(self):
-return self._packet_queue
-
 def _process_new_bytes(self, new_bytes):
 if not new_bytes:
 return
@@ -114,7 +120,7 @@
 has_more = False
 # handle '+' ack
 elif self._receive_buffer[0] == "+":
-self._packet_queue.put("+")
+self._pump_queues.packet_queue().put("+")
 self._receive_buffer = self._receive_buffer[1:]
 if self._logger:
 self._logger.debug(
@@ -132,10 +138,10 @@
 if new_output_content:
 # This was an $O packet with new content.
 self._accumulated_output += new_output_content
-self._output_queue.put(self._accumulated_output)
+self._pump_queues.outp

[Lldb-commits] [lldb] r263421 - Extend XFlaky in TestProcessIO to linux as well

2016-03-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Mar 14 06:19:39 2016
New Revision: 263421

URL: http://llvm.org/viewvc/llvm-project?rev=263421&view=rev
Log:
Extend XFlaky in TestProcessIO to linux as well

The test sometimes fails on local linux as well. The cause is the same.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py?rev=263421&r1=263420&r2=263421&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
 Mon Mar 14 06:19:39 2016
@@ -30,7 +30,7 @@ class ProcessIOTestCase(TestBase):
 
 @skipIfWindows # stdio manipulation unsupported on Windows
 @add_test_categories(['pyapi'])
-@expectedFlakeyAndroid(bugnumber="llvm.org/pr26437", api_levels=[21,22])
+@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
 def test_stdin_by_api(self):
 """Exercise SBProcess.PutSTDIN()."""
 self.build()
@@ -41,7 +41,7 @@ class ProcessIOTestCase(TestBase):
 
 @skipIfWindows # stdio manipulation unsupported on Windows
 @add_test_categories(['pyapi'])
-@expectedFlakeyAndroid(bugnumber="llvm.org/pr26437", api_levels=[21,22])
+@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
 def test_stdin_redirection(self):
 """Exercise SBLaunchInfo::AddOpenFileAction() for STDIN without 
specifying STDOUT or STDERR."""
 self.build()
@@ -53,7 +53,7 @@ class ProcessIOTestCase(TestBase):
 
 @skipIfWindows # stdio manipulation unsupported on Windows
 @add_test_categories(['pyapi'])
-@expectedFlakeyAndroid(bugnumber="llvm.org/pr26437", api_levels=[21,22])
+@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
 def test_stdout_redirection(self):
 """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without 
specifying STDIN or STDERR."""
 self.build()
@@ -66,7 +66,7 @@ class ProcessIOTestCase(TestBase):
 
 @skipIfWindows # stdio manipulation unsupported on Windows
 @add_test_categories(['pyapi'])
-@expectedFlakeyAndroid(bugnumber="llvm.org/pr26437", api_levels=[21,22])
+@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
 def test_stderr_redirection(self):
 """Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without 
specifying STDIN or STDOUT."""
 self.build()
@@ -79,7 +79,7 @@ class ProcessIOTestCase(TestBase):
 
 @skipIfWindows # stdio manipulation unsupported on Windows
 @add_test_categories(['pyapi'])
-@expectedFlakeyAndroid(bugnumber="llvm.org/pr26437", api_levels=[21,22])
+@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
 def test_stdout_stderr_redirection(self):
 """Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR 
without redirecting STDIN."""
 self.build()


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


Re: [Lldb-commits] [PATCH] D18096: accept any build-id length between 4 and 20 bytes inclusive

2016-03-14 Thread Ed Maste via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263432: Allow any build-id length between 4 and 20 bytes 
inclusive (authored by emaste).

Changed prior to commit:
  http://reviews.llvm.org/D18096?vs=50464&id=50587#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18096

Files:
  lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1410,8 +1410,9 @@
 // Only bother processing this if we don't already have 
the uuid set.
 if (!uuid.IsValid())
 {
-// 16 bytes is UUID|MD5, 20 bytes is SHA1
-if ((note.n_descsz == 16 || note.n_descsz == 20))
+// 16 bytes is UUID|MD5, 20 bytes is SHA1. Other 
linkers may produce a build-id of a different
+// length. Accept it as long as it's at least 4 bytes 
as it will be better than our own crc32.
+if (note.n_descsz >= 4 && note.n_descsz <= 20)
 {
 uint8_t uuidbuf[20];
 if (data.GetU8 (&offset, &uuidbuf, note.n_descsz) 
== nullptr)


Index: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1410,8 +1410,9 @@
 // Only bother processing this if we don't already have the uuid set.
 if (!uuid.IsValid())
 {
-// 16 bytes is UUID|MD5, 20 bytes is SHA1
-if ((note.n_descsz == 16 || note.n_descsz == 20))
+// 16 bytes is UUID|MD5, 20 bytes is SHA1. Other linkers may produce a build-id of a different
+// length. Accept it as long as it's at least 4 bytes as it will be better than our own crc32.
+if (note.n_descsz >= 4 && note.n_descsz <= 20)
 {
 uint8_t uuidbuf[20];
 if (data.GetU8 (&offset, &uuidbuf, note.n_descsz) == nullptr)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r263432 - Allow any build-id length between 4 and 20 bytes inclusive

2016-03-14 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Mar 14 09:06:00 2016
New Revision: 263432

URL: http://llvm.org/viewvc/llvm-project?rev=263432&view=rev
Log:
Allow any build-id length between 4 and 20 bytes inclusive

Build-id support is being added to lld and by default it may produce a
64-bit build-id.

Prior to this change lldb would reject such a build-id. However, it then
falls back to a 4-byte crc32, which is a poorer quality identifier.

Differential Revision:  http://reviews.llvm.org/D18096

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=263432&r1=263431&r2=263432&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Mon Mar 14 
09:06:00 2016
@@ -1410,8 +1410,9 @@ ObjectFileELF::RefineModuleDetailsFromNo
 // Only bother processing this if we don't already have 
the uuid set.
 if (!uuid.IsValid())
 {
-// 16 bytes is UUID|MD5, 20 bytes is SHA1
-if ((note.n_descsz == 16 || note.n_descsz == 20))
+// 16 bytes is UUID|MD5, 20 bytes is SHA1. Other 
linkers may produce a build-id of a different
+// length. Accept it as long as it's at least 4 bytes 
as it will be better than our own crc32.
+if (note.n_descsz >= 4 && note.n_descsz <= 20)
 {
 uint8_t uuidbuf[20];
 if (data.GetU8 (&offset, &uuidbuf, note.n_descsz) 
== nullptr)


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


[Lldb-commits] [PATCH] D18146: [test] Correctly retry connections on android targets

2016-03-14 Thread Pavel Labath via lldb-commits
labath created this revision.
labath added reviewers: tfiala, tberghammer.
labath added a subscriber: lldb-commits.
Herald added subscribers: srhines, danalbert, tberghammer.

Normally, when the remote stub is not ready, we will get ECONNREFUSED during 
the connect()
attempt. However, due to the way how ADB forwarding works, on android targets 
the connect() will
always be successful, but the connection will be immediately dropped if ADB 
could not connect on
the remote side. This commit tries to detect this situation, and report it as 
"connection
refused" so that the upper test layers attempt the connection again.

http://reviews.llvm.org/D18146

Files:
  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
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get 
ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, 
on android targets
+# the connect() will always be successful, but the connection will be 
immediately dropped
+# if ADB could not connect on the remote side. This function tries to 
detect this
+# situation, and report it as "connection refused" so that the upper 
layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+return # Data is available, connection is alive.
+if len(sock.recv(1, socket.MSG_PEEK)) == 0:
+raise _ConnectionRefused() # Got EOF, connection dropped.
+
 def create_socket(self):
 sock = socket.socket()
 logger = self.logger
@@ -275,7 +294,12 @@
 
 logger.info("Connecting to debug monitor on %s:%d", 
self.stub_hostname, self.port)
 connect_info = (self.stub_hostname, self.port)
-sock.connect(connect_info)
+try:
+sock.connect(connect_info)
+except socket.error as serr:
+if serr.errno == errno.ECONNREFUSED:
+raise _ConnectionRefused()
+raise serr
 
 def shutdown_socket():
 if sock:
@@ -292,6 +316,8 @@
 
 self.addTearDownHook(shutdown_socket)
 
+self._verify_socket(sock)
+
 return sock
 
 def set_inferior_startup_launch(self):
@@ -379,12 +405,12 @@
 while connect_attemps < MAX_CONNECT_ATTEMPTS:
 # Create a socket to talk to the server
 try:
+logger.info("Connect attempt %d", connect_attemps+1)
 self.sock = self.create_socket()
 return server
-except socket.error as serr:
-# We're only trying to handle connection refused.
-if serr.errno != errno.ECONNREFUSED:
-raise serr
+except _ConnectionRefused as serr:
+# Ignore, and try again.
+pass
 time.sleep(0.5)
 connect_attemps += 1
 


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
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, on android targets
+# the connect() will always be successful, but the connection will be immediately dropped
+# if ADB could not connect on the remote side. This function tries to detect this
+# situation, and report it as "connection refused" so that the upper layers attempt the
+# connection again.
+

Re: [Lldb-commits] [PATCH] D17972: [TestRegisterVariables] Adjust compiler range in expected failure decorator.

2016-03-14 Thread Ed Maste via lldb-commits
emaste added a subscriber: emaste.
emaste added a comment.

Now failing on FreeBSD: http://llvm.org/pr26937


Repository:
  rL LLVM

http://reviews.llvm.org/D17972



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


Re: [Lldb-commits] [lldb] r263333 - Let's not convert from UINT32_MAX to the std::numeric_limits version.

2016-03-14 Thread Adrian McCarthy via lldb-commits
If we're favoring the  macros over the  functions, then
perhaps update the #includes?

On Fri, Mar 11, 2016 at 7:33 PM, Jim Ingham via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

> Author: jingham
> Date: Fri Mar 11 21:33:36 2016
> New Revision: 26
>
> URL: http://llvm.org/viewvc/llvm-project?rev=26&view=rev
> Log:
> Let's not convert from UINT32_MAX to the std::numeric_limits version.
>
> Modified:
> lldb/trunk/source/Core/DataEncoder.cpp
> lldb/trunk/source/Core/Disassembler.cpp
> lldb/trunk/source/Core/FileSpecList.cpp
> lldb/trunk/source/Core/SearchFilter.cpp
>
> Modified: lldb/trunk/source/Core/DataEncoder.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataEncoder.cpp?rev=26&r1=263332&r2=26&view=diff
>
> ==
> --- lldb/trunk/source/Core/DataEncoder.cpp (original)
> +++ lldb/trunk/source/Core/DataEncoder.cpp Fri Mar 11 21:33:36 2016
> @@ -233,7 +233,7 @@ DataEncoder::PutU8 (uint32_t offset, uin
>  m_start[offset] = value;
>  return offset + 1;
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  uint32_t
> @@ -248,7 +248,7 @@ DataEncoder::PutU16 (uint32_t offset, ui
>
>  return offset + sizeof (value);
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  uint32_t
> @@ -263,7 +263,7 @@ DataEncoder::PutU32 (uint32_t offset, ui
>
>  return offset + sizeof (value);
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  uint32_t
> @@ -278,7 +278,7 @@ DataEncoder::PutU64 (uint32_t offset, ui
>
>  return offset + sizeof (value);
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  //--
> @@ -304,7 +304,7 @@ DataEncoder::PutMaxU64 (uint32_t offset,
>  assert(!"GetMax64 unhandled case!");
>  break;
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  uint32_t
> @@ -318,7 +318,7 @@ DataEncoder::PutData (uint32_t offset, c
>  memcpy (m_start + offset, src, src_len);
>  return offset + src_len;
>  }
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
>  uint32_t
> @@ -332,5 +332,5 @@ DataEncoder::PutCString (uint32_t offset
>  {
>  if (cstr != nullptr)
>  return PutData (offset, cstr, strlen(cstr) + 1);
> -return std::numeric_limits::max();
> +return UINT32_MAX;
>  }
>
> Modified: lldb/trunk/source/Core/Disassembler.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=26&r1=263332&r2=26&view=diff
>
> ==
> --- lldb/trunk/source/Core/Disassembler.cpp (original)
> +++ lldb/trunk/source/Core/Disassembler.cpp Fri Mar 11 21:33:36 2016
> @@ -1036,7 +1036,7 @@ InstructionList::GetIndexOfNextBranchIns
>  {
>  size_t num_instructions = m_instructions.size();
>
> -uint32_t next_branch = std::numeric_limits::max();
> +uint32_t next_branch = UINT32_MAX;
>  size_t i;
>  for (i = start; i < num_instructions; i++)
>  {
> @@ -1053,7 +1053,7 @@ InstructionList::GetIndexOfNextBranchIns
>  if (target.GetArchitecture().GetTriple().getArch() ==
> llvm::Triple::hexagon)
>  {
>  // If we didn't find a branch, find the last packet start.
> -if (next_branch == std::numeric_limits::max())
> +if (next_branch == UINT32_MAX)
>  {
>  i = num_instructions - 1;
>  }
> @@ -1086,7 +1086,7 @@ InstructionList::GetIndexOfNextBranchIns
>  }
>  }
>
> -if (next_branch == std::numeric_limits::max())
> +if (next_branch == UINT32_MAX)
>  {
>  // We couldn't find the previous packet, so return start
>  next_branch = start;
> @@ -1099,7 +1099,7 @@ uint32_t
>  InstructionList::GetIndexOfInstructionAtAddress (const Address &address)
>  {
>  size_t num_instructions = m_instructions.size();
> -uint32_t index = std::numeric_limits::max();
> +uint32_t index = UINT32_MAX;
>  for (size_t i = 0; i < num_instructions; i++)
>  {
>  if (m_instructions[i]->GetAddress() == address)
> @@ -1152,7 +1152,7 @@ Disassembler::ParseInstructions (const E
>  m_arch.GetByteOrder(),
>  m_arch.GetAddressByteSize());
>  const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
> -return DecodeInstructions(range.GetBaseAddress(), data, 0,
> std::numeric_limits::max(), false,
> +return DecodeInstructions(range.GetBaseAddress(), data, 0,
> UINT32_MAX, false,
>data_from_file);
>  }
>  else if (error_strm_ptr)
>
> Modified: lldb/trunk/source/Core/Fil

Re: [Lldb-commits] [lldb] r262970 - [TestRegisterVariables] Adjust compiler range in expected failure decorator.

2016-03-14 Thread Ed Maste via lldb-commits
On 8 March 2016 at 19:02, Siva Chandra via lldb-commits
 wrote:
> Author: sivachandra
> Date: Tue Mar  8 18:02:00 2016
> New Revision: 262970
>
> -@expectedFailureAll(compiler="clang", compiler_version=['<', '3.5'])
> +@expectedFailureAll(compiler="clang", compiler_version=['>', '3.5'])

This test is now reporting Failure on FreeBSD 10, with system Clang
3.4.1. Should this be > 3.4 now instead?
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D17957: Expression evaluation for overloaded C functions

2016-03-14 Thread Ewan Crawford via lldb-commits
EwanCrawford updated this revision to Diff 50595.
EwanCrawford added a comment.

Thanks for taking a look Sean.

I moved the mangling logic into `LanguageCPlusPlus` and created a new method 
for it. 
There was an existing function `FindEquivalentNames` that used 
`CPPRuntimeEquivalents`, but looked like that was targeted at types. Let me 
know if you prefer I reuse that.


Repository:
  rL LLVM

http://reviews.llvm.org/D17957

Files:
  
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/Makefile
  
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/TestCallOverloadedCFunction.py
  
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/main.c
  source/Expression/IRExecutionUnit.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h

Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
===
--- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
+++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
@@ -174,6 +174,11 @@
 static uint32_t
 FindEquivalentNames(ConstString type_name, std::vector& equivalents);
 
+// Given a mangled function name, calculates some alternative manglings
+// since the compiler mangling may not line up with the symbol we are expecting
+static uint32_t
+FindAlternateFunctionMangling(ConstString mangled_name, std::vector& alternates);
+
 //--
 // PluginInterface protocol
 //--
Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -482,6 +482,85 @@
 return count;
 }
 
+// Given a mangled function, replaces all the function parameters of mangled type
+// 'search', with parameters of type 'replace'.
+static ConstString
+SubstituteMangledParameters(const llvm::StringRef& mangled, const llvm::StringRef& search, const llvm::StringRef& replace)
+{
+// Find length of function name, already encoded in mangled symbol
+static const llvm::StringRef numeric_digits("0123456789");
+const size_t encoded_length_start = mangled.find_first_of(numeric_digits);
+if (encoded_length_start == llvm::StringRef::npos)
+return ConstString();
+
+const size_t encoded_length_end = mangled.find_first_not_of(numeric_digits, encoded_length_start);
+if (encoded_length_end == llvm::StringRef::npos || encoded_length_end <= encoded_length_start)
+   return ConstString();
+
+// Parse encoded length into name_length
+int name_length;
+const llvm::StringRef encoded_length_str = mangled.substr(encoded_length_start, encoded_length_end - encoded_length_start);
+if (encoded_length_str.getAsInteger(10, name_length) || name_length == 0)
+   return ConstString();
+
+// Position in 'mangled' string of first function parameter
+size_t param_pos = encoded_length_end + name_length;
+
+// Iterate over all matching parameters, replacing them with string 'replace'
+std::string modified_str = mangled.str();
+while ((param_pos = modified_str.find(search, param_pos)) != std::string::npos)
+{
+modified_str.replace(param_pos, search.size(), replace);
+param_pos += replace.size();
+}
+
+return ConstString(modified_str);
+}
+
+uint32_t
+CPlusPlusLanguage::FindAlternateFunctionMangling(ConstString mangled_name, std::vector& alternates)
+{
+const uint32_t start_size = alternates.size();
+
+// Maybe we're looking for a const symbol but the debug info told us it was const...
+if (!strncmp(mangled_name.GetCString(), "_ZN", 3) &&
+strncmp(mangled_name.GetCString(), "_ZNK", 4))
+{
+std::string fixed_scratch("_ZNK");
+fixed_scratch.append(mangled_name.GetCString() + 3);
+alternates.push_back(ConstString(fixed_scratch.c_str()));
+}
+
+// Maybe we're looking for a static symbol but we thought it was global...
+if (!strncmp(mangled_name.GetCString(), "_Z", 2) &&
+strncmp(mangled_name.GetCString(), "_ZL", 3))
+{
+std::string fixed_scratch("_ZL");
+fixed_scratch.append(mangled_name.GetCString() + 2);
+alternates.push_back(ConstString(fixed_scratch.c_str()));
+}
+
+// Char is implementation defined as either signed or unsigned.
+// As a result a char parameter has 3 possible manglings: 'c'-char, 'a'-signed char, 'h'-unsigned char.
+// If we're looking for symbols with a signed char parameter,
+// try finding matches which have the general case 'c'.
+ConstString char_fixup = SubstituteMangledParameters(mangl

Re: [Lldb-commits] [PATCH] D18146: [test] Correctly retry connections on android targets

2016-03-14 Thread Tamas Berghammer via lldb-commits
tberghammer accepted this revision.
tberghammer added a comment.
This revision is now accepted and ready to land.

Looks good


http://reviews.llvm.org/D18146



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


Re: [Lldb-commits] [PATCH] D18146: [test] Correctly retry connections on android targets

2016-03-14 Thread Pavel Labath via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263439: [test] Correctly retry connections on android 
targets (authored by labath).

Changed prior to commit:
  http://reviews.llvm.org/D18146?vs=50600&id=50601#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18146

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

Index: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get 
ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, 
on android targets
+# the connect() will always be successful, but the connection will be 
immediately dropped
+# if ADB could not connect on the remote side. This function tries to 
detect this
+# situation, and report it as "connection refused" so that the upper 
layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+return # Data is not available, but the connection is alive.
+if len(sock.recv(1, socket.MSG_PEEK)) == 0:
+raise _ConnectionRefused() # Got EOF, connection dropped.
+
 def create_socket(self):
 sock = socket.socket()
 logger = self.logger
@@ -275,7 +294,12 @@
 
 logger.info("Connecting to debug monitor on %s:%d", 
self.stub_hostname, self.port)
 connect_info = (self.stub_hostname, self.port)
-sock.connect(connect_info)
+try:
+sock.connect(connect_info)
+except socket.error as serr:
+if serr.errno == errno.ECONNREFUSED:
+raise _ConnectionRefused()
+raise serr
 
 def shutdown_socket():
 if sock:
@@ -292,6 +316,8 @@
 
 self.addTearDownHook(shutdown_socket)
 
+self._verify_socket(sock)
+
 return sock
 
 def set_inferior_startup_launch(self):
@@ -379,12 +405,12 @@
 while connect_attemps < MAX_CONNECT_ATTEMPTS:
 # Create a socket to talk to the server
 try:
+logger.info("Connect attempt %d", connect_attemps+1)
 self.sock = self.create_socket()
 return server
-except socket.error as serr:
-# We're only trying to handle connection refused.
-if serr.errno != errno.ECONNREFUSED:
-raise serr
+except _ConnectionRefused as serr:
+# Ignore, and try again.
+pass
 time.sleep(0.5)
 connect_attemps += 1
 


Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, on android targets
+# the connect() will always be successful, but the connection will be immediately dropped
+# if ADB could not connect on the remote side. This function tries to detect this
+# situation, and report it as "connection refused" so that the upper layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+

Re: [Lldb-commits] [PATCH] D18146: [test] Correctly retry connections on android targets

2016-03-14 Thread Pavel Labath via lldb-commits
labath updated this revision to Diff 50600.
labath added a comment.

Fix comment


http://reviews.llvm.org/D18146

Files:
  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
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get 
ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, 
on android targets
+# the connect() will always be successful, but the connection will be 
immediately dropped
+# if ADB could not connect on the remote side. This function tries to 
detect this
+# situation, and report it as "connection refused" so that the upper 
layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+return # Data is not available, but the connection is alive.
+if len(sock.recv(1, socket.MSG_PEEK)) == 0:
+raise _ConnectionRefused() # Got EOF, connection dropped.
+
 def create_socket(self):
 sock = socket.socket()
 logger = self.logger
@@ -275,7 +294,12 @@
 
 logger.info("Connecting to debug monitor on %s:%d", 
self.stub_hostname, self.port)
 connect_info = (self.stub_hostname, self.port)
-sock.connect(connect_info)
+try:
+sock.connect(connect_info)
+except socket.error as serr:
+if serr.errno == errno.ECONNREFUSED:
+raise _ConnectionRefused()
+raise serr
 
 def shutdown_socket():
 if sock:
@@ -292,6 +316,8 @@
 
 self.addTearDownHook(shutdown_socket)
 
+self._verify_socket(sock)
+
 return sock
 
 def set_inferior_startup_launch(self):
@@ -379,12 +405,12 @@
 while connect_attemps < MAX_CONNECT_ATTEMPTS:
 # Create a socket to talk to the server
 try:
+logger.info("Connect attempt %d", connect_attemps+1)
 self.sock = self.create_socket()
 return server
-except socket.error as serr:
-# We're only trying to handle connection refused.
-if serr.errno != errno.ECONNREFUSED:
-raise serr
+except _ConnectionRefused as serr:
+# Ignore, and try again.
+pass
 time.sleep(0.5)
 connect_attemps += 1
 


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
@@ -24,6 +24,9 @@
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, on android targets
+# the connect() will always be successful, but the connection will be immediately dropped
+# if ADB could not connect on the remote side. This function tries to detect this
+# situation, and report it as "connection refused" so that the upper layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+return # Data is not available, but the connection is alive.
+if len(sock.recv(1, socket.MSG_PEEK)) == 0:
+raise _ConnectionRefused() # Got EOF, connection dropped.
+
 def create_socket(self):
 sock = socket.socket()
 logger = self.logge

[Lldb-commits] [lldb] r263439 - [test] Correctly retry connections on android targets

2016-03-14 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon Mar 14 10:33:25 2016
New Revision: 263439

URL: http://llvm.org/viewvc/llvm-project?rev=263439&view=rev
Log:
[test] Correctly retry connections on android targets

Summary:
Normally, when the remote stub is not ready, we will get ECONNREFUSED during 
the connect()
attempt. However, due to the way how ADB forwarding works, on android targets 
the connect() will
always be successful, but the connection will be immediately dropped if ADB 
could not connect on
the remote side. This commit tries to detect this situation, and report it as 
"connection
refused" so that the upper test layers attempt the connection again.

Reviewers: tfiala, tberghammer

Subscribers: tberghammer, danalbert, srhines, lldb-commits

Differential Revision: http://reviews.llvm.org/D18146

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py?rev=263439&r1=263438&r2=263439&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
 Mon Mar 14 10:33:25 2016
@@ -24,6 +24,9 @@ from lldbsuite.test.lldbtest import *
 from lldbgdbserverutils import *
 import logging
 
+class _ConnectionRefused(IOError):
+pass
+
 class GdbRemoteTestCaseBase(TestBase):
 
 _TIMEOUT_SECONDS = 7
@@ -265,6 +268,22 @@ class GdbRemoteTestCaseBase(TestBase):
 subprocess.call(adb + [ "tcp:%d" % source, "tcp:%d" % target])
 self.addTearDownHook(remove_port_forward)
 
+def _verify_socket(self, sock):
+# Normally, when the remote stub is not ready, we will get 
ECONNREFUSED during the
+# connect() attempt. However, due to the way how ADB forwarding works, 
on android targets
+# the connect() will always be successful, but the connection will be 
immediately dropped
+# if ADB could not connect on the remote side. This function tries to 
detect this
+# situation, and report it as "connection refused" so that the upper 
layers attempt the
+# connection again.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if not re.match(".*-.*-.*-android", triple):
+return # Not android.
+can_read, _, _ = select.select([sock], [], [], 0.1)
+if sock not in can_read:
+return # Data is not available, but the connection is alive.
+if len(sock.recv(1, socket.MSG_PEEK)) == 0:
+raise _ConnectionRefused() # Got EOF, connection dropped.
+
 def create_socket(self):
 sock = socket.socket()
 logger = self.logger
@@ -275,7 +294,12 @@ class GdbRemoteTestCaseBase(TestBase):
 
 logger.info("Connecting to debug monitor on %s:%d", 
self.stub_hostname, self.port)
 connect_info = (self.stub_hostname, self.port)
-sock.connect(connect_info)
+try:
+sock.connect(connect_info)
+except socket.error as serr:
+if serr.errno == errno.ECONNREFUSED:
+raise _ConnectionRefused()
+raise serr
 
 def shutdown_socket():
 if sock:
@@ -292,6 +316,8 @@ class GdbRemoteTestCaseBase(TestBase):
 
 self.addTearDownHook(shutdown_socket)
 
+self._verify_socket(sock)
+
 return sock
 
 def set_inferior_startup_launch(self):
@@ -379,12 +405,12 @@ class GdbRemoteTestCaseBase(TestBase):
 while connect_attemps < MAX_CONNECT_ATTEMPTS:
 # Create a socket to talk to the server
 try:
+logger.info("Connect attempt %d", connect_attemps+1)
 self.sock = self.create_socket()
 return server
-except socket.error as serr:
-# We're only trying to handle connection refused.
-if serr.errno != errno.ECONNREFUSED:
-raise serr
+except _ConnectionRefused as serr:
+# Ignore, and try again.
+pass
 time.sleep(0.5)
 connect_attemps += 1
 


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


Re: [Lldb-commits] [PATCH] D17099: Add reverse-connect functionality to the gdb-remote command

2016-03-14 Thread Francis Ricci via lldb-commits
fjricci abandoned this revision.
fjricci added a comment.

This functionality can already be accessed by using the "process connect" 
command with a listen url directly.


http://reviews.llvm.org/D17099



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


Re: [Lldb-commits] [PATCH] D17957: Expression evaluation for overloaded C functions

2016-03-14 Thread Greg Clayton via lldb-commits
clayborg accepted this revision.


Comment at: 
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/Makefile:8
@@ +7,2 @@
+clean::
+   rm -rf $(wildcard *.o *.d *.dSYM)

Maybe we can have a standard clean rule in the main makefiles:

standard_clean:
rm -rf $(wildcard *.o *.d *.dSYM)

And maybe we can call this before calling the "clean" where each test case can 
override this. Not required for this patch though.


Repository:
  rL LLVM

http://reviews.llvm.org/D17957



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


Re: [Lldb-commits] [PATCH] D17957: Expression evaluation for overloaded C functions

2016-03-14 Thread Pavel Labath via lldb-commits
labath added a subscriber: labath.


Comment at: 
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/Makefile:8
@@ +7,2 @@
+clean::
+   rm -rf $(wildcard *.o *.d *.dSYM)

clayborg wrote:
> Maybe we can have a standard clean rule in the main makefiles:
> 
> standard_clean:
> rm -rf $(wildcard *.o *.d *.dSYM)
> 
> And maybe we can call this before calling the "clean" where each test case 
> can override this. Not required for this patch though.
The main Makefile.rules does the cleanup already, I'm pretty sure this rule is 
not necessary.


Repository:
  rL LLVM

http://reviews.llvm.org/D17957



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


Re: [Lldb-commits] [PATCH] D17957: Expression evaluation for overloaded C functions

2016-03-14 Thread Ewan Crawford via lldb-commits
EwanCrawford added inline comments.


Comment at: 
packages/Python/lldbsuite/test/expression_command/call-overloaded-c-fuction/Makefile:8
@@ +7,2 @@
+clean::
+   rm -rf $(wildcard *.o *.d *.dSYM)

labath wrote:
> clayborg wrote:
> > Maybe we can have a standard clean rule in the main makefiles:
> > 
> > standard_clean:
> > rm -rf $(wildcard *.o *.d *.dSYM)
> > 
> > And maybe we can call this before calling the "clean" where each test case 
> > can override this. Not required for this patch though.
> The main Makefile.rules does the cleanup already, I'm pretty sure this rule 
> is not necessary.
Good to know, I'll remove this case


Repository:
  rL LLVM

http://reviews.llvm.org/D17957



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


Re: [Lldb-commits] [lldb] r262970 - [TestRegisterVariables] Adjust compiler range in expected failure decorator.

2016-03-14 Thread Siva Chandra via lldb-commits
On Mon, Mar 14, 2016 at 8:08 AM, Ed Maste  wrote:
> On 8 March 2016 at 19:02, Siva Chandra via lldb-commits
>  wrote:
>> Author: sivachandra
>> Date: Tue Mar  8 18:02:00 2016
>> New Revision: 262970
>>
>> -@expectedFailureAll(compiler="clang", compiler_version=['<', '3.5'])
>> +@expectedFailureAll(compiler="clang", compiler_version=['>', '3.5'])
>
> This test is now reporting Failure on FreeBSD 10, with system Clang
> 3.4.1. Should this be > 3.4 now instead?

Feel free to change it.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r263467 - Enable expectedFailure for all Clang versions in TestRegisterVariables

2016-03-14 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Mar 14 13:59:44 2016
New Revision: 263467

URL: http://llvm.org/viewvc/llvm-project?rev=263467&view=rev
Log:
Enable expectedFailure for all Clang versions in TestRegisterVariables

In r262970 this was changed from xfail Clang < 3.5 to > 3.5, but it
still fails on FreeBSD 10's system Clang 3.4.1 so assume it fails on
all versions.

llvm.org/pr26937

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=263467&r1=263466&r2=263467&view=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
 Mon Mar 14 13:59:44 2016
@@ -15,7 +15,7 @@ class RegisterVariableTestCase(TestBase)
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAll(oslist=['macosx'], compiler='clang', 
compiler_version=['<', '7.0.0'], debug_info="dsym")
-@expectedFailureAll(compiler="clang", compiler_version=['>', '3.5'])
+@expectedFailureAll(compiler="clang")
 @expectedFailureAll(compiler="gcc", compiler_version=['>=', '4.8.2'])
 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] r263468 - More of the alias refactoring work! CommandAlias is now a CommandObject

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 14:00:21 2016
New Revision: 263468

URL: http://llvm.org/viewvc/llvm-project?rev=263468&view=rev
Log:
More of the alias refactoring work! CommandAlias is now a CommandObject


Modified:
lldb/trunk/include/lldb/Interpreter/CommandAlias.h
lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/source/Interpreter/CommandAlias.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandAlias.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandAlias.h?rev=263468&r1=263467&r2=263468&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandAlias.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandAlias.h Mon Mar 14 14:00:21 2016
@@ -18,16 +18,21 @@
 // Project includes
 #include "lldb/lldb-forward.h"
 #include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/CommandObject.h"
 
 namespace lldb_private {
-class CommandAlias
+class CommandAlias : public CommandObject
 {
 public:
 typedef std::unique_ptr UniquePointer;
 
-static UniquePointer
-GetCommandAlias (lldb::CommandObjectSP cmd_sp,
- const char *options_args);
+CommandAlias (CommandInterpreter &interpreter,
+  lldb::CommandObjectSP cmd_sp,
+  const char *options_args,
+  const char *name,
+  const char *help = nullptr,
+  const char *syntax = nullptr,
+  uint32_t flags = 0);
 
 void
 GetAliasExpansion (StreamString &help_string);
@@ -43,13 +48,18 @@ public:
 return IsValid();
 }
 
+bool
+WantsRawCommandString() override;
+
+bool
+IsAlias () override { return true; }
+
+bool
+Execute(const char *args_string, CommandReturnObject &result) override;
+
 lldb::CommandObjectSP GetUnderlyingCommand() { return 
m_underlying_command_sp; }
 OptionArgVectorSP GetOptionArguments() { return m_option_args_sp; }
 
-protected:
-CommandAlias (lldb::CommandObjectSP cmd_sp = nullptr,
-  OptionArgVectorSP args_sp = nullptr);
-
 private:
 lldb::CommandObjectSP m_underlying_command_sp;
 OptionArgVectorSP m_option_args_sp ;

Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=263468&r1=263467&r2=263468&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Mon Mar 14 
14:00:21 2016
@@ -201,7 +201,7 @@ class CommandInterpreter :
 public IOHandlerDelegate
 {
 public:
-typedef std::map CommandAliasMap;
+typedef std::map CommandAliasMap;
 
 enum
 {

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=263468&r1=263467&r2=263468&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Mon Mar 14 14:00:21 2016
@@ -177,6 +177,9 @@ public:
 
 virtual bool
 IsMultiwordObject () { return false; }
+
+virtual bool
+IsAlias () { return false; }
 
 virtual lldb::CommandObjectSP
 GetSubcommandSP(const char *sub_cmd, StringList *matches = nullptr)

Modified: lldb/trunk/source/Interpreter/CommandAlias.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandAlias.cpp?rev=263468&r1=263467&r2=263468&view=diff
==
--- lldb/trunk/source/Interpreter/CommandAlias.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandAlias.cpp Mon Mar 14 14:00:21 2016
@@ -9,6 +9,8 @@
 
 #include "lldb/Interpreter/CommandAlias.h"
 
+#include "llvm/Support/ErrorHandling.h"
+
 #include "lldb/Core/StreamString.h"
 #include "lldb/Interpreter/CommandObject.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
@@ -70,22 +72,48 @@ ProcessAliasOptionsArgs (lldb::CommandOb
 return success;
 }
 
-CommandAlias::UniquePointer
-CommandAlias::GetCommandAlias (lldb::CommandObjectSP cmd_sp,
-   const char *options_args)
+CommandAlias::CommandAlias (CommandInterpreter &interpreter,
+lldb::CommandObjectSP cmd_sp,
+const char *options_args,
+const char *name,
+const char *help,
+const char *syntax,
+uint32_t flags) :
+CommandO

Re: [Lldb-commits] [PATCH] D17402: Shuffle an #undef to avoid a warning on FreeBSD

2016-03-14 Thread Chaoren Lin via lldb-commits
chaoren accepted this revision.
chaoren added a comment.
This revision is now accepted and ready to land.

Seems legit.


http://reviews.llvm.org/D17402



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


[Lldb-commits] [lldb] r263486 - Shuffle an #undef to avoid a warning on FreeBSD

2016-03-14 Thread Ed Maste via lldb-commits
Author: emaste
Date: Mon Mar 14 15:39:08 2016
New Revision: 263486

URL: http://llvm.org/viewvc/llvm-project?rev=263486&view=rev
Log:
Shuffle an #undef to avoid a warning on FreeBSD

On FreeBSD _LIBCPP_EXTERN_TEMPLATE is being defined from something
included by lldb/lldb-private.h. Undefine it after the #include to avoid
the redefinition warning.

Differential Revision: http://reviews.llvm.org/D17402

Modified:
lldb/trunk/source/Core/CxaDemangle.cpp

Modified: lldb/trunk/source/Core/CxaDemangle.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/CxaDemangle.cpp?rev=263486&r1=263485&r2=263486&view=diff
==
--- lldb/trunk/source/Core/CxaDemangle.cpp (original)
+++ lldb/trunk/source/Core/CxaDemangle.cpp Mon Mar 14 15:39:08 2016
@@ -20,9 +20,8 @@
 #include "lldb/Host/windows/win32.h" // snprintf
 #endif
 #include "llvm/Support/Compiler.h"   // LLVM_{NOEXCEPT, CONSTEXPR, ALIGNAS}
-#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
-
 #include "lldb/lldb-private.h"
+#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
 
 //===-- cxa_demangle.cpp 
--===//
 //


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


Re: [Lldb-commits] [PATCH] D17402: Shuffle an #undef to avoid a warning on FreeBSD

2016-03-14 Thread Ed Maste via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL263486: Shuffle an #undef to avoid a warning on FreeBSD 
(authored by emaste).

Changed prior to commit:
  http://reviews.llvm.org/D17402?vs=48364&id=50641#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D17402

Files:
  lldb/trunk/source/Core/CxaDemangle.cpp

Index: lldb/trunk/source/Core/CxaDemangle.cpp
===
--- lldb/trunk/source/Core/CxaDemangle.cpp
+++ lldb/trunk/source/Core/CxaDemangle.cpp
@@ -20,9 +20,8 @@
 #include "lldb/Host/windows/win32.h" // snprintf
 #endif
 #include "llvm/Support/Compiler.h"   // LLVM_{NOEXCEPT, CONSTEXPR, ALIGNAS}
-#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
-
 #include "lldb/lldb-private.h"
+#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
 
 //===-- cxa_demangle.cpp 
--===//
 //


Index: lldb/trunk/source/Core/CxaDemangle.cpp
===
--- lldb/trunk/source/Core/CxaDemangle.cpp
+++ lldb/trunk/source/Core/CxaDemangle.cpp
@@ -20,9 +20,8 @@
 #include "lldb/Host/windows/win32.h" // snprintf
 #endif
 #include "llvm/Support/Compiler.h"   // LLVM_{NOEXCEPT, CONSTEXPR, ALIGNAS}
-#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
-
 #include "lldb/lldb-private.h"
+#undef _LIBCPP_EXTERN_TEMPLATE   // Avoid warning below
 
 //===-- cxa_demangle.cpp --===//
 //
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r263499 - Lots of progress on the CommandAlias refactoring

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 17:17:04 2016
New Revision: 263499

URL: http://llvm.org/viewvc/llvm-project?rev=263499&view=rev
Log:
Lots of progress on the CommandAlias refactoring

This cleans things up such CommandAlias essentially can work as its own object; 
the aliases still live in a separate map, but are now just full-fledged 
CommandObjectSPs
This patch also cleans up help generation for aliases, allows aliases to vend 
their own help, and adds a tweak such that "dash-dash aliases", such as po, 
don't show the list of options for their underlying command, since those can't 
be provided anyway

I plan to fix up a few more things here, and then add a test case and proclaim 
victory


Modified:
lldb/trunk/include/lldb/Interpreter/CommandAlias.h
lldb/trunk/include/lldb/Interpreter/CommandObject.h
lldb/trunk/source/Commands/CommandObjectHelp.cpp
lldb/trunk/source/Interpreter/CommandAlias.cpp
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
lldb/trunk/source/Interpreter/CommandObject.cpp
lldb/trunk/source/Interpreter/Options.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandAlias.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandAlias.h?rev=263499&r1=263498&r2=263499&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandAlias.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandAlias.h Mon Mar 14 17:17:04 2016
@@ -52,9 +52,43 @@ public:
 WantsRawCommandString() override;
 
 bool
+WantsCompletion() override;
+
+int
+HandleCompletion (Args &input,
+  int &cursor_index,
+  int &cursor_char_position,
+  int match_start_point,
+  int max_return_elements,
+  bool &word_complete,
+  StringList &matches) override;
+
+int
+HandleArgumentCompletion (Args &input,
+  int &cursor_index,
+  int &cursor_char_position,
+  OptionElementVector &opt_element_vector,
+  int match_start_point,
+  int max_return_elements,
+  bool &word_complete,
+  StringList &matches) override;
+
+Options*
+GetOptions() override;
+
+bool
 IsAlias () override { return true; }
 
 bool
+IsDashDashCommand () override;
+
+const char*
+GetHelp () override;
+
+const char*
+GetHelpLong () override;
+
+bool
 Execute(const char *args_string, CommandReturnObject &result) override;
 
 lldb::CommandObjectSP GetUnderlyingCommand() { return 
m_underlying_command_sp; }
@@ -63,6 +97,7 @@ public:
 private:
 lldb::CommandObjectSP m_underlying_command_sp;
 OptionArgVectorSP m_option_args_sp ;
+LazyBool m_is_dashdash_alias;
 };
 } // namespace lldb_private
 

Modified: lldb/trunk/include/lldb/Interpreter/CommandObject.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandObject.h?rev=263499&r1=263498&r2=263499&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandObject.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandObject.h Mon Mar 14 17:17:04 2016
@@ -148,7 +148,7 @@ public:
 virtual const char *
 GetHelpLong ();
 
-const char *
+virtual const char *
 GetSyntax ();
 
 const char *
@@ -180,6 +180,12 @@ public:
 
 virtual bool
 IsAlias () { return false; }
+
+// override this to return true if your command is somehow a "dash-dash"
+// form of some other command (e.g. po is expr -O --); this is a powerful
+// hint to the help system that one cannot pass options to this command
+virtual bool
+IsDashDashCommand () { return false; }
 
 virtual lldb::CommandObjectSP
 GetSubcommandSP(const char *sub_cmd, StringList *matches = nullptr)

Modified: lldb/trunk/source/Commands/CommandObjectHelp.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectHelp.cpp?rev=263499&r1=263498&r2=263499&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectHelp.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectHelp.cpp Mon Mar 14 17:17:04 2016
@@ -128,6 +128,8 @@ CommandObjectHelp::DoExecute (Args& comm
 {
 sub_command = command.GetArgumentAtIndex(i);
 matches.Clear();
+if (sub_cmd_obj->IsAlias())
+sub_cmd_obj = 
((CommandAlias*)sub_cmd_obj)->GetUnderlyingCommand().get();
 if (! sub_cmd_obj->IsMultiwordObject ())
 {
 all_okay = false;

Modified: l

[Lldb-commits] [lldb] r263517 - This was printing arguments twice in dash-dash aliases; don't do that

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 20:17:32 2016
New Revision: 263517

URL: http://llvm.org/viewvc/llvm-project?rev=263517&view=rev
Log:
This was printing arguments twice in dash-dash aliases; don't do that

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

Modified: lldb/trunk/source/Interpreter/Options.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Options.cpp?rev=263517&r1=263516&r2=263517&view=diff
==
--- lldb/trunk/source/Interpreter/Options.cpp (original)
+++ lldb/trunk/source/Interpreter/Options.cpp Mon Mar 14 20:17:32 2016
@@ -511,22 +511,22 @@ Options::GenerateOptionUsage
 
 uint32_t i;
 
-for (uint32_t opt_set = 0; opt_set < num_option_sets; ++opt_set)
+if (!only_print_args)
 {
-uint32_t opt_set_mask;
-
-opt_set_mask = 1 << opt_set;
-if (opt_set > 0)
-strm.Printf ("\n");
-strm.Indent (name);
-
-// Different option sets may require different args.
-StreamString args_str;
-if (cmd)
-cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
-
-if (!only_print_args)
+for (uint32_t opt_set = 0; opt_set < num_option_sets; ++opt_set)
 {
+uint32_t opt_set_mask;
+
+opt_set_mask = 1 << opt_set;
+if (opt_set > 0)
+strm.Printf ("\n");
+strm.Indent (name);
+
+// Different option sets may require different args.
+StreamString args_str;
+if (cmd)
+cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
+
 // First go through and print all options that take no arguments as
 // a single string. If a command has "-a" "-b" and "-c", this will 
show
 // up as [-abc]
@@ -619,24 +619,24 @@ Options::GenerateOptionUsage
 PrintOption (opt_defs[i], eDisplayBestOption, " ", 
nullptr, true, strm);
 }
 }
-}
-
-if (args_str.GetSize() > 0)
-{
-if (cmd->WantsRawCommandString() && !only_print_args)
-strm.Printf(" --");
 
-strm.Printf (" %s", args_str.GetData());
-if (only_print_args)
-break;
+if (args_str.GetSize() > 0)
+{
+if (cmd->WantsRawCommandString() && !only_print_args)
+strm.Printf(" --");
+
+strm.Printf (" %s", args_str.GetData());
+if (only_print_args)
+break;
+}
 }
 }
 
 if (cmd &&
-cmd->WantsRawCommandString() &&
+(only_print_args || cmd->WantsRawCommandString()) &&
 arguments_str.GetSize() > 0)
 {
-strm.PutChar('\n');
+if (!only_print_args) strm.PutChar('\n');
 strm.Indent(name);
 strm.Printf(" %s", arguments_str.GetData());
 }


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


[Lldb-commits] [lldb] r263520 - Add some test coverage for the changes in alias help

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 20:43:00 2016
New Revision: 263520

URL: http://llvm.org/viewvc/llvm-project?rev=263520&view=rev
Log:
Add some test coverage for the changes in alias help


Modified:
lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py?rev=263520&r1=263519&r2=263520&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py Mon Mar 14 
20:43:00 2016
@@ -167,6 +167,24 @@ class HelpCommandTestCase(TestBase):
 'variable +--'])
 
 @no_debug_info_test
+def test_help_po_hides_options(self):
+"""Test that 'help po' does not show all the options for expression"""
+self.expect("help po",
+substrs = ['--show-all-children', '--object-description'], 
matching=False)
+
+@no_debug_info_test
+def test_help_run_hides_options(self):
+"""Test that 'help run' does not show all the options for process 
launch"""
+self.expect("help run",
+substrs = ['--arch', '--environment'], matching=False)
+
+@no_debug_info_test
+def test_help_next_shows_options(self):
+"""Test that 'help next' shows all the options for thread step-over"""
+self.expect("help next",
+substrs = ['--python-class','--run-mode'], matching=True)
+
+@no_debug_info_test
 def test_help_provides_alternatives(self):
 """Test that help on commands that don't exist provides information on 
additional help avenues"""
 self.expect("help thisisnotadebuggercommand",


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


[Lldb-commits] [lldb] r263519 - Improve the way we decide whether an alias is a dashdash alias

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 20:42:34 2016
New Revision: 263519

URL: http://llvm.org/viewvc/llvm-project?rev=263519&view=rev
Log:
Improve the way we decide whether an alias is a dashdash alias


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

Modified: lldb/trunk/source/Interpreter/CommandAlias.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandAlias.cpp?rev=263519&r1=263518&r2=263519&view=diff
==
--- lldb/trunk/source/Interpreter/CommandAlias.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandAlias.cpp Mon Mar 14 20:42:34 2016
@@ -226,7 +226,8 @@ CommandAlias::IsDashDashCommand ()
 for (const OptionArgPair& opt_arg : *GetOptionArguments())
 {
 if (opt_arg.first == "" &&
-opt_arg.second.second == " --")
+!opt_arg.second.second.empty() &&
+llvm::StringRef(opt_arg.second.second).endswith("--"))
 {
 m_is_dashdash_alias = eLazyBoolYes;
 break;


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


[Lldb-commits] [lldb] r263523 - Workaround the fact that "b" is now a separate command object from "_regexp-break", and thus "help b" doesn't show the possible syntaxes

2016-03-14 Thread Enrico Granata via lldb-commits
Author: enrico
Date: Mon Mar 14 20:57:10 2016
New Revision: 263523

URL: http://llvm.org/viewvc/llvm-project?rev=263523&view=rev
Log:
Workaround the fact that "b" is now a separate command object from 
"_regexp-break", and thus "help b" doesn't show the possible syntaxes

It would be nice to have a longer-term plan for how to handle help for regular 
expression commands, since their syntax is highly irregular. I can see a few 
options (*), but for now this is a reasonable stop-gag measure for the most 
blatant regression.

(*) the simplest is, of course, to detect a regex command and inherit the 
syntax for any aliases thereof; it would be nice if this also didn't show the 
underlying regex command name when the alias is used


Modified:
lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h?rev=263523&r1=263522&r2=263523&view=diff
==
--- lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h (original)
+++ lldb/trunk/include/lldb/Interpreter/CommandInterpreter.h Mon Mar 14 
20:57:10 2016
@@ -278,7 +278,7 @@ public:
 bool
 UserCommandExists (const char *cmd);
 
-bool
+CommandAlias*
 AddAlias (const char *alias_name,
   lldb::CommandObjectSP& command_obj_sp,
   const char *args_string = nullptr);

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=263523&r1=263522&r2=263523&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Mon Mar 14 20:57:10 
2016
@@ -217,7 +217,7 @@ CommandInterpreter::Initialize ()
 
 cmd_obj_sp = GetCommandSPExact ("_regexp-break",false);
 if (cmd_obj_sp)
-AddAlias ("b", cmd_obj_sp);
+AddAlias ("b", cmd_obj_sp)->SetSyntax(cmd_obj_sp->GetSyntax());
 
 cmd_obj_sp = GetCommandSPExact ("_regexp-tbreak",false);
 if (cmd_obj_sp)
@@ -1049,7 +1049,7 @@ CommandInterpreter::UserCommandExists (c
 return m_user_dict.find(cmd) != m_user_dict.end();
 }
 
-bool
+CommandAlias*
 CommandInterpreter::AddAlias (const char *alias_name,
   lldb::CommandObjectSP& command_obj_sp,
   const char *args_string)
@@ -1064,11 +1064,11 @@ CommandInterpreter::AddAlias (const char
 
 if (command_alias_up && command_alias_up->IsValid())
 {
-m_alias_dict[alias_name] = CommandObjectSP(command_alias_up.release());
-return true;
+m_alias_dict[alias_name] = CommandObjectSP(command_alias_up.get());
+return command_alias_up.release();
 }
 
-return false;
+return nullptr;
 }
 
 bool


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


[Lldb-commits] [lldb] r263529 - Bump the lldb version # in the xcode project files from

2016-03-14 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Mar 14 23:36:11 2016
New Revision: 263529

URL: http://llvm.org/viewvc/llvm-project?rev=263529&view=rev
Log:
Bump the lldb version # in the xcode project files from
350.99.0 to 360.99.0.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/resources/LLDB-Info.plist
lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=263529&r1=263528&r2=263529&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Mar 14 23:36:11 2016
@@ -7711,9 +7711,9 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
COMBINE_HIDPI_IMAGES = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
DYLIB_COMPATIBILITY_VERSION = 1;
-   DYLIB_CURRENT_VERSION = 350.99.0;
+   DYLIB_CURRENT_VERSION = 360.99.0;
EXPORTED_SYMBOLS_FILE = 
source/API/liblldb.xcode.exports;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -7784,10 +7784,10 @@
CLANG_LINK_OBJC_RUNTIME = NO;
CLANG_OBJC_RUNTIME = NO;
COMBINE_HIDPI_IMAGES = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
DEAD_CODE_STRIPPING = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
-   DYLIB_CURRENT_VERSION = 350.99.0;
+   DYLIB_CURRENT_VERSION = 360.99.0;
EXPORTED_SYMBOLS_FILE = 
source/API/liblldb.xcode.exports;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -7855,7 +7855,7 @@
buildSettings = {
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
DEBUGGING_SYMBOLS = YES;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@@ -7880,7 +7880,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
OTHER_CFLAGS = "";
@@ -7896,7 +7896,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
OTHER_CFLAGS = "";
@@ -7910,8 +7910,8 @@
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
-   DYLIB_CURRENT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
+   DYLIB_CURRENT_VERSION = 360.99.0;
EXECUTABLE_EXTENSION = a;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
@@ -7955,8 +7955,8 @@
isa = XCBuildConfiguration;
buildSettings = {
COMBINE_HIDPI_IMAGES = YES;
-   CURRENT_PROJECT_VERSION = 350.99.0;
-   DYLIB_CURRENT_VERSION = 350.99.0;
+   CURRENT_PROJECT_VERSION = 360.99.0;
+   DYLIB_CURRENT_VERSION = 360.99.0;
EXECUTABL

Re: [Lldb-commits] [PATCH] D18082: [LLDB]{MIPS] Fix TestPlatformProcessConnect.py

2016-03-14 Thread Nitesh Jain via lldb-commits
nitesh.jain added a comment.

Hi Tamas Berghammer,

Is it ok to commit?


Repository:
  rL LLVM

http://reviews.llvm.org/D18082



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