[Lldb-commits] [lldb] r369502 - Properly EXCLUDE_FROM_ALL the testing support library

2019-08-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Aug 21 01:21:51 2019
New Revision: 369502

URL: http://llvm.org/viewvc/llvm-project?rev=369502&view=rev
Log:
Properly EXCLUDE_FROM_ALL the testing support library

The EXCLUDE_FROM_ALL variable is used by add_llvm_library, but lldb does
not use that function (it uses llvm_add_library :P). Instead, set the directory
property with the same name directly.

This should fix standalone builds against an llvm install tree.

Modified:
lldb/trunk/unittests/TestingSupport/CMakeLists.txt

Modified: lldb/trunk/unittests/TestingSupport/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/TestingSupport/CMakeLists.txt?rev=369502&r1=369501&r2=369502&view=diff
==
--- lldb/trunk/unittests/TestingSupport/CMakeLists.txt (original)
+++ lldb/trunk/unittests/TestingSupport/CMakeLists.txt Wed Aug 21 01:21:51 2019
@@ -1,4 +1,4 @@
-set(EXCLUDE_FROM_ALL ON)
+set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
 add_lldb_library(lldbUtilityHelpers
   MockTildeExpressionResolver.cpp
   TestUtilities.cpp


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


[Lldb-commits] [lldb] r369503 - Fix an unused variable warning in ClangASTContext.cpp

2019-08-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Aug 21 01:22:19 2019
New Revision: 369503

URL: http://llvm.org/viewvc/llvm-project?rev=369503&view=rev
Log:
Fix an unused variable warning in ClangASTContext.cpp

Modified:
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=369503&r1=369502&r2=369503&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Aug 21 01:22:19 2019
@@ -1557,9 +1557,8 @@ CompilerType ClangASTContext::CreateReco
 //
 // FIXME: An unnamed class within a class is also wrongly recognized as an
 // anonymous struct.
-if (CXXRecordDecl *record = dyn_cast(decl_ctx)) {
+if (isa(decl_ctx))
   decl->setAnonymousStructOrUnion(true);
-}
   }
 
   if (decl) {


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


[Lldb-commits] [PATCH] D66507: Generalize FindTypes with CompilerContext to support fuzzy lookup

2019-08-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I don't have any context or opinion on the high level functionality, but can we 
please not use inheritance in this way? Though I have done similar things in 
the past, I am not really proud of them. It looks like the matching code can be 
just as easily be implemented as a free function...




Comment at: lldb/source/Symbol/Type.cpp:54-60
+if (it->kind == CompilerContextKind::Module)
+  while (std::next(it) != end() &&
+ std::next(it)->kind == CompilerContextKind::Module)
+++it;
+else
+  // Zero module matches, apply the next pattern on this element.
+  continue;

it looks like you should use `context_chain.end()` instead of `end()`.
Also, all of this probably boils down to `it = std::find_if(it, 
context_chain.end(), [](??? cc) { return cc.kind != Module; });`


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

https://reviews.llvm.org/D66507



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


[Lldb-commits] [lldb] r369506 - [lldb][NFC] Add tests for invalid command invocations

2019-08-21 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 21 02:15:44 2019
New Revision: 369506

URL: http://llvm.org/viewvc/llvm-project?rev=369506&view=rev
Log:
[lldb][NFC] Add tests for invalid command invocations

Added:
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/TestReproducer.py
lldb/trunk/packages/Python/lldbsuite/test/functionalities/version/

lldb/trunk/packages/Python/lldbsuite/test/functionalities/version/TestVersion.py
Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
lldb/trunk/packages/Python/lldbsuite/test/help/TestHelp.py

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py?rev=369506&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
 Wed Aug 21 02:15:44 2019
@@ -0,0 +1,19 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+
+class AproposTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def setUp(self):
+TestBase.setUp(self)
+
+@no_debug_info_test
+def test_apropos(self):
+self.expect("apropos", error=True,
+substrs=[' must be called with exactly one argument'])
+self.expect("apropos a b", error=True,
+substrs=[' must be called with exactly one argument'])
+self.expect("apropos ''", error=True,
+substrs=['\'\' is not a valid search word'])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=369506&r1=369505&r2=369506&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Wed Aug 21 02:15:44 2019
@@ -91,6 +91,10 @@ class CommandLineCompletionTestCase(Test
'arm64'])
 
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot
+def test_plugin_load(self):
+self.complete_from_to('plugin load ', [])
+
+@skipIfFreeBSD  # timing out on the FreeBSD buildbot
 def test_quoted_command(self):
 self.complete_from_to('"set',
   ['"settings" '])

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py?rev=369506&r1=369505&r2=369506&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
 Wed Aug 21 02:15:44 2019
@@ -64,3 +64,15 @@ class PluginCommandTestCase(TestBase):
 print(retobj.GetOutput())
 
 self.expect(retobj, substrs=['abc def ghi'], exe=False)
+
+@no_debug_info_test
+def test_invalid_plugin_invocation(self):
+self.expect("plugin load a b",
+error=True, startstr="error: 'plugin load' requires one 
argument")
+self.expect("plugin load",
+error=True, startstr="error: 'plugin load' requires one 
argument")
+
+@no_debug_info_test
+def test_invalid_plugin_target(self):
+self.expect("plugin load ThisIsNotAValidPluginName",
+error=True, startstr="error: no such file")

Added: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/TestReproducer.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/TestReproducer.py?rev=369506&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/TestReproducer.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/reproducer/TestReproducer.py
 Wed Aug 21 02:15:44 2019
@@ -0,0 +1,20 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators imp

[Lldb-commits] [PATCH] D66522: [lldb][NFC] Remove dead code that is supposed to handle invalid command options

2019-08-21 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: JDevlieghere.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

We currently have a bunch of code that is supposed to handle invalid command 
options, but
all this code is unreachable because invalid options are already handled in 
`Options::Parse`.
The only way we can reach this code is when we declare but then not implement 
an option
(which will be made impossible with D65386 , 
which is also when we can completely remove
the `default` cases).

This patch replaces all this code with `llvm_unreachable` to make clear this is 
dead code
that can't be reached.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D66522

Files:
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectBreakpointCommand.cpp
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/CommandObjectDisassemble.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectHelp.h
  lldb/source/Commands/CommandObjectLog.cpp
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectRegister.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/CommandObjectSource.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Commands/CommandObjectWatchpoint.cpp
  lldb/source/Commands/CommandObjectWatchpointCommand.cpp
  lldb/source/Interpreter/OptionGroupArchitecture.cpp
  lldb/source/Interpreter/OptionGroupFormat.cpp
  lldb/source/Interpreter/OptionGroupOutputFile.cpp
  lldb/source/Interpreter/OptionGroupPlatform.cpp
  lldb/source/Interpreter/OptionGroupUUID.cpp
  lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
  lldb/source/Interpreter/OptionGroupVariable.cpp
  lldb/source/Interpreter/OptionGroupWatchpoint.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Target/Platform.cpp
  lldb/source/Target/Process.cpp

Index: lldb/source/Target/Process.cpp
===
--- lldb/source/Target/Process.cpp
+++ lldb/source/Target/Process.cpp
@@ -356,9 +356,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized short option character '%c'",
-   short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
   return error;
 }
Index: lldb/source/Target/Platform.cpp
===
--- lldb/source/Target/Platform.cpp
+++ lldb/source/Target/Platform.cpp
@@ -1412,8 +1412,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
@@ -1450,8 +1449,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
@@ -1477,8 +1475,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
===
--- lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -557,7 +557,7 @@
   break;
 
 default:
-  error.SetErrorStringWithFormat("unsupported option '%c'", short_option);
+  llvm_unreachable("Unimplemented option");
 }
 return error;
   }
Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -4108,7 +4108,7 @@
 break;
   }
   default:
-err.SetErrorStringWithFormat("Invalid option '-%c'", short_option);
+llvm_unreachable("Unimplemented option");
   }
   return err;
 }
@@ -4258,8 +4258,7 @@
 break;
   }
   default:
-err.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
   return err

[Lldb-commits] [lldb] r369513 - [lldb][NFC] Add tests for register command

2019-08-21 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 21 03:40:05 2019
New Revision: 369513

URL: http://llvm.org/viewvc/llvm-project?rev=369513&view=rev
Log:
[lldb][NFC] Add tests for register command

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=369513&r1=369512&r2=369513&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 Wed Aug 21 03:40:05 2019
@@ -475,3 +475,16 @@ class RegisterCommandsTestCase(TestBase)
 if test_16bit_regs:
 self.expect("expr -- $ax == (($ah << 8) | $al)",
 substrs=['true'])
+
+@skipIfiOSSimulator
+@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
+@expectedFailureNetBSD
+def test_invalid_invocation(self):
+self.build()
+self.common_setup()
+
+self.expect("register read -a arg", error=True,
+substrs=["the --all option can't be used when registers 
names are supplied as arguments"])
+
+self.expect("register read --set 0 r", error=True,
+substrs=["the --set  option can't be used when 
registers names are supplied as arguments"])


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


[Lldb-commits] [lldb] r369521 - [lldb] Add tests for setting completions and enable 'settings remove' completion

2019-08-21 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 21 05:57:06 2019
New Revision: 369521

URL: http://llvm.org/viewvc/llvm-project?rev=369521&view=rev
Log:
[lldb] Add tests for setting completions and enable 'settings remove' completion

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
lldb/trunk/source/Commands/CommandObjectSettings.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py?rev=369521&r1=369520&r2=369521&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
 Wed Aug 21 05:57:06 2019
@@ -216,6 +216,24 @@ class CommandLineCompletionTestCase(Test
 'settings replace target.run-args')
 
 @skipIfFreeBSD  # timing out on the FreeBSD buildbot
+def test_settings_show_term(self):
+self.complete_from_to(
+'settings show term-',
+'settings show term-width')
+
+@skipIfFreeBSD  # timing out on the FreeBSD buildbot
+def test_settings_list_term(self):
+self.complete_from_to(
+'settings list term-',
+'settings list term-width')
+
+@skipIfFreeBSD  # timing out on the FreeBSD buildbot
+def test_settings_remove_term(self):
+self.complete_from_to(
+'settings remove term-',
+'settings remove term-width')
+
+@skipIfFreeBSD  # timing out on the FreeBSD buildbot
 def test_settings_s(self):
 """Test that 'settings s' completes to ['set', 'show']."""
 self.complete_from_to(

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=369521&r1=369520&r2=369521&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Wed Aug 21 05:57:06 
2019
@@ -613,6 +613,8 @@ public:
 
   ~CommandObjectSettingsRemove() override = default;
 
+  bool WantsCompletion() override { return true; }
+
   int HandleArgumentCompletion(
   CompletionRequest &request,
   OptionElementVector &opt_element_vector) override {


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


[Lldb-commits] [lldb] r369522 - Fix two compiler warnings

2019-08-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Aug 21 06:11:30 2019
New Revision: 369522

URL: http://llvm.org/viewvc/llvm-project?rev=369522&view=rev
Log:
Fix two compiler warnings

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h?rev=369522&r1=369521&r2=369522&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDeclVendor.h Wed Aug 
21 06:11:30 2019
@@ -37,6 +37,6 @@ public:
 private:
   DISALLOW_COPY_AND_ASSIGN(ClangDeclVendor);
 };
-}; // namespace lldb_private
+} // namespace lldb_private
 
 #endif

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=369522&r1=369521&r2=369522&view=diff
==
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Aug 21 06:11:30 2019
@@ -106,10 +106,12 @@ using namespace llvm;
 using namespace clang;
 
 namespace {
+#ifdef LLDB_CONFIGURATION_DEBUG
 static void VerifyDecl(clang::Decl *decl) {
   assert(decl && "VerifyDecl called with nullptr?");
   decl->getAccess();
 }
+#endif
 
 static inline bool
 ClangASTContextSupportsLanguage(lldb::LanguageType language) {


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


[Lldb-commits] [lldb] r369523 - Recommit "Minidump/Windows: Fix module lookup""

2019-08-21 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed Aug 21 06:20:25 2019
New Revision: 369523

URL: http://llvm.org/viewvc/llvm-project?rev=369523&view=rev
Log:
Recommit "Minidump/Windows: Fix module lookup""

This recommits r368416, which was reverted in r368838 because of test
failures under ASAN. These have been dealt with by llvm r369370.

The original commit message was:
When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Reviewers: clayborg, amccarth

Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits

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

Added:
lldb/trunk/lit/Minidump/Windows/Inputs/find-module.dmp.yaml
lldb/trunk/lit/Minidump/Windows/Inputs/find-module.exe.yaml
lldb/trunk/lit/Minidump/Windows/find-module.test
Modified:
lldb/trunk/source/Plugins/Process/minidump/MinidumpParser.cpp

Added: lldb/trunk/lit/Minidump/Windows/Inputs/find-module.dmp.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Minidump/Windows/Inputs/find-module.dmp.yaml?rev=369523&view=auto
==
--- lldb/trunk/lit/Minidump/Windows/Inputs/find-module.dmp.yaml (added)
+++ lldb/trunk/lit/Minidump/Windows/Inputs/find-module.dmp.yaml Wed Aug 21 
06:20:25 2019
@@ -0,0 +1,26 @@
+--- !minidump
+Streams:
+  - Type:ModuleList
+Modules:
+  - Base of Image:   0x000B
+Size of Image:   0x5000
+Module Name: 'find-module.exe'
+CodeView Record: 
525344533ED87D89C8A8184197F3A925EE4BF7410100433A5C70726F6A656374735C746573745F6170705C436F6E736F6C654170706C69636174696F6E315C44656275675C436F6E736F6C654170706C69636174696F6E312E70646200
+  - Type:SystemInfo
+Processor Arch:  X86
+Processor Level: 23
+Processor Revision: 2050
+Number of Processors: 32
+Product type:1
+Major Version:   10
+Build Number:17134
+Platform ID: Win32NT
+Suite Mask:  0x0300
+CPU:
+  Vendor ID:   AuthenticAMD
+  Version Info:0x00800F82
+  Feature Info:0x178BFBFF
+  AMD Extended Features: 0x2FD3FBFF
+  - Type:MiscInfo
+Content: 
5405F7030829C883495DAC0D9808AC0D020002200D000200C4FF430065006E007400720061006C0020004500750072006F007000650020005300740061006E0064006100720064002000540069006D0065000A0005000300430065006E007400720061006C0020004500750072006F00700065002000530075006D006D00650072002000540069006D006500030005000200C4FF310037003100330034002E0031002E007800380036006600720065002E007200730034005F00720065006C0065006100730065002E003100380030003400310030002D00310038003000340064006200670063006F00720065002E0069003300380036002C00310030002E0030002E00310037003100330034002E00310

[Lldb-commits] [lldb] r369524 - [lldb] Add tests for 'settings remove' and fix error message typos

2019-08-21 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 21 06:24:21 2019
New Revision: 369524

URL: http://llvm.org/viewvc/llvm-project?rev=369524&view=rev
Log:
[lldb] Add tests for 'settings remove' and fix error message typos

Modified:
lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
lldb/trunk/source/Commands/CommandObjectSettings.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py?rev=369524&r1=369523&r2=369524&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/settings/TestSettings.py Wed Aug 
21 06:24:21 2019
@@ -481,6 +481,45 @@ class SettingsCommandTestCase(TestBase):
 substrs=['disassembly-format (format-string) = "foo "'])
 self.runCmd("settings clear disassembly-format", check=False)
 
+def test_settings_list(self):
+# List settings (and optionally test the filter to only show 'target' 
settings).
+self.expect("settings list target", substrs=["language", "arg0", 
"detach-on-error"])
+self.expect("settings list target", matching=False, 
substrs=["packet-timeout"])
+self.expect("settings list", substrs=["language", "arg0", 
"detach-on-error", "packet-timeout"])
+
+def test_settings_remove_single(self):
+# Set some environment variables and use 'remove' to delete them.
+self.runCmd("settings set target.env-vars a=b c=d")
+self.expect("settings show target.env-vars", substrs=["a=b", "c=d"])
+self.runCmd("settings remove target.env-vars a")
+self.expect("settings show target.env-vars", matching=False, 
substrs=["a=b"])
+self.expect("settings show target.env-vars", substrs=["c=d"])
+self.runCmd("settings remove target.env-vars c")
+self.expect("settings show target.env-vars", matching=False, 
substrs=["a=b", "c=d"])
+
+def test_settings_remove_multiple(self):
+self.runCmd("settings set target.env-vars a=b c=d e=f")
+self.expect("settings show target.env-vars", substrs=["a=b", "c=d", 
"e=f"])
+self.runCmd("settings remove target.env-vars a e")
+self.expect("settings show target.env-vars", matching=False, 
substrs=["a=b", "e=f"])
+self.expect("settings show target.env-vars", substrs=["c=d"])
+
+def test_settings_remove_nonexistent_value(self):
+self.expect("settings remove target.env-vars doesntexist", error=True,
+substrs=["no value found named 'doesntexist'"])
+
+def test_settings_remove_nonexistent_settings(self):
+self.expect("settings remove doesntexist alsodoesntexist", error=True,
+substrs=["error: invalid value path 'doesntexist'"])
+
+def test_settings_remove_missing_arg(self):
+self.expect("settings remove", error=True,
+substrs=["'settings remove' takes an array or dictionary 
item, or"])
+
+def test_settings_remove_empty_arg(self):
+self.expect("settings remove ''", error=True,
+substrs=["'settings remove' command requires a valid 
variable name"])
+
 def test_all_settings_exist(self):
 self.expect("settings show",
 substrs=["auto-confirm",

Modified: lldb/trunk/source/Commands/CommandObjectSettings.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectSettings.cpp?rev=369524&r1=369523&r2=369524&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectSettings.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectSettings.cpp Wed Aug 21 06:24:21 
2019
@@ -638,8 +638,8 @@ protected:
 
 const size_t argc = cmd_args.GetArgumentCount();
 if (argc == 0) {
-  result.AppendError("'settings set' takes an array or dictionary item, or 
"
- "an array followed by one or more indexes, or a "
+  result.AppendError("'settings remove' takes an array or dictionary item, 
"
+ "or an array followed by one or more indexes, or a "
  "dictionary followed by one or more key names to "
  "remove");
   result.SetStatus(eReturnStatusFailed);
@@ -649,7 +649,7 @@ protected:
 const char *var_name = cmd_args.GetArgumentAtIndex(0);
 if ((var_name == nullptr) || (var_name[0] == '\0')) {
   result.AppendError(
-  "'settings set' command requires a valid variable name");
+  "'settings remove' command requires a valid variable name");
   result.SetStatus(eReturnStatusFailed);
   return false;
 }


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

Re: [Lldb-commits] [lldb] r369502 - Properly EXCLUDE_FROM_ALL the testing support library

2019-08-21 Thread Davide Italiano via lldb-commits
Thanks, the bot is green again!

On Wed, Aug 21, 2019 at 1:20 AM Pavel Labath via lldb-commits
 wrote:
>
> Author: labath
> Date: Wed Aug 21 01:21:51 2019
> New Revision: 369502
>
> URL: http://llvm.org/viewvc/llvm-project?rev=369502&view=rev
> Log:
> Properly EXCLUDE_FROM_ALL the testing support library
>
> The EXCLUDE_FROM_ALL variable is used by add_llvm_library, but lldb does
> not use that function (it uses llvm_add_library :P). Instead, set the 
> directory
> property with the same name directly.
>
> This should fix standalone builds against an llvm install tree.
>
> Modified:
> lldb/trunk/unittests/TestingSupport/CMakeLists.txt
>
> Modified: lldb/trunk/unittests/TestingSupport/CMakeLists.txt
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/TestingSupport/CMakeLists.txt?rev=369502&r1=369501&r2=369502&view=diff
> ==
> --- lldb/trunk/unittests/TestingSupport/CMakeLists.txt (original)
> +++ lldb/trunk/unittests/TestingSupport/CMakeLists.txt Wed Aug 21 01:21:51 
> 2019
> @@ -1,4 +1,4 @@
> -set(EXCLUDE_FROM_ALL ON)
> +set_property(DIRECTORY PROPERTY EXCLUDE_FROM_ALL ON)
>  add_lldb_library(lldbUtilityHelpers
>MockTildeExpressionResolver.cpp
>TestUtilities.cpp
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66522: [lldb][NFC] Remove dead code that is supposed to handle invalid command options

2019-08-21 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 216385.
teemperor added a comment.

- Remove some unreachable that are not in the command/interpreter directory (as 
they might be used differently and could be reached).


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

https://reviews.llvm.org/D66522

Files:
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectBreakpointCommand.cpp
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/CommandObjectDisassemble.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectHelp.h
  lldb/source/Commands/CommandObjectLog.cpp
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectRegister.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/CommandObjectSource.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Commands/CommandObjectWatchpoint.cpp
  lldb/source/Commands/CommandObjectWatchpointCommand.cpp
  lldb/source/Interpreter/OptionGroupArchitecture.cpp
  lldb/source/Interpreter/OptionGroupFormat.cpp
  lldb/source/Interpreter/OptionGroupOutputFile.cpp
  lldb/source/Interpreter/OptionGroupPlatform.cpp
  lldb/source/Interpreter/OptionGroupUUID.cpp
  lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
  lldb/source/Interpreter/OptionGroupVariable.cpp
  lldb/source/Interpreter/OptionGroupWatchpoint.cpp

Index: lldb/source/Interpreter/OptionGroupWatchpoint.cpp
===
--- lldb/source/Interpreter/OptionGroupWatchpoint.cpp
+++ lldb/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -101,9 +101,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized short option '%c'",
-   short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupVariable.cpp
===
--- lldb/source/Interpreter/OptionGroupVariable.cpp
+++ lldb/source/Interpreter/OptionGroupVariable.cpp
@@ -109,9 +109,7 @@
 error = summary_string.SetCurrentValue(option_arg);
 break;
   default:
-error.SetErrorStringWithFormat("unrecognized short option '%c'",
-   short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
===
--- lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -152,8 +152,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupUUID.cpp
===
--- lldb/source/Interpreter/OptionGroupUUID.cpp
+++ lldb/source/Interpreter/OptionGroupUUID.cpp
@@ -40,8 +40,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupPlatform.cpp
===
--- lldb/source/Interpreter/OptionGroupPlatform.cpp
+++ lldb/source/Interpreter/OptionGroupPlatform.cpp
@@ -113,8 +113,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
   return error;
 }
Index: lldb/source/Interpreter/OptionGroupOutputFile.cpp
===
--- lldb/source/Interpreter/OptionGroupOutputFile.cpp
+++ lldb/source/Interpreter/OptionGroupOutputFile.cpp
@@ -50,8 +50,7 @@
 break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupFormat.cpp
===
--- lldb/source/Interpreter/OptionGroupFormat.cpp
+++ lldb/source/Interpreter/OptionGroupFormat.cpp
@@ -160,8 +160,7 @@
   } break;
 
   default:
-error.SetErrorStringWithFormat("unrecognized option '%c'", short_option);
-break;
+llvm_unreachable("Unimplemented option");
   }
 
   return error;
Index: lldb/source/Interpreter/OptionGroupArchitecture.cpp
===
--- 

Re: [Lldb-commits] [lldb] r369506 - [lldb][NFC] Add tests for invalid command invocations

2019-08-21 Thread Pavel Labath via lldb-commits

On 21/08/2019 11:15, Raphael Isemann via lldb-commits wrote:

Author: teemperor
Date: Wed Aug 21 02:15:44 2019
New Revision: 369506

URL: http://llvm.org/viewvc/llvm-project?rev=369506&view=rev
Log:
[lldb][NFC] Add tests for invalid command invocations

Added:
 lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/
 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py


It looks like there is already a test called TestApropos.py in 
./packages/Python/lldbsuite/test/help/TestApropos.py.


This makes lldb-dotest sad:
$ python2 bin/lldb-dotest
...
Traceback (most recent call last):
  File "/home/pavelo/ll/lldb/test/dotest.py", line 7, in 
lldbsuite.test.run_suite()
  File "/home/pavelo/ll/lldb/packages/Python/lldbsuite/test/dotest.py", 
line 1237, in run_suite

visit('Test', dirpath, filenames)
  File "/home/pavelo/ll/lldb/packages/Python/lldbsuite/test/dotest.py", 
line 881, in visit

raise Exception("Found multiple tests with the name %s" % name)
Exception: Found multiple tests with the name TestApropos.py
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r369530 - [lldb][NFC] Merge multiple TestApropos.py

2019-08-21 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Wed Aug 21 07:22:59 2019
New Revision: 369530

URL: http://llvm.org/viewvc/llvm-project?rev=369530&view=rev
Log:
[lldb][NFC] Merge multiple TestApropos.py

That's cleaner and makes lldb-dotest no longer fail due to conflicting names.

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

lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py?rev=369530&r1=369529&r2=369530&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
 Wed Aug 21 07:22:59 2019
@@ -17,3 +17,13 @@ class AproposTestCase(TestBase):
 substrs=[' must be called with exactly one argument'])
 self.expect("apropos ''", error=True,
 substrs=['\'\' is not a valid search word'])
+
+@no_debug_info_test
+def test_apropos_variable(self):
+"""Test that 'apropos variable' prints the fully qualified command 
name"""
+self.expect(
+'apropos variable',
+substrs=[
+'frame variable',
+'target variable',
+'watchpoint set variable'])

Removed: lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py?rev=369529&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/help/TestApropos.py (removed)
@@ -1,26 +0,0 @@
-"""
-Test some lldb apropos commands.
-"""
-
-from __future__ import print_function
-
-
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class AproposCommandTestCase(TestBase):
-
-mydir = TestBase.compute_mydir(__file__)
-
-@no_debug_info_test
-def test_apropos_variable(self):
-"""Test that 'apropos variable' prints the fully qualified command 
name"""
-self.expect(
-'apropos variable',
-substrs=[
-'frame variable',
-'target variable',
-'watchpoint set variable'])


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


Re: [Lldb-commits] [lldb] r369506 - [lldb][NFC] Add tests for invalid command invocations

2019-08-21 Thread Raphael “Teemperor” Isemann via lldb-commits
Thanks, just pushed a fix where I merge that into the dedicated apropos test!

> On 21. Aug 2019, at 16:16, Pavel Labath  wrote:
> 
> On 21/08/2019 11:15, Raphael Isemann via lldb-commits wrote:
>> Author: teemperor
>> Date: Wed Aug 21 02:15:44 2019
>> New Revision: 369506
>> URL: http://llvm.org/viewvc/llvm-project?rev=369506&view=rev
>> Log:
>> [lldb][NFC] Add tests for invalid command invocations
>> Added:
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/
>> 
>> lldb/trunk/packages/Python/lldbsuite/test/functionalities/apropos/TestApropos.py
> 
> It looks like there is already a test called TestApropos.py in 
> ./packages/Python/lldbsuite/test/help/TestApropos.py.
> 
> This makes lldb-dotest sad:
> $ python2 bin/lldb-dotest
> ...
> Traceback (most recent call last):
>  File "/home/pavelo/ll/lldb/test/dotest.py", line 7, in 
>lldbsuite.test.run_suite()
>  File "/home/pavelo/ll/lldb/packages/Python/lldbsuite/test/dotest.py", line 
> 1237, in run_suite
>visit('Test', dirpath, filenames)
>  File "/home/pavelo/ll/lldb/packages/Python/lldbsuite/test/dotest.py", line 
> 881, in visit
>raise Exception("Found multiple tests with the name %s" % name)
> Exception: Found multiple tests with the name TestApropos.py

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


[Lldb-commits] [PATCH] D65952: SymbolVendor: Have plugins return symbol files directly

2019-08-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Greg, any thoughts on my last comment? My biggest question is that if we remove 
the SymbolVendor completely, then where will the code that's currently in 
SymbolVendorELF and SymbolVendorMacOS go to...


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

https://reviews.llvm.org/D65952



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


[Lldb-commits] [PATCH] D66536: [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values

2019-08-21 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: JDevlieghere.
Herald added subscribers: lldb-commits, abidh, arphaman.
Herald added a project: LLDB.
teemperor updated this revision to Diff 216398.
teemperor added a comment.

- Add comment that we emulate the old API by adding the common prefix as 
element 0.


We still have some leftovers of the old completion API in the internals of
LLDB that haven't been replaced by the new CompletionRequest. These leftovers
are:

- The return values (int/size_t) in all completion functions.
- Our result array that starts indexing at 1.
- `WordComplete` mode.

I didn't replace them back then because it's tricky to figure out what exactly 
they
are used for and the completion code is relatively untested. I finally got 
around
to writing more tests for the API and understanding the semantics, so I think 
it's
a good time to get rid of them.

A few words why those things should be removed/replaced:

- The return values are really cryptic, partly redundant and rarely documented. 
They are also completely ignored by Xcode, so whatever information they contain 
will end up breaking Xcode's completion mechanism. They are also partly 
impossible to even implement as we assign negative values special meaning and 
our completion API sometimes returns size_t.

  Completion functions are supposed to return -2 to rewrite the current line. 
We seem to use this in some untested code path to expand the history repeat 
character to the full command, but I haven't figured out why that doesn't work 
at the moment. Completion functions return -1 to 'insert the completion 
character', but that isn't implemented (even though we seem to activate this 
feature in LLDB sometimes). All positive values have to match the number of 
results. This is obviously just redundant information as the user can just look 
at the result list to get that information (which is what Xcode does).

- The result array that starts indexing at 1 is obviously unexpected. The first 
element of the array is reserved for the common prefix of all completions (e.g. 
"foobar" and "footar" -> "foo"). The idea is that we calculate this to make the 
life of the API caller easier, but obviously forcing people to have 1-based 
indices is not helpful (or even worse, forces them to manually copy the results 
to make it 0-based like Xcode has to do).

- The `WordComplete` mode indicates that LLDB should enter a space behind the 
completion. The idea is that we let the top-level API know that we just 
provided a full completion. Interestingly we `WordComplete` is just a single 
bool that somehow represents all N completions. And we always provide full 
completions in LLDB, so in theory it should always be true. The only use it 
currently serves is providing redundant information about whether we have a 
single definitive completion or not (which we already know from the number of 
results we get).

This patch essentially removes `WordComplete` mode and makes the result array 
indexed from 0.
It also removes all return values from all internal completion functions. The 
only non-redundant information
they contain is about rewriting the current line (which is broken), so that 
functionality was moved
to the CompletionRequest API. So you can now do `addCompletion("blub", 
"description", CompletionMode::RewriteLine)`
to do the same.

For the SB API we emulate the old behaviour by making the array indexed from 1 
again with the common
prefix at index 0. I didn't keep the special negative return codes as we either 
never sent them before (e.g. -2) or we
didn't even implement them in the Editline handler (e.g. -1).

I tried to keep this patch minimal and I'm aware we can probably now even 
further simplify a bunch of related code,
but I would prefer doing this in follow-up NFC commits


https://reviews.llvm.org/D66536

Files:
  lldb/include/lldb/Core/FormatEntity.h
  lldb/include/lldb/Core/IOHandler.h
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Expression/REPL.h
  lldb/include/lldb/Host/Editline.h
  lldb/include/lldb/Interpreter/CommandAlias.h
  lldb/include/lldb/Interpreter/CommandCompletions.h
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/include/lldb/Interpreter/CommandObject.h
  lldb/include/lldb/Interpreter/CommandObjectMultiword.h
  lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h
  lldb/include/lldb/Interpreter/OptionValue.h
  lldb/include/lldb/Interpreter/OptionValueArch.h
  lldb/include/lldb/Interpreter/OptionValueBoolean.h
  lldb/include/lldb/Interpreter/OptionValueEnumeration.h
  lldb/include/lldb/Interpreter/OptionValueFileSpec.h
  lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
  lldb/include/lldb/Interpreter/OptionValueUUID.h
  lldb/include/lldb/Symbol/Variable.h
  lldb/include/lldb/Utility/ArchSpec.h
  lldb/include/lldb/Utility/CompletionRequest.h
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandO

[Lldb-commits] [PATCH] D66536: [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values

2019-08-21 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/source/Interpreter/CommandInterpreter.cpp:1847
-
-  if (request.GetParsedLine().GetArgumentCount() == 0) {
-// If we got an empty string, insert nothing.

Note that I moved this code to 
SBCommandInterpreter::HandleCompletionWithDescriptions (as it adds the common 
prefix in  element 0).


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

https://reviews.llvm.org/D66536



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


[Lldb-commits] [PATCH] D66536: [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values

2019-08-21 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 216398.
teemperor added a comment.

- Add comment that we emulate the old API by adding the common prefix as 
element 0.


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

https://reviews.llvm.org/D66536

Files:
  lldb/include/lldb/Core/FormatEntity.h
  lldb/include/lldb/Core/IOHandler.h
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Expression/REPL.h
  lldb/include/lldb/Host/Editline.h
  lldb/include/lldb/Interpreter/CommandAlias.h
  lldb/include/lldb/Interpreter/CommandCompletions.h
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/include/lldb/Interpreter/CommandObject.h
  lldb/include/lldb/Interpreter/CommandObjectMultiword.h
  lldb/include/lldb/Interpreter/CommandObjectRegexCommand.h
  lldb/include/lldb/Interpreter/OptionValue.h
  lldb/include/lldb/Interpreter/OptionValueArch.h
  lldb/include/lldb/Interpreter/OptionValueBoolean.h
  lldb/include/lldb/Interpreter/OptionValueEnumeration.h
  lldb/include/lldb/Interpreter/OptionValueFileSpec.h
  lldb/include/lldb/Interpreter/OptionValueFormatEntity.h
  lldb/include/lldb/Interpreter/OptionValueUUID.h
  lldb/include/lldb/Symbol/Variable.h
  lldb/include/lldb/Utility/ArchSpec.h
  lldb/include/lldb/Utility/CompletionRequest.h
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Commands/CommandObjectExpression.h
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectHelp.h
  lldb/source/Commands/CommandObjectMultiword.cpp
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectPlugin.cpp
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectSettings.cpp
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Core/FormatEntity.cpp
  lldb/source/Core/IOHandler.cpp
  lldb/source/Core/PluginManager.cpp
  lldb/source/Expression/REPL.cpp
  lldb/source/Host/common/Editline.cpp
  lldb/source/Interpreter/CommandAlias.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp
  lldb/source/Interpreter/CommandObject.cpp
  lldb/source/Interpreter/CommandObjectRegexCommand.cpp
  lldb/source/Interpreter/OptionValue.cpp
  lldb/source/Interpreter/OptionValueArch.cpp
  lldb/source/Interpreter/OptionValueBoolean.cpp
  lldb/source/Interpreter/OptionValueEnumeration.cpp
  lldb/source/Interpreter/OptionValueFileSpec.cpp
  lldb/source/Interpreter/OptionValueFormatEntity.cpp
  lldb/source/Interpreter/OptionValueUUID.cpp
  lldb/source/Interpreter/Options.cpp
  lldb/source/Symbol/Variable.cpp
  lldb/source/Utility/ArchSpec.cpp
  lldb/source/Utility/CompletionRequest.cpp
  lldb/unittests/Interpreter/TestCompletion.cpp
  lldb/unittests/Utility/CompletionRequestTest.cpp

Index: lldb/unittests/Utility/CompletionRequestTest.cpp
===
--- lldb/unittests/Utility/CompletionRequestTest.cpp
+++ lldb/unittests/Utility/CompletionRequestTest.cpp
@@ -26,7 +26,6 @@
   EXPECT_EQ(request.GetRawCursorPos(), cursor_pos);
   EXPECT_EQ(request.GetCursorIndex(), arg_index);
   EXPECT_EQ(request.GetCursorCharPosition(), arg_cursor_pos);
-  EXPECT_EQ(request.GetWordComplete(), false);
 
   EXPECT_EQ(request.GetPartialParsedLine().GetArgumentCount(), 2u);
   EXPECT_STREQ(request.GetPartialParsedLine().GetArgumentAtIndex(1), "b");
Index: lldb/unittests/Interpreter/TestCompletion.cpp
===
--- lldb/unittests/Interpreter/TestCompletion.cpp
+++ lldb/unittests/Interpreter/TestCompletion.cpp
@@ -116,20 +116,16 @@
 StringList &Results) {
 // When a partial name matches, it returns all matches.  If it matches both
 // a full name AND some partial names, it returns all of them.
-uint32_t Count =
-CommandCompletions::DiskDirectories(Prefix + "foo", Results, Resolver);
-ASSERT_EQ(4u, Count);
-ASSERT_EQ(Count, Results.GetSize());
+CommandCompletions::DiskDirectories(Prefix + "foo", Results, Resolver);
+ASSERT_EQ(4u, Results.GetSize());
 EXPECT_TRUE(HasEquivalentFile(DirFoo, Results));
 EXPECT_TRUE(HasEquivalentFile(DirFooA, Results));
 EXPECT_TRUE(HasEquivalentFile(DirFooB, Results));
 EXPECT_TRUE(HasEquivalentFile(DirFooC, Results));
 
 // If it matches only partial names, it still works as expected.
-Count = CommandCompletions::DiskDirectories(Twine(Prefix) + "b", Results,
-Resolver);
-ASSERT_EQ(2u, Count);
-ASSERT_EQ(Count, Results.GetSize());
+CommandCompletions::DiskDirectories(Twine(Prefix) + "b", Results, Resolver);
+ASSERT_EQ(2u, Results.GetSize());
 EXPECT_TRUE(HasEquivalentFile(DirBar, Results));
 EXPECT_TRUE(HasEquivalentFile(DirBaz, Results));
   }
@@ -160,21 +156,17 @@
   // When

[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D66447#1638783 , @labath wrote:

> In D66447#1638047 , @JDevlieghere 
> wrote:
>
> > In D66447#1637640 , @labath wrote:
> >
> > > This looks good to me, but why are we using a nul character to test utf8 
> > > support? Shouldn't we insert some funnier characters too? I mean, one of 
> > > the advantages of unicode is that it should not be affected by the system 
> > > code pages and such, so hopefully this would not cause problems even on 
> > > some more exotic setups. (And I am pretty sure I remember already seeing 
> > > some chinese chars in some of our data formatter tests)
> >
> >
> > I only glanced at the proposal, but unless I misunderstand the type only 
> > fits UTF-8 characters representable in 1 byte, which are basically just 
> > ASCII.
>
>
> I have now too glanced at the proposal (just the cppreference page, really :) 
> ). I think I understand where you got this impression from, but I don't think 
> that is fully correct. It is true that a *single* char8_t variable can hold 
> only 8 bit UTF8 code units (*not* characters), but that is not surprising 
> since UTF8 is a variable length encoding, so you can't have a type that 
> matches one character exactly. However, an *array* of char8_t is a completely 
> different thing, and I am pretty sure that these are intended to hold utf8 
> strings containing any utf8 characters (otherwise, it wouldn't really deserve 
> to call itself a utf8 type), and so we should print (and test) it as regular 
> utf8.


Sounds like I simply misunderstood your earlier comment. I thought you meant 
putting a full UTF-8 *character* in a `char8_t.

> However, this actually surfaces the question of how should we format single 
> char8_t variables. It makes sense to display the character value if the value 
> happens to be ASCII, but I guess we shouldn't print something like "invalid 
> utf8 character" if it does contain one unit of the multibyte characters.

What about the current implementation that prints both the hex and the ASCII 
value?


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

https://reviews.llvm.org/D66447



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


[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 216422.
JDevlieghere added a comment.

- Use UTF8 string


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

https://reviews.llvm.org/D66447

Files:
  lldb/include/lldb/lldb-enumerations.h
  lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
  lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
  lldb/source/Symbol/ClangASTContext.cpp

Index: lldb/source/Symbol/ClangASTContext.cpp
===
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -1382,11 +1382,12 @@
 
 case DW_ATE_UTF:
   if (type_name) {
-if (streq(type_name, "char16_t")) {
+if (streq(type_name, "char16_t"))
   return CompilerType(this, ast->Char16Ty.getAsOpaquePtr());
-} else if (streq(type_name, "char32_t")) {
+else if (streq(type_name, "char32_t"))
   return CompilerType(this, ast->Char32Ty.getAsOpaquePtr());
-}
+else if (streq(type_name, "char8_t"))
+  return CompilerType(this, ast->Char8Ty.getAsOpaquePtr());
   }
   break;
 }
Index: lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
===
--- lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
+++ lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
@@ -16,6 +16,9 @@
 
 namespace lldb_private {
 namespace formatters {
+bool Char8StringSummaryProvider(ValueObject &valobj, Stream &stream,
+const TypeSummaryOptions &options); // char8_t*
+
 bool Char16StringSummaryProvider(
 ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &options); // char16_t* and unichar*
@@ -27,6 +30,9 @@
 bool WCharStringSummaryProvider(ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &options); // wchar_t*
 
+bool Char8SummaryProvider(ValueObject &valobj, Stream &stream,
+  const TypeSummaryOptions &options); // char8_t
+
 bool Char16SummaryProvider(
 ValueObject &valobj, Stream &stream,
 const TypeSummaryOptions &options); // char16_t and unichar
Index: lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
@@ -32,6 +32,31 @@
 using namespace lldb_private;
 using namespace lldb_private::formatters;
 
+bool lldb_private::formatters::Char8StringSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &) {
+  ProcessSP process_sp = valobj.GetProcessSP();
+  if (!process_sp)
+return false;
+
+  lldb::addr_t valobj_addr = GetArrayAddressOrPointerValue(valobj);
+  if (valobj_addr == 0 || valobj_addr == LLDB_INVALID_ADDRESS)
+return false;
+
+  StringPrinter::ReadStringAndDumpToStreamOptions options(valobj);
+  options.SetLocation(valobj_addr);
+  options.SetProcessSP(process_sp);
+  options.SetStream(&stream);
+  options.SetPrefixToken("u8");
+
+  if (!StringPrinter::ReadStringAndDumpToStream<
+  StringPrinter::StringElementType::UTF8>(options)) {
+stream.Printf("Summary Unavailable");
+return true;
+  }
+
+  return true;
+}
+
 bool lldb_private::formatters::Char16StringSummaryProvider(
 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &) {
   ProcessSP process_sp = valobj.GetProcessSP();
@@ -128,6 +153,32 @@
   return true;
 }
 
+bool lldb_private::formatters::Char8SummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &) {
+  DataExtractor data;
+  Status error;
+  valobj.GetData(data, error);
+
+  if (error.Fail())
+return false;
+
+  std::string value;
+  valobj.GetValueAsCString(lldb::eFormatUnicode8, value);
+  if (!value.empty())
+stream.Printf("%s ", value.c_str());
+
+  StringPrinter::ReadBufferAndDumpToStreamOptions options(valobj);
+  options.SetData(data);
+  options.SetStream(&stream);
+  options.SetPrefixToken("u8");
+  options.SetQuote('\'');
+  options.SetSourceSize(1);
+  options.SetBinaryZeroIsTerminator(false);
+
+  return StringPrinter::ReadBufferAndDumpToStream<
+  StringPrinter::StringElementType::UTF8>(options);
+}
+
 bool lldb_private::formatters::Char16SummaryProvider(
 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &) {
   DataExtractor data;
Index: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/CP

[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

In D66447#1638783 , @labath wrote:

> In D66447#1638047 , @JDevlieghere 
> wrote:
>
> > In D66447#1637640 , @labath wrote:
> >
> > > This looks good to me, but why are we using a nul character to test utf8 
> > > support? Shouldn't we insert some funnier characters too? I mean, one of 
> > > the advantages of unicode is that it should not be affected by the system 
> > > code pages and such, so hopefully this would not cause problems even on 
> > > some more exotic setups. (And I am pretty sure I remember already seeing 
> > > some chinese chars in some of our data formatter tests)
> >
> >
> > I only glanced at the proposal, but unless I misunderstand the type only 
> > fits UTF-8 characters representable in 1 byte, which are basically just 
> > ASCII.
>
>
> I have now too glanced at the proposal (just the cppreference page, really :) 
> ). I think I understand where you got this impression from, but I don't think 
> that is fully correct. It is true that a *single* char8_t variable can hold 
> only 8 bit UTF8 code units (*not* characters), but that is not surprising 
> since UTF8 is a variable length encoding, so you can't have a type that 
> matches one character exactly. However, an *array* of char8_t is a completely 
> different thing, and I am pretty sure that these are intended to hold utf8 
> strings containing any utf8 characters (otherwise, it wouldn't really deserve 
> to call itself a utf8 type), and so we should print (and test) it as regular 
> utf8.
>
> However, this actually surfaces the question of how should we format single 
> char8_t variables. It makes sense to display the character value if the value 
> happens to be ASCII, but I guess we shouldn't print something like "invalid 
> utf8 character" if it does contain one unit of the multibyte characters.


You may find the the C++ Evolution Working Groups entry on [N4197 Adding u8 
character literals, [tiny] Why no u8 character 
literals?](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4540.html#119)
 and the proposal that add char8_t 
 helpful 
in understanding the rationale and the proposal for `char8_t` runs through a 
lot of examples.


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

https://reviews.llvm.org/D66447



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


[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

I changed the test to use `frame variable` again. With `target variable` the 
UTF-8 formatting doesn't work. Given that this patch just copies the Char16 and 
Char32 implementation, I think that's something for a different patch. I'll 
file a PR when this gets in.

  (lldb) target variable ab
  (const char8_t *) ab = 0x00010fa6
  (lldb) target variable abc
  (char8_t [9]) abc = {
[0] = 0xe4 u8'
[1] = 0xbd u8'' 



[2] = 0xa0 u8'' 



[3] = 0xe5 u8'
[4] = 0xa5 u8''
[5] = 0xbd u8''
[6] = 0x00 u8'\0'
[7] = 0x00 u8'\0'
[8] = 0x00 u8'\0'
  }


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

https://reviews.llvm.org/D66447



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


[Lldb-commits] [PATCH] D66536: [lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

Thanks for cleaning this up, Raphael!




Comment at: lldb/source/API/SBCommandInterpreter.cpp:379
+
+  // Make the result array indexed from 1 again by adding the 'common prefix'
+  // of all completions as element 0.

Maybe add that this is here to emulate old behavior that our clients rely on. 


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

https://reviews.llvm.org/D66536



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


[Lldb-commits] [PATCH] D66507: Generalize FindTypes with CompilerContext to support fuzzy lookup

2019-08-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 216425.
aprantl added a comment.

Address feedback from Pavel.


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

https://reviews.llvm.org/D66507

Files:
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Symbol/Type.h
  lldb/include/lldb/lldb-private-enumerations.h
  lldb/lit/SymbolFile/DWARF/compilercontext.ll
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Symbol/SymbolFile.cpp
  lldb/source/Symbol/Type.cpp
  lldb/tools/lldb-test/lldb-test.cpp
  lldb/unittests/Symbol/TestType.cpp

Index: lldb/unittests/Symbol/TestType.cpp
===
--- lldb/unittests/Symbol/TestType.cpp
+++ lldb/unittests/Symbol/TestType.cpp
@@ -48,3 +48,47 @@
   "std::set>::iterator", true,
   "std::set>::", "iterator");
 }
+
+TEST(Type, CompilerContextPattern) {
+  std::vector mms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mms, mms));
+  std::vector mmc = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Class, ConstString("S")}};
+  EXPECT_FALSE(contextMatches(mms, mmc));
+  std::vector ms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  std::vector mas = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::AnyModule, ConstString("*")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mms, mas));
+  EXPECT_TRUE(contextMatches(ms, mas));
+  EXPECT_FALSE(contextMatches(mas, ms));
+  std::vector mmms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Module, ConstString("C")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mmms, mas));
+  std::vector mme = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Enum, ConstString("S")}};
+  std::vector mma = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::AnyType, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mme, mma));
+  EXPECT_TRUE(contextMatches(mms, mma));
+  std::vector mme2 = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Enum, ConstString("S2")}};
+  EXPECT_FALSE(contextMatches(mme2, mma));
+}
Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -242,12 +242,14 @@
 .Case("Module", CompilerContextKind::Module)
 .Case("Namespace", CompilerContextKind::Namespace)
 .Case("Class", CompilerContextKind::Class)
-.Case("Structure", CompilerContextKind::Structure)
+.Case("Struct", CompilerContextKind::Struct)
 .Case("Union", CompilerContextKind::Union)
 .Case("Function", CompilerContextKind::Function)
 .Case("Variable", CompilerContextKind::Variable)
-.Case("Enumeration", CompilerContextKind::Enumeration)
+.Case("Enum", CompilerContextKind::Enum)
 .Case("Typedef", CompilerContextKind::Typedef)
+.Case("AnyModule", CompilerContextKind::AnyModule)
+.Case("AnyType", CompilerContextKind::AnyType)
 .Default(CompilerContextKind::Invalid);
 if (value.empty()) {
   WithColor::error() << "compiler context entry has no \"name\"\n";
@@ -511,7 +513,7 @@
 Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
   SearchedFiles, Map);
   else
-Symfile.FindTypes(parseCompilerContext(), true, Map);
+Symfile.FindTypes({parseCompilerContext()}, true, Map);
 
   outs() << formatv("Found {0} types:\n", Map.GetSize());
   StreamString Stream;
Index: lldb/source/Symbol/Type.cpp
=

[Lldb-commits] [PATCH] D66507: Generalize FindTypes with CompilerContext to support fuzzy lookup

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM




Comment at: lldb/include/lldb/Symbol/Type.h:42
 
+/// Match this context pattern (which may contain "Any" kinds)
+/// against the context chain of a type. Note that \p context_chain

nit: reflow


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

https://reviews.llvm.org/D66507



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


[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D66447#1639490 , @JDevlieghere 
wrote:

> Sounds like I simply misunderstood your earlier comment. I thought you meant 
> putting a full UTF-8 *character* in a `char8_t.


Ah yes, I can see how that request could have been interpreted this way. I'm 
glad that we understand each other.

> 
> 
>> However, this actually surfaces the question of how should we format single 
>> char8_t variables. It makes sense to display the character value if the 
>> value happens to be ASCII, but I guess we shouldn't print something like 
>> "invalid utf8 character" if it does contain one unit of the multibyte 
>> characters.
> 
> What about the current implementation that prints both the hex and the ASCII 
> value?

I think that's fine. lgtm.


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

https://reviews.llvm.org/D66447



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


[Lldb-commits] [lldb] r369555 - Generalize FindTypes with CompilerContext to support fuzzy lookup

2019-08-21 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed Aug 21 11:06:56 2019
New Revision: 369555

URL: http://llvm.org/viewvc/llvm-project?rev=369555&view=rev
Log:
Generalize FindTypes with CompilerContext to support fuzzy lookup

This patch generalizes the FindTypes with CompilerContext interface to
support looking up a type of unknown kind by name, as well as looking
up a type inside an unspecified submodule. These features are
motivated by the Swift branch, but are fully tested via unit tests and
lldb-test on llvm.org.  Specifically, this patch adds an AnyModule and
an AnyType CompilerContext kind.

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

rdar://problem/54471165

Modified:
lldb/trunk/include/lldb/Symbol/SymbolFile.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/lldb-private-enumerations.h
lldb/trunk/lit/SymbolFile/DWARF/compilercontext.ll
lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/source/Symbol/SymbolFile.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/tools/lldb-test/lldb-test.cpp
lldb/trunk/unittests/Symbol/TestType.cpp

Modified: lldb/trunk/include/lldb/Symbol/SymbolFile.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/SymbolFile.h?rev=369555&r1=369554&r2=369555&view=diff
==
--- lldb/trunk/include/lldb/Symbol/SymbolFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/SymbolFile.h Wed Aug 21 11:06:56 2019
@@ -189,8 +189,8 @@ public:
 bool append, uint32_t max_matches,
 llvm::DenseSet &searched_symbol_files,
 TypeMap &types);
-  virtual size_t FindTypes(const std::vector &context,
-   bool append, TypeMap &types);
+  virtual size_t FindTypes(llvm::ArrayRef pattern, bool 
append,
+   TypeMap &types);
 
   virtual void
   GetMangledNamesForFunction(const std::string &scope_qualified_name,

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=369555&r1=369554&r2=369555&view=diff
==
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Wed Aug 21 11:06:56 2019
@@ -21,22 +21,28 @@
 #include 
 
 namespace lldb_private {
-// CompilerContext allows an array of these items to be passed to perform
-// detailed lookups in SymbolVendor and SymbolFile functions.
+
+/// CompilerContext allows an array of these items to be passed to perform
+/// detailed lookups in SymbolVendor and SymbolFile functions.
 struct CompilerContext {
-  CompilerContext(CompilerContextKind t, ConstString n)
-  : type(t), name(n) {}
+  CompilerContext(CompilerContextKind t, ConstString n) : kind(t), name(n) {}
 
   bool operator==(const CompilerContext &rhs) const {
-return type == rhs.type && name == rhs.name;
+return kind == rhs.kind && name == rhs.name;
   }
+  bool operator!=(const CompilerContext &rhs) const { return !(*this == rhs); }
 
   void Dump() const;
 
-  CompilerContextKind type;
+  CompilerContextKind kind;
   ConstString name;
 };
 
+/// Match \p context_chain against \p pattern, which may contain "Any"
+/// kinds. The \p context_chain should *not* contain any "Any" kinds.
+bool contextMatches(llvm::ArrayRef context_chain,
+llvm::ArrayRef pattern);
+
 class SymbolFileType : public std::enable_shared_from_this,
public UserID {
 public:

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=369555&r1=369554&r2=369555&view=diff
==
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Wed Aug 21 11:06:56 2019
@@ -198,18 +198,24 @@ enum class LineStatus {
 enum class TypeValidatorResult : bool { Success = true, Failure = false };
 
 // Enumerations that can be used to specify scopes types when looking up types.
-enum class CompilerContextKind {
+enum class CompilerContextKind : uint16_t {
   Invalid = 0,
-  TranslationUnit,
-  

[Lldb-commits] [PATCH] D66507: Generalize FindTypes with CompilerContext to support fuzzy lookup

2019-08-21 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369555: Generalize FindTypes with CompilerContext to support 
fuzzy lookup (authored by adrian, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66507?vs=216425&id=216434#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66507

Files:
  lldb/trunk/include/lldb/Symbol/SymbolFile.h
  lldb/trunk/include/lldb/Symbol/Type.h
  lldb/trunk/include/lldb/lldb-private-enumerations.h
  lldb/trunk/lit/SymbolFile/DWARF/compilercontext.ll
  lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/trunk/source/Symbol/SymbolFile.cpp
  lldb/trunk/source/Symbol/Type.cpp
  lldb/trunk/tools/lldb-test/lldb-test.cpp
  lldb/trunk/unittests/Symbol/TestType.cpp

Index: lldb/trunk/unittests/Symbol/TestType.cpp
===
--- lldb/trunk/unittests/Symbol/TestType.cpp
+++ lldb/trunk/unittests/Symbol/TestType.cpp
@@ -48,3 +48,47 @@
   "std::set>::iterator", true,
   "std::set>::", "iterator");
 }
+
+TEST(Type, CompilerContextPattern) {
+  std::vector mms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mms, mms));
+  std::vector mmc = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Class, ConstString("S")}};
+  EXPECT_FALSE(contextMatches(mms, mmc));
+  std::vector ms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  std::vector mas = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::AnyModule, ConstString("*")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mms, mas));
+  EXPECT_TRUE(contextMatches(ms, mas));
+  EXPECT_FALSE(contextMatches(mas, ms));
+  std::vector mmms = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Module, ConstString("C")},
+  {CompilerContextKind::Struct, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mmms, mas));
+  std::vector mme = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Enum, ConstString("S")}};
+  std::vector mma = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::AnyType, ConstString("S")}};
+  EXPECT_TRUE(contextMatches(mme, mma));
+  EXPECT_TRUE(contextMatches(mms, mma));
+  std::vector mme2 = {
+  {CompilerContextKind::Module, ConstString("A")},
+  {CompilerContextKind::Module, ConstString("B")},
+  {CompilerContextKind::Enum, ConstString("S2")}};
+  EXPECT_FALSE(contextMatches(mme2, mma));
+}
Index: lldb/trunk/tools/lldb-test/lldb-test.cpp
===
--- lldb/trunk/tools/lldb-test/lldb-test.cpp
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp
@@ -242,12 +242,14 @@
 .Case("Module", CompilerContextKind::Module)
 .Case("Namespace", CompilerContextKind::Namespace)
 .Case("Class", CompilerContextKind::Class)
-.Case("Structure", CompilerContextKind::Structure)
+.Case("Struct", CompilerContextKind::Struct)
 .Case("Union", CompilerContextKind::Union)
 .Case("Function", CompilerContextKind::Function)
 .Case("Variable", CompilerContextKind::Variable)
-.Case("Enumeration", CompilerContextKind::Enumeration)
+.Case("Enum", CompilerContextKind::Enum)
 .Case("Typedef", CompilerContextKind::Typedef)
+.Case("AnyModule", CompilerContextKind::AnyModule)
+.Case("AnyType", CompilerContextKind::AnyType)
 .Default(CompilerContextKind::Invalid);
 if (value.empty()) {
   WithColor::error() << "compiler context entry has no \"name\"\n";
@@ -511,7 

[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl created this revision.
aprantl added reviewers: labath, clayborg, jasonmolenda, JDevlieghere.

This patch is also motivated by the Swift branch and is effectively NFC for the 
single-TypeSystem llvm.org branch.

In multi-language projects it is extremely common to have, e.g., a Clang type 
and a similarly-named rendition of that same type in another language. When 
searching for a type It is much cheaper to pass a set of supported languages to 
the SymbolFile than having it materialize every result and then rejecting the 
materialized types that have the wrong language.


https://reviews.llvm.org/D66546

Files:
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/lit/SymbolFile/DWARF/compilercontext.ll
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/SymbolFile.cpp
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/Symbol/VariableList.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/CleanUp.h"
@@ -144,6 +145,10 @@
 cl::desc("Specify a compiler context as \"kind:name,...\"."),
 cl::value_desc("context"), cl::sub(SymbolsSubcommand));
 
+static cl::opt
+Language("language", cl::desc("Specify a DWARF language like C99."),
+ cl::value_desc("language"), cl::sub(SymbolsSubcommand));
+
 static cl::list FunctionNameFlags(
 "function-flags", cl::desc("Function search flags:"),
 cl::values(clEnumValN(eFunctionNameTypeAuto, "auto",
@@ -507,13 +512,17 @@
   CompilerDeclContext *ContextPtr =
   ContextOr->IsValid() ? &*ContextOr : nullptr;
 
+  SmallBitVector languages(eNumLanguageTypes);
+  if (!Language.empty())
+languages.set(Language::GetLanguageTypeFromString(Language));
+  
   DenseSet SearchedFiles;
   TypeMap Map;
   if (!Name.empty())
 Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
   SearchedFiles, Map);
   else
-Symfile.FindTypes({parseCompilerContext()}, true, Map);
+Symfile.FindTypes({parseCompilerContext()}, languages, true, Map);
 
   outs() << formatv("Found {0} types:\n", Map.GetSize());
   StreamString Stream;
Index: lldb/source/Symbol/SymbolFile.cpp
===
--- lldb/source/Symbol/SymbolFile.cpp
+++ lldb/source/Symbol/SymbolFile.cpp
@@ -150,7 +150,8 @@
 }
 
 size_t SymbolFile::FindTypes(llvm::ArrayRef pattern,
- bool append, TypeMap &types) {
+ llvm::SmallBitVector languages, bool append,
+ TypeMap &types) {
   if (!append)
 types.Clear();
   return 0;
Index: lldb/source/Symbol/ClangASTContext.cpp
===
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -798,6 +798,28 @@
   m_pointer_byte_size = 0;
 }
 
+llvm::SmallBitVector ClangASTContext::GetSupportedLanguages() const {
+  llvm::SmallBitVector languages(64-8, 0);
+  static_assert(eNumLanguageTypes < 64-8,
+"Languages bit vector is no longer small on 64 bit systems");
+  uint64_t mask =
+1 << eLanguageTypeC89 |
+1 << eLanguageTypeC |
+1 << eLanguageTypeC_plus_plus |
+1 << eLanguageTypeC99 |
+1 << eLanguageTypeObjC |
+1 << eLanguageTypeObjC_plus_plus |
+1 << eLanguageTypeUPC |
+1 << eLanguageTypeC_plus_plus_03 |
+1 << eLanguageTypeC_plus_plus_11 |
+1 << eLanguageTypeC11 |
+1 << eLanguageTypeC_plus_plus_14;
+  uint32_t mask32[2];
+  memcpy(mask32, &mask, 8);
+  languages.setBitsInMask(mask32, 7);
+  return languages;
+}
+
 void ClangASTContext::setSema(Sema *s) {
   // Ensure that the new sema actually belongs to our ASTContext.
   assert(s == nullptr || &s->getASTContext() == m_ast_up.get());
Index: lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
===
--- lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
+++ lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
@@ -133,7 +133,8 @@
 lldb_private::Typ

[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

I think the functionality is fine.

I know this is a little ironic, given that we just had this discussion, but I 
would propose wrapping the `SmallBitVector` here. That way you can abstracting 
away the details about the underlying enum values, the size, and make the whole 
thing type safe. Although I agree with Pavel's earlier comment, I think 
subclassing might even be a good fit, so that you don't have to wrap the 
operator and set methods, but either having the `SmallBitVector` as a member is 
fine with me too.




Comment at: lldb/source/Symbol/ClangASTContext.cpp:802
+llvm::SmallBitVector ClangASTContext::GetSupportedLanguages() const {
+  llvm::SmallBitVector languages(64-8, 0);
+  static_assert(eNumLanguageTypes < 64-8,

Let's add a comment why you choose 64-8 and why we can't use those last 8 bits.


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

https://reviews.llvm.org/D66546



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


[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

I also just discovered void ClangASTContext::EnumerateSupportedLanguages() and 
will incorporate that into the next revision, too.


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

https://reviews.llvm.org/D66546



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


[Lldb-commits] [lldb] r369582 - Add char8_t support (C++20)

2019-08-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 21 14:30:55 2019
New Revision: 369582

URL: http://llvm.org/viewvc/llvm-project?rev=369582&view=rev
Log:
Add char8_t support (C++20)

This patch adds support for the char8_t type introduced in C++20
char8_t. The original patch was submitted by James Blachly  on the LLDB
mailing list [1]. I modified the patch a bit and added a test.

[1] http://lists.llvm.org/pipermail/lldb-dev/2019-August/015393.html

Differential revision: https://reviews.llvm.org/D66447

Added:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
Modified:
lldb/trunk/include/lldb/lldb-enumerations.h
lldb/trunk/source/Commands/CommandObjectMemory.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=369582&r1=369581&r2=369582&view=diff
==
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Wed Aug 21 14:30:55 2019
@@ -193,6 +193,7 @@ enum Format {
   eFormatHexFloat,// ISO C99 hex float string
   eFormatInstruction, // Disassemble an opcode
   eFormatVoid,// Do not print this
+  eFormatUnicode8,
   kNumFormats
 };
 
@@ -592,7 +593,7 @@ enum CommandArgumentType {
 };
 
 // Symbol types
-// Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 
63 
+// Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
 // entries you will have to resize that field.
 enum SymbolType {
   eSymbolTypeAny = 0,

Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile?rev=369582&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile Wed Aug 
21 14:30:55 2019
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+CFLAGS_EXTRAS := -std=c++2a -fchar8_t
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py?rev=369582&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py 
(added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py 
Wed Aug 21 14:30:55 2019
@@ -0,0 +1,40 @@
+# coding=utf8
+"""
+Test that C++ supports char8_t correctly.
+"""
+
+from __future__ import print_function
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+
+class CxxChar8_tTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIf(compiler="clang", compiler_version=['<', '7.0'])
+def test(self):
+"""Test that C++ supports char8_t correctly."""
+self.build()
+exe = self.getBuildArtifact("a.out")
+
+# Create a target by the debugger.
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+# FIXME: We should be able to test this with target variable, but the
+# data formatter output is broken.
+lldbutil.run_break_set_by_symbol(self, 'main')
+self.runCmd("run", RUN_SUCCEEDED)
+
+self.expect(
+"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
+
+self.expect(
+"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"ä½ 
好"'])
+
+self.expect(
+"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])

Added: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp?rev=369582&view=auto
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp (added)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp Wed Aug 
21 14:30:55 2019
@@ -0,0 +1,7 @@
+#include 
+
+char8_t a  = u8'a';
+const char8_t* ab = u8"你好";
+char8_t abc[

[Lldb-commits] [lldb] r369584 - When building file without debug info, include the architecture

2019-08-21 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Aug 21 14:34:17 2019
New Revision: 369584

URL: http://llvm.org/viewvc/llvm-project?rev=369584&view=rev
Log:
When building file without debug info, include the architecture
setting in the cflags on Darwin systems.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile?rev=369584&r1=369583&r2=369584&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile 
Wed Aug 21 14:34:17 2019
@@ -1,7 +1,11 @@
 LEVEL = ../../../make
 OBJCXX_SOURCES := main.mm myobject.mm
 include $(LEVEL)/Makefile.rules
+CFLAGS_NO_DEBUG =
+ifeq "$(OS)" "Darwin"
+   CFLAGS_NO_DEBUG += -arch $(ARCH)
+endif
 
 # myobject.o needs to be built without debug info
 myobject.o: myobject.mm
-   $(CXX) -c -o $@ $<
+   $(CXX) $(CFLAGS_NO_DEBUG) -c -o $@ $<


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


[Lldb-commits] [PATCH] D66447: Add char8_t support (C++20)

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369582: Add char8_t support (C++20) (authored by 
JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66447?vs=216422&id=216481#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66447

Files:
  lldb/trunk/include/lldb/lldb-enumerations.h
  lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
  lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
  lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
  lldb/trunk/source/Commands/CommandObjectMemory.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CxxStringTypes.h
  lldb/trunk/source/Symbol/ClangASTContext.cpp

Index: lldb/trunk/include/lldb/lldb-enumerations.h
===
--- lldb/trunk/include/lldb/lldb-enumerations.h
+++ lldb/trunk/include/lldb/lldb-enumerations.h
@@ -193,6 +193,7 @@
   eFormatHexFloat,// ISO C99 hex float string
   eFormatInstruction, // Disassemble an opcode
   eFormatVoid,// Do not print this
+  eFormatUnicode8,
   kNumFormats
 };
 
@@ -592,7 +593,7 @@
 };
 
 // Symbol types
-// Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63 
+// Symbol holds the SymbolType in a 6-bit field (m_type), so if you get over 63
 // entries you will have to resize that field.
 enum SymbolType {
   eSymbolTypeAny = 0,
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+CFLAGS_EXTRAS := -std=c++2a -fchar8_t
+
+include $(LEVEL)/Makefile.rules
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/main.cpp
@@ -0,0 +1,7 @@
+#include 
+
+char8_t a  = u8'a';
+const char8_t* ab = u8"你好";
+char8_t abc[9] = u8"你好";
+
+int main (int argc, char const *argv[]) { return 0; }
Index: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
@@ -0,0 +1,40 @@
+# coding=utf8
+"""
+Test that C++ supports char8_t correctly.
+"""
+
+from __future__ import print_function
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+
+
+class CxxChar8_tTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIf(compiler="clang", compiler_version=['<', '7.0'])
+def test(self):
+"""Test that C++ supports char8_t correctly."""
+self.build()
+exe = self.getBuildArtifact("a.out")
+
+# Create a target by the debugger.
+target = self.dbg.CreateTarget(exe)
+self.assertTrue(target, VALID_TARGET)
+
+# FIXME: We should be able to test this with target variable, but the
+# data formatter output is broken.
+lldbutil.run_break_set_by_symbol(self, 'main')
+self.runCmd("run", RUN_SUCCEEDED)
+
+self.expect(
+"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
+
+self.expect(
+"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"你好"'])
+
+self.expect(
+"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -854,6 +854,14 @@
   // FIXME because of a bug in the FormattersContainer we need to add a summary
   // for both X* and const X* ()
   AddCXXSummary(
+  cpp_category_sp, lldb_private::formatters::Char8StringSummaryProvider,
+  "char8_t * summary provider", ConstString("char8_t *"), string_flags);
+  AddCXXSummary(cpp_category_sp,
+lldb_private::formatters::Char8StringSummaryProvider,
+"char8_t [] summary provider",
+

[Lldb-commits] [lldb] r369595 - [test] Update test so it matches the Windows output

2019-08-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 21 15:32:21 2019
New Revision: 369595

URL: http://llvm.org/viewvc/llvm-project?rev=369595&view=rev
Log:
[test] Update test so it matches the Windows output

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py?rev=369595&r1=369594&r2=369595&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py 
(original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/char8_t/TestCxxChar8_t.py 
Wed Aug 21 15:32:21 2019
@@ -31,10 +31,10 @@ class CxxChar8_tTestCase(TestBase):
 self.runCmd("run", RUN_SUCCEEDED)
 
 self.expect(
-"frame variable a", substrs=["(char8_t) ::a = 0x61 u8'a'"])
+"frame variable a", substrs=["(char8_t)", "0x61 u8'a'"])
 
 self.expect(
-"frame variable ab", substrs=['(const char8_t *) ::ab', 'u8"ä½ 
好"'])
+"frame variable ab", substrs=['(const char8_t *)' , 'u8"你好"'])
 
 self.expect(
-"frame variable abc", substrs=['(char8_t [9]) ::abc = u8"你好"'])
+"frame variable abc", substrs=['(char8_t [9])', 'u8"你好"'])


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


[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 216508.
aprantl added a comment.

Address review feedback.

(This was quite a trip down the rabbit hole, but on the plus side I got to 
remove a few (now) completely useless callback APIs).


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

https://reviews.llvm.org/D66546

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/include/lldb/Target/Language.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/lit/SymbolFile/DWARF/compilercontext.ll
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/PluginManager.cpp
  lldb/source/Interpreter/OptionValueLanguage.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/SymbolFile.cpp
  lldb/source/Symbol/TypeSystem.cpp
  lldb/source/Target/Language.cpp
  lldb/source/Target/Target.cpp
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/Symbol/VariableList.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/CleanUp.h"
@@ -144,6 +145,10 @@
 cl::desc("Specify a compiler context as \"kind:name,...\"."),
 cl::value_desc("context"), cl::sub(SymbolsSubcommand));
 
+static cl::opt
+Language("language", cl::desc("Specify a language type, like C99."),
+ cl::value_desc("language"), cl::sub(SymbolsSubcommand));
+
 static cl::list FunctionNameFlags(
 "function-flags", cl::desc("Function search flags:"),
 cl::values(clEnumValN(eFunctionNameTypeAuto, "auto",
@@ -507,13 +512,17 @@
   CompilerDeclContext *ContextPtr =
   ContextOr->IsValid() ? &*ContextOr : nullptr;
 
+  SmallBitVector languages(eNumLanguageTypes);
+  if (!Language.empty())
+languages.set(Language::GetLanguageTypeFromString(Language));
+  
   DenseSet SearchedFiles;
   TypeMap Map;
   if (!Name.empty())
 Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
   SearchedFiles, Map);
   else
-Symfile.FindTypes({parseCompilerContext()}, true, Map);
+Symfile.FindTypes({parseCompilerContext()}, languages, true, Map);
 
   outs() << formatv("Found {0} types:\n", Map.GetSize());
   StreamString Stream;
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -206,13 +206,11 @@
 lldb::REPLSP Target::GetREPL(Status &err, lldb::LanguageType language,
  const char *repl_options, bool can_create) {
   if (language == eLanguageTypeUnknown) {
-std::set repl_languages;
+LanguageSet repl_languages = Language::GetLanguagesSupportingREPLs();
 
-Language::GetLanguagesSupportingREPLs(repl_languages);
-
-if (repl_languages.size() == 1) {
-  language = *repl_languages.begin();
-} else if (repl_languages.size() == 0) {
+if (repl_languages.count() == 1) {
+  language = (LanguageType)repl_languages.find_first();
+} else if (repl_languages.none()) {
   err.SetErrorStringWithFormat(
   "LLDB isn't configured with REPL support for any languages.");
   return REPLSP();
@@ -2129,22 +2127,19 @@
   if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all
  // assembly code
   || language == eLanguageTypeUnknown) {
-std::set languages_for_types;
-std::set languages_for_expressions;
-
-Language::GetLanguagesSupportingTypeSystems(languages_for_types,
-languages_for_expressions);
+LanguageSet languages_for_expressions =
+Language::GetLanguagesSupportingTypeSystemsForExpressions();
 
-if (languages_for_expressions.count(eLanguageTypeC)) {
+if (languages_for_expressions[eLanguageTypeC]) {
   language = eLanguageTypeC; // LLDB's default.  Override by setting the
  // target language.
 } else {
-  if (languages_for_expressions.empty()) {
+  if (languages_for_expressions.none()) {
 return llvm::make_err

[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

This looks like a great improvement. Thanks for working on this!




Comment at: lldb/include/lldb/Core/PluginManager.h:400
-  static TypeSystemEnumerateSupportedLanguages
-  GetTypeSystemEnumerateSupportedLanguagesCallbackAtIndex(uint32_t idx);
 

🤔



Comment at: lldb/include/lldb/Core/PluginManager.h:423
-  static REPLEnumerateSupportedLanguages
-  GetREPLSystemEnumerateSupportedLanguagesCallbackForPluginName(
-  ConstString name);

🙄



Comment at: lldb/source/Core/Debugger.cpp:1628
 
-Language::GetLanguagesSupportingREPLs(repl_languages);
-
-if (repl_languages.size() == 1) {
-  language = *repl_languages.begin();
-} else if (repl_languages.empty()) {
+if (repl_languages.count() == 1) {
+  language = (LanguageType)repl_languages.find_first();

Let's wrap this check and the `find_first` call into a method that returns an 
`llvm::Optional< LanguageType>`?


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

https://reviews.llvm.org/D66546



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


[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 216518.
aprantl added a comment.

More feedback from Jonas.


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

https://reviews.llvm.org/D66546

Files:
  lldb/include/lldb/Core/PluginManager.h
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/SymbolFile.h
  lldb/include/lldb/Symbol/TypeSystem.h
  lldb/include/lldb/Target/Language.h
  lldb/include/lldb/lldb-private-interfaces.h
  lldb/lit/SymbolFile/DWARF/compilercontext.ll
  lldb/source/Core/Debugger.cpp
  lldb/source/Core/PluginManager.cpp
  lldb/source/Interpreter/OptionValueLanguage.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
  lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
  lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/SymbolFile.cpp
  lldb/source/Symbol/TypeSystem.cpp
  lldb/source/Target/Language.cpp
  lldb/source/Target/Target.cpp
  lldb/tools/lldb-test/lldb-test.cpp

Index: lldb/tools/lldb-test/lldb-test.cpp
===
--- lldb/tools/lldb-test/lldb-test.cpp
+++ lldb/tools/lldb-test/lldb-test.cpp
@@ -26,6 +26,7 @@
 #include "lldb/Symbol/TypeList.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/Symbol/VariableList.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/CleanUp.h"
@@ -144,6 +145,10 @@
 cl::desc("Specify a compiler context as \"kind:name,...\"."),
 cl::value_desc("context"), cl::sub(SymbolsSubcommand));
 
+static cl::opt
+Language("language", cl::desc("Specify a language type, like C99."),
+ cl::value_desc("language"), cl::sub(SymbolsSubcommand));
+
 static cl::list FunctionNameFlags(
 "function-flags", cl::desc("Function search flags:"),
 cl::values(clEnumValN(eFunctionNameTypeAuto, "auto",
@@ -507,13 +512,17 @@
   CompilerDeclContext *ContextPtr =
   ContextOr->IsValid() ? &*ContextOr : nullptr;
 
+  SmallBitVector languages(eNumLanguageTypes);
+  if (!Language.empty())
+languages.set(Language::GetLanguageTypeFromString(Language));
+  
   DenseSet SearchedFiles;
   TypeMap Map;
   if (!Name.empty())
 Symfile.FindTypes(ConstString(Name), ContextPtr, true, UINT32_MAX,
   SearchedFiles, Map);
   else
-Symfile.FindTypes({parseCompilerContext()}, true, Map);
+Symfile.FindTypes({parseCompilerContext()}, languages, true, Map);
 
   outs() << formatv("Found {0} types:\n", Map.GetSize());
   StreamString Stream;
Index: lldb/source/Target/Target.cpp
===
--- lldb/source/Target/Target.cpp
+++ lldb/source/Target/Target.cpp
@@ -206,13 +206,11 @@
 lldb::REPLSP Target::GetREPL(Status &err, lldb::LanguageType language,
  const char *repl_options, bool can_create) {
   if (language == eLanguageTypeUnknown) {
-std::set repl_languages;
+LanguageSet repl_languages = Language::GetLanguagesSupportingREPLs();
 
-Language::GetLanguagesSupportingREPLs(repl_languages);
-
-if (repl_languages.size() == 1) {
-  language = *repl_languages.begin();
-} else if (repl_languages.size() == 0) {
+if (auto single_lang = repl_languages.GetSingularLanguage()) {
+  language = *single_lang;
+} else if (repl_languages.none()) {
   err.SetErrorStringWithFormat(
   "LLDB isn't configured with REPL support for any languages.");
   return REPLSP();
@@ -2129,23 +2127,18 @@
   if (language == eLanguageTypeMipsAssembler // GNU AS and LLVM use it for all
  // assembly code
   || language == eLanguageTypeUnknown) {
-std::set languages_for_types;
-std::set languages_for_expressions;
-
-Language::GetLanguagesSupportingTypeSystems(languages_for_types,
-languages_for_expressions);
+LanguageSet languages_for_expressions =
+Language::GetLanguagesSupportingTypeSystemsForExpressions();
 
-if (languages_for_expressions.count(eLanguageTypeC)) {
+if (languages_for_expressions[eLanguageTypeC]) {
   language = eLanguageTypeC; // LLDB's default.  Override by setting the
  // target language.
 } else {
-  if (languages_for_expressions.empty()) {
+  if (languages_for_expressions.none())
 return llvm::make_error(
 "No expression support for any languages",
 llvm::inconvertibleErrorCode());
-  } else {
-la

[Lldb-commits] [PATCH] D66566: [lldb] Replace std::once_flag with llvm::once_flag.

2019-08-21 Thread Davide Italiano via Phabricator via lldb-commits
davide created this revision.
davide added reviewers: jasonmolenda, friss.
Herald added a project: LLDB.

The former seems like it's not working on some platforms.
All the other uses use `llvm::`, so, let's change for consistency.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66566

Files:
  lldb/include/lldb/Target/Process.h
  lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp


Index: lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
===
--- lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
+++ lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
@@ -46,7 +46,7 @@
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static std::once_flag s_once_flag;
+  static llvm::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {
Index: lldb/include/lldb/Target/Process.h
===
--- lldb/include/lldb/Target/Process.h
+++ lldb/include/lldb/Target/Process.h
@@ -50,6 +50,7 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
@@ -2741,7 +2742,7 @@
   enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
   
   std::unique_ptr m_dlopen_utility_func_up;
-  std::once_flag m_dlopen_utility_func_flag_once;
+  llvm::once_flag m_dlopen_utility_func_flag_once;
 
   size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;


Index: lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
===
--- lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
+++ lldb/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
@@ -46,7 +46,7 @@
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static std::once_flag s_once_flag;
+  static llvm::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {
Index: lldb/include/lldb/Target/Process.h
===
--- lldb/include/lldb/Target/Process.h
+++ lldb/include/lldb/Target/Process.h
@@ -50,6 +50,7 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
@@ -2741,7 +2742,7 @@
   enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
   
   std::unique_ptr m_dlopen_utility_func_up;
-  std::once_flag m_dlopen_utility_func_flag_once;
+  llvm::once_flag m_dlopen_utility_func_flag_once;
 
   size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D66546: Extend FindTypes w/ CompilerContext to allow filtering by language

2019-08-21 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

This LGTM, unless Pavel has comments.


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

https://reviews.llvm.org/D66546



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


[Lldb-commits] [PATCH] D66566: [lldb] Replace std::once_flag with llvm::once_flag.

2019-08-21 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

I and Jason discussed this offline and he's fine with it, so, I'm going to land 
this now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66566



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


[Lldb-commits] [lldb] r369611 - The g_format_infos table needs to be updated in concert with the

2019-08-21 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Wed Aug 21 19:06:03 2019
New Revision: 369611

URL: http://llvm.org/viewvc/llvm-project?rev=369611&view=rev
Log:
The g_format_infos table needs to be updated in concert with the
enum Format entries; else we can crash in a place like
FormatManager::GetFormatAsCString().  We should add  bounds checks
to prevent this more reliably, but for tonight I'm just adding this
entry to keep an address-sanitizer test run working.


Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=369611&r1=369610&r2=369611&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Wed Aug 21 19:06:03 2019
@@ -47,6 +47,7 @@ static FormatInfo g_format_infos[] = {
 {eFormatFloat, 'f', "float"},
 {eFormatOctal, 'o', "octal"},
 {eFormatOSType, 'O', "OSType"},
+{eFormatUnicode8, 'u', "unicode8"},
 {eFormatUnicode16, 'U', "unicode16"},
 {eFormatUnicode32, '\0', "unicode32"},
 {eFormatUnsigned, 'u', "unsigned decimal"},


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


[Lldb-commits] [lldb] r369614 - [FormatManager] Add static_assert to keep formats in sync.

2019-08-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 21 19:56:00 2019
New Revision: 369614

URL: http://llvm.org/viewvc/llvm-project?rev=369614&view=rev
Log:
[FormatManager] Add static_assert to keep formats in sync.

This adds a static assert that ensures that there's a format info entry
for every format enum value. This should prevent others from making the
same mistake I made and Jason kindly fixed in r369611. (Thanks!)

Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=369614&r1=369613&r2=369614&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Wed Aug 21 19:56:00 2019
@@ -30,7 +30,7 @@ struct FormatInfo {
// current format
 };
 
-static FormatInfo g_format_infos[] = {
+static constexpr FormatInfo g_format_infos[] = {
 {eFormatDefault, '\0', "default"},
 {eFormatBoolean, 'B', "boolean"},
 {eFormatBinary, 'b', "binary"},
@@ -72,6 +72,10 @@ static FormatInfo g_format_infos[] = {
 {eFormatInstruction, 'i', "instruction"},
 {eFormatVoid, 'v', "void"}};
 
+static_assert((sizeof(g_format_infos) / sizeof(g_format_infos[0])) ==
+  kNumFormats,
+  "All formats must have a corresponding info entry.");
+
 static uint32_t g_num_format_infos = llvm::array_lengthof(g_format_infos);
 
 static bool GetFormatFromFormatChar(char format_char, Format &format) {


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


[Lldb-commits] [lldb] r369618 - [lldb] Replace std::once_flag with llvm::once_flag.

2019-08-21 Thread Davide Italiano via lldb-commits
Author: davide
Date: Wed Aug 21 20:12:49 2019
New Revision: 369618

URL: http://llvm.org/viewvc/llvm-project?rev=369618&view=rev
Log:
[lldb] Replace std::once_flag with llvm::once_flag.

Summary:
The former seems like it's not working on some platforms.
All the other uses use `llvm::`, so, let's change for consistency.

Reviewers: jasonmolenda, friss

Subscribers: lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=369618&r1=369617&r2=369618&view=diff
==
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Wed Aug 21 20:12:49 2019
@@ -50,6 +50,7 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
@@ -2741,7 +2742,7 @@ protected:
   enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
   
   std::unique_ptr m_dlopen_utility_func_up;
-  std::once_flag m_dlopen_utility_func_flag_once;
+  llvm::once_flag m_dlopen_utility_func_flag_once;
 
   size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;

Modified: 
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp?rev=369618&r1=369617&r2=369618&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp 
Wed Aug 21 20:12:49 2019
@@ -46,7 +46,7 @@ static os_activity_stream_set_event_hand
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static std::once_flag s_once_flag;
+  static llvm::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {


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


[Lldb-commits] [lldb] r369617 - [FormatManage] Fix the format info order

2019-08-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 21 20:12:25 2019
New Revision: 369617

URL: http://llvm.org/viewvc/llvm-project?rev=369617&view=rev
Log:
[FormatManage] Fix the format info order

The format info entries need to match the order of the enum entries.
This should fix the two failing data-formatter tests.

Modified:
lldb/trunk/source/DataFormatters/FormatManager.cpp

Modified: lldb/trunk/source/DataFormatters/FormatManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/FormatManager.cpp?rev=369617&r1=369616&r2=369617&view=diff
==
--- lldb/trunk/source/DataFormatters/FormatManager.cpp (original)
+++ lldb/trunk/source/DataFormatters/FormatManager.cpp Wed Aug 21 20:12:25 2019
@@ -47,7 +47,6 @@ static constexpr FormatInfo g_format_inf
 {eFormatFloat, 'f', "float"},
 {eFormatOctal, 'o', "octal"},
 {eFormatOSType, 'O', "OSType"},
-{eFormatUnicode8, 'u', "unicode8"},
 {eFormatUnicode16, 'U', "unicode16"},
 {eFormatUnicode32, '\0', "unicode32"},
 {eFormatUnsigned, 'u', "unsigned decimal"},
@@ -70,7 +69,9 @@ static constexpr FormatInfo g_format_inf
 {eFormatAddressInfo, 'A', "address"},
 {eFormatHexFloat, '\0', "hex float"},
 {eFormatInstruction, 'i', "instruction"},
-{eFormatVoid, 'v', "void"}};
+{eFormatVoid, 'v', "void"},
+{eFormatUnicode8, 'u', "unicode8"},
+};
 
 static_assert((sizeof(g_format_infos) / sizeof(g_format_infos[0])) ==
   kNumFormats,


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


[Lldb-commits] [PATCH] D66566: [lldb] Replace std::once_flag with llvm::once_flag.

2019-08-21 Thread Davide Italiano via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL369618: [lldb] Replace std::once_flag with llvm::once_flag. 
(authored by davide, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66566?vs=216521&id=216546#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66566

Files:
  lldb/trunk/include/lldb/Target/Process.h
  lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp


Index: 
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
===
--- lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
@@ -46,7 +46,7 @@
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static std::once_flag s_once_flag;
+  static llvm::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {
Index: lldb/trunk/include/lldb/Target/Process.h
===
--- lldb/trunk/include/lldb/Target/Process.h
+++ lldb/trunk/include/lldb/Target/Process.h
@@ -50,6 +50,7 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
@@ -2741,7 +2742,7 @@
   enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
   
   std::unique_ptr m_dlopen_utility_func_up;
-  std::once_flag m_dlopen_utility_func_flag_once;
+  llvm::once_flag m_dlopen_utility_func_flag_once;
 
   size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;


Index: lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
===
--- lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
+++ lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
@@ -46,7 +46,7 @@
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static std::once_flag s_once_flag;
+  static llvm::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {
Index: lldb/trunk/include/lldb/Target/Process.h
===
--- lldb/trunk/include/lldb/Target/Process.h
+++ lldb/trunk/include/lldb/Target/Process.h
@@ -50,6 +50,7 @@
 #include "lldb/lldb-private.h"
 
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/Threading.h"
 #include "llvm/Support/VersionTuple.h"
 
 namespace lldb_private {
@@ -2741,7 +2742,7 @@
   enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
   
   std::unique_ptr m_dlopen_utility_func_up;
-  std::once_flag m_dlopen_utility_func_flag_once;
+  llvm::once_flag m_dlopen_utility_func_flag_once;
 
   size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r369621 - [debugserver] Switch back to std::once_flag

2019-08-21 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Wed Aug 21 20:48:19 2019
New Revision: 369621

URL: http://llvm.org/viewvc/llvm-project?rev=369621&view=rev
Log:
[debugserver] Switch back to std::once_flag

We cannot use llvm::once_flag in debugserver because doesn't link
against llvm.

Modified:
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp

Modified: 
lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp?rev=369621&r1=369620&r2=369621&view=diff
==
--- lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp 
(original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp 
Wed Aug 21 20:48:19 2019
@@ -46,7 +46,7 @@ static os_activity_stream_set_event_hand
 s_os_activity_stream_set_event_handler;
 
 bool LookupSPICalls() {
-  static llvm::once_flag s_once_flag;
+  static std::once_flag s_once_flag;
   static bool s_has_spi;
 
   std::call_once(s_once_flag, [] {


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


Re: [Lldb-commits] [PATCH] D66566: [lldb] Replace std::once_flag with llvm::once_flag.

2019-08-21 Thread Jonas Devlieghere via lldb-commits
I've reverted the debugserver change in r369621 because it doesn't
link against llvm and was therefore failing to build on the bot.

On Wed, Aug 21, 2019 at 8:18 PM Davide Italiano via Phabricator via
lldb-commits  wrote:
>
> This revision was not accepted when it landed; it landed in state "Needs 
> Review".
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL369618: [lldb] Replace std::once_flag with 
> llvm::once_flag. (authored by davide, committed by ).
> Herald added a project: LLVM.
> Herald added a subscriber: llvm-commits.
>
> Changed prior to commit:
>   https://reviews.llvm.org/D66566?vs=216521&id=216546#toc
>
> Repository:
>   rL LLVM
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D66566/new/
>
> https://reviews.llvm.org/D66566
>
> Files:
>   lldb/trunk/include/lldb/Target/Process.h
>   lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
>
>
> Index: 
> lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
> ===
> --- 
> lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
> +++ 
> lldb/trunk/tools/debugserver/source/MacOSX/DarwinLog/DarwinLogCollector.cpp
> @@ -46,7 +46,7 @@
>  s_os_activity_stream_set_event_handler;
>
>  bool LookupSPICalls() {
> -  static std::once_flag s_once_flag;
> +  static llvm::once_flag s_once_flag;
>static bool s_has_spi;
>
>std::call_once(s_once_flag, [] {
> Index: lldb/trunk/include/lldb/Target/Process.h
> ===
> --- lldb/trunk/include/lldb/Target/Process.h
> +++ lldb/trunk/include/lldb/Target/Process.h
> @@ -50,6 +50,7 @@
>  #include "lldb/lldb-private.h"
>
>  #include "llvm/ADT/ArrayRef.h"
> +#include "llvm/Support/Threading.h"
>  #include "llvm/Support/VersionTuple.h"
>
>  namespace lldb_private {
> @@ -2741,7 +2742,7 @@
>enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
>
>std::unique_ptr m_dlopen_utility_func_up;
> -  std::once_flag m_dlopen_utility_func_flag_once;
> +  llvm::once_flag m_dlopen_utility_func_flag_once;
>
>size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
> uint8_t *buf) const;
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits