[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: teemperor, dblaikie, clayborg.
jankratochvil added a project: LLDB.
Herald added a subscriber: JDevlieghere.
jankratochvil requested review of this revision.

This is a part of D101237  to fix LLDB 
testsuite with GCC 11 installed (and its libstdc++). Any non-trivial handling 
of `std::unique_ptr` still asserts LLDB, that is the rest of D101237 
.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104283

Files:
  lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp


Index: lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,12 @@
   if (ptr_obj)
 m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
 
-  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (del_obj)
-m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  // GCC 11 std::default_delete<...> has existing child with GetByteSize()==1.
+  if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+if (del_obj)
+  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  }
 
   if (m_ptr_obj) {
 Status error;


Index: lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,12 @@
   if (ptr_obj)
 m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
 
-  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (del_obj)
-m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  // GCC 11 std::default_delete<...> has existing child with GetByteSize()==1.
+  if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+if (del_obj)
+  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  }
 
   if (m_ptr_obj) {
 Status error;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D104281: [lldb][docs] Add reference docs for Lua scripting

2021-06-15 Thread Siger Young via Phabricator via lldb-commits
siger-young added a comment.

In D104281#2818620 , @teemperor wrote:

> Instead of copying the text from the Python page, I was actually thinking 
> whether we should make the 'scripting' page more generic and just add the 
> language-specific examples for Python and Lua there. I am not sure what's the 
> best way to do that visually though with RST. We could just go for raw HTML 
> and use a tab switcher like this:

In fact, the same idea also occurred to me before. I think it's also achievable 
by a plugin sphinx-code-tabs.

I will try to improve the whole scripting section in this kind of way.

> Also I don't think a lot of LLDB distributors include Lua at the moment, so I 
> think that should be pointed out at some point, otherwise this leads to 
> confusion.

Yes. I will put some tips at the beginning of the docs.

I will update the patch in few weeks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104281

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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor requested changes to this revision.
teemperor added a comment.
This revision now requires changes to proceed.

I think the way the provider is supposed to work is that there is always 
`deleter` child as long as it's not `default_delete`, so I think we have to 
check for the name to avoid that we also hide an empty user-specified deleter.

  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
  if (del_obj) {
ConstString del_name = del_obj->GetDisplayTypeName();
if (!del_name.GetStringRef().startswith("std::default_delete<"))
  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
  }

(Technically that would hide the deleter if the user specifies a 
default-deleter that just happens to be compatible, but that seems like an 
obscure corner case so this seems "good enough").


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil abandoned this revision.
jankratochvil added a comment.

So I think you can check-in your patch. I would just copy-paste it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D104283#2818693 , @teemperor wrote:

> (Technically that would hide the deleter if the user specifies a 
> default-deleter that just happens to be compatible, but that seems like an 
> obscure corner case so this seems "good enough").

Personally I think if there is the pointer (and `sizeof(std::unique_ptr == 16`) there should be the "deleter =" specified even if it is default 
deleter. So I rather disagree with your patch. But whetever, it would be nice 
to finally fix it for the last stable Fedora release.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

> Personally I think if there is the pointer (and sizeof(std::unique_ptr YYY> == 16) there should be the "deleter =" specified even if it is default 
> deleter.

I don't think that it can happen that `sizeof(ptr) == 16` with a reasonable 
unique_ptr/default_delete implementation, but I think in theory it could be 
possible.

But anyway, after some offline discussion with @jankratochvil  the consensus 
was:

- We should hide the deleter if it's stateless (default_delete or a 
user-specified deleter that is empty) as the less verbose output is more useful 
for command line users.
- Users that care about the (user-specified) empty deleter (or the default 
deleter) can always inspect the type via the template argument. That anyway has 
to happen via the SB API and the ValueObject doesn't provide a great benefit 
there.

So this patch LGTM, but please update the update comment when landing to 
something like:

  // Add a 'deleter' child if there was a non-empty deleter type specified.
  // 
  // The object might have size=1 in the TypeSystem but occupies no dedicated 
storage due
  // to no_unique_address, so infer the actual size from the total size of the 
unique_ptr class.
  // If sizeof(unique_ptr) == sizeof(void*) then the deleter is empty and 
should be hidden.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

In D104283#2818897 , @teemperor wrote:

> - We should hide the deleter if it's stateless (default_delete or a 
> user-specified deleter that is empty) as the less verbose output is more 
> useful for command line users.

My point of view is to rather more closely show what is physically stored in 
the unique_ptr.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

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


[Lldb-commits] [lldb] fffb975 - [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via lldb-commits

Author: Jan Kratochvil
Date: 2021-06-15T11:19:20+02:00
New Revision: fffb975095119adb5f91be4e3c83ac0cb4b1602c

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

LOG: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite 
TestDataFormatterStdUniquePtr.py

libstdc++ since version 11 has a conditional compilation based on
[[no_unique_address]] availability whether one element is either
inherited or put there as a field with [[no_unique_address]].

The code comment is by teemperor.

Reviewed By: teemperor

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

Added: 


Modified: 
lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp 
b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
index 0b34b4e2fc899..79e864a2cbd5e 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,17 @@ bool LibStdcppUniquePtrSyntheticFrontEnd::Update() {
   if (ptr_obj)
 m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
 
-  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (del_obj)
-m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  // Add a 'deleter' child if there was a non-empty deleter type specified.
+  //
+  // The object might have size=1 in the TypeSystem but occupies no dedicated
+  // storage due to no_unique_address, so infer the actual size from the total
+  // size of the unique_ptr class. If sizeof(unique_ptr) == sizeof(void*) then
+  // the deleter is empty and should be hidden.
+  if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+if (del_obj)
+  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  }
 
   if (m_ptr_obj) {
 Status error;



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


[Lldb-commits] [PATCH] D104283: [lldb] Fix libstdc++ 11's std::unique_ptr affecting LLDB testsuite TestDataFormatterStdUniquePtr.py

2021-06-15 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGfffb97509511: [lldb] Fix libstdc++ 11's std::unique_ptr 
affecting LLDB testsuite… (authored by jankratochvil).

Changed prior to commit:
  https://reviews.llvm.org/D104283?vs=352053&id=352076#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104283

Files:
  lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp


Index: lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,17 @@
   if (ptr_obj)
 m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
 
-  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (del_obj)
-m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  // Add a 'deleter' child if there was a non-empty deleter type specified.
+  //
+  // The object might have size=1 in the TypeSystem but occupies no dedicated
+  // storage due to no_unique_address, so infer the actual size from the total
+  // size of the unique_ptr class. If sizeof(unique_ptr) == sizeof(void*) then
+  // the deleter is empty and should be hidden.
+  if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+if (del_obj)
+  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  }
 
   if (m_ptr_obj) {
 Status error;


Index: lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
===
--- lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ lldb/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -99,9 +99,17 @@
   if (ptr_obj)
 m_ptr_obj = ptr_obj->Clone(ConstString("pointer")).get();
 
-  ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
-  if (del_obj)
-m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  // Add a 'deleter' child if there was a non-empty deleter type specified.
+  //
+  // The object might have size=1 in the TypeSystem but occupies no dedicated
+  // storage due to no_unique_address, so infer the actual size from the total
+  // size of the unique_ptr class. If sizeof(unique_ptr) == sizeof(void*) then
+  // the deleter is empty and should be hidden.
+  if (tuple_sp->GetByteSize() > ptr_obj->GetByteSize()) {
+ValueObjectSP del_obj = tuple_frontend->GetChildAtIndex(1);
+if (del_obj)
+  m_del_obj = del_obj->Clone(ConstString("deleter")).get();
+  }
 
   if (m_ptr_obj) {
 Status error;
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D103575: Allow signposts to take advantage of deferred string substitution

2021-06-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

In D103575#2818340 , 
@stella.stamenova wrote:

> The Windows buildbot does not like signposts:
>
> https://lab.llvm.org/buildbot/#/builders/83/builds/7271



  
C:\PROGRA~2\MICROS~3\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe
  /nologo /TP -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS 
-D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_HAS_EXCEPTIONS=0 
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
-Itools\lldb\source\Utility 
-IC:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\source\Utility 
-Itools\lldb\source 
-IC:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include 
-Itools\lldb\include -Iinclude 
-IC:\buildbot\lldb-x64-windows-ninja\llvm-project\llvm\include -I"C:\Program 
Files (x86)\Microsoft Visual Studio\Shared\Python36_64\include" 
-IC:\buildbot\lldb-x64-windows-ninja\llvm-project\llvm\..\clang\include 
-Itools\lldb\..\clang\include 
-IC:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\source\. /DWIN32 
/D_WINDOWS   /Zc:inline /Zc:__cplusplus /Zc:strictStrings /Oi /Zc:rvalueCast 
/bigobj /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 
-wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 
-wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 
-wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /MD 
/O2 /Ob2 /DNDEBUG   -wd4018 -wd4068 -wd4150 -wd4201 -wd4251 -wd4521 -wd4530  
/EHs-c- /GR- -std:c++14 /showIncludes 
/Fotools\lldb\source\Utility\CMakeFiles\lldbUtility.dir\Timer.cpp.obj 
/Fdtools\lldb\source\Utility\CMakeFiles\lldbUtility.dir\lldbUtility.pdb /FS -c 
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\source\Utility\Timer.cpp
  
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include\lldb/Utility/Timer.h(49):
 error C3646: '__attribute__': unknown override specifier
  
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include\lldb/Utility/Timer.h(49):
 error C2059: syntax error: '('
  
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include\lldb/Utility/Timer.h(50):
 error C2059: syntax error: '('
  
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include\lldb/Utility/Timer.h(53):
 error C2143: syntax error: missing ')' before ';'
  
C:\buildbot\lldb-x64-windows-ninja\llvm-project\lldb\include\lldb/Utility/Timer.h(53):
 error C2059: syntax error: ')'

Looks like it's the attribute that it doesn't know about:

  /// Default constructor.
  Timer(Category &category, const char *format, ...)
  __attribute__((format(printf, 3, 4)));


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103575

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


[Lldb-commits] [PATCH] D103575: Allow signposts to take advantage of deferred string substitution

2021-06-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

which is weird because I didn't actually change that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103575

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


[Lldb-commits] [lldb] 073e7a0 - Work around MSVC compiler intricacies.

2021-06-15 Thread Adrian Prantl via lldb-commits

Author: Adrian Prantl
Date: 2021-06-15T08:17:56-07:00
New Revision: 073e7a08e83ab61198e6b9e106369e876a5b7509

URL: 
https://github.com/llvm/llvm-project/commit/073e7a08e83ab61198e6b9e106369e876a5b7509
DIFF: 
https://github.com/llvm/llvm-project/commit/073e7a08e83ab61198e6b9e106369e876a5b7509.diff

LOG: Work around MSVC compiler intricacies.

Added: 


Modified: 
lldb/include/lldb/Utility/Timer.h

Removed: 




diff  --git a/lldb/include/lldb/Utility/Timer.h 
b/lldb/include/lldb/Utility/Timer.h
index ae30e719aa41..4696a80319a9 100644
--- a/lldb/include/lldb/Utility/Timer.h
+++ b/lldb/include/lldb/Utility/Timer.h
@@ -47,7 +47,11 @@ class Timer {
 
   /// Default constructor.
   Timer(Category &category, const char *format, ...)
-  __attribute__((format(printf, 3, 4)));
+#if !defined(_MSC_VER)
+  // MSVC appears to have trouble recognizing the this argument in the 
constructor.
+  __attribute__((format(printf, 3, 4)))
+#endif
+;
 
   /// Destructor
   ~Timer();



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


[Lldb-commits] [PATCH] D103575: Allow signposts to take advantage of deferred string substitution

2021-06-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

I tried to work around it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103575

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


[Lldb-commits] [PATCH] D104307: [lldb] Remove SBHostOS threading functionality

2021-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: LLDB.
Herald added a subscriber: krytarowski.
teemperor requested review of this revision.

Follow up patch for D104231  which deprecates 
this in the SB API.

This removes the threading functionality that just exists for the sake of 
implementing the SBHostOS threading framework.


https://reviews.llvm.org/D104307

Files:
  lldb/include/lldb/Host/HostNativeThreadBase.h
  lldb/include/lldb/Host/HostThread.h
  lldb/include/lldb/Host/posix/HostThreadPosix.h
  lldb/include/lldb/Host/windows/HostThreadWindows.h
  lldb/source/API/SBHostOS.cpp
  lldb/source/Host/common/HostThread.cpp
  lldb/source/Host/posix/HostThreadPosix.cpp
  lldb/source/Host/windows/HostThreadWindows.cpp

Index: lldb/source/Host/windows/HostThreadWindows.cpp
===
--- lldb/source/Host/windows/HostThreadWindows.cpp
+++ lldb/source/Host/windows/HostThreadWindows.cpp
@@ -50,14 +50,6 @@
   return error;
 }
 
-Status HostThreadWindows::Cancel() {
-  Status error;
-
-  DWORD result = ::QueueUserAPC(::ExitThreadProxy, m_thread, 0);
-  error.SetError(result, eErrorTypeWin32);
-  return error;
-}
-
 lldb::tid_t HostThreadWindows::GetThreadId() const {
   return ::GetThreadId(m_thread);
 }
Index: lldb/source/Host/posix/HostThreadPosix.cpp
===
--- lldb/source/Host/posix/HostThreadPosix.cpp
+++ lldb/source/Host/posix/HostThreadPosix.cpp
@@ -36,26 +36,3 @@
   Reset();
   return error;
 }
-
-Status HostThreadPosix::Cancel() {
-  Status error;
-  if (IsJoinable()) {
-#ifndef __FreeBSD__
-llvm_unreachable("someone is calling HostThread::Cancel()");
-#else
-int err = ::pthread_cancel(m_thread);
-error.SetError(err, eErrorTypePOSIX);
-#endif
-  }
-  return error;
-}
-
-Status HostThreadPosix::Detach() {
-  Status error;
-  if (IsJoinable()) {
-int err = ::pthread_detach(m_thread);
-error.SetError(err, eErrorTypePOSIX);
-  }
-  Reset();
-  return error;
-}
Index: lldb/source/Host/common/HostThread.cpp
===
--- lldb/source/Host/common/HostThread.cpp
+++ lldb/source/Host/common/HostThread.cpp
@@ -21,8 +21,6 @@
   return m_native_thread->Join(result);
 }
 
-Status HostThread::Cancel() { return m_native_thread->Cancel(); }
-
 void HostThread::Reset() { return m_native_thread->Reset(); }
 
 lldb::thread_t HostThread::Release() { return m_native_thread->Release(); }
Index: lldb/source/API/SBHostOS.cpp
===
--- lldb/source/API/SBHostOS.cpp
+++ lldb/source/API/SBHostOS.cpp
@@ -104,20 +104,10 @@
 lldb::thread_t SBHostOS::ThreadCreate(const char *name,
   lldb::thread_func_t thread_function,
   void *thread_arg, SBError *error_ptr) {
-  LLDB_RECORD_DUMMY(lldb::thread_t, SBHostOS, ThreadCreate,
-(lldb::thread_func_t, void *, SBError *), name,
-thread_function, thread_arg, error_ptr);
-  llvm::Expected thread =
-  ThreadLauncher::LaunchThread(name, thread_function, thread_arg);
-  if (!thread) {
-if (error_ptr)
-  error_ptr->SetError(Status(thread.takeError()));
-else
-  llvm::consumeError(thread.takeError());
-return LLDB_INVALID_HOST_THREAD;
-  }
 
-  return thread->Release();
+  if (error_ptr)
+error_ptr->SetErrorString("ThreadCreate is no longer supported.");
+  return LLDB_INVALID_HOST_THREAD;
 }
 
 void SBHostOS::ThreadCreated(const char *name) {
@@ -130,13 +120,9 @@
 (lldb::thread_t, lldb::SBError *), thread,
 error_ptr);
 
-  Status error;
-  HostThread host_thread(thread);
-  error = host_thread.Cancel();
   if (error_ptr)
-error_ptr->SetError(error);
-  host_thread.Release();
-  return error.Success();
+error_ptr->SetErrorString("ThreadCancel is no longer supported.");
+  return false;
 }
 
 bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) {
@@ -144,18 +130,9 @@
 (lldb::thread_t, lldb::SBError *), thread,
 error_ptr);
 
-  Status error;
-#if defined(_WIN32)
-  if (error_ptr)
-error_ptr->SetErrorString("ThreadDetach is not supported on this platform");
-#else
-  HostThread host_thread(thread);
-  error = host_thread.GetNativeThread().Detach();
   if (error_ptr)
-error_ptr->SetError(error);
-  host_thread.Release();
-#endif
-  return error.Success();
+error_ptr->SetErrorString("ThreadDetach is no longer supported.");
+  return false;
 }
 
 bool SBHostOS::ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result,
@@ -164,14 +141,9 @@
   bool, SBHostOS, ThreadJoin,
   (lldb::thread_t, lldb::thread_result_t *, lldb::SBError *), thread,
   result, error_ptr);
-
-  Status error;
-  HostThread host_thre

[Lldb-commits] [PATCH] D104281: [lldb][docs] Add reference docs for Lua scripting

2021-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

> In fact, the same idea also occurred to me before. I think it's also 
> achievable by a plugin sphinx-code-tabs.

I like that idea! We do have to give the peopler running the docs bot a heads 
up though that they need to install that plugin, but I can take care of that 
when everyone agrees this is ready to land. Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104281

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


[Lldb-commits] [PATCH] D103500: [trace][intel-pt] Create basic SB API

2021-06-15 Thread walter erquinigo via Phabricator via lldb-commits
wallace added a comment.

ping


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103500

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


[Lldb-commits] [PATCH] D101128: [lldb-vscode] only report long running progress events

2021-06-15 Thread walter erquinigo via Phabricator via lldb-commits
wallace added a comment.

ping


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101128

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


[Lldb-commits] [PATCH] D103588: [trace] Create a top level ThreadTrace class

2021-06-15 Thread walter erquinigo via Phabricator via lldb-commits
wallace added a comment.

I'll redo this in a different patch


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103588

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


[Lldb-commits] [lldb] b856755 - [lldb] Make the ClassTemplateDecl merging logic in TypeSystemClang respect template parameters

2021-06-15 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2021-06-15T19:25:07+02:00
New Revision: b8567559cf3872d0cc2a0ed24a171da8b1ff400f

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

LOG: [lldb] Make the ClassTemplateDecl merging logic in TypeSystemClang respect 
template parameters

DWARF doesn't describe templates itself but only actual template instantiations.
Because of that LLDB has to infer the parameters of the class template
declarations from the actual instantiations when creating the internal Clang AST
from debug info

Because there is no dedicated DIE for the class template, LLDB also creates the
`ClassTemplateDecl` implicitly when parsing a template instantiation. To avoid
creating one ClassTemplateDecls for every instantiation,
`TypeSystemClang::CreateClassTemplateDecl` will check if there is already a
`ClassTemplateDecl` in the requested `DeclContext` and will reuse a found
fitting declaration.

The logic that checks if a found class template fits to an instantiation is
currently just comparing the name of the template. So right now we map
`template struct S;` to an instantiation with the values `S<1, 2,
3>` even though they clearly don't belong together.

This causes crashes later on when for example the Itanium mangler's
`TemplateArgManglingInfo::needExactType` method tries to find fitting the class
template parameter that fits to an instantiation value. In the example above it
will try to find the parameter for the value `2` but will just trigger a
boundary check when retrieving the parameter with index 1 from the class
template.

There are two ways we can end up with an instantiation that doesn't fit to a
class template with the same name:

1. We have two TUs with two templates that have the same name and internal
   linkage.
2. A forward declared template instantiation is emitted by GCC and Clang
   without an empty list of parameter values.

This patch makes the check for whether a class template declaration can be
reused more sophisticated by also comparing whether the parameter values can fit
to the found class template. If we can't find a fitting class template we
justcreate a second class template with the fitting parameters.

Fixes rdar://76592821

Reviewed By: kastiglione

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

Added: 
lldb/test/API/lang/cpp/forward-declared-template-specialization/Makefile

lldb/test/API/lang/cpp/forward-declared-template-specialization/TestCppForwardDeclaredTemplateSpecialization.py
lldb/test/API/lang/cpp/forward-declared-template-specialization/main.cpp
lldb/test/API/lang/cpp/incompatible-class-templates/Makefile

lldb/test/API/lang/cpp/incompatible-class-templates/TestCppIncompatibleClassTemplates.py
lldb/test/API/lang/cpp/incompatible-class-templates/main.cpp
lldb/test/API/lang/cpp/incompatible-class-templates/other.cpp

Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
lldb/unittests/Symbol/TestTypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 3ffc5d2870b8a..306573e06250e 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1357,9 +1357,11 @@ CompilerType TypeSystemClang::CreateRecordType(
 }
 
 namespace {
-  bool IsValueParam(const clang::TemplateArgument &argument) {
-return argument.getKind() == TemplateArgument::Integral;
-  }
+/// Returns true iff the given TemplateArgument should be represented as an
+/// NonTypeTemplateParmDecl in the AST.
+bool IsValueParam(const clang::TemplateArgument &argument) {
+  return argument.getKind() == TemplateArgument::Integral;
+}
 }
 
 static TemplateParameterList *CreateTemplateParameterList(
@@ -1463,6 +1465,99 @@ void 
TypeSystemClang::CreateFunctionTemplateSpecializationInfo(
template_args_ptr, nullptr);
 }
 
+/// Returns true if the given template parameter can represent the given value.
+/// For example, `typename T` can represent `int` but not integral values such
+/// as `int I = 3`.
+static bool TemplateParameterAllowsValue(NamedDecl *param,
+ const TemplateArgument &value) {
+  if (auto *type_param = llvm::dyn_cast(param)) {
+// Compare the argument kind, i.e. ensure that  != .
+if (value.getKind() != TemplateArgument::Type)
+  return false;
+  } else if (auto *type_param =
+ llvm::dyn_cast(param)) {
+// Compare the argument kind, i.e. ensure that  != .
+if (!IsValueParam(value))
+  return false;
+// Compare the integral type, i.e. ensure that  

[Lldb-commits] [PATCH] D100662: [lldb] Make the ClassTemplateDecl merging logic in TypeSystemClang respect template parameters

2021-06-15 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb8567559cf38: [lldb] Make the ClassTemplateDecl merging 
logic in TypeSystemClang respect… (authored by teemperor).
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100662

Files:
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.h
  lldb/test/API/lang/cpp/forward-declared-template-specialization/Makefile
  
lldb/test/API/lang/cpp/forward-declared-template-specialization/TestCppForwardDeclaredTemplateSpecialization.py
  lldb/test/API/lang/cpp/forward-declared-template-specialization/main.cpp
  lldb/test/API/lang/cpp/incompatible-class-templates/Makefile
  
lldb/test/API/lang/cpp/incompatible-class-templates/TestCppIncompatibleClassTemplates.py
  lldb/test/API/lang/cpp/incompatible-class-templates/main.cpp
  lldb/test/API/lang/cpp/incompatible-class-templates/other.cpp
  lldb/unittests/Symbol/TestTypeSystemClang.cpp

Index: lldb/unittests/Symbol/TestTypeSystemClang.cpp
===
--- lldb/unittests/Symbol/TestTypeSystemClang.cpp
+++ lldb/unittests/Symbol/TestTypeSystemClang.cpp
@@ -515,6 +515,187 @@
   }
 }
 
+class TestCreateClassTemplateDecl : public TestTypeSystemClang {
+protected:
+  /// The class templates created so far by the Expect* functions below.
+  llvm::DenseSet m_created_templates;
+
+  /// Utility function for creating a class template.
+  ClassTemplateDecl *
+  CreateClassTemplate(const TypeSystemClang::TemplateParameterInfos &infos) {
+ClassTemplateDecl *decl = m_ast->CreateClassTemplateDecl(
+m_ast->GetTranslationUnitDecl(), OptionalClangModuleID(), eAccessPublic,
+"foo", TTK_Struct, infos);
+return decl;
+  }
+
+  /// Creates a new class template with the given template parameters.
+  /// Asserts that a new ClassTemplateDecl is created.
+  /// \param description The gtest scope string that should describe the input.
+  /// \param infos The template parameters that the class template should have.
+  /// \returns The created ClassTemplateDecl.
+  ClassTemplateDecl *
+  ExpectNewTemplate(std::string description,
+const TypeSystemClang::TemplateParameterInfos &infos) {
+SCOPED_TRACE(description);
+ClassTemplateDecl *first_template = CreateClassTemplate(infos);
+// A new template should have been created.
+EXPECT_FALSE(m_created_templates.contains(first_template))
+<< "Didn't create new class template but reused this existing decl:\n"
+<< ClangUtil::DumpDecl(first_template);
+m_created_templates.insert(first_template);
+
+// Creating a new template with the same arguments should always return
+// the template created above.
+ClassTemplateDecl *second_template = CreateClassTemplate(infos);
+EXPECT_EQ(first_template, second_template)
+<< "Second attempt to create class template didn't reuse first decl:\n"
+<< ClangUtil::DumpDecl(first_template) << "\nInstead created/reused:\n"
+<< ClangUtil::DumpDecl(second_template);
+return first_template;
+  }
+
+  /// Tries to create a new class template but asserts that an existing class
+  /// template in the current AST is reused (in contract so a new class
+  /// template being created).
+  /// \param description The gtest scope string that should describe the input.
+  /// \param infos The template parameters that the class template should have.
+  void
+  ExpectReusedTemplate(std::string description,
+   const TypeSystemClang::TemplateParameterInfos &infos,
+   ClassTemplateDecl *expected) {
+SCOPED_TRACE(description);
+ClassTemplateDecl *td = CreateClassTemplate(infos);
+EXPECT_EQ(td, expected)
+<< "Created/reused class template is:\n"
+<< ClangUtil::DumpDecl(td) << "\nExpected to reuse:\n"
+<< ClangUtil::DumpDecl(expected);
+  }
+};
+
+TEST_F(TestCreateClassTemplateDecl, FindExistingTemplates) {
+  // This tests the logic in TypeSystemClang::CreateClassTemplateDecl that
+  // decides whether an existing ClassTemplateDecl in the AST can be reused.
+  // The behaviour should follow the C++ rules for redeclaring templates
+  // (e.g., parameter names can be changed/omitted.)
+
+  // This describes a class template *instantiation* from which we will infer
+  // the structure of the class template.
+  TypeSystemClang::TemplateParameterInfos infos;
+
+  // Test an empty template parameter list: <>
+  ExpectNewTemplate("<>", infos);
+
+  // Test that  with T = int creates a new template.
+  infos.names = {"T"};
+  infos.args = {TemplateArgument(m_ast->getASTContext().IntTy)};
+  ClassTemplateDecl *single_type_arg = ExpectNewTemplate("", infos);
+
+  // Test that changing t

[Lldb-commits] [lldb] e8f998c - AArch64 Linux and elf-core PAC stack unwinder support

2021-06-15 Thread Muhammad Omair Javaid via lldb-commits

Author: Muhammad Omair Javaid
Date: 2021-06-16T02:09:46+05:00
New Revision: e8f998c0c5edda3d6bad9b70e60975296df3d9fb

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

LOG: AArch64 Linux and elf-core PAC stack unwinder support

This patch builds on D100521 and other related patches to add support
for unwinding stack on AArch64 systems with pointer authentication
feature enabled.

We override FixCodeAddress and FixDataAddress function in ABISysV_arm64
class. We now try to calculate and set code and data masks after reading
data_mask and code_mask registers exposed by AArch64 targets running Linux.

This patch utilizes core file linux-aarch64-pac.core for testing that
LLDB can successfully unwind stack frames in the presence of signed
return address after masking off ignored bits.

This patch also includes a AArch64 Linux native test case to demonstrate
successful back trace calculation in presence of pointer authentication
feature.

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

Added: 
lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.out
lldb/test/API/functionalities/unwind/aarch64_unwind_pac/Makefile

lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
lldb/test/API/functionalities/unwind/aarch64_unwind_pac/main.c

Modified: 
lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py

Removed: 




diff  --git a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp 
b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
index 312b5620262d..16fb38e107c3 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
+++ b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
@@ -787,6 +787,56 @@ lldb::addr_t ABISysV_arm64::FixAddress(addr_t pc, addr_t 
mask) {
   return (pc & pac_sign_extension) ? pc | mask : pc & (~mask);
 }
 
+// Reads code or data address mask for the current Linux process.
+static lldb::addr_t ReadLinuxProcessAddressMask(lldb::ProcessSP process_sp,
+llvm::StringRef reg_name) {
+  // Linux configures user-space virtual addresses with top byte ignored.
+  // We set default value of mask such that top byte is masked out.
+  uint64_t address_mask = ~((1ULL << 56) - 1);
+  // If Pointer Authentication feature is enabled then Linux exposes
+  // PAC data and code mask register. Try reading relevant register
+  // below and merge it with default address mask calculated above.
+  lldb::ThreadSP thread_sp = process_sp->GetThreadList().GetSelectedThread();
+  if (thread_sp) {
+lldb::RegisterContextSP reg_ctx_sp = thread_sp->GetRegisterContext();
+if (reg_ctx_sp) {
+  const RegisterInfo *reg_info =
+  reg_ctx_sp->GetRegisterInfoByName(reg_name, 0);
+  if (reg_info) {
+lldb::addr_t mask_reg_val = reg_ctx_sp->ReadRegisterAsUnsigned(
+reg_info->kinds[eRegisterKindLLDB], LLDB_INVALID_ADDRESS);
+if (mask_reg_val != LLDB_INVALID_ADDRESS)
+  address_mask |= mask_reg_val;
+  }
+}
+  }
+  return address_mask;
+}
+
+lldb::addr_t ABISysV_arm64::FixCodeAddress(lldb::addr_t pc) {
+  if (lldb::ProcessSP process_sp = GetProcessSP()) {
+if (process_sp->GetTarget().GetArchitecture().GetTriple().isOSLinux() &&
+!process_sp->GetCodeAddressMask())
+  process_sp->SetCodeAddressMask(
+  ReadLinuxProcessAddressMask(process_sp, "code_mask"));
+
+return FixAddress(pc, process_sp->GetCodeAddressMask());
+  }
+  return pc;
+}
+
+lldb::addr_t ABISysV_arm64::FixDataAddress(lldb::addr_t pc) {
+  if (lldb::ProcessSP process_sp = GetProcessSP()) {
+if (process_sp->GetTarget().GetArchitecture().GetTriple().isOSLinux() &&
+!process_sp->GetDataAddressMask())
+  process_sp->SetDataAddressMask(
+  ReadLinuxProcessAddressMask(process_sp, "data_mask"));
+
+return FixAddress(pc, process_sp->GetDataAddressMask());
+  }
+  return pc;
+}
+
 void ABISysV_arm64::Initialize() {
   PluginManager::RegisterPlugin(GetPluginNameStatic(),
 "SysV ABI for AArch64 targets", 
CreateInstance);

diff  --git a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h 
b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
index 4c88ee2cb63e..3428a7ad9418 100644
--- a/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
+++ b/lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
@@ -85,6 +85,9 @@ class ABISysV_arm64 : public ABIAArch64 {
 
   uint32_t GetPluginVersion() override;
 
+  lldb::addr_t FixCodeAddress(lldb::addr_t pc) override;
+  lldb::addr_t FixDataAddress(lldb::addr_t pc) override;
+
 protected:
   lldb::ValueObjectSP
   GetReturnValueObjectImpl(lldb_private::Thread &threa

[Lldb-commits] [PATCH] D99944: [LLDB] AArch64 Linux and elf-core PAC stack unwinder support

2021-06-15 Thread Muhammad Omair Javaid via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe8f998c0c5ed: AArch64 Linux and elf-core PAC stack unwinder 
support (authored by omjavaid).

Changed prior to commit:
  https://reviews.llvm.org/D99944?vs=347848&id=352239#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99944

Files:
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.cpp
  lldb/source/Plugins/ABI/AArch64/ABISysV_arm64.h
  lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
  lldb/test/API/functionalities/postmortem/elf-core/linux-aarch64-pac.out
  lldb/test/API/functionalities/unwind/aarch64_unwind_pac/Makefile
  
lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
  lldb/test/API/functionalities/unwind/aarch64_unwind_pac/main.c

Index: lldb/test/API/functionalities/unwind/aarch64_unwind_pac/main.c
===
--- /dev/null
+++ lldb/test/API/functionalities/unwind/aarch64_unwind_pac/main.c
@@ -0,0 +1,24 @@
+// This program makes a multi tier nested function call to test AArch64
+// Pointer Authentication feature.
+
+// To enable PAC return address signing compile with following clang arguments:
+// -march=armv8.3-a -mbranch-protection=pac-ret+leaf
+
+#include 
+
+static void __attribute__((noinline)) func_c(void) {
+  exit(0); // Frame func_c
+}
+
+static void __attribute__((noinline)) func_b(void) {
+  func_c(); // Frame func_b
+}
+
+static void __attribute__((noinline)) func_a(void) {
+  func_b(); // Frame func_a
+}
+
+int main(int argc, char *argv[]) {
+  func_a(); // Frame main
+  return 0;
+}
Index: lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
===
--- /dev/null
+++ lldb/test/API/functionalities/unwind/aarch64_unwind_pac/TestAArch64UnwindPAC.py
@@ -0,0 +1,44 @@
+"""
+Test that we can backtrace correctly when AArch64 PAC is enabled
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class AArch64UnwindPAC(TestBase):
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIf(archs=no_match(["aarch64"]))
+@skipIf(oslist=no_match(['linux']))
+def test(self):
+"""Test that we can backtrace correctly when AArch64 PAC is enabled"""
+self.build()
+
+self.line = line_number('main.c', '// Frame func_c')
+
+exe = self.getBuildArtifact("a.out")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(
+self, "main.c", self.line, num_expected_locations=1)
+self.runCmd("run", RUN_SUCCEEDED)
+self.expect("thread backtrace", STOPPED_DUE_TO_BREAKPOINT,
+substrs=["stop reason = breakpoint 1."])
+
+target = self.dbg.GetSelectedTarget()
+process = target.GetProcess()
+thread = process.GetThreadAtIndex(0)
+
+backtrace = ["func_c", "func_b", "func_a", "main", "__libc_start_main", "_start"]
+self.assertEqual(thread.GetNumFrames(), len(backtrace))
+for frame_idx, frame in enumerate(thread.frames):
+frame = thread.GetFrameAtIndex(frame_idx)
+self.assertTrue(frame)
+self.assertEqual(frame.GetFunctionName(), backtrace[frame_idx])
+			# Check line number for functions in main.c
+if (frame_idx < 4):
+self.assertEqual(frame.GetLineEntry().GetLine(),
+ line_number("main.c", "Frame " + backtrace[frame_idx]))
Index: lldb/test/API/functionalities/unwind/aarch64_unwind_pac/Makefile
===
--- /dev/null
+++ lldb/test/API/functionalities/unwind/aarch64_unwind_pac/Makefile
@@ -0,0 +1,5 @@
+C_SOURCES := main.c
+
+CFLAGS := -g -Os -march=armv8.3-a -mbranch-protection=pac-ret+leaf
+
+include Makefile.rules
Index: lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
===
--- lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -20,6 +20,7 @@
 mydir = TestBase.compute_mydir(__file__)
 
 _aarch64_pid = 37688
+_aarch64_pac_pid = 387
 _i386_pid = 32306
 _x86_64_pid = 32259
 _s390x_pid = 1045
@@ -257,6 +258,18 @@
 
 self.dbg.DeleteTarget(target)
 
+@skipIfLLVMTargetMissing("AArch64")
+def test_aarch64_pac(self):
+"""Test that lldb can unwind stack for AArch64 elf core file with PAC enabled."""
+
+target = self.dbg.CreateTarget("linux-aarch64-pac.out")
+self.assertTrue(ta

lldb-commits@lists.llvm.org

2021-06-15 Thread Jim Ingham via lldb-commits

Author: Jim Ingham
Date: 2021-06-15T14:34:02-07:00
New Revision: cfb96d845a684a5c567823dbe2aa4392937ee979

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

LOG: Convert functions that were returning BreakpointOption * to 
BreakpointOption &.

This is an NFC cleanup.

Many of the API's that returned BreakpointOptions always returned valid ones.
Internally the BreakpointLocations usually have null BreakpointOptions, since 
they
use their owner's options until an option is set specifically on the location.
So the original code used pointers & unique_ptr everywhere for consistency.
But that made the code hard to reason about from the outside.

This patch changes the code so that everywhere an API is guaranteed to
return a non-null BreakpointOption, it returns it as a reference to make
that clear.

It also changes the Breakpoint to hold a BreakpointOption
member where it previously had a UP.  Since we were always filling the UP
in the Breakpoint constructor, having the UP wasn't helping anything.

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

Added: 


Modified: 
lldb/include/lldb/Breakpoint/Breakpoint.h
lldb/include/lldb/Breakpoint/BreakpointLocation.h
lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
lldb/include/lldb/Breakpoint/BreakpointSite.h
lldb/include/lldb/Interpreter/ScriptInterpreter.h
lldb/source/API/SBBreakpoint.cpp
lldb/source/API/SBBreakpointLocation.cpp
lldb/source/API/SBBreakpointName.cpp
lldb/source/Breakpoint/Breakpoint.cpp
lldb/source/Breakpoint/BreakpointLocation.cpp
lldb/source/Breakpoint/BreakpointLocationCollection.cpp
lldb/source/Breakpoint/BreakpointName.cpp
lldb/source/Breakpoint/BreakpointOptions.cpp
lldb/source/Breakpoint/BreakpointSite.cpp
lldb/source/Commands/CommandObjectBreakpoint.cpp
lldb/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/source/Core/IOHandlerCursesGUI.cpp
lldb/source/Interpreter/ScriptInterpreter.cpp
lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/source/Target/StopInfo.cpp

Removed: 




diff  --git a/lldb/include/lldb/Breakpoint/Breakpoint.h 
b/lldb/include/lldb/Breakpoint/Breakpoint.h
index 37710bb33118..f2e2a0d22784 100644
--- a/lldb/include/lldb/Breakpoint/Breakpoint.h
+++ b/lldb/include/lldb/Breakpoint/Breakpoint.h
@@ -481,16 +481,16 @@ class Breakpoint : public 
std::enable_shared_from_this,
   /// Meant to be used by the BreakpointLocation class.
   ///
   /// \return
-  /// A pointer to this breakpoint's BreakpointOptions.
-  BreakpointOptions *GetOptions();
+  /// A reference to this breakpoint's BreakpointOptions.
+  BreakpointOptions &GetOptions();
 
   /// Returns the BreakpointOptions structure set at the breakpoint level.
   ///
   /// Meant to be used by the BreakpointLocation class.
   ///
   /// \return
-  /// A pointer to this breakpoint's BreakpointOptions.
-  const BreakpointOptions *GetOptions() const;
+  /// A reference to this breakpoint's BreakpointOptions.
+  const BreakpointOptions &GetOptions() const;
 
   /// Invoke the callback action when the breakpoint is hit.
   ///
@@ -640,8 +640,7 @@ class Breakpoint : public 
std::enable_shared_from_this,
   // to skip certain breakpoint hits.  For instance, exception breakpoints use
   // this to limit the stop to certain exception classes, while leaving the
   // condition & callback free for user specification.
-  std::unique_ptr
-  m_options_up; // Settable breakpoint options
+  BreakpointOptions m_options; // Settable breakpoint options
   BreakpointLocationList
   m_locations; // The list of locations currently found for this 
breakpoint.
   std::string m_kind_description;

diff  --git a/lldb/include/lldb/Breakpoint/BreakpointLocation.h 
b/lldb/include/lldb/Breakpoint/BreakpointLocation.h
index ca1739161c0c..a6d1232162fc 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointLocation.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointLocation.h
@@ -202,8 +202,8 @@ class BreakpointLocation
   /// hasn't been done already
   ///
   /// \return
-  ///A pointer to the breakpoint options.
-  BreakpointOptions *GetLocationOptions();
+  ///A reference to the breakpoint options.
+  BreakpointOptions &GetLocationOptions();
 
   /// Use this to access breakpoint options from this breakpoint location.
   /// This will return the options that have a setting for the specifi

[Lldb-commits] [PATCH] D104162: NFC Fix the handling of BreakpointOptions - return references to make it clear when you will get a valid object

2021-06-15 Thread Jim Ingham via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcfb96d845a68: Convert functions that were returning 
BreakpointOption * to BreakpointOption &. (authored by jingham).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104162

Files:
  lldb/include/lldb/Breakpoint/Breakpoint.h
  lldb/include/lldb/Breakpoint/BreakpointLocation.h
  lldb/include/lldb/Breakpoint/BreakpointLocationCollection.h
  lldb/include/lldb/Breakpoint/BreakpointSite.h
  lldb/include/lldb/Interpreter/ScriptInterpreter.h
  lldb/source/API/SBBreakpoint.cpp
  lldb/source/API/SBBreakpointLocation.cpp
  lldb/source/API/SBBreakpointName.cpp
  lldb/source/Breakpoint/Breakpoint.cpp
  lldb/source/Breakpoint/BreakpointLocation.cpp
  lldb/source/Breakpoint/BreakpointLocationCollection.cpp
  lldb/source/Breakpoint/BreakpointName.cpp
  lldb/source/Breakpoint/BreakpointOptions.cpp
  lldb/source/Breakpoint/BreakpointSite.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectBreakpointCommand.cpp
  lldb/source/Core/IOHandlerCursesGUI.cpp
  lldb/source/Interpreter/ScriptInterpreter.cpp
  lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
  lldb/source/Target/StopInfo.cpp

Index: lldb/source/Target/StopInfo.cpp
===
--- lldb/source/Target/StopInfo.cpp
+++ lldb/source/Target/StopInfo.cpp
@@ -125,7 +125,7 @@
   BreakpointSiteSP bp_site_sp(
   process_sp->GetBreakpointSiteList().FindByID(m_value));
   if (bp_site_sp)
-return bp_site_sp->ValidForThisThread(&thread);
+return bp_site_sp->ValidForThisThread(thread);
 }
 return false;
   }
@@ -413,7 +413,7 @@
 // The breakpoint site may have many locations associated with it,
 // not all of them valid for this thread.  Skip the ones that
 // aren't:
-if (!bp_loc_sp->ValidForThisThread(thread_sp.get())) {
+if (!bp_loc_sp->ValidForThisThread(*thread_sp)) {
   if (log) {
 LLDB_LOGF(log,
   "Breakpoint %s hit on thread 0x%llx but it was not "
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
@@ -244,7 +244,7 @@
   std::unique_ptr AcquireInterpreterLock() override;
 
   void CollectDataForBreakpointCommandCallback(
-  std::vector &bp_options_vec,
+  std::vector> &bp_options_vec,
   CommandReturnObject &result) override;
 
   void
@@ -252,20 +252,19 @@
   CommandReturnObject &result) override;
 
   /// Set the callback body text into the callback for the breakpoint.
-  Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
+  Status SetBreakpointCommandCallback(BreakpointOptions &bp_options,
   const char *callback_body) override;
 
   Status SetBreakpointCommandCallbackFunction(
-  BreakpointOptions *bp_options,
-  const char *function_name,
+  BreakpointOptions &bp_options, const char *function_name,
   StructuredData::ObjectSP extra_args_sp) override;
 
   /// This one is for deserialization:
   Status SetBreakpointCommandCallback(
-  BreakpointOptions *bp_options,
+  BreakpointOptions &bp_options,
   std::unique_ptr &data_up) override;
 
-  Status SetBreakpointCommandCallback(BreakpointOptions *bp_options,
+  Status SetBreakpointCommandCallback(BreakpointOptions &bp_options,
   const char *command_body_text,
   StructuredData::ObjectSP extra_args_sp,
   bool uses_extra_args);
Index: lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -635,11 +635,10 @@
   case eIOHandlerNone:
 break;
   case eIOHandlerBreakpoint: {
-std::vector *bp_options_vec =
-(std::vector *)io_handler.GetUserData();
-for (auto bp_options : *

[Lldb-commits] [lldb] 479c357 - Missed a Windows use of ValidForThisThread in the changes for

2021-06-15 Thread Jim Ingham via lldb-commits

Author: Jim Ingham
Date: 2021-06-15T15:43:53-07:00
New Revision: 479c3577fb825c0c7933b49ac0dd944c4aae22bf

URL: 
https://github.com/llvm/llvm-project/commit/479c3577fb825c0c7933b49ac0dd944c4aae22bf
DIFF: 
https://github.com/llvm/llvm-project/commit/479c3577fb825c0c7933b49ac0dd944c4aae22bf.diff

LOG: Missed a Windows use of ValidForThisThread in the changes for
cfb96d845a684a5c567823dbe2aa4392937ee979.

Added: 


Modified: 
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp 
b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index 899d090f43a87..03a33548fadd5 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -394,7 +394,7 @@ void ProcessWindows::RefreshStateAfterStop() {
 RegisterContextSP register_context = stop_thread->GetRegisterContext();
 const uint64_t pc = register_context->GetPC();
 BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc));
-if (site && site->ValidForThisThread(stop_thread.get())) {
+if (site && site->ValidForThisThread(*stop_thread)) {
   LLDB_LOG(log,
"Single-stepped onto a breakpoint in process {0} at "
"address {1:x} with breakpoint site {2}",
@@ -449,7 +449,7 @@ void ProcessWindows::RefreshStateAfterStop() {
m_session_data->m_debugger->GetProcess().GetProcessId(), pc,
site->GetID());
 
-  if (site->ValidForThisThread(stop_thread.get())) {
+  if (site->ValidForThisThread(*stop_thread)) {
 LLDB_LOG(log,
  "Breakpoint site {0} is valid for this thread ({1:x}), "
  "creating stop info.",



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


Re: [Lldb-commits] [lldb] 3bea730 - [lldb] Fix compilation with gcc-6.5

2021-06-15 Thread Chandler Carruth via lldb-commits
+Tom Stellard  - Could this get cherry-picked into
12.0.N for the next point release? Without it, LLDB in the 12 release
doesn't build with GCC <= 6.5 which the docs indicate is supposed to work.

On Wed, Mar 31, 2021 at 11:45 PM Pavel Labath via lldb-commits <
lldb-commits@lists.llvm.org> wrote:

>
> Author: Pavel Labath
> Date: 2021-04-01T08:44:50+02:00
> New Revision: 3bea7306e8669f94bacafae68748a9139cfc0b98
>
> URL:
> https://github.com/llvm/llvm-project/commit/3bea7306e8669f94bacafae68748a9139cfc0b98
> DIFF:
> https://github.com/llvm/llvm-project/commit/3bea7306e8669f94bacafae68748a9139cfc0b98.diff
>
> LOG: [lldb] Fix compilation with gcc-6.5
>
> This fixes (works around) two errors with gcc-6.5.
> - in the RegisterContext_x86 files, gcc is unable to synthesize a
>   default constructor -- it thinks it needs to initialize the virtual
>   base class, even though said classes are abstract. I fix that by
>   providing a dummy constructor.
> - In ReproducerInstrumentationTest, it is not able to deduce that the
>   TestingRegistry class is movable (it contains a map of unique
>   pointers). I change the type from Optional to
>   unique_ptr   (copying/moving a polymorphic type is not a very good idea in any
>   case).
>
> Added:
>
>
> Modified:
> lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
> lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
> lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
>
> Removed:
>
>
>
>
> 
> diff  --git
> a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
> b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
> index dfd0106837853..7d5ea575269dc 100644
> --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
> +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.h
> @@ -58,6 +58,12 @@ class NativeRegisterContextLinux
>virtual llvm::Optional GetMmapData() { return llvm::None; }
>
>  protected:
> +  // NB: This constructor is here only because gcc<=6.5 requires a
> virtual base
> +  // class initializer on abstract class (even though it is never used).
> It can
> +  // be deleted once we move to gcc>=7.0.
> +  NativeRegisterContextLinux(NativeThreadProtocol &thread)
> +  : NativeRegisterContextRegisterInfo(thread, nullptr) {}
> +
>lldb::ByteOrder GetByteOrder() const;
>
>virtual Status ReadRegisterRaw(uint32_t reg_index, RegisterValue
> ®_value);
>
> diff  --git
> a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> index c197d70825b4b..bd4b168f4964e 100644
> ---
> a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> +++
> b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
> @@ -292,6 +292,8 @@
> NativeRegisterContextLinux_x86_64::NativeRegisterContextLinux_x86_64(
>  const ArchSpec &target_arch, NativeThreadProtocol &native_thread)
>  : NativeRegisterContextRegisterInfo(
>native_thread, CreateRegisterInfoInterface(target_arch)),
> +  NativeRegisterContextLinux(native_thread),
> +  NativeRegisterContextDBReg_x86(native_thread),
>m_xstate_type(XStateType::Invalid), m_ymm_set(), m_mpx_set(),
>m_reg_info(), m_gpr_x86_64() {
>// Set up data about ranges of valid registers.
>
> diff  --git
> a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
> b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
> index c0c6ce29eab53..a4ed8bfb97eaf 100644
> --- a/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
> +++ b/lldb/source/Plugins/Process/Utility/NativeRegisterContextDBReg_x86.h
> @@ -16,6 +16,12 @@ namespace lldb_private {
>  class NativeRegisterContextDBReg_x86
>  : public virtual NativeRegisterContextRegisterInfo {
>  public:
> +  // NB: This constructor is here only because gcc<=6.5 requires a
> virtual base
> +  // class initializer on abstract class (even though it is never used).
> It can
> +  // be deleted once we move to gcc>=7.0.
> +  NativeRegisterContextDBReg_x86(NativeThreadProtocol &thread)
> +  : NativeRegisterContextRegisterInfo(thread, nullptr) {}
> +
>Status IsWatchpointHit(uint32_t wp_index, bool &is_hit) override;
>
>Status GetWatchpointHitIndex(uint32_t &wp_index,
>
> diff  --git a/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
> b/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
> index e9f6fcf34e17f..ce259c5969e09 100644
> --- a/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
> +++ b/lldb/unittests/Utility/ReproducerInstrumentationTest.cpp
> @@ -50,7 +50,7 @@ class TestingRegistry : public Registry {
>TestingRegistry();
>  };
>
> -static llvm::Optional g_registry;
> +static std::unique_ptr g_registry;
>

[Lldb-commits] [lldb] 80b2da4 - Don't depend on the "run" alias doing shell expanding.

2021-06-15 Thread Jim Ingham via lldb-commits

Author: Jim Ingham
Date: 2021-06-15T16:37:46-07:00
New Revision: 80b2da42d28466341b9512599aac354c178c39f8

URL: 
https://github.com/llvm/llvm-project/commit/80b2da42d28466341b9512599aac354c178c39f8
DIFF: 
https://github.com/llvm/llvm-project/commit/80b2da42d28466341b9512599aac354c178c39f8.diff

LOG: Don't depend on the "run" alias doing shell expanding.
Instead dial it up explicitly.

This test started failing recently and I'm not sure why.  It also
doesn't make sense to me the replacing "run" with "process launch -X 1 --"
should make any difference - run is an alias for the latter.  But
it does pass with the change, and unless we are testing for the exact
run alias, it's better to ask for what we want explicitly.

Added: 


Modified: 
lldb/test/Shell/Host/TestCustomShell.test

Removed: 




diff  --git a/lldb/test/Shell/Host/TestCustomShell.test 
b/lldb/test/Shell/Host/TestCustomShell.test
index 1823d094ea7a1..61094ec67bc27 100644
--- a/lldb/test/Shell/Host/TestCustomShell.test
+++ b/lldb/test/Shell/Host/TestCustomShell.test
@@ -6,8 +6,8 @@
 # XFAIL: system-openbsd
 
 # RUN: %clang_host %S/Inputs/simple.c -g -o %t.out
-# RUN: SHELL=bogus not %lldb %t.out -b -o 'run' 2>&1 | FileCheck %s 
--check-prefix ERROR
-# RUN: env -i %lldb %t.out -b -o 'run' 2>&1 | FileCheck %s
+# RUN: SHELL=bogus not %lldb %t.out -b -o 'process launch -X 1 --' 2>&1 | 
FileCheck %s --check-prefix ERROR
+# RUN: env -i %lldb %t.out -b -o 'process launch -X 1 --' 2>&1 | FileCheck %s
 
 # ERROR: error: shell expansion failed
 # CHECK-NOT: error: shell expansion failed



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


[Lldb-commits] [lldb] ed88e57 - [LLDB] Fix buildbots breakage due to TestGuessLanguage.py

2021-06-15 Thread Chen Zheng via lldb-commits

Author: Chen Zheng
Date: 2021-06-16T05:03:06Z
New Revision: ed88e57f6587ea51d1c106acbdd82a083f746606

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

LOG: [LLDB] Fix buildbots breakage due to TestGuessLanguage.py

Fix LLDB buidbot breakage due to D104291

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

Added: 


Modified: 
lldb/test/API/commands/frame/language/TestGuessLanguage.py

Removed: 




diff  --git a/lldb/test/API/commands/frame/language/TestGuessLanguage.py 
b/lldb/test/API/commands/frame/language/TestGuessLanguage.py
index f20f184e3910b..1adab53a4ebc1 100644
--- a/lldb/test/API/commands/frame/language/TestGuessLanguage.py
+++ b/lldb/test/API/commands/frame/language/TestGuessLanguage.py
@@ -66,7 +66,7 @@ def do_test(self):
 thread = threads[0]
 
 c_frame_language = lldb.eLanguageTypeC99
-cxx_frame_language = lldb.eLanguageTypeC_plus_plus
+cxx_frame_language = lldb.eLanguageTypeC_plus_plus_11
 # gcc emits DW_LANG_C89 even if -std=c99 was specified
 if "gcc" in self.getCompiler():
 c_frame_language = lldb.eLanguageTypeC89



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