[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-12-08 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

Just giving this a gentle nudge again. As I said before, there's no rush, but 
if there's any action I can take to get this landed, please let me know. Many 
thanks again, ben.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-12-16 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

Polite ping to get this committed.

I have rebased against main today and run the test, it still passes and the 
patch applies cleanly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2022-01-01 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

Friendly ping to get this landed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning created this revision.
puremourning requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When printing a std::string_view, print the referenced string as the
summary. Support string_view, u32string_view, u16string_view and
wstring_view, as we do for std::string and friends.

This is based on the existing fomratter for std::string, and just
extracts the data and length members, pushing them through the existing
string formatter.

In testing this, a "FIXME" was corrected for printing of non-ASCII empty
values. Previously, the "u", 'U" etc. prefixes were not printed for
basic_string<> types that were not char. This is trivial to resolve by
printing the prefix before the `""`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,27 @@
+#include 
+#include 
+#include 
+
+int main()
+{
+std::wstring_view wempty(L"");
+std::wstring_view s(L"hello world! מזל טוב!");
+std::wstring_view S(L"");
+std::string_view empty("");
+std::string q_source = "hello world";
+std::string_view q(q_source);
+std::string_view Q("quite a long std::strin with lots of info inside it");
+std::string_view TheVeryLongOne("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890someText12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

I'm happy to revert/split out the change for empty strings, as this is perhaps 
contentious (and not exactly minimal for this patch).

Also, I'm only implementing libcxx (for now). We can follow up with libstdc++ 
in another patch if this is accepted.

This is my first lldb patch, so apologies if I did something out of ordinary.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

> I would actually prefer if we could split this into a separate change :) 
> (Sorry!)

No problem, that was my gut feeling at the time too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning updated this revision to Diff 381293.
puremourning added a comment.

Remove change to the formatting of empty u16 and u32 strings


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,27 @@
+#include 
+#include 
+#include 
+
+int main()
+{
+std::wstring_view wempty(L"");
+std::wstring_view s(L"hello world! מזל טוב!");
+std::wstring_view S(L"");
+std::string_view empty("");
+std::string q_source = "hello world";
+std::string_view q(q_source);
+std::string_view Q("quite a long std::strin with lots of info inside it");
+std::string_view TheVeryLongOne("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890someText1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning updated this revision to Diff 381295.
puremourning added a comment.

RE-post with clang-format in path


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,97 @@
+#include 
+#include 
+#include 
+
+int main() {
+  std::wstring_view wempty(L"");
+  std::wstring_view s(L"hello world! מזל טוב!");
+  std::wstring_view S(L"");
+  std::string_view empty("");
+  std::string q_source = "hello world";
+  std::string_view q(q_source);
+  std::string_view Q("quite a long std::strin with lots of info inside it");
+  std::string_view TheVeryLongOne(
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "9012345678901234567890123456789012345678901234567890someText123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning updated this revision to Diff 381344.
puremourning added a comment.

Use expect_var_path rather than just expect in test


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,97 @@
+#include 
+#include 
+#include 
+
+int main() {
+  std::wstring_view wempty(L"");
+  std::wstring_view s(L"hello world! מזל טוב!");
+  std::wstring_view S(L"");
+  std::string_view empty("");
+  std::string q_source = "hello world";
+  std::string_view q(q_source);
+  std::string_view Q("quite a long std::strin with lots of info inside it");
+  std::string_view TheVeryLongOne(
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "9012345678901234567890123456789012345678901234567890someText123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

Thanks for the review!




Comment at: 
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py:62
+ns = self.namespace
+self.expect(
+"frame variable",

jingham wrote:
> We have lldbtest.expect_var_path for doing this sort of test.  It makes these 
> tests easier to read and less likely to be fooled by accidental matches.
Done. There's s slight difference in this API - the null pointer summary 
returns "" via this api rather than the output which returns "nullptr", so I've 
inlaced both in the test.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning updated this revision to Diff 381357.
puremourning added a comment.

Revert some formatting lost in rebase


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,97 @@
+#include 
+#include 
+#include 
+
+int main() {
+  std::wstring_view wempty(L"");
+  std::wstring_view s(L"hello world! מזל טוב!");
+  std::wstring_view S(L"");
+  std::string_view empty("");
+  std::string q_source = "hello world";
+  std::string_view q(q_source);
+  std::string_view Q("quite a long std::strin with lots of info inside it");
+  std::string_view TheVeryLongOne(
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "9012345678901234567890123456789012345678901234567890someText123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "90123456789012345678901234567890

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

In D11#3078896 , @shafik wrote:

> It looks good to me but can we verify it behaves nicely with undefined 
> behavior cases e.g.:
>
>   std::string s = "Hellooo ";
>   std::string_view sv = s + "World\n";

Will add some cases, sure.

> and a case like the one that was fixed in D108228 
> 

Thanks for the pointer! (no pun intended). I will apply the same 
change/mitigattion to my new code.

> I am not expecting any surprises since you are using the underlying string 
> formatter but worth checking.

yes, certainly is, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-10-21 Thread Ben Jackson via Phabricator via lldb-commits
puremourning updated this revision to Diff 381372.
puremourning added a comment.

Add some tests for dodgy inputs.
Handle invalid cases more consistently.
Factor out some copy paste code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

Files:
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.cpp
  lldb/source/Plugins/Language/CPlusPlus/LibCxx.h
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/Makefile
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/TestDataFormatterLibcxxStringView.py
  
lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp

Index: lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
===
--- /dev/null
+++ lldb/test/API/functionalities/data-formatter/data-formatter-stl/libcxx/string_view/main.cpp
@@ -0,0 +1,108 @@
+#include 
+#include 
+#include 
+
+static size_t touch_string(std::string_view &in_str_view) {
+  return in_str_view.size(); // Break here to look at bad string view.
+}
+
+int main() {
+  std::wstring_view wempty(L"");
+  std::wstring_view s(L"hello world! מזל טוב!");
+  std::wstring_view S(L"");
+  std::string_view empty("");
+  std::string q_source = "hello world";
+  std::string_view q(q_source);
+  std::string_view Q("quite a long std::strin with lots of info inside it");
+  std::string_view TheVeryLongOne(
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "9012345678901234567890123456789012345678901234567890someText123456789012"
+  "345678901234567890123456789012345678901234567890123456789012345678901234"
+  "567890123456789012345678901234567890123456789012345678901234567890123456"
+  "789012345678901234567890123456789012345678901234567890123456789012345678"
+  "901234567890123456789012345678901234567890123456789012345678901234567890"
+  "123456789012345678901234567890123456789012345678901234567890123456789012"
+  "34567890123456789012345678901234567890123456789012345678901234567890123

[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-11-18 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

Sorry, but is anything further required from me on this patch ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-11-19 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

In D11#3141363 , @jingham wrote:

> In D11#3141355 , @puremourning 
> wrote:
>
>> Sorry, but is anything further required from me on this patch ?
>
> You addressed an issue Shafik asked you to, so then he should make sure he's 
> happy with the change and mark the patch accepted.  OTOH we're all busy so 
> it's easy to let this sort of thing drop.  On your end, you should wait a 
> polite interval then issue a gentle ping in his direction...  A week is an 
> okay interval, I think, so now would be appropriate.

Sure, I wasn't nagging, just checking :) I completely understand how these 
things go. There's no rush.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D112222: [LLDB] libcxx summary formatters for std::string_view

2021-11-23 Thread Ben Jackson via Phabricator via lldb-commits
puremourning added a comment.

In D11#3143966 , @shafik wrote:

> Apologies, this dropped off my radar it LGTM, thank you!

Thanks!

Sorry for my ignorance, but what's the next step to land this? Do you want me 
to rebase it first and push that, or is someone abele land this for me, as I 
don't have commit rights ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D11

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


[Lldb-commits] [PATCH] D72152: Support Launching in External Console in lldb-vscode

2020-01-03 Thread Ben Jackson via Phabricator via lldb-commits
puremourning created this revision.
puremourning added a reviewer: clayborg.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

When testing terminal-mode applications using lldb-vscode on macOS, it's
currently required to set LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY when starting
lldb-vscode so that the application launches in a new Terminal.app
window. This is unlikely to work for VSCode as there's no obvious way to
set it.

vscode-cpptools uses `externalConsole: true` to enable this behaviour,
so we implement the same here .


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72152

Files:
  
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
  lldb/tools/lldb-vscode/README.md
  lldb/tools/lldb-vscode/lldb-vscode.cpp
  lldb/tools/lldb-vscode/package.json

Index: lldb/tools/lldb-vscode/package.json
===
--- lldb/tools/lldb-vscode/package.json
+++ lldb/tools/lldb-vscode/package.json
@@ -89,6 +89,11 @@
 "description": "Automatically stop after launch.",
 "default": false
 			},
+			"externalConsole": {
+"type": "boolean",
+"description": "Launch the program in a new terminal",
+"default": false
+			},
 			"disableASLR": {
 "type": "boolean",
 "description": "Enable or disable Address space layout randomization if the debugger supports it.",
Index: lldb/tools/lldb-vscode/lldb-vscode.cpp
===
--- lldb/tools/lldb-vscode/lldb-vscode.cpp
+++ lldb/tools/lldb-vscode/lldb-vscode.cpp
@@ -1395,6 +1395,8 @@
 flags |= lldb::eLaunchFlagDisableSTDIO;
   if (GetBoolean(arguments, "shellExpandArguments", false))
 flags |= lldb::eLaunchFlagShellExpandArguments;
+  if (GetBoolean(arguments, "externalConsole", false ))
+flags |= lldb::eLaunchFlagLaunchInTTY | lldb::eLaunchFlagCloseTTYOnExit;
   const bool detatchOnError = GetBoolean(arguments, "detachOnError", false);
   g_vsc.launch_info.SetDetachOnError(detatchOnError);
   g_vsc.launch_info.SetLaunchFlags(flags | lldb::eLaunchFlagDebug |
Index: lldb/tools/lldb-vscode/README.md
===
--- lldb/tools/lldb-vscode/README.md
+++ lldb/tools/lldb-vscode/README.md
@@ -88,6 +88,7 @@
 |**exitCommands**   |[string]| | LLDB commands executed when the program exits. Commands and command output will be sent to the debugger console when they are executed.
 |**sourceMap**  |[string[2]]| | Specify an array of path re-mappings. Each element in the array must be a two element array containing a source and destination pathname.
 |**debuggerRoot**   | string| |Specify a working directory to use when launching lldb-vscode. If the debug information in your executable contains relative paths, this option can be used so that `lldb-vscode` can find source files and object files that have relative paths.
+| **externalConsole** |boolean| | Set to TRUE to start the application in a new terminal. Useful for testing console applications.
 
 ## Attaching Settings
 
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/vscode.py
@@ -562,7 +562,7 @@
disableSTDIO=False, shellExpandArguments=False,
trace=False, initCommands=None, preRunCommands=None,
stopCommands=None, exitCommands=None, sourcePath=None,
-   debuggerRoot=None, launchCommands=None):
+   debuggerRoot=None, launchCommands=None, **kwargs):
 args_dict = {
 'program': program
 }
@@ -597,6 +597,8 @@
 args_dict['debuggerRoot'] = debuggerRoot
 if launchCommands:
 args_dict['launchCommands'] = launchCommands
+args_dict.update(kwargs)
+
 command_dict = {
 'command': 'launch',
 'type': 'request',
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -265,7 +265,7 @@
disableSTDIO=False, shellExpandArguments=False,
trace=False, initCommands=None, preRunCommands=None,
stopCommands=None, exitCommands=None,sourcePath= None,
-   debuggerRoot=None, launchCommands=None):
+   debuggerRoot=None, launchCommands=None, **kwargs):
 '''Sending launc