[Lldb-commits] [PATCH] D87345: [lldb/Docs] Correct LLDB_ENABLE_TESTS to LLDB_INCLUDE_TESTS

2020-09-08 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added a reviewer: JDevlieghere.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
kastiglione requested review of this revision.

Fix references to LLDB_ENABLE_TESTS.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87345

Files:
  lldb/docs/resources/build.rst


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -244,7 +244,7 @@
 
 On Windows the LLDB test suite requires lld. Either add ``lld`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``.
+``LLDB_INCLUDE_TESTS=OFF``.
 
 Although the following CMake variables are by no means Windows specific, they
 are commonly used on Windows.
@@ -300,7 +300,7 @@
 
 On macOS the LLDB test suite requires libc++. Either add ``libcxx`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``. Further useful options:
+``LLDB_INCLUDE_TESTS=OFF``. Further useful options:
 
 * ``LLDB_BUILD_FRAMEWORK:BOOL``: Builds the LLDB.framework.
 * ``LLDB_CODESIGN_IDENTITY:STRING``: Set the identity to use for code-signing


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -244,7 +244,7 @@
 
 On Windows the LLDB test suite requires lld. Either add ``lld`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``.
+``LLDB_INCLUDE_TESTS=OFF``.
 
 Although the following CMake variables are by no means Windows specific, they
 are commonly used on Windows.
@@ -300,7 +300,7 @@
 
 On macOS the LLDB test suite requires libc++. Either add ``libcxx`` to
 ``LLVM_ENABLE_PROJECTS`` or disable the test suite with
-``LLDB_ENABLE_TESTS=OFF``. Further useful options:
+``LLDB_INCLUDE_TESTS=OFF``. Further useful options:
 
 * ``LLDB_BUILD_FRAMEWORK:BOOL``: Builds the LLDB.framework.
 * ``LLDB_CODESIGN_IDENTITY:STRING``: Set the identity to use for code-signing
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D87333#2262260 , @rupprecht wrote:

> In D87333#2262241 , @clayborg wrote:
>
>> In D87333#2262236 , @rupprecht 
>> wrote:
>>
>>> In D87333#2262229 , @clayborg 
>>> wrote:
>>>
 FYI: we switched away from "localhost" a long time ago due to issues with 
 people having a "localhost" entry in their /etc/hosts folder.
>>>
>>> I assume you mean people *not* having a "localhost" entry?
>>
>> I believe the issue was with people having a modified version that replaces 
>> localhost with some other IP address.
>>
>>> I didn't even realize that was an option. Yes, this patch would break that. 
>>> I'll have to take another approach, then.
>>
>> You might check the "git log" on any files that have "127.0.0.1" in them for 
>> details.
>>
>>> Do you happen to have any references (bugs etc.) for those kinds of issues?
>
> Looks like rLLDB202424  is the patch 
> that did most of this. There may be more context in rdar://problem/16154630 
> but I don't have access to that.

Not a lot of context in that radar. Greg wrote:

> Anyone who was able to previously reproduce this issue by having DNS lookups 
> on "localhost" take more than 3 seconds should no longer see this issue 
> because we are now using "127.0.0.1" which will just get parsed as 4 numbers, 
> not as a "lookup this name in a DNS registry".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87333/new/

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D85705: Add a "Trace" plug-in to LLDB to add process trace support in stages.

2020-09-08 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.

This looks good to me. We will need to wait until the JSON changes from 
https://reviews.llvm.org/D87335 to make it in though in case there are any 
modifications to that patch.

Walter will put up the RFC for trace plug-ins and if that differs from this 
patch much we can modify this to match. I don't see a need to hold up the patch 
since this won't affect anyone as it is new functionality that doesn't affect 
normal debugging or other workflows.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85705/new/

https://reviews.llvm.org/D85705

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


[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added a comment.

In D87333#2262241 , @clayborg wrote:

> In D87333#2262236 , @rupprecht wrote:
>
>> In D87333#2262229 , @clayborg wrote:
>>
>>> FYI: we switched away from "localhost" a long time ago due to issues with 
>>> people having a "localhost" entry in their /etc/hosts folder.
>>
>> I assume you mean people *not* having a "localhost" entry?
>
> I believe the issue was with people having a modified version that replaces 
> localhost with some other IP address.
>
>> I didn't even realize that was an option. Yes, this patch would break that. 
>> I'll have to take another approach, then.
>
> You might check the "git log" on any files that have "127.0.0.1" in them for 
> details.
>
>> Do you happen to have any references (bugs etc.) for those kinds of issues?

Looks like rLLDB202424  is the patch that 
did most of this. There may be more context in rdar://problem/16154630 but I 
don't have access to that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87333/new/

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D86670: [intel-pt] Add a basic implementation of the dump command

2020-09-08 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 290607.
wallace added a comment.

- format


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86670/new/

https://reviews.llvm.org/D86670

Files:
  lldb/include/lldb/Target/Target.h
  lldb/include/lldb/Target/Trace.h
  lldb/source/Commands/CommandObjectTrace.cpp
  lldb/source/Commands/Options.td
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Target/Target.cpp
  lldb/source/Target/Trace.cpp
  lldb/test/API/commands/trace/TestTraceDump.py
  lldb/test/API/commands/trace/TestTraceLoad.py
  lldb/test/API/commands/trace/intelpt-trace/trace2.json

Index: lldb/test/API/commands/trace/intelpt-trace/trace2.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace2.json
@@ -0,0 +1,53 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+{
+  "pid": 1,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 11,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+},
+{
+  "pid": 2,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 21,
+  "traceFile": "3842849.trace"
+},
+{
+  "tid": 22,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+}
+  ]
+}
Index: lldb/test/API/commands/trace/TestTraceLoad.py
===
--- lldb/test/API/commands/trace/TestTraceLoad.py
+++ lldb/test/API/commands/trace/TestTraceLoad.py
@@ -55,3 +55,5 @@
 self.expect("trace load -v " + trace_definition_file2, error=True,
 substrs=['error: JSON object is missing the "pid" field.'])
 self.assertEqual(self.dbg.GetNumTargets(), 0)
+
+self.expect("trace dump", substrs=["error: no trace data in this target"])
Index: lldb/test/API/commands/trace/TestTraceDump.py
===
--- /dev/null
+++ lldb/test/API/commands/trace/TestTraceDump.py
@@ -0,0 +1,48 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test.decorators import *
+
+class TestTraceDump(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
+
+def setUp(self):
+TestBase.setUp(self)
+if 'intel-pt' not in configuration.enabled_plugins:
+self.skipTest("The intel-pt test plugin is not enabled")
+
+
+def testDumpTrace(self):
+self.expect("trace dump", substrs=["error: no trace data in this target"])
+
+src_dir = self.getSourceDir()
+trace_definition_file = os.path.join(src_dir, "intelpt-trace", "trace2.json")
+self.expect("trace load " + trace_definition_file)
+
+# An invalid thread id should show an error message
+self.expect("trace dump -t 5678", substrs=['error: the thread id "5678" does not exist in this target'])
+
+# Only the specified thread should be printed
+self.expect("trace dump -t 22", substrs=["Trace files"],
+  patterns=["pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+# Verbose should output the entire JSON settings besides the thread specific information
+self.expect("trace dump -t 22 -v",
+  substrs=["Settings", "3842849.trace", "intel-pt", "Settings directory"],
+  patterns=["pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+# In this case all threads should be printed
+self.expect("trace dump", substrs=["Trace files"],
+  patterns=["pid: '2', tid: '21' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace",
+"pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+self.expect("trace dump -t 21 --thread-id 22", substrs=["Trace files"],
+  patterns=["pid: '2', tid: '21' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace",
+"pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+# We switch targets and check the threads of this target
+self.dbg.SetSelectedTarget(self.dbg.FindTargetWithProcessID(1))
+self.expect("trace dump", substrs=["Trace 

[Lldb-commits] [PATCH] D86670: [intel-pt] Add a basic implementation of the dump command

2020-09-08 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 290605.
wallace added a comment.

Addresses Greg's comments.

As a side note, I'll work on a RFC for the LLDB mailing list to get feedback on 
the overall design of the feature, as @labath suggested. However, Greg and I 
want to get these patches in, as we need this functionality soon. We can easily 
make modifications whenever suggestions come, following an iterative approach 
to development.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86670/new/

https://reviews.llvm.org/D86670

Files:
  lldb/include/lldb/Target/Target.h
  lldb/include/lldb/Target/Trace.h
  lldb/source/Commands/CommandObjectTrace.cpp
  lldb/source/Commands/Options.td
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Target/Target.cpp
  lldb/source/Target/Trace.cpp
  lldb/test/API/commands/trace/TestTraceDump.py
  lldb/test/API/commands/trace/TestTraceLoad.py
  lldb/test/API/commands/trace/intelpt-trace/trace2.json

Index: lldb/test/API/commands/trace/intelpt-trace/trace2.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace2.json
@@ -0,0 +1,53 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+{
+  "pid": 1,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 11,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+},
+{
+  "pid": 2,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 21,
+  "traceFile": "3842849.trace"
+},
+{
+  "tid": 22,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+}
+  ]
+}
Index: lldb/test/API/commands/trace/TestTraceLoad.py
===
--- lldb/test/API/commands/trace/TestTraceLoad.py
+++ lldb/test/API/commands/trace/TestTraceLoad.py
@@ -55,3 +55,5 @@
 self.expect("trace load -v " + trace_definition_file2, error=True,
 substrs=['error: JSON object is missing the "pid" field.'])
 self.assertEqual(self.dbg.GetNumTargets(), 0)
+
+self.expect("trace dump", substrs=["error: no trace data in this target"])
Index: lldb/test/API/commands/trace/TestTraceDump.py
===
--- /dev/null
+++ lldb/test/API/commands/trace/TestTraceDump.py
@@ -0,0 +1,48 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+from lldbsuite.test.decorators import *
+
+class TestTraceDump(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+NO_DEBUG_INFO_TESTCASE = True
+
+def setUp(self):
+TestBase.setUp(self)
+if 'intel-pt' not in configuration.enabled_plugins:
+self.skipTest("The intel-pt test plugin is not enabled")
+
+
+def testDumpTrace(self):
+self.expect("trace dump", substrs=["error: no trace data in this target"])
+
+src_dir = self.getSourceDir()
+trace_definition_file = os.path.join(src_dir, "intelpt-trace", "trace2.json")
+self.expect("trace load " + trace_definition_file)
+
+# An invalid thread id should show an error message
+self.expect("trace dump -t 5678", substrs=['error: the thread id "5678" does not exist in this target'])
+
+# Only the specified thread should be printed
+self.expect("trace dump -t 22", substrs=["Trace files"],
+  patterns=["pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+# Verbose should output the entire JSON settings besides the thread specific information
+self.expect("trace dump -t 22 -v",
+  substrs=["Settings", "3842849.trace", "intel-pt", "Settings directory"],
+  patterns=["pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+# In this case all threads should be printed
+self.expect("trace dump", substrs=["Trace files"],
+  patterns=["pid: '2', tid: '21' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace",
+"pid: '2', tid: '22' -> .*/test/API/commands/trace/intelpt-trace/3842849.trace"])
+
+self.expect("trace dump -t 21 --thread-id 22", substrs=["Trace files"],
+  patterns=["pid: '2', tid: 

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

In D87333#2262236 , @rupprecht wrote:

> In D87333#2262229 , @clayborg wrote:
>
>> FYI: we switched away from "localhost" a long time ago due to issues with 
>> people having a "localhost" entry in their /etc/hosts folder.
>
> I assume you mean people *not* having a "localhost" entry?

I believe the issue was with people having a modified version that replaces 
localhost with some other IP address.

> I didn't even realize that was an option. Yes, this patch would break that. 
> I'll have to take another approach, then.

You might check the "git log" on any files that have "127.0.0.1" in them for 
details.

> Do you happen to have any references (bugs etc.) for those kinds of issues?




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87333/new/

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht added a comment.

In D87333#2262229 , @clayborg wrote:

> FYI: we switched away from "localhost" a long time ago due to issues with 
> people having a "localhost" entry in their /etc/hosts folder.

I assume you mean people *not* having a "localhost" entry? I didn't even 
realize that was an option. Yes, this patch would break that. I'll have to take 
another approach, then.

Do you happen to have any references (bugs etc.) for those kinds of issues?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87333/new/

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D85705: Add a "Trace" plug-in to LLDB to add process trace support in stages.

2020-09-08 Thread walter erquinigo via Phabricator via lldb-commits
wallace updated this revision to Diff 290603.
wallace added a comment.

- Moved the JSON changes to another diff.
- Addressed all the comments so far.

As a side note, I'll work on a RFC for the LLDB mailing list to get feedback on 
the overall design of the feature, as @labath suggested. However, Greg and I 
want to get these patches in, as we need this functionality soon. We can easily 
make modifications whenever suggestions come, following an iterative approach 
to development.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85705/new/

https://reviews.llvm.org/D85705

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Target/Trace.h
  lldb/include/lldb/Target/TraceSettingsParser.h
  lldb/include/lldb/lldb-forward.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/source/Commands/CMakeLists.txt
  lldb/source/Commands/CommandObjectTrace.cpp
  lldb/source/Commands/CommandObjectTrace.h
  lldb/source/Commands/Options.td
  lldb/source/Core/PluginManager.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Plugins/CMakeLists.txt
  lldb/source/Plugins/Trace/CMakeLists.txt
  lldb/source/Plugins/Trace/intel-pt/CMakeLists.txt
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPT.h
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.cpp
  lldb/source/Plugins/Trace/intel-pt/TraceIntelPTSettingsParser.h
  lldb/source/Target/CMakeLists.txt
  lldb/source/Target/Trace.cpp
  lldb/source/Target/TraceSettingsParser.cpp
  lldb/source/Utility/StructuredData.cpp
  lldb/test/API/commands/trace/TestTraceLoad.py
  lldb/test/API/commands/trace/TestTraceSchema.py
  lldb/test/API/commands/trace/intelpt-trace/3842849.trace
  lldb/test/API/commands/trace/intelpt-trace/a.out
  lldb/test/API/commands/trace/intelpt-trace/main.cpp
  lldb/test/API/commands/trace/intelpt-trace/trace.json
  lldb/test/API/commands/trace/intelpt-trace/trace_bad.json
  lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
  lldb/test/API/commands/trace/intelpt-trace/trace_bad3.json

Index: lldb/test/API/commands/trace/intelpt-trace/trace_bad3.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace_bad3.json
@@ -0,0 +1,32 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+{
+  "pid": 1234,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 5678,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+},
+{}
+  ]
+}
Index: lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace_bad2.json
@@ -0,0 +1,41 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+{
+  "pid": 1234,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 5678,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": "a.out",
+  "systemPath": "a.out",
+  "loadAddress": "0x0040",
+  "uuid": "6AA9A4E2-6F28-2F33-377D-59FECE874C71-5B41261A"
+}
+  ]
+},
+{
+  "pid": 12345,
+  "threads": [
+{
+  "tid": 56789,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": []
+}
+  ]
+}
Index: lldb/test/API/commands/trace/intelpt-trace/trace_bad.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace_bad.json
@@ -0,0 +1,14 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+123
+  ]
+}
Index: lldb/test/API/commands/trace/intelpt-trace/trace.json
===
--- /dev/null
+++ lldb/test/API/commands/trace/intelpt-trace/trace.json
@@ -0,0 +1,31 @@
+{
+  "trace": {
+"type": "intel-pt",
+"pt_cpu": {
+  "vendor": "intel",
+  "family": 6,
+  "model": 79,
+  "stepping": 1
+}
+  },
+  "processes": [
+{
+  "pid": 1234,
+  "triple": "x86_64-*-linux",
+  "threads": [
+{
+  "tid": 3842849,
+  "traceFile": "3842849.trace"
+}
+  ],
+  "modules": [
+{
+  "file": 

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added a comment.

FYI: we switched away from "localhost" a long time ago due to issues with 
people having a "localhost" entry in their /etc/hosts folder.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87333/new/

https://reviews.llvm.org/D87333

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


[Lldb-commits] [PATCH] D86996: [lldb] Add -l/--language option to script command

2020-09-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 290596.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86996/new/

https://reviews.llvm.org/D86996

Files:
  lldb/source/Commands/CommandObjectScript.cpp
  lldb/source/Commands/CommandObjectScript.h
  lldb/source/Commands/Options.td
  lldb/test/Shell/ScriptInterpreter/Lua/lua-python.test
  lldb/test/Shell/ScriptInterpreter/Lua/lua.test
  lldb/test/Shell/ScriptInterpreter/Python/python.test

Index: lldb/test/Shell/ScriptInterpreter/Python/python.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Python/python.test
@@ -0,0 +1,12 @@
+# REQUIRES: python
+# RUN: %lldb --script-language python -o 'script -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# RUN: %lldb --script-language python -o 'script --language default -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script -l python -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script -lpython -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script --language python -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script --language=python -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s
+# CHECK: 
+
+# RUN: %lldb -o 'script --language invalid -- print("{}".format(1000+100+10+1))' 2>&1 | FileCheck %s --check-prefix INVALID
+# INVALID: error: unrecognized value for language 'invalid'
+# INVALID-NOT: 
Index: lldb/test/Shell/ScriptInterpreter/Lua/lua.test
===
--- lldb/test/Shell/ScriptInterpreter/Lua/lua.test
+++ lldb/test/Shell/ScriptInterpreter/Lua/lua.test
@@ -1,3 +1,6 @@
 # REQUIRES: lua
-# RUN: %lldb --script-language lua -o 'script print(1000+100+10+1)' 2>&1 | FileCheck %s
+# RUN: %lldb --script-language lua -o 'script -- io.stdout:write(1000+100+10+1, "\n")' 2>&1 | FileCheck %s
+# RUN: %lldb --script-language lua -o 'script --language default -- io.stdout:write(1000+100+10+1, "\n")' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script -l lua -- io.stdout:write(1000+100+10+1, "\n")' 2>&1 | FileCheck %s
+# RUN: %lldb -o 'script --language lua -- io.stdout:write(1000+100+10+1, "\n")' 2>&1 | FileCheck %s
 # CHECK: 
Index: lldb/test/Shell/ScriptInterpreter/Lua/lua-python.test
===
--- /dev/null
+++ lldb/test/Shell/ScriptInterpreter/Lua/lua-python.test
@@ -0,0 +1,17 @@
+# REQUIRES: lua
+# REQUIRES: python
+# UNSUPPORTED: lldb-repro
+
+# RUN: mkdir -p %t
+# RUN: cd %t
+# RUN: echo "int main() { return 0; }" | %clang_host -x c - -o a.out
+# RUN: cat %s | %lldb 2>&1 | FileCheck %s
+script -l lua --
+target = lldb.debugger:CreateTarget("a.out")
+print("target is valid:", tostring(target:IsValid()))
+lldb.debugger:SetSelectedTarget(target)
+quit
+# CHECK: target is valid: true
+script -l python --
+print("selected target: {}".format(lldb.debugger.GetSelectedTarget()))
+# CHECK: selected target: a.out
Index: lldb/source/Commands/Options.td
===
--- lldb/source/Commands/Options.td
+++ lldb/source/Commands/Options.td
@@ -717,6 +717,12 @@
 "LLDB event system.">;
 }
 
+let Command = "script" in {
+  def script_language : Option<"language", "l">,
+EnumArg<"ScriptLang", "ScriptOptionEnum()">, Desc<"Specify the scripting "
+" language. If none is specific the default scripting language is used.">;
+}
+
 let Command = "source info" in {
   def source_info_count : Option<"count", "c">, Arg<"Count">,
 Desc<"The number of line entries to display.">;
Index: lldb/source/Commands/CommandObjectScript.h
===
--- lldb/source/Commands/CommandObjectScript.h
+++ lldb/source/Commands/CommandObjectScript.h
@@ -17,9 +17,24 @@
 public:
   CommandObjectScript(CommandInterpreter );
   ~CommandObjectScript() override;
+  Options *GetOptions() override { return _options; }
+
+  class CommandOptions : public Options {
+  public:
+CommandOptions() : Options() {}
+~CommandOptions() override = default;
+Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
+  ExecutionContext *execution_context) override;
+void OptionParsingStarting(ExecutionContext *execution_context) override;
+llvm::ArrayRef GetDefinitions() override;
+lldb::ScriptLanguage language = lldb::eScriptLanguageNone;
+  };
 
 protected:
   bool DoExecute(llvm::StringRef command, CommandReturnObject ) override;
+
+private:
+  CommandOptions m_options;
 };
 
 } // namespace lldb_private
Index: lldb/source/Commands/CommandObjectScript.cpp
===
--- lldb/source/Commands/CommandObjectScript.cpp
+++ lldb/source/Commands/CommandObjectScript.cpp
@@ -10,36 +10,107 @@
 #include "lldb/Core/Debugger.h"
 

[Lldb-commits] [PATCH] D87333: [lldb/ipv6] Support running lldb tests in an ipv6-only environment.

2020-09-08 Thread Jordan Rupprecht via Phabricator via lldb-commits
rupprecht created this revision.
rupprecht added reviewers: labath, clayborg.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
rupprecht requested review of this revision.
Herald added a subscriber: JDevlieghere.

When running in an ipv6-only environment where `AF_INET` sockets are not 
available, many lldb tests (mostly gdb remote tests) fail because things like 
`127.0.0.1` don't work there.

This change is mostly a simple search-and-replace of `127.0.0.1` -> `localhost` 
until tests pass in an internal ipv6-only environment. A few places have been 
updated to dynamically retry with `AF_INET6` if creating a socket with 
`AF_INET` doesn't work.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87333

Files:
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
  lldb/source/Target/Platform.cpp
  lldb/test/API/functionalities/gdb_remote_client/gdbclientutils.py
  lldb/test/API/tools/lldb-server/commandline/TestStubReverseConnect.py
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTestUtilities.cpp

Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- lldb/unittests/Host/SocketTestUtilities.cpp
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -101,13 +101,14 @@
  "Creating a canary {0} TCP socket failed: {1}.",
  Proto, Err)
  .str();
-  bool HasAddrNotAvail = false;
+  bool HasProtocolError = false;
   handleAllErrors(std::move(Err), [&](std::unique_ptr ECErr) {
-if (ECErr->convertToErrorCode() ==
-std::make_error_code(std::errc::address_not_available))
-  HasAddrNotAvail = true;
+std::error_code ec = ECErr->convertToErrorCode();
+if (ec == std::make_error_code(std::errc::address_family_not_supported) ||
+ec == std::make_error_code(std::errc::address_not_available))
+  HasProtocolError = true;
   });
-  if (HasAddrNotAvail) {
+  if (HasProtocolError) {
 GTEST_LOG_(WARNING)
 << llvm::formatv(
"Assuming the host does not support {0}. Skipping test.", Proto)
Index: lldb/unittests/Host/SocketTest.cpp
===
--- lldb/unittests/Host/SocketTest.cpp
+++ lldb/unittests/Host/SocketTest.cpp
@@ -14,12 +14,24 @@
 
 using namespace lldb_private;
 
-class SocketTest : public testing::Test {
+struct SocketTestParams {
+  bool is_ipv6;
+  std::string localhost_ip;
+};
+
+class SocketTest : public testing::TestWithParam {
 public:
   SubsystemRAII subsystems;
+
+protected:
+  bool HostSupportsProtocol() const {
+if (GetParam().is_ipv6)
+  return HostSupportsIPv6();
+return HostSupportsIPv4();
+  }
 };
 
-TEST_F(SocketTest, DecodeHostAndPort) {
+TEST_P(SocketTest, DecodeHostAndPort) {
   std::string host_str;
   std::string port_str;
   int32_t port;
@@ -86,7 +98,7 @@
 }
 
 #if LLDB_ENABLE_POSIX
-TEST_F(SocketTest, DomainListenConnectAccept) {
+TEST_P(SocketTest, DomainListenConnectAccept) {
   llvm::SmallString<64> Path;
   std::error_code EC = llvm::sys::fs::createUniqueDirectory("DomainListenConnectAccept", Path);
   ASSERT_FALSE(EC);
@@ -102,18 +114,22 @@
 }
 #endif
 
-TEST_F(SocketTest, TCPListen0ConnectAccept) {
+TEST_P(SocketTest, TCPListen0ConnectAccept) {
+  if (!HostSupportsProtocol())
+return;
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  CreateTCPConnectedSockets("127.0.0.1", _a_up, _b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, _a_up,
+_b_up);
 }
 
-TEST_F(SocketTest, TCPGetAddress) {
+TEST_P(SocketTest, TCPGetAddress) {
   std::unique_ptr socket_a_up;
   std::unique_ptr socket_b_up;
-  if (!HostSupportsIPv4())
+  if (!HostSupportsProtocol())
 return;
-  CreateTCPConnectedSockets("127.0.0.1", _a_up, _b_up);
+  CreateTCPConnectedSockets(GetParam().localhost_ip, _a_up,
+_b_up);
 
   EXPECT_EQ(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetRemotePortNumber());
@@ -121,11 +137,16 @@
 socket_a_up->GetRemotePortNumber());
   EXPECT_NE(socket_a_up->GetLocalPortNumber(),
 socket_b_up->GetLocalPortNumber());
-  EXPECT_STREQ("127.0.0.1", socket_a_up->GetRemoteIPAddress().c_str());
-  EXPECT_STREQ("127.0.0.1", socket_b_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_a_up->GetRemoteIPAddress().c_str());
+  EXPECT_STREQ(GetParam().localhost_ip.c_str(),
+   socket_b_up->GetRemoteIPAddress().c_str());
 }
 
-TEST_F(SocketTest, UDPConnect) {
+TEST_P(SocketTest, UDPConnect) {
+  // UDPSocket::Connect() creates sockets with AF_INET (IPv4).
+  if 

[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-08 Thread Dave Lee via Phabricator via lldb-commits
kastiglione updated this revision to Diff 290581.
kastiglione added a comment.

clang-format


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87327/new/

https://reviews.llvm.org/D87327

Files:
  lldb/tools/debugserver/source/debugserver.cpp

Index: lldb/tools/debugserver/source/debugserver.cpp
===
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -156,18 +156,36 @@
   return eRNBRunLoopModeExit;
 }
 
-// Check the name to see if it ends with .app
-static bool is_dot_app (const char *app_name) {
-  size_t len = strlen(app_name);
-  if (len < 4)
+static nub_launch_flavor_t default_launch_flavor(const char *app_name) {
+#if defined(WITH_FBS) || defined(WITH_BKS) || defined(WITH_SPRINGBOARD)
+  // Check the name to see if it ends with .app
+  auto is_dot_app = [](const char *app_name) {
+size_t len = strlen(app_name);
+if (len < 4)
+  return false;
+
+if (app_name[len - 4] == '.' && app_name[len - 3] == 'a' &&
+app_name[len - 2] == 'p' && app_name[len - 1] == 'p')
+  return true;
 return false;
-  
-  if (app_name[len - 4] == '.' &&
-  app_name[len - 3] == 'a' && 
-  app_name[len - 2] == 'p' &&
-  app_name[len - 1] == 'p')
-return true;
-  return false;
+  };
+
+  if (is_dot_app(app_name)) {
+#if defined WITH_FBS
+// Check if we have an app bundle, if so launch using FrontBoard Services.
+return eLaunchFlavorFBS;
+#elif defined WITH_BKS
+// Check if we have an app bundle, if so launch using BackBoard Services.
+return eLaunchFlavorBKS;
+#elif defined WITH_SPRINGBOARD
+// Check if we have an app bundle, if so launch using SpringBoard.
+return eLaunchFlavorSpringBoard;
+#endif
+  }
+#endif
+
+  // Our default launch method is posix spawn
+  return eLaunchFlavorPosixSpawn;
 }
 
 // This run loop mode will wait for the process to launch and hit its
@@ -208,29 +226,8 @@
   // figure our how we are going to launch automatically.
 
   nub_launch_flavor_t launch_flavor = g_launch_flavor;
-  if (launch_flavor == eLaunchFlavorDefault) {
-// Our default launch method is posix spawn
-launch_flavor = eLaunchFlavorPosixSpawn;
-
-const bool dot_app = is_dot_app(inferior_argv[0]);
-(void)dot_app;
-#if defined WITH_FBS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorFBS;
-}
-#elif defined WITH_BKS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorBKS;
-}
-#elif defined WITH_SPRINGBOARD
-// Check if we have an app bundle, if so launch using SpringBoard.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorSpringBoard;
-}
-#endif
-  }
+  if (launch_flavor == eLaunchFlavorDefault)
+launch_flavor = default_launch_flavor(inferior_argv[0]);
 
   ctx.SetLaunchFlavor(launch_flavor);
   char resolved_path[PATH_MAX];
@@ -1509,27 +1506,8 @@
   timeout_ptr = _timeout_abstime;
 }
 nub_launch_flavor_t launch_flavor = g_launch_flavor;
-if (launch_flavor == eLaunchFlavorDefault) {
-  // Our default launch method is posix spawn
-  launch_flavor = eLaunchFlavorPosixSpawn;
-
-#if defined WITH_FBS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorFBS;
-  }
-#elif defined WITH_BKS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorBKS;
-  }
-#elif defined WITH_SPRINGBOARD
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorSpringBoard;
-  }
-#endif
-}
+if (launch_flavor == eLaunchFlavorDefault)
+  launch_flavor = default_launch_flavor(waitfor_pid_name.c_str());
 
 ctx.SetLaunchFlavor(launch_flavor);
 bool ignore_existing = false;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-08 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment.

Follow up to 8aeb212887024a615ca02437cd12fa055bd54b6f 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87327/new/

https://reviews.llvm.org/D87327

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


[Lldb-commits] [PATCH] D87327: [debugserver] Extract function for default launch flavor

2020-09-08 Thread Dave Lee via Phabricator via lldb-commits
kastiglione created this revision.
kastiglione added reviewers: jasonmolenda, teemperor.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
kastiglione requested review of this revision.
Herald added a subscriber: JDevlieghere.

Extract a function for turning `eLaunchFlavorDefault` into a concreate 
`eLaunchFlavor` value.

This new function encapsulates the few compile time variables involved, and 
also prevents clang unused code diagnostics.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87327

Files:
  lldb/tools/debugserver/source/debugserver.cpp

Index: lldb/tools/debugserver/source/debugserver.cpp
===
--- lldb/tools/debugserver/source/debugserver.cpp
+++ lldb/tools/debugserver/source/debugserver.cpp
@@ -156,18 +156,38 @@
   return eRNBRunLoopModeExit;
 }
 
-// Check the name to see if it ends with .app
-static bool is_dot_app (const char *app_name) {
-  size_t len = strlen(app_name);
-  if (len < 4)
+static nub_launch_flavor_t default_launch_flavor(const char *app_name) {
+#if defined(WITH_FBS) || defined(WITH_BKS) || defined(WITH_SPRINGBOARD)
+  // Check the name to see if it ends with .app
+  auto is_dot_app = [](const char *app_name) {
+size_t len = strlen(app_name);
+if (len < 4)
+  return false;
+
+if (app_name[len - 4] == '.' &&
+app_name[len - 3] == 'a' &&
+app_name[len - 2] == 'p' &&
+app_name[len - 1] == 'p')
+  return true;
 return false;
-  
-  if (app_name[len - 4] == '.' &&
-  app_name[len - 3] == 'a' && 
-  app_name[len - 2] == 'p' &&
-  app_name[len - 1] == 'p')
-return true;
-  return false;
+  };
+
+  if (is_dot_app(app_name)) {
+#if defined WITH_FBS
+// Check if we have an app bundle, if so launch using FrontBoard Services.
+return eLaunchFlavorFBS;
+#elif defined WITH_BKS
+// Check if we have an app bundle, if so launch using BackBoard Services.
+return eLaunchFlavorBKS;
+#elif defined WITH_SPRINGBOARD
+// Check if we have an app bundle, if so launch using SpringBoard.
+return eLaunchFlavorSpringBoard;
+#endif
+  }
+#endif
+
+  // Our default launch method is posix spawn
+  return eLaunchFlavorPosixSpawn;
 }
 
 // This run loop mode will wait for the process to launch and hit its
@@ -208,29 +228,8 @@
   // figure our how we are going to launch automatically.
 
   nub_launch_flavor_t launch_flavor = g_launch_flavor;
-  if (launch_flavor == eLaunchFlavorDefault) {
-// Our default launch method is posix spawn
-launch_flavor = eLaunchFlavorPosixSpawn;
-
-const bool dot_app = is_dot_app(inferior_argv[0]);
-(void)dot_app;
-#if defined WITH_FBS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorFBS;
-}
-#elif defined WITH_BKS
-// Check if we have an app bundle, if so launch using BackBoard Services.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorBKS;
-}
-#elif defined WITH_SPRINGBOARD
-// Check if we have an app bundle, if so launch using SpringBoard.
-if (dot_app) {
-  launch_flavor = eLaunchFlavorSpringBoard;
-}
-#endif
-  }
+  if (launch_flavor == eLaunchFlavorDefault)
+launch_flavor = default_launch_flavor(inferior_argv[0]);
 
   ctx.SetLaunchFlavor(launch_flavor);
   char resolved_path[PATH_MAX];
@@ -1509,27 +1508,8 @@
   timeout_ptr = _timeout_abstime;
 }
 nub_launch_flavor_t launch_flavor = g_launch_flavor;
-if (launch_flavor == eLaunchFlavorDefault) {
-  // Our default launch method is posix spawn
-  launch_flavor = eLaunchFlavorPosixSpawn;
-
-#if defined WITH_FBS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorFBS;
-  }
-#elif defined WITH_BKS
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorBKS;
-  }
-#elif defined WITH_SPRINGBOARD
-  // Check if we have an app bundle, if so launch using SpringBoard.
-  if (is_dot_app(waitfor_pid_name.c_str())) {
-launch_flavor = eLaunchFlavorSpringBoard;
-  }
-#endif
-}
+if (launch_flavor == eLaunchFlavorDefault)
+  launch_flavor = default_launch_flavor(waitfor_pid_name.c_str());
 
 ctx.SetLaunchFlavor(launch_flavor);
 bool ignore_existing = false;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 5c463d1 - Revert "Retry of D84974"

2020-09-08 Thread Walter Erquinigo via lldb-commits

Author: Walter Erquinigo
Date: 2020-09-08T13:41:11-07:00
New Revision: 5c463d107d3c26fc5573f31b838a8a3a1e4b5065

URL: 
https://github.com/llvm/llvm-project/commit/5c463d107d3c26fc5573f31b838a8a3a1e4b5065
DIFF: 
https://github.com/llvm/llvm-project/commit/5c463d107d3c26fc5573f31b838a8a3a1e4b5065.diff

LOG: Revert "Retry of D84974"

This reverts commit 5b2b4f331d78f326e5e29166bec5ad92c864343d.

This caused a link error in
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/18794/steps/build/logs/stdio

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
lldb/tools/lldb-vscode/JSONUtils.cpp
lldb/tools/lldb-vscode/JSONUtils.h
lldb/tools/lldb-vscode/VSCode.cpp
lldb/tools/lldb-vscode/VSCode.h
lldb/tools/lldb-vscode/lldb-vscode.cpp
lldb/tools/lldb-vscode/package.json

Removed: 
lldb/test/API/tools/lldb-vscode/runInTerminal/Makefile
lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
lldb/test/API/tools/lldb-vscode/runInTerminal/main.c



diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index 5710751ec34b..fa5a9c0db1eb 100644
--- 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -282,7 +282,7 @@ def launch(self, program=None, args=None, cwd=None, 
env=None,
trace=False, initCommands=None, preRunCommands=None,
stopCommands=None, exitCommands=None, terminateCommands=None,
sourcePath=None, debuggerRoot=None, launchCommands=None,
-   sourceMap=None, disconnectAutomatically=True, 
runInTerminal=False):
+   sourceMap=None, disconnectAutomatically=True):
 '''Sending launch request to vscode
 '''
 
@@ -316,16 +316,10 @@ def cleanup():
 sourcePath=sourcePath,
 debuggerRoot=debuggerRoot,
 launchCommands=launchCommands,
-sourceMap=sourceMap,
-runInTerminal=runInTerminal)
+sourceMap=sourceMap)
 if not (response and response['success']):
 self.assertTrue(response['success'],
 'launch failed (%s)' % (response['message']))
-# We need to trigger a request_configurationDone after we've 
successfully
-# attached a runInTerminal process to finish initialization.
-if runInTerminal:
-self.vscode.request_configurationDone()
-
 
 def build_and_launch(self, program, args=None, cwd=None, env=None,
  stopOnEntry=False, disableASLR=True,
@@ -333,7 +327,7 @@ def build_and_launch(self, program, args=None, cwd=None, 
env=None,
  trace=False, initCommands=None, preRunCommands=None,
  stopCommands=None, exitCommands=None,
  terminateCommands=None, sourcePath=None,
- debuggerRoot=None, runInTerminal=False):
+ debuggerRoot=None):
 '''Build the default Makefile target, create the VSCode debug adaptor,
and launch the process.
 '''
@@ -343,4 +337,4 @@ def build_and_launch(self, program, args=None, cwd=None, 
env=None,
 self.launch(program, args, cwd, env, stopOnEntry, disableASLR,
 disableSTDIO, shellExpandArguments, trace,
 initCommands, preRunCommands, stopCommands, exitCommands,
-terminateCommands, sourcePath, debuggerRoot, 
runInTerminal=runInTerminal)
+terminateCommands, sourcePath, debuggerRoot)

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
index 834e33ef5c3d..6b1c1c961b54 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -300,29 +300,12 @@ def send_recv(self, command):
 self.send_packet(command)
 done = False
 while not done:
-response_or_request = self.recv_packet(filter_type=['response', 
'request'])
-if response_or_request is None:
+response = self.recv_packet(filter_type='response')
+if response is None:
 desc = 'no response for "%s"' % (command['command'])
 raise ValueError(desc)
-if response_or_request['type'] == 'response':
-self.validate_response(command, response_or_request)
-return response_or_request
-else:
-if response_or_request['command'] == 'runInTerminal':

[Lldb-commits] [lldb] 5b2b4f3 - Retry of D84974

2020-09-08 Thread Walter Erquinigo via lldb-commits

Author: Walter Erquinigo
Date: 2020-09-08T11:50:09-07:00
New Revision: 5b2b4f331d78f326e5e29166bec5ad92c864343d

URL: 
https://github.com/llvm/llvm-project/commit/5b2b4f331d78f326e5e29166bec5ad92c864343d
DIFF: 
https://github.com/llvm/llvm-project/commit/5b2b4f331d78f326e5e29166bec5ad92c864343d.diff

LOG: Retry of D84974

The test is being disabled on Linux, as lldb-vscode has a bug with
--wait-for on LInux.
I'm also fixing some compilation warnings.

Added: 
lldb/test/API/tools/lldb-vscode/runInTerminal/Makefile
lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
lldb/test/API/tools/lldb-vscode/runInTerminal/main.c

Modified: 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
lldb/tools/lldb-vscode/JSONUtils.cpp
lldb/tools/lldb-vscode/JSONUtils.h
lldb/tools/lldb-vscode/VSCode.cpp
lldb/tools/lldb-vscode/VSCode.h
lldb/tools/lldb-vscode/lldb-vscode.cpp
lldb/tools/lldb-vscode/package.json

Removed: 




diff  --git 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index fa5a9c0db1eb..5710751ec34b 100644
--- 
a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -282,7 +282,7 @@ def launch(self, program=None, args=None, cwd=None, 
env=None,
trace=False, initCommands=None, preRunCommands=None,
stopCommands=None, exitCommands=None, terminateCommands=None,
sourcePath=None, debuggerRoot=None, launchCommands=None,
-   sourceMap=None, disconnectAutomatically=True):
+   sourceMap=None, disconnectAutomatically=True, 
runInTerminal=False):
 '''Sending launch request to vscode
 '''
 
@@ -316,10 +316,16 @@ def cleanup():
 sourcePath=sourcePath,
 debuggerRoot=debuggerRoot,
 launchCommands=launchCommands,
-sourceMap=sourceMap)
+sourceMap=sourceMap,
+runInTerminal=runInTerminal)
 if not (response and response['success']):
 self.assertTrue(response['success'],
 'launch failed (%s)' % (response['message']))
+# We need to trigger a request_configurationDone after we've 
successfully
+# attached a runInTerminal process to finish initialization.
+if runInTerminal:
+self.vscode.request_configurationDone()
+
 
 def build_and_launch(self, program, args=None, cwd=None, env=None,
  stopOnEntry=False, disableASLR=True,
@@ -327,7 +333,7 @@ def build_and_launch(self, program, args=None, cwd=None, 
env=None,
  trace=False, initCommands=None, preRunCommands=None,
  stopCommands=None, exitCommands=None,
  terminateCommands=None, sourcePath=None,
- debuggerRoot=None):
+ debuggerRoot=None, runInTerminal=False):
 '''Build the default Makefile target, create the VSCode debug adaptor,
and launch the process.
 '''
@@ -337,4 +343,4 @@ def build_and_launch(self, program, args=None, cwd=None, 
env=None,
 self.launch(program, args, cwd, env, stopOnEntry, disableASLR,
 disableSTDIO, shellExpandArguments, trace,
 initCommands, preRunCommands, stopCommands, exitCommands,
-terminateCommands, sourcePath, debuggerRoot)
+terminateCommands, sourcePath, debuggerRoot, 
runInTerminal=runInTerminal)

diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
index 6b1c1c961b54..834e33ef5c3d 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -300,12 +300,29 @@ def send_recv(self, command):
 self.send_packet(command)
 done = False
 while not done:
-response = self.recv_packet(filter_type='response')
-if response is None:
+response_or_request = self.recv_packet(filter_type=['response', 
'request'])
+if response_or_request is None:
 desc = 'no response for "%s"' % (command['command'])
 raise ValueError(desc)
-self.validate_response(command, response)
-return response
+if response_or_request['type'] == 'response':
+self.validate_response(command, response_or_request)
+return response_or_request
+else:
+if 

[Lldb-commits] [PATCH] D86996: [lldb] Add -l/--language option to script command

2020-09-08 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added a comment.

Sounds reasonable to me. I'll split it up in two patches. I'll update this one 
to use the double dashes so we can land the functionality and keep things 
consistent with the rest of LLDB. I'll create another patch to do the handling 
of raw commands to use a heuristic.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86996/new/

https://reviews.llvm.org/D86996

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


[Lldb-commits] [PATCH] D85820: Use find_library for ncurses

2020-09-08 Thread Kamil Rytarowski via Phabricator via lldb-commits
krytarowski added a comment.

Please note that ncurses is not the only supported curses library. NetBSD uses 
its original BSD curses for LLVM projects.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85820/new/

https://reviews.llvm.org/D85820

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