[Lldb-commits] [lldb] da9499e - [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114293)

2024-11-08 Thread via lldb-commits

Author: SpencerAbson
Date: 2024-11-08T15:07:05Z
New Revision: da9499ebfb323602c42aeb674571fe89cec20ca6

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

LOG: [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114293)

This patch introduces the amended feature flag for
[FEAT_SVE_AES](https://developer.arm.com/documentation/109697/2024_09/Feature-descriptions/The-Armv9-0-architecture-extension?lang=en#md457-the-armv90-architecture-extension__feat_FEAT_SVE_AES),
'**sve-aes**'. The existing flag associated with this feature,
'sve2-aes' must be retained as an alias of 'sve-aes' and 'sve2' for
backwards compatibility.

The
[ACLE](https://github.com/ARM-software/acle/blob/main/main/acle.md#aes-extension)
documents `__ARM_FEATURE_SVE2_AES`, which was previously defined to 1
when

> there is hardware support for the SVE2 AES (FEAT_SVE_AES) instructions
and if the associated ACLE intrinsics are available.

The front-end has been amended such that it is compatible with +sve2-aes
and +sve2+sve-aes.

Added: 


Modified: 
clang/include/clang/Basic/arm_sve.td
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/AArch64.h
clang/test/CodeGen/aarch64-fmv-dependencies.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c
clang/test/Driver/aarch64-implied-sve-features.c
clang/test/Driver/print-supported-extensions-aarch64.c
clang/test/Preprocessor/aarch64-target-features.c
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp
lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s
llvm/lib/Target/AArch64/AArch64.td
llvm/lib/Target/AArch64/AArch64FMV.td
llvm/lib/Target/AArch64/AArch64Features.td
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll
llvm/test/MC/AArch64/SVE2/aesd.s
llvm/test/MC/AArch64/SVE2/aese.s
llvm/test/MC/AArch64/SVE2/aesimc.s
llvm/test/MC/AArch64/SVE2/aesmc.s
llvm/test/MC/AArch64/SVE2/directive-arch-negative.s
llvm/test/MC/AArch64/SVE2/directive-arch.s
llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s
llvm/test/MC/AArch64/SVE2/directive-arch_extension.s
llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s
llvm/test/MC/AArch64/SVE2/directive-cpu.s
llvm/test/MC/AArch64/SVE2/pmullb-128.s
llvm/test/MC/AArch64/SVE2/pmullt-128.s
llvm/unittests/TargetParser/TargetParserTest.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index 90b1ec242e6bae..b4bc4b7f61c347 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;

diff  --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index e35ee2b7b9c385..3fd43373cab445 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVE2AES)
+  if (HasSVE2 && HasSVEAES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && 

[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread via lldb-commits

https://github.com/SpencerAbson closed 
https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)

2024-11-08 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

I remember that when lldb-dap was being brought up, the breakpoint structs were 
very simple, but they have become non-trivial at this point, so I second the 
idea of turning them into proper classes with better data encapsulation.

https://github.com/llvm/llvm-project/pull/115208
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/115500

>From 4858c858724b3b1047dec4f3d7dd00e672dfdb41 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 8 Nov 2024 07:39:01 -0800
Subject: [PATCH 1/2] [lldb] Support both Lua 5.3 and Lua 5.4

Lua 5.3 and Lua 5.4 are similar enough that we can easily support both
in LLDB. This patch adds support for building LLDB with both and updates
the documentation accordingly.
---
 lldb/CMakeLists.txt |  3 +--
 lldb/cmake/modules/FindLuaAndSwig.cmake | 16 ++--
 lldb/docs/resources/build.rst   |  2 +-
 lldb/test/API/lit.site.cfg.py.in|  2 +-
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 5827e04b5662f3..20fbb57d62e69a 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -87,8 +87,7 @@ if (LLDB_ENABLE_PYTHON)
 endif ()
 
 if (LLDB_ENABLE_LUA)
-  find_program(Lua_EXECUTABLE lua5.3)
-  set(LLDB_LUA_DEFAULT_RELATIVE_PATH "lib/lua/5.3")
+  set(LLDB_LUA_DEFAULT_RELATIVE_PATH 
"lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
   set(LLDB_LUA_RELATIVE_PATH ${LLDB_LUA_DEFAULT_RELATIVE_PATH}
 CACHE STRING "Path where Lua modules are installed, relative to install 
prefix")
 endif ()
diff --git a/lldb/cmake/modules/FindLuaAndSwig.cmake 
b/lldb/cmake/modules/FindLuaAndSwig.cmake
index 11548b76f843f0..33fadb2a097407 100644
--- a/lldb/cmake/modules/FindLuaAndSwig.cmake
+++ b/lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -8,11 +8,21 @@ if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND LLDB_ENABLE_SWIG)
   set(LUAANDSWIG_FOUND TRUE)
 else()
   if (LLDB_ENABLE_SWIG)
-find_package(Lua 5.3 EXACT)
+find_package(Lua 5.3)
 if(LUA_FOUND)
+  # Find the Lua executable. Only required to run a subset of the Lua
+  # tests.
+  find_program(LUA_EXECUTABLE
+NAMES
+"lua"
+"lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+  )
   mark_as_advanced(
 LUA_LIBRARIES
-LUA_INCLUDE_DIR)
+LUA_INCLUDE_DIR
+LUA_VERSION_MINOR
+LUA_VERSION_MAJOR
+LUA_EXECUTABLE)
 endif()
   else()
 message(STATUS "SWIG 4 or later is required for Lua support in LLDB but 
could not be found")
@@ -26,5 +36,7 @@ else()
 REQUIRED_VARS
   LUA_LIBRARIES
   LUA_INCLUDE_DIR
+  LUA_VERSION_MINOR
+  LUA_VERSION_MAJOR
   LLDB_ENABLE_SWIG)
 endif()
diff --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index 33b6a6f79def4b..66db84522bff1f 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -64,7 +64,7 @@ CMake configuration error.
 
+---+--+--+
 | Python| Python scripting | 
``LLDB_ENABLE_PYTHON``   |
 
+---+--+--+
-| Lua   | Lua scripting| 
``LLDB_ENABLE_LUA``  |
+| Lua   | Lua scripting. Lua 5.3 and 5.4 are supported.| 
``LLDB_ENABLE_LUA``  |
 
+---+--+--+
 
 Depending on your platform and package manager, one might run any of the
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index 7dd8ffd2f5cb4c..ff6c705caea96c 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -20,7 +20,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@Python3_EXECUTABLE@"
-config.lua_executable = "@Lua_EXECUTABLE@"
+config.lua_executable = "@LUA_EXECUTABLE@"
 config.lua_test_entry = "TestLuaAPI.py"
 config.dotest_common_args_str = 
lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
 config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")

>From 04eab84c4b9a52cda8d05f29eaa44349365a9880 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 8 Nov 2024 08:45:28 -0800
Subject: [PATCH 2/2] Pass the Lua cpath to TestLuaAPI

---
 lldb/CMakeLists.txt | 6 +++---
 lldb/test/API/lit.site.cfg.py.in| 1 +
 lldb/test/API/lldbtest.py   | 4 ++--
 lldb/test/API/lua_api/TestLuaAPI.py | 5 ++---
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 20fbb57d62e69a..85ba4fde17418a 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -137,12 +137,12 @@ endif()
 
 if (LLDB_ENABLE_LUA)
   if(LLDB_BUILD_FRAMEWORK)
-set(lldb_lua_target_dir 

[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I'm not a fan of how TestLuaAPI.py works today. I think it should be its own 
lit format, without going through `detest.py`. I think that shouldn't be too 
hard, but I'll do that as a follow-up. 

https://github.com/llvm/llvm-project/pull/115500
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti created 
https://github.com/llvm/llvm-project/pull/115551

None

>From cc7dd5f8b51f9ad0379193e9ccaf4049307c9615 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Fri, 8 Nov 2024 14:04:13 -0800
Subject: [PATCH] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX.

---
 lldb/tools/lldb-dap/JSONUtils.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 663ae33ed83170..a7300abae0eac8 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -31,6 +31,7 @@
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBType.h"
 #include "lldb/API/SBValue.h"
+#include "lldb/Host/PosixApi.h" // IWYU pragma: keep
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-types.h"

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


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)


Changes

This should fix https://lab.llvm.org/buildbot/#/builders/141/builds/3722

---
Full diff: https://github.com/llvm/llvm-project/pull/115551.diff


1 Files Affected:

- (modified) lldb/tools/lldb-dap/JSONUtils.cpp (+1) 


``diff
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 663ae33ed83170..a7300abae0eac8 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -31,6 +31,7 @@
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBType.h"
 #include "lldb/API/SBValue.h"
+#include "lldb/Host/PosixApi.h" // IWYU pragma: keep
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-types.h"

``




https://github.com/llvm/llvm-project/pull/115551
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 8d8d9f0 - [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (#115551)

2024-11-08 Thread via lldb-commits

Author: John Harrison
Date: 2024-11-08T14:09:07-08:00
New Revision: 8d8d9f0ece2337d0ce34f464f0ce3d5193460ca4

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

LOG: [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (#115551)

This should fix https://lab.llvm.org/buildbot/#/builders/141/builds/3722

Added: 


Modified: 
lldb/tools/lldb-dap/JSONUtils.cpp

Removed: 




diff  --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index 663ae33ed83170..a7300abae0eac8 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -31,6 +31,7 @@
 #include "lldb/API/SBThread.h"
 #include "lldb/API/SBType.h"
 #include "lldb/API/SBValue.h"
+#include "lldb/Host/PosixApi.h" // IWYU pragma: keep
 #include "lldb/lldb-defines.h"
 #include "lldb/lldb-enumerations.h"
 #include "lldb/lldb-types.h"



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


[Lldb-commits] [lldb] [lldb] Have disassembler show load addresses when using a core file (PR #115453)

2024-11-08 Thread Jason Molenda via lldb-commits

https://github.com/jasonmolenda approved this pull request.

Quick review of the method being modified, this looks fine to me.

https://github.com/llvm/llvm-project/pull/115453
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti ready_for_review 
https://github.com/llvm/llvm-project/pull/115551
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti edited 
https://github.com/llvm/llvm-project/pull/115551
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti closed 
https://github.com/llvm/llvm-project/pull/115551
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Fix lldb-dap build for windows, missing PATH_MAX. (PR #115551)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.


https://github.com/llvm/llvm-project/pull/115551
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

https://github.com/SpencerAbson created 
https://github.com/llvm/llvm-project/pull/115539

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

>From 8d4263cb961fe96d329ca23e090dab25e9b697cb Mon Sep 17 00:00:00 2001
From: SpencerAbson 
Date: Fri, 8 Nov 2024 19:43:36 +
Subject: [PATCH] Revert "[AArch64] Reduce +sve2-aes to an alias of
 +sve-aes+sve2 (#114293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.
---
 clang/include/clang/Basic/arm_sve.td  |  2 +-
 clang/lib/Basic/Targets/AArch64.cpp   | 12 ---
 clang/lib/Basic/Targets/AArch64.h |  2 +-
 clang/test/CodeGen/aarch64-fmv-dependencies.c |  2 +-
 .../aarch64-sve2-intrinsics/acle_sve2_aesd.c  |  8 ++---
 .../aarch64-sve2-intrinsics/acle_sve2_aese.c  |  8 ++---
 .../acle_sve2_aesimc.c|  8 ++---
 .../aarch64-sve2-intrinsics/acle_sve2_aesmc.c |  8 ++---
 .../acle_sve2_pmullb_128.c|  8 ++---
 .../acle_sve2_pmullt_128.c|  8 ++---
 .../Driver/aarch64-implied-sve-features.c |  9 ++---
 .../print-supported-extensions-aarch64.c  |  7 ++--
 .../Preprocessor/aarch64-target-features.c| 12 ---
 .../acle_sve2_aes_bitperm_sha3_sm4.cpp| 32 +-
 .../command-disassemble-aarch64-extensions.s  |  2 +-
 llvm/lib/Target/AArch64/AArch64.td|  2 +-
 llvm/lib/Target/AArch64/AArch64FMV.td |  2 +-
 llvm/lib/Target/AArch64/AArch64Features.td| 11 +++
 llvm/lib/Target/AArch64/AArch64InstrInfo.td   |  4 +--
 .../lib/Target/AArch64/AArch64SVEInstrInfo.td |  2 +-
 .../AArch64/AsmParser/AArch64AsmParser.cpp|  3 +-
 .../CodeGen/AArch64/sve2-intrinsics-crypto.ll |  1 -
 llvm/test/MC/AArch64/SVE2/aesd.s  | 10 +++---
 llvm/test/MC/AArch64/SVE2/aese.s  | 10 +++---
 llvm/test/MC/AArch64/SVE2/aesimc.s| 12 +++
 llvm/test/MC/AArch64/SVE2/aesmc.s | 12 +++
 .../MC/AArch64/SVE2/directive-arch-negative.s |  6 ++--
 llvm/test/MC/AArch64/SVE2/directive-arch.s|  2 +-
 .../SVE2/directive-arch_extension-negative.s  |  6 ++--
 .../AArch64/SVE2/directive-arch_extension.s   |  2 +-
 .../MC/AArch64/SVE2/directive-cpu-negative.s  |  6 ++--
 llvm/test/MC/AArch64/SVE2/directive-cpu.s |  2 +-
 llvm/test/MC/AArch64/SVE2/pmullb-128.s| 10 +++---
 llvm/test/MC/AArch64/SVE2/pmullt-128.s| 10 +++---
 .../TargetParser/TargetParserTest.cpp | 33 +--
 35 files changed, 120 insertions(+), 154 deletions(-)

diff --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES = true;
+  FPU |= SveMode;
+  HasFullFP16 = true;
+  HasSVE2 = true;
+  HasSVE2AES = true;
 }
 if (Feature == "+sve2-sha3") {
   FPU |= NeonMode;
diff --git a/clang/lib/Basic/Targets/AArch64.h 
b/clang/lib/Basic

[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-backend-aarch64

Author: None (SpencerAbson)


Changes

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

---

Patch is 52.30 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/115539.diff


35 Files Affected:

- (modified) clang/include/clang/Basic/arm_sve.td (+1-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+7-5) 
- (modified) clang/lib/Basic/Targets/AArch64.h (+1-1) 
- (modified) clang/test/CodeGen/aarch64-fmv-dependencies.c (+1-1) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c 
(+4-4) 
- (modified) clang/test/Driver/aarch64-implied-sve-features.c (+3-6) 
- (modified) clang/test/Driver/print-supported-extensions-aarch64.c (+3-4) 
- (modified) clang/test/Preprocessor/aarch64-target-features.c (-12) 
- (modified) 
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp 
(+16-16) 
- (modified) lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s 
(+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64FMV.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64Features.td (+4-7) 
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+2-2) 
- (modified) llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1-2) 
- (modified) llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll (-1) 
- (modified) llvm/test/MC/AArch64/SVE2/aesd.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aese.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aesimc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/aesmc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s 
(+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullb-128.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullt-128.s (+5-5) 
- (modified) llvm/unittests/TargetParser/TargetParserTest.cpp (+9-24) 


``diff
diff --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES

[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-clang-driver

Author: None (SpencerAbson)


Changes

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

---

Patch is 52.30 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/115539.diff


35 Files Affected:

- (modified) clang/include/clang/Basic/arm_sve.td (+1-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+7-5) 
- (modified) clang/lib/Basic/Targets/AArch64.h (+1-1) 
- (modified) clang/test/CodeGen/aarch64-fmv-dependencies.c (+1-1) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c 
(+4-4) 
- (modified) clang/test/Driver/aarch64-implied-sve-features.c (+3-6) 
- (modified) clang/test/Driver/print-supported-extensions-aarch64.c (+3-4) 
- (modified) clang/test/Preprocessor/aarch64-target-features.c (-12) 
- (modified) 
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp 
(+16-16) 
- (modified) lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s 
(+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64FMV.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64Features.td (+4-7) 
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+2-2) 
- (modified) llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1-2) 
- (modified) llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll (-1) 
- (modified) llvm/test/MC/AArch64/SVE2/aesd.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aese.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aesimc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/aesmc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s 
(+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullb-128.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullt-128.s (+5-5) 
- (modified) llvm/unittests/TargetParser/TargetParserTest.cpp (+9-24) 


``diff
diff --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES = 

[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: None (SpencerAbson)


Changes

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

---

Patch is 52.30 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/115539.diff


35 Files Affected:

- (modified) clang/include/clang/Basic/arm_sve.td (+1-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+7-5) 
- (modified) clang/lib/Basic/Targets/AArch64.h (+1-1) 
- (modified) clang/test/CodeGen/aarch64-fmv-dependencies.c (+1-1) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c 
(+4-4) 
- (modified) clang/test/Driver/aarch64-implied-sve-features.c (+3-6) 
- (modified) clang/test/Driver/print-supported-extensions-aarch64.c (+3-4) 
- (modified) clang/test/Preprocessor/aarch64-target-features.c (-12) 
- (modified) 
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp 
(+16-16) 
- (modified) lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s 
(+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64FMV.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64Features.td (+4-7) 
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+2-2) 
- (modified) llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1-2) 
- (modified) llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll (-1) 
- (modified) llvm/test/MC/AArch64/SVE2/aesd.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aese.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aesimc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/aesmc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s 
(+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullb-128.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullt-128.s (+5-5) 
- (modified) llvm/unittests/TargetParser/TargetParserTest.cpp (+9-24) 


``diff
diff --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES = true;
+ 

[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: None (SpencerAbson)


Changes

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

---

Patch is 52.30 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/115539.diff


35 Files Affected:

- (modified) clang/include/clang/Basic/arm_sve.td (+1-1) 
- (modified) clang/lib/Basic/Targets/AArch64.cpp (+7-5) 
- (modified) clang/lib/Basic/Targets/AArch64.h (+1-1) 
- (modified) clang/test/CodeGen/aarch64-fmv-dependencies.c (+1-1) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c (+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c 
(+4-4) 
- (modified) clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c 
(+4-4) 
- (modified) clang/test/Driver/aarch64-implied-sve-features.c (+3-6) 
- (modified) clang/test/Driver/print-supported-extensions-aarch64.c (+3-4) 
- (modified) clang/test/Preprocessor/aarch64-target-features.c (-12) 
- (modified) 
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp 
(+16-16) 
- (modified) lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s 
(+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64FMV.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AArch64Features.td (+4-7) 
- (modified) llvm/lib/Target/AArch64/AArch64InstrInfo.td (+2-2) 
- (modified) llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td (+1-1) 
- (modified) llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp (+1-2) 
- (modified) llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll (-1) 
- (modified) llvm/test/MC/AArch64/SVE2/aesd.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aese.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/aesimc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/aesmc.s (+6-6) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s 
(+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-arch_extension.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s (+3-3) 
- (modified) llvm/test/MC/AArch64/SVE2/directive-cpu.s (+1-1) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullb-128.s (+5-5) 
- (modified) llvm/test/MC/AArch64/SVE2/pmullt-128.s (+5-5) 
- (modified) llvm/unittests/TargetParser/TargetParserTest.cpp (+9-24) 


``diff
diff --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;
diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES = true;
+

[Lldb-commits] [lldb] b99d411 - [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (#115208)

2024-11-08 Thread via lldb-commits

Author: John Harrison
Date: 2024-11-08T13:36:25-08:00
New Revision: b99d4112585302cbd01f9b851a04adc6e4fb5218

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

LOG: [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. 
(#115208)

Refactoring breakpoints to not use the `g_dap` reference.

Instead, when a breakpoint is constructed it will be passed a DAP
reference that it should use for its lifetime.

This is part of a larger refactor to remove the global `g_dap` variable
to allow us to create multiple DAP instances.

-

Co-authored-by: Pavel Labath 

Added: 


Modified: 
lldb/tools/lldb-dap/Breakpoint.cpp
lldb/tools/lldb-dap/Breakpoint.h
lldb/tools/lldb-dap/BreakpointBase.cpp
lldb/tools/lldb-dap/BreakpointBase.h
lldb/tools/lldb-dap/DAP.cpp
lldb/tools/lldb-dap/DAPForward.h
lldb/tools/lldb-dap/ExceptionBreakpoint.cpp
lldb/tools/lldb-dap/ExceptionBreakpoint.h
lldb/tools/lldb-dap/FunctionBreakpoint.cpp
lldb/tools/lldb-dap/FunctionBreakpoint.h
lldb/tools/lldb-dap/InstructionBreakpoint.cpp
lldb/tools/lldb-dap/InstructionBreakpoint.h
lldb/tools/lldb-dap/JSONUtils.cpp
lldb/tools/lldb-dap/JSONUtils.h
lldb/tools/lldb-dap/SourceBreakpoint.cpp
lldb/tools/lldb-dap/SourceBreakpoint.h
lldb/tools/lldb-dap/Watchpoint.cpp
lldb/tools/lldb-dap/Watchpoint.h
lldb/tools/lldb-dap/lldb-dap.cpp

Removed: 




diff  --git a/lldb/tools/lldb-dap/Breakpoint.cpp 
b/lldb/tools/lldb-dap/Breakpoint.cpp
index 9ea7a42ca85a1e..b3bfa61595a82c 100644
--- a/lldb/tools/lldb-dap/Breakpoint.cpp
+++ b/lldb/tools/lldb-dap/Breakpoint.cpp
@@ -7,10 +7,15 @@
 
//===--===//
 
 #include "Breakpoint.h"
-#include "DAP.h"
 #include "JSONUtils.h"
+#include "lldb/API/SBAddress.h"
 #include "lldb/API/SBBreakpointLocation.h"
+#include "lldb/API/SBLineEntry.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Support/JSON.h"
+#include 
+#include 
+#include 
 
 using namespace lldb_dap;
 
@@ -51,7 +56,7 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) 
{
 
   if (bp_addr.IsValid()) {
 std::string formatted_addr =
-"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(g_dap.target));
+"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(bp.GetTarget()));
 object.try_emplace("instructionReference", formatted_addr);
 auto line_entry = bp_addr.GetLineEntry();
 const auto line = line_entry.GetLine();

diff  --git a/lldb/tools/lldb-dap/Breakpoint.h 
b/lldb/tools/lldb-dap/Breakpoint.h
index ee9d3736d6190f..a726f27e59ee00 100644
--- a/lldb/tools/lldb-dap/Breakpoint.h
+++ b/lldb/tools/lldb-dap/Breakpoint.h
@@ -10,6 +10,7 @@
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 
 #include "BreakpointBase.h"
+#include "DAPForward.h"
 #include "lldb/API/SBBreakpoint.h"
 
 namespace lldb_dap {
@@ -18,9 +19,8 @@ struct Breakpoint : public BreakpointBase {
   // The LLDB breakpoint associated wit this source breakpoint
   lldb::SBBreakpoint bp;
 
-  Breakpoint() = default;
-  Breakpoint(const llvm::json::Object &obj) : BreakpointBase(obj){};
-  Breakpoint(lldb::SBBreakpoint bp) : bp(bp) {}
+  Breakpoint(DAP &d, const llvm::json::Object &obj) : BreakpointBase(d, obj) {}
+  Breakpoint(DAP &d, lldb::SBBreakpoint bp) : BreakpointBase(d), bp(bp) {}
 
   void SetCondition() override;
   void SetHitCondition() override;

diff  --git a/lldb/tools/lldb-dap/BreakpointBase.cpp 
b/lldb/tools/lldb-dap/BreakpointBase.cpp
index f3cb06a3562d48..1e28c29082a9fc 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.cpp
+++ b/lldb/tools/lldb-dap/BreakpointBase.cpp
@@ -8,11 +8,12 @@
 
 #include "BreakpointBase.h"
 #include "JSONUtils.h"
+#include "llvm/ADT/StringRef.h"
 
 using namespace lldb_dap;
 
-BreakpointBase::BreakpointBase(const llvm::json::Object &obj)
-: condition(std::string(GetString(obj, "condition"))),
+BreakpointBase::BreakpointBase(DAP &d, const llvm::json::Object &obj)
+: dap(d), condition(std::string(GetString(obj, "condition"))),
   hitCondition(std::string(GetString(obj, "hitCondition"))) {}
 
 void BreakpointBase::UpdateBreakpoint(const BreakpointBase &request_bp) {

diff  --git a/lldb/tools/lldb-dap/BreakpointBase.h 
b/lldb/tools/lldb-dap/BreakpointBase.h
index 79301480e0e588..3c248dd1736d07 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.h
+++ b/lldb/tools/lldb-dap/BreakpointBase.h
@@ -9,12 +9,14 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 
-#include "llvm/Support/JSON.h"
+#include "DAPForward.h"
 #include 
 
 namespace lldb_dap {
 
 struct BreakpointBase {
+  // Associated DAP session.
+  DAP &dap;
 
   // An optional expression for conditional breakpoints.
   std::string condition;
@@ -22,8 +24,8 @@ struct B

[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti closed 
https://github.com/llvm/llvm-project/pull/115208
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits

https://github.com/weliveindetail updated 
https://github.com/llvm/llvm-project/pull/115177

From b12300bcd0b801348267a1b2a00e7ee774620099 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Fri, 8 Nov 2024 17:16:20 +0100
Subject: [PATCH] [lldb] Infer MSInheritanceAttr for CXXRecordDecl from DWARF
 on Windows

---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp  | 11 
 .../TypeSystem/Clang/TypeSystemClang.cpp  | 12 +++-
 .../SymbolFile/DWARF/x86/member-pointers.cpp  | 65 +++
 3 files changed, 74 insertions(+), 14 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index a30d898a93cc4d..9676ba27c555fb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -43,6 +43,7 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/Type.h"
+#include "clang/Basic/Specifiers.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Demangle/Demangle.h"
 
@@ -2138,6 +2139,16 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   if (record_decl)
 GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
+  // DWARF doesn't have the attribute, but we can infer the value the same way
+  // as Clang Sema does. It's required to calculate the size of pointers to
+  // member functions of this type.
+  if (m_ast.getASTContext().getTargetInfo().getCXXABI().isMicrosoft()) {
+auto IM = record_decl->calculateInheritanceModel();
+record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
+m_ast.getASTContext(), true, {},
+clang::MSInheritanceAttr::Spelling(IM)));
+  }
+
   // Now parse all contained types inside of the class. We make forward
   // declarations to all classes, but we need the CXXRecordDecl to have decls
   // for all contained types because we don't get asked for them via the
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index f5063175d6e070..9f137d58cbf78f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -2772,7 +2772,17 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 allow_completion);
 
   case clang::Type::MemberPointer:
-return !qual_type.getTypePtr()->isIncompleteType();
+// MS C++ ABI requires type of the class to be complete of which the 
pointee
+// is a member.
+if (ast->getTargetInfo().getCXXABI().isMicrosoft()) {
+  auto *MPT = qual_type.getTypePtr()->castAs();
+  if (MPT->getClass()->isRecordType())
+GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+  allow_completion);
+
+  return !qual_type.getTypePtr()->isIncompleteType();
+}
+break;
 
   default:
 break;
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp 
b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
index c7bd95774d33f7..a12892305798a8 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
@@ -2,23 +2,62 @@
 
 // Itanium ABI:
 // RUN: %clang --target=x86_64-pc-linux -gdwarf -c -o %t_linux.o %s
-// RUN: %lldb -f %t_linux.o -b -o "target variable mp" | FileCheck %s
+// RUN: %lldb -f %t_linux.o -b -o "target variable s1 s2 m1 m2 v1 v2 v3 v4" | 
FileCheck --check-prefix=CHECK-GNU %s
 //
-// CHECK: (char SI::*) mp = 0x
+// CHECK-GNU: (void (Single1::*)()) s1 = 0x
+// CHECK-GNU: (void (Single2::*)()) s2 = 0x
+// CHECK-GNU: (void (Multiple1::*)()) m1 = 0x
+// CHECK-GNU: (void (Multiple2::*)()) m2 = 0x
+// CHECK-GNU: (void (Virtual1::*)()) v1 = 0x
+// CHECK-GNU: (void (Virtual2::*)()) v2 = 0x
+// CHECK-GNU: (void (Virtual3::*)()) v3 = 0x
+// CHECK-GNU: (void (Virtual4::*)()) v4 = 0x
 
 // Microsoft ABI:
-// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj -- %s
-// RUN: lld-link /out:%t_win.exe %t_win.obj /nodefaultlib /entry:main /debug
-// RUN: %lldb -f %t_win.exe -b -o "target variable mp" | FileCheck 
--check-prefix=CHECK-MSVC %s
+// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj /GS- 
-- %s
+// RUN: lld-link /out:%t_win.exe %t_win.obj /entry:main /debug /nodefaultlib
+// RUN: %lldb -f %t_win.exe -b -o "target variable s1 s2 m1 m2 v1 v2 v3 v4" | 
FileCheck --check-prefix=CHECK-MSVC %s
 //
-// DWARF has no representation of MSInheritanceAttr, so we cannot determine 
the size
-// of member-pointers yet. For the moment, make sure we don't cra

[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits

weliveindetail wrote:

Pre-merge checks failed due to an unrelated test error. The one on Windows was 
fine actually, but let me squash and rebase to try this again.

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support overriding the disassembly CPU & features (PR #115382)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/115382

>From b5947cfe8fd7702f801c91f48ca050a5c839a707 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 7 Nov 2024 14:08:50 -0800
Subject: [PATCH 1/4] [lldb] Support overriding the disassembly CPU & features

Add the ability to override the disassembly CPU and CPU features through
a target setting (`target.disassembly-cpu` and
`target.disassembly-features`) and a `disassemble` command option
(`--cpu` and `--features`).

This is especially relevant for architectures like RISC-V which relies
heavily on CPU extensions.

The majority of this patch is plumbing the options through. I recommend
looking at DisassemblerLLVMC and the test for the observable change in
behavior.
---
 lldb/include/lldb/Core/Disassembler.h |  32 +--
 .../Interpreter/CommandOptionArgumentTable.h  |   2 +
 lldb/include/lldb/Target/Target.h |   4 +
 lldb/include/lldb/lldb-enumerations.h |   2 +
 lldb/include/lldb/lldb-private-interfaces.h   |   5 +-
 lldb/source/API/SBFunction.cpp|   4 +-
 lldb/source/API/SBSymbol.cpp  |   4 +-
 lldb/source/API/SBTarget.cpp  |  13 +-
 .../Commands/CommandObjectDisassemble.cpp |  38 ++-
 .../Commands/CommandObjectDisassemble.h   |  14 ++
 lldb/source/Commands/Options.td   |   4 +
 lldb/source/Core/Disassembler.cpp |  42 ++--
 lldb/source/Core/DumpDataExtractor.cpp|   7 +-
 lldb/source/Expression/IRExecutionUnit.cpp|   6 +-
 .../Architecture/Mips/ArchitectureMips.cpp|   2 +-
 .../Disassembler/LLVMC/DisassemblerLLVMC.cpp  | 120 -
 .../Disassembler/LLVMC/DisassemblerLLVMC.h|   8 +-
 .../Windows-DYLD/DynamicLoaderWindowsDYLD.cpp |   2 +-
 .../Process/Utility/StopInfoMachException.cpp |   7 +-
 .../UnwindAssemblyInstEmulation.cpp   |   4 +-
 lldb/source/Symbol/Function.cpp   |   6 +-
 lldb/source/Symbol/Symbol.cpp |   6 +-
 lldb/source/Target/Process.cpp|   5 +-
 lldb/source/Target/StackFrame.cpp |  17 +-
 lldb/source/Target/Target.cpp |  14 ++
 lldb/source/Target/TargetProperties.td|   6 +
 lldb/source/Target/ThreadPlanStepRange.cpp|   6 +-
 lldb/source/Target/ThreadPlanTracer.cpp   |   5 +-
 lldb/source/Target/TraceDumper.cpp|   6 +-
 .../command-disassemble-cpu-features.yaml | 230 ++
 30 files changed, 478 insertions(+), 143 deletions(-)
 create mode 100644 
lldb/test/Shell/Commands/command-disassemble-cpu-features.yaml

diff --git a/lldb/include/lldb/Core/Disassembler.h 
b/lldb/include/lldb/Core/Disassembler.h
index 21969aed03c209..e0ad4316e02497 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -409,35 +409,37 @@ class Disassembler : public 
std::enable_shared_from_this,
   // flavor string gets set wrong. Instead, if you get a flavor string you
   // don't understand, use the default.  Folks who care to check can use the
   // FlavorValidForArchSpec method on the disassembler they got back.
-  static lldb::DisassemblerSP
-  FindPlugin(const ArchSpec &arch, const char *flavor, const char 
*plugin_name);
+  static lldb::DisassemblerSP FindPlugin(const ArchSpec &arch,
+ const char *flavor, const char *cpu,
+ const char *features,
+ const char *plugin_name);
 
   // This version will use the value in the Target settings if flavor is NULL;
-  static lldb::DisassemblerSP FindPluginForTarget(const Target &target,
-  const ArchSpec &arch,
-  const char *flavor,
-  const char *plugin_name);
+  static lldb::DisassemblerSP
+  FindPluginForTarget(const Target &target, const ArchSpec &arch,
+  const char *flavor, const char *cpu, const char 
*features,
+  const char *plugin_name);
 
   struct Limit {
 enum { Bytes, Instructions } kind;
 lldb::addr_t value;
   };
 
-  static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch,
-   const char *plugin_name,
-   const char *flavor,
-   Target &target,
-   const AddressRange 
&disasm_range,
-   bool force_live_memory = false);
+  static lldb::DisassemblerSP
+  DisassembleRange(const ArchSpec &arch, const char *plugin_name,
+   const char *flavor, const char *cpu, const char *features,
+   Target &target, const AddressRange &disasm_range,
+   bool force_live_memory = false);
 
   static lldb::Disass

[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread via lldb-commits

jimingham wrote:

Spell-checkers sometimes reveal hidden truths...

Jim

> On Nov 8, 2024, at 10:52 AM, Pavel Labath ***@***.***> wrote:
> 
> 
> detest.py
> 
> I'm not a fan of how TestLuaAPI.py works today.
> 
> You could even say you detest it. :P
> 
> —
> Reply to this email directly, view it on GitHub 
> , 
> or unsubscribe 
> .
> You are receiving this because you are on a team that was mentioned.
> 



https://github.com/llvm/llvm-project/pull/115500
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I'd say this was a Freudian slip. 

https://github.com/llvm/llvm-project/pull/115500
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Have disassembler show load addresses when using a core file (PR #115453)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere approved this pull request.

Unless there's a reason (that Jason remembers) to do it differently, the new 
behavior makes more sense to me. 

https://github.com/llvm/llvm-project/pull/115453
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits


@@ -78,7 +78,7 @@ def : FMVExtension<"sme2", "FEAT_SME2", "+sme2,+sme,+bf16", 
580>;
 def : FMVExtension<"ssbs", "FEAT_SSBS2", "+ssbs", 490>;
 def : FMVExtension<"sve", "FEAT_SVE", "+sve,+fullfp16,+fp-armv8,+neon", 310>;
 def : FMVExtension<"sve2", "FEAT_SVE2", 
"+sve2,+sve,+fullfp16,+fp-armv8,+neon", 370>;
-def : FMVExtension<"sve2-aes", "FEAT_SVE_PMULL128", 
"+sve2,+sve,+aes,+sve2-aes,+fullfp16,+fp-armv8,+neon", 380>;
+def : FMVExtension<"sve2-aes", "FEAT_SVE_PMULL128", 
"+sve2,+sve,+aes,+sve-aes,+fullfp16,+fp-armv8,+neon", 380>;

labrinea wrote:

This should be changed back. The FMVExtension "sve2-aes" depends on the 
ExtensionWithMArch "sve2-aes". Patches like 
https://github.com/llvm/llvm-project/pull/113281 and 
https://github.com/llvm/llvm-project/pull/87939 rely on it.

https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits


@@ -6,10 +6,10 @@ tbx z0.b, z1.b, z2.b
 // CHECK: error: instruction requires: sve2 or sme
 // CHECK-NEXT: tbx z0.b, z1.b, z2.b
 
-.arch_extension sve2-aes
-.arch_extension nosve2-aes
+.arch_extension sve-aes
+.arch_extension nosve-aes

labrinea wrote:

Here you are replacing the old test instead of adding a new one. Now the 
(no)sve2-aes directives are not tested anywhere. Similarly in other files.

https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits


@@ -365,9 +365,12 @@ def FeatureSVE2 : ExtensionWithMArch<"sve2", "SVE2", 
"FEAT_SVE2",
   "Enable Scalable Vector Extension 2 (SVE2) instructions",
   [FeatureSVE, FeatureUseScalarIncVL]>;
 
-def FeatureSVE2AES : ExtensionWithMArch<"sve2-aes", "SVE2AES",
+def FeatureSVEAES : ExtensionWithMArch<"sve-aes", "SVEAES",
   "FEAT_SVE_AES, FEAT_SVE_PMULL128",
-  "Enable AES SVE2 instructions", [FeatureSVE2, FeatureAES]>;
+  "Enable SVE AES and quadword SVE polynomial multiply instructions", 
[FeatureAES]>;
+
+def AliasSVE2AES : ExtensionWithMArch<"sve2-aes", "ALIAS_SVE2AES", "",

labrinea wrote:

If you read at the definition of ExtensionWithMArch the second argument is used 
to generate the AEK_ field. See inside 
./include/llvm/TargetParser/AArch64TargetParserDef.inc in the build directory. 
We now have this entry:
`{"sve2-aes", {}, AArch64::AEK_ALIAS_SVE2AES, "", "An alias of +sve2+sve-aes", 
"+sve2-aes", "-sve2-aes"},`
I think the ALIAS subexpression has no place in AEK.

https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits

https://github.com/labrinea edited 
https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits

labrinea wrote:

This doesn't seem right. The breaks 
https://github.com/llvm/llvm-project/pull/113281. I can see your commit 
https://github.com/llvm/llvm-project/pull/114293/commits/ec6f646e905c16a161487fea34c7dea09635c150
 which tries to address it. The patch suggests that the FMV feature sve2-aes 
now means sve-aes. @andrewcarlotti do you agree?

https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread Pavel Labath via lldb-commits

labath wrote:

> `detest.py`

> I'm not a fan of how TestLuaAPI.py works today.

You could even say you detest it. :P

https://github.com/llvm/llvm-project/pull/115500
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits

https://github.com/labrinea approved this pull request.


https://github.com/llvm/llvm-project/pull/115539
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread Alexandros Lamprineas via lldb-commits


@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)

labrinea wrote:

sve2-pmull128 does not exist, this function and the one below need cleanup

https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (PR #115539)

2024-11-08 Thread via lldb-commits

https://github.com/SpencerAbson closed 
https://github.com/llvm/llvm-project/pull/115539
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] bbcd352 - Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… (#115539)

2024-11-08 Thread via lldb-commits

Author: SpencerAbson
Date: 2024-11-08T20:19:31Z
New Revision: bbcd35270ef4597402b924d547d845893e7fd165

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

LOG: Revert "[AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (#114… 
(#115539)

…293)"

This reverts commit da9499ebfb323602c42aeb674571fe89cec20ca6.

Added: 


Modified: 
clang/include/clang/Basic/arm_sve.td
clang/lib/Basic/Targets/AArch64.cpp
clang/lib/Basic/Targets/AArch64.h
clang/test/CodeGen/aarch64-fmv-dependencies.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesd.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aese.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesimc.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_aesmc.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullb_128.c
clang/test/CodeGen/aarch64-sve2-intrinsics/acle_sve2_pmullt_128.c
clang/test/Driver/aarch64-implied-sve-features.c
clang/test/Driver/print-supported-extensions-aarch64.c
clang/test/Preprocessor/aarch64-target-features.c
clang/test/Sema/aarch64-sve2-intrinsics/acle_sve2_aes_bitperm_sha3_sm4.cpp
lldb/test/Shell/Commands/command-disassemble-aarch64-extensions.s
llvm/lib/Target/AArch64/AArch64.td
llvm/lib/Target/AArch64/AArch64FMV.td
llvm/lib/Target/AArch64/AArch64Features.td
llvm/lib/Target/AArch64/AArch64InstrInfo.td
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
llvm/test/CodeGen/AArch64/sve2-intrinsics-crypto.ll
llvm/test/MC/AArch64/SVE2/aesd.s
llvm/test/MC/AArch64/SVE2/aese.s
llvm/test/MC/AArch64/SVE2/aesimc.s
llvm/test/MC/AArch64/SVE2/aesmc.s
llvm/test/MC/AArch64/SVE2/directive-arch-negative.s
llvm/test/MC/AArch64/SVE2/directive-arch.s
llvm/test/MC/AArch64/SVE2/directive-arch_extension-negative.s
llvm/test/MC/AArch64/SVE2/directive-arch_extension.s
llvm/test/MC/AArch64/SVE2/directive-cpu-negative.s
llvm/test/MC/AArch64/SVE2/directive-cpu.s
llvm/test/MC/AArch64/SVE2/pmullb-128.s
llvm/test/MC/AArch64/SVE2/pmullt-128.s
llvm/unittests/TargetParser/TargetParserTest.cpp

Removed: 




diff  --git a/clang/include/clang/Basic/arm_sve.td 
b/clang/include/clang/Basic/arm_sve.td
index b4bc4b7f61c347..90b1ec242e6bae 100644
--- a/clang/include/clang/Basic/arm_sve.td
+++ b/clang/include/clang/Basic/arm_sve.td
@@ -1962,7 +1962,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = 
"sme2,lut,bf16" in {
 

 // SVE2 - Optional
 
-let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
+let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
 def SVAESD   : SInst<"svaesd[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aesd", [IsOverloadNone]>;
 def SVAESIMC : SInst<"svaesimc[_{d}]", "dd",  "Uc", MergeNone, 
"aarch64_sve_aesimc", [IsOverloadNone]>;
 def SVAESE   : SInst<"svaese[_{d}]",   "ddd", "Uc", MergeNone, 
"aarch64_sve_aese", [IsOverloadNone]>;

diff  --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3fd43373cab445..e35ee2b7b9c385 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVEAES)
+  if (HasSVE2 && HasSVE2AES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,10 +861,12 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
-if (Feature == "+sve-aes") {
+if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
-  HasAES = true;
-  HasSVEAES = true;
+  FPU |= SveMode;
+  HasFullFP16 = true;
+  HasSVE2 = true;
+  HasSVE2AES = true;
 }
 if (Feature == "+sve2-sha3") {
   FPU |= NeonMode;

diff  --git a/clang/lib/Basic/Targets/AArch64.h 
b/clang/lib/Basic/Targets/AArch64.h
index 4c25bdb5bb16df..ea3e4015d84265 100644
--- a/clang/lib/Basic/Targets/AArch64.h
+++ b/cla

[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang edited 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Adrian Vogelsgesang via lldb-commits

https://github.com/vogelsgesang approved this pull request.


https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Adrian Vogelsgesang via lldb-commits


@@ -154,7 +154,7 @@ DecodeMemoryReference(llvm::StringRef memoryReference) {
 std::vector GetStrings(const llvm::json::Object *obj,
 llvm::StringRef key) {
   std::vector strs;
-  auto json_array = obj->getArray(key);
+  const auto *json_array = obj->getArray(key);

vogelsgesang wrote:

ah, you are using clang-tidy? I always always get those warnings 😄 

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits


@@ -1465,11 +1462,7 @@ CreateRunInTerminalReverseRequest(const 
llvm::json::Object &launch_request,
 llvm::StringRef key = envs.GetNameAtIndex(index);
 llvm::StringRef value = envs.GetValueAtIndex(index);
 
-if (key.empty())
-  g_dap.SendOutput(OutputType::Stderr,
-   "empty environment variable for value: \"" +
-   value.str() + '\"');
-else

ashgti wrote:

Ah, your right, I mixed that up. Trying to set an empty key in lldb produces:

```
(lldb) settings set target.env-vars =1
error: empty dictionary key
```

However, if I have `"env": ["=123"],` in my launch.json I do end up with the 
empty "" being set at runtime, at least on macOS, which is kinda of wild that 
it works.

```
(vsocde-repl) `expr (char*)getenv("")
(lldb) expr (char*)getenv("")
(char *) $0 = 0x00016fdff65f "123"
```

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Adrian Vogelsgesang via lldb-commits


@@ -1465,11 +1462,7 @@ CreateRunInTerminalReverseRequest(const 
llvm::json::Object &launch_request,
 llvm::StringRef key = envs.GetNameAtIndex(index);
 llvm::StringRef value = envs.GetValueAtIndex(index);
 
-if (key.empty())
-  g_dap.SendOutput(OutputType::Stderr,
-   "empty environment variable for value: \"" +
-   value.str() + '\"');
-else

vogelsgesang wrote:

> In lldb I can use `settings set target.env-vars FOO=` [...]

Note that this warning warns about `key.empty()`, not `value.empty()`, i.e. for 
`=FOO` and not `FOO=`.

That being said, I am also not sure how much value this warning provides

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits


@@ -154,7 +154,7 @@ DecodeMemoryReference(llvm::StringRef memoryReference) {
 std::vector GetStrings(const llvm::json::Object *obj,
 llvm::StringRef key) {
   std::vector strs;
-  auto json_array = obj->getArray(key);
+  const auto *json_array = obj->getArray(key);

ashgti wrote:

Yea, trying to fix those as I work on refactoring `g_dap`.

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Use heterogenous lookups with std::map (NFC) (PR #115590)

2024-11-08 Thread Kazu Hirata via lldb-commits

https://github.com/kazutakahirata created 
https://github.com/llvm/llvm-project/pull/115590

Heterogenous lookups allow us to call find with StringRef, avoiding a
temporary heap allocation of std::string.


>From 1ae19de089b41bda586403d6379e6f644654e4ba Mon Sep 17 00:00:00 2001
From: Kazu Hirata 
Date: Fri, 8 Nov 2024 07:46:06 -0800
Subject: [PATCH] [lldb-dap] Use heterogenous lookups with std::map (NFC)

Heterogenous lookups allow us to call find with StringRef, avoiding a
temporary heap allocation of std::string.
---
 lldb/tools/lldb-dap/DAP.cpp | 2 +-
 lldb/tools/lldb-dap/DAP.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index 647e28080b6339..e45f9bf359e5bf 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -692,7 +692,7 @@ bool DAP::HandleObject(const llvm::json::Object &object) {
   const auto packet_type = GetString(object, "type");
   if (packet_type == "request") {
 const auto command = GetString(object, "command");
-auto handler_pos = request_handlers.find(std::string(command));
+auto handler_pos = request_handlers.find(command);
 if (handler_pos != request_handlers.end()) {
   handler_pos->second(object);
   return true; // Success
diff --git a/lldb/tools/lldb-dap/DAP.h b/lldb/tools/lldb-dap/DAP.h
index dab4ce44ab202c..1641a58c7dbd06 100644
--- a/lldb/tools/lldb-dap/DAP.h
+++ b/lldb/tools/lldb-dap/DAP.h
@@ -171,7 +171,7 @@ struct DAP {
   // the old process here so we can detect this case and keep running.
   lldb::pid_t restarting_process_id;
   bool configuration_done_sent;
-  std::map request_handlers;
+  std::map> request_handlers;
   bool waiting_for_run_in_terminal;
   ProgressEventReporter progress_event_reporter;
   // Keep track of the last stop thread index IDs as threads won't go away

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


[Lldb-commits] [lldb] [lldb-dap] Use heterogenous lookups with std::map (NFC) (PR #115590)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Kazu Hirata (kazutakahirata)


Changes

Heterogenous lookups allow us to call find with StringRef, avoiding a
temporary heap allocation of std::string.


---
Full diff: https://github.com/llvm/llvm-project/pull/115590.diff


2 Files Affected:

- (modified) lldb/tools/lldb-dap/DAP.cpp (+1-1) 
- (modified) lldb/tools/lldb-dap/DAP.h (+1-1) 


``diff
diff --git a/lldb/tools/lldb-dap/DAP.cpp b/lldb/tools/lldb-dap/DAP.cpp
index 647e28080b6339..e45f9bf359e5bf 100644
--- a/lldb/tools/lldb-dap/DAP.cpp
+++ b/lldb/tools/lldb-dap/DAP.cpp
@@ -692,7 +692,7 @@ bool DAP::HandleObject(const llvm::json::Object &object) {
   const auto packet_type = GetString(object, "type");
   if (packet_type == "request") {
 const auto command = GetString(object, "command");
-auto handler_pos = request_handlers.find(std::string(command));
+auto handler_pos = request_handlers.find(command);
 if (handler_pos != request_handlers.end()) {
   handler_pos->second(object);
   return true; // Success
diff --git a/lldb/tools/lldb-dap/DAP.h b/lldb/tools/lldb-dap/DAP.h
index dab4ce44ab202c..1641a58c7dbd06 100644
--- a/lldb/tools/lldb-dap/DAP.h
+++ b/lldb/tools/lldb-dap/DAP.h
@@ -171,7 +171,7 @@ struct DAP {
   // the old process here so we can detect this case and keep running.
   lldb::pid_t restarting_process_id;
   bool configuration_done_sent;
-  std::map request_handlers;
+  std::map> request_handlers;
   bool waiting_for_run_in_terminal;
   ProgressEventReporter progress_event_reporter;
   // Keep track of the last stop thread index IDs as threads won't go away

``




https://github.com/llvm/llvm-project/pull/115590
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)


Changes

Lua 5.3 and Lua 5.4 are similar enough that we can easily support both in LLDB. 
This patch adds support for building LLDB with both and updates the 
documentation accordingly.

---
Full diff: https://github.com/llvm/llvm-project/pull/115500.diff


4 Files Affected:

- (modified) lldb/CMakeLists.txt (+1-2) 
- (modified) lldb/cmake/modules/FindLuaAndSwig.cmake (+14-2) 
- (modified) lldb/docs/resources/build.rst (+1-1) 
- (modified) lldb/test/API/lit.site.cfg.py.in (+1-1) 


``diff
diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 5827e04b5662f3..20fbb57d62e69a 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -87,8 +87,7 @@ if (LLDB_ENABLE_PYTHON)
 endif ()
 
 if (LLDB_ENABLE_LUA)
-  find_program(Lua_EXECUTABLE lua5.3)
-  set(LLDB_LUA_DEFAULT_RELATIVE_PATH "lib/lua/5.3")
+  set(LLDB_LUA_DEFAULT_RELATIVE_PATH 
"lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
   set(LLDB_LUA_RELATIVE_PATH ${LLDB_LUA_DEFAULT_RELATIVE_PATH}
 CACHE STRING "Path where Lua modules are installed, relative to install 
prefix")
 endif ()
diff --git a/lldb/cmake/modules/FindLuaAndSwig.cmake 
b/lldb/cmake/modules/FindLuaAndSwig.cmake
index 11548b76f843f0..33fadb2a097407 100644
--- a/lldb/cmake/modules/FindLuaAndSwig.cmake
+++ b/lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -8,11 +8,21 @@ if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND LLDB_ENABLE_SWIG)
   set(LUAANDSWIG_FOUND TRUE)
 else()
   if (LLDB_ENABLE_SWIG)
-find_package(Lua 5.3 EXACT)
+find_package(Lua 5.3)
 if(LUA_FOUND)
+  # Find the Lua executable. Only required to run a subset of the Lua
+  # tests.
+  find_program(LUA_EXECUTABLE
+NAMES
+"lua"
+"lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+  )
   mark_as_advanced(
 LUA_LIBRARIES
-LUA_INCLUDE_DIR)
+LUA_INCLUDE_DIR
+LUA_VERSION_MINOR
+LUA_VERSION_MAJOR
+LUA_EXECUTABLE)
 endif()
   else()
 message(STATUS "SWIG 4 or later is required for Lua support in LLDB but 
could not be found")
@@ -26,5 +36,7 @@ else()
 REQUIRED_VARS
   LUA_LIBRARIES
   LUA_INCLUDE_DIR
+  LUA_VERSION_MINOR
+  LUA_VERSION_MAJOR
   LLDB_ENABLE_SWIG)
 endif()
diff --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index 33b6a6f79def4b..66db84522bff1f 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -64,7 +64,7 @@ CMake configuration error.
 
+---+--+--+
 | Python| Python scripting | 
``LLDB_ENABLE_PYTHON``   |
 
+---+--+--+
-| Lua   | Lua scripting| 
``LLDB_ENABLE_LUA``  |
+| Lua   | Lua scripting. Lua 5.3 and 5.4 are supported.| 
``LLDB_ENABLE_LUA``  |
 
+---+--+--+
 
 Depending on your platform and package manager, one might run any of the
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index 7dd8ffd2f5cb4c..ff6c705caea96c 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -20,7 +20,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@Python3_EXECUTABLE@"
-config.lua_executable = "@Lua_EXECUTABLE@"
+config.lua_executable = "@LUA_EXECUTABLE@"
 config.lua_test_entry = "TestLuaAPI.py"
 config.dotest_common_args_str = 
lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
 config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")

``




https://github.com/llvm/llvm-project/pull/115500
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Support both Lua 5.3 and Lua 5.4 (PR #115500)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/115500

Lua 5.3 and Lua 5.4 are similar enough that we can easily support both in LLDB. 
This patch adds support for building LLDB with both and updates the 
documentation accordingly.

>From 4858c858724b3b1047dec4f3d7dd00e672dfdb41 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 8 Nov 2024 07:39:01 -0800
Subject: [PATCH] [lldb] Support both Lua 5.3 and Lua 5.4

Lua 5.3 and Lua 5.4 are similar enough that we can easily support both
in LLDB. This patch adds support for building LLDB with both and updates
the documentation accordingly.
---
 lldb/CMakeLists.txt |  3 +--
 lldb/cmake/modules/FindLuaAndSwig.cmake | 16 ++--
 lldb/docs/resources/build.rst   |  2 +-
 lldb/test/API/lit.site.cfg.py.in|  2 +-
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index 5827e04b5662f3..20fbb57d62e69a 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -87,8 +87,7 @@ if (LLDB_ENABLE_PYTHON)
 endif ()
 
 if (LLDB_ENABLE_LUA)
-  find_program(Lua_EXECUTABLE lua5.3)
-  set(LLDB_LUA_DEFAULT_RELATIVE_PATH "lib/lua/5.3")
+  set(LLDB_LUA_DEFAULT_RELATIVE_PATH 
"lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}")
   set(LLDB_LUA_RELATIVE_PATH ${LLDB_LUA_DEFAULT_RELATIVE_PATH}
 CACHE STRING "Path where Lua modules are installed, relative to install 
prefix")
 endif ()
diff --git a/lldb/cmake/modules/FindLuaAndSwig.cmake 
b/lldb/cmake/modules/FindLuaAndSwig.cmake
index 11548b76f843f0..33fadb2a097407 100644
--- a/lldb/cmake/modules/FindLuaAndSwig.cmake
+++ b/lldb/cmake/modules/FindLuaAndSwig.cmake
@@ -8,11 +8,21 @@ if(LUA_LIBRARIES AND LUA_INCLUDE_DIR AND LLDB_ENABLE_SWIG)
   set(LUAANDSWIG_FOUND TRUE)
 else()
   if (LLDB_ENABLE_SWIG)
-find_package(Lua 5.3 EXACT)
+find_package(Lua 5.3)
 if(LUA_FOUND)
+  # Find the Lua executable. Only required to run a subset of the Lua
+  # tests.
+  find_program(LUA_EXECUTABLE
+NAMES
+"lua"
+"lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
+  )
   mark_as_advanced(
 LUA_LIBRARIES
-LUA_INCLUDE_DIR)
+LUA_INCLUDE_DIR
+LUA_VERSION_MINOR
+LUA_VERSION_MAJOR
+LUA_EXECUTABLE)
 endif()
   else()
 message(STATUS "SWIG 4 or later is required for Lua support in LLDB but 
could not be found")
@@ -26,5 +36,7 @@ else()
 REQUIRED_VARS
   LUA_LIBRARIES
   LUA_INCLUDE_DIR
+  LUA_VERSION_MINOR
+  LUA_VERSION_MAJOR
   LLDB_ENABLE_SWIG)
 endif()
diff --git a/lldb/docs/resources/build.rst b/lldb/docs/resources/build.rst
index 33b6a6f79def4b..66db84522bff1f 100644
--- a/lldb/docs/resources/build.rst
+++ b/lldb/docs/resources/build.rst
@@ -64,7 +64,7 @@ CMake configuration error.
 
+---+--+--+
 | Python| Python scripting | 
``LLDB_ENABLE_PYTHON``   |
 
+---+--+--+
-| Lua   | Lua scripting| 
``LLDB_ENABLE_LUA``  |
+| Lua   | Lua scripting. Lua 5.3 and 5.4 are supported.| 
``LLDB_ENABLE_LUA``  |
 
+---+--+--+
 
 Depending on your platform and package manager, one might run any of the
diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in
index 7dd8ffd2f5cb4c..ff6c705caea96c 100644
--- a/lldb/test/API/lit.site.cfg.py.in
+++ b/lldb/test/API/lit.site.cfg.py.in
@@ -20,7 +20,7 @@ config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
 config.target_triple = "@LLVM_TARGET_TRIPLE@"
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 config.python_executable = "@Python3_EXECUTABLE@"
-config.lua_executable = "@Lua_EXECUTABLE@"
+config.lua_executable = "@LUA_EXECUTABLE@"
 config.lua_test_entry = "TestLuaAPI.py"
 config.dotest_common_args_str = 
lit_config.substitute("@LLDB_TEST_COMMON_ARGS@")
 config.dotest_user_args_str = lit_config.substitute("@LLDB_TEST_USER_ARGS@")

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


[Lldb-commits] [lldb] [lldb][docs] Document Lua 5.3 as the only supported version (PR #115288)

2024-11-08 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

https://github.com/llvm/llvm-project/pull/115500

https://github.com/llvm/llvm-project/pull/115288
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti updated 
https://github.com/llvm/llvm-project/pull/115208

>From 125c8976906ff25da6e212dff21d1b129575bd28 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Wed, 6 Nov 2024 09:36:48 -0800
Subject: [PATCH 01/10] [lldb-dap] Refactoring breakpoints to not use the
 `g_dap` reference.

Instead, when a breakpoint is constructed it will be passed a DAP reference 
that it should use for its lifetime.

This is part of a larger refactor to remove the global `g_dap` variable in 
favor of managing instances.
---
 lldb/tools/lldb-dap/Breakpoint.cpp|   8 +-
 lldb/tools/lldb-dap/Breakpoint.h  |   9 +-
 lldb/tools/lldb-dap/BreakpointBase.cpp|   4 +-
 lldb/tools/lldb-dap/BreakpointBase.h  |  12 +-
 lldb/tools/lldb-dap/DAP.cpp   |  22 +-
 lldb/tools/lldb-dap/DAPForward.h  |   1 +
 lldb/tools/lldb-dap/ExceptionBreakpoint.cpp   |   6 +-
 lldb/tools/lldb-dap/ExceptionBreakpoint.h |  12 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.cpp|   7 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.h  |   4 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.cpp |  13 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.h   |  14 +-
 lldb/tools/lldb-dap/JSONUtils.cpp |  64 ---
 lldb/tools/lldb-dap/JSONUtils.h   |  11 -
 lldb/tools/lldb-dap/SourceBreakpoint.cpp  |  17 +-
 lldb/tools/lldb-dap/SourceBreakpoint.h|   3 +-
 lldb/tools/lldb-dap/Watchpoint.cpp|   9 +-
 lldb/tools/lldb-dap/Watchpoint.h  |   8 +-
 lldb/tools/lldb-dap/lldb-dap.cpp  | 495 --
 19 files changed, 318 insertions(+), 401 deletions(-)

diff --git a/lldb/tools/lldb-dap/Breakpoint.cpp 
b/lldb/tools/lldb-dap/Breakpoint.cpp
index 9ea7a42ca85a1e..aee2f87e2cc23e 100644
--- a/lldb/tools/lldb-dap/Breakpoint.cpp
+++ b/lldb/tools/lldb-dap/Breakpoint.cpp
@@ -7,11 +7,13 @@
 
//===--===//
 
 #include "Breakpoint.h"
-#include "DAP.h"
-#include "JSONUtils.h"
+
 #include "lldb/API/SBBreakpointLocation.h"
 #include "llvm/ADT/StringExtras.h"
 
+#include "DAP.h"
+#include "JSONUtils.h"
+
 using namespace lldb_dap;
 
 void Breakpoint::SetCondition() { bp.SetCondition(condition.c_str()); }
@@ -51,7 +53,7 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) 
{
 
   if (bp_addr.IsValid()) {
 std::string formatted_addr =
-"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(g_dap.target));
+"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(bp.GetTarget()));
 object.try_emplace("instructionReference", formatted_addr);
 auto line_entry = bp_addr.GetLineEntry();
 const auto line = line_entry.GetLine();
diff --git a/lldb/tools/lldb-dap/Breakpoint.h b/lldb/tools/lldb-dap/Breakpoint.h
index ee9d3736d6190f..cffeb2fab1f0ef 100644
--- a/lldb/tools/lldb-dap/Breakpoint.h
+++ b/lldb/tools/lldb-dap/Breakpoint.h
@@ -9,18 +9,19 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 
-#include "BreakpointBase.h"
 #include "lldb/API/SBBreakpoint.h"
 
+#include "BreakpointBase.h"
+
 namespace lldb_dap {
 
 struct Breakpoint : public BreakpointBase {
   // The LLDB breakpoint associated wit this source breakpoint
   lldb::SBBreakpoint bp;
 
-  Breakpoint() = default;
-  Breakpoint(const llvm::json::Object &obj) : BreakpointBase(obj){};
-  Breakpoint(lldb::SBBreakpoint bp) : bp(bp) {}
+  Breakpoint(DAP &d) : BreakpointBase(d) {}
+  Breakpoint(DAP &d, const llvm::json::Object &obj) : BreakpointBase(d, obj) {}
+  Breakpoint(DAP &d, lldb::SBBreakpoint bp) : BreakpointBase(d), bp(bp) {}
 
   void SetCondition() override;
   void SetHitCondition() override;
diff --git a/lldb/tools/lldb-dap/BreakpointBase.cpp 
b/lldb/tools/lldb-dap/BreakpointBase.cpp
index f3cb06a3562d48..c5d7a9778df018 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.cpp
+++ b/lldb/tools/lldb-dap/BreakpointBase.cpp
@@ -11,8 +11,8 @@
 
 using namespace lldb_dap;
 
-BreakpointBase::BreakpointBase(const llvm::json::Object &obj)
-: condition(std::string(GetString(obj, "condition"))),
+BreakpointBase::BreakpointBase(DAP &d, const llvm::json::Object &obj)
+: dap(d), condition(std::string(GetString(obj, "condition"))),
   hitCondition(std::string(GetString(obj, "hitCondition"))) {}
 
 void BreakpointBase::UpdateBreakpoint(const BreakpointBase &request_bp) {
diff --git a/lldb/tools/lldb-dap/BreakpointBase.h 
b/lldb/tools/lldb-dap/BreakpointBase.h
index 79301480e0e588..bb660ddc451bd5 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.h
+++ b/lldb/tools/lldb-dap/BreakpointBase.h
@@ -9,12 +9,17 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 
-#include "llvm/Support/JSON.h"
 #include 
 
+#include "llvm/Support/JSON.h"
+
+#include "DAPForward.h"
+
 namespace lldb_dap {
 
 struct BreakpointBase {
+  // Associated DAP session.
+  DAP &dap;
 
   // An optional expression for conditional breakpoints.
   std::str

[Lldb-commits] [lldb] c93eb43 - [lldb] Fix TestFileHandle.lua

2024-11-08 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-11-08T07:23:11-08:00
New Revision: c93eb43a63d3b5c90e828608b5c2063644a3b161

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

LOG: [lldb] Fix TestFileHandle.lua

 - Explicitly create an `SBFile`.
 - Add missing call to `close`.
 - Use `SetErrorFile` in TestLegacyFileErr.

Added: 


Modified: 
lldb/test/API/lua_api/TestFileHandle.lua

Removed: 




diff  --git a/lldb/test/API/lua_api/TestFileHandle.lua 
b/lldb/test/API/lua_api/TestFileHandle.lua
index aed45be206ea62..8db5ccb2c4650a 100644
--- a/lldb/test/API/lua_api/TestFileHandle.lua
+++ b/lldb/test/API/lua_api/TestFileHandle.lua
@@ -2,7 +2,8 @@ _T = require('lua_lldb_test').create_test('TestFileHandle')
 
 function _T:TestLegacyFileOutScript()
 local f = io.open(self.output, 'w')
-self.debugger:SetOutputFile(f)
+local sbf = lldb.SBFile(f)
+self.debugger:SetOutputFile(sbf)
 self:handle_command('script print(1+1)')
 self.debugger:GetOutputFileHandle():write('FOO\n')
 self.debugger:GetOutputFileHandle():flush()
@@ -15,7 +16,8 @@ end
 
 function _T:TestLegacyFileOut()
 local f = io.open(self.output, 'w')
-self.debugger:SetOutputFile(f)
+local sbf = lldb.SBFile(f)
+self.debugger:SetOutputFile(sbf)
 self:handle_command('expression/x 3735928559', false)
 f:close()
 
@@ -26,8 +28,10 @@ end
 
 function _T:TestLegacyFileErr()
 local f = io.open(self.output, 'w')
-self.debugger:SetErrorFile(f)
+local sbf = lldb.SBFile(f)
+self.debugger:SetErrorFile(sbf)
 self:handle_command('lol', false)
+f:close()
 
 f = io.open(self.output, 'r')
 assertStrContains(f:read('*l'), 'is not a valid command')



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


[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti updated 
https://github.com/llvm/llvm-project/pull/115208

>From 125c8976906ff25da6e212dff21d1b129575bd28 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Wed, 6 Nov 2024 09:36:48 -0800
Subject: [PATCH 1/9] [lldb-dap] Refactoring breakpoints to not use the `g_dap`
 reference.

Instead, when a breakpoint is constructed it will be passed a DAP reference 
that it should use for its lifetime.

This is part of a larger refactor to remove the global `g_dap` variable in 
favor of managing instances.
---
 lldb/tools/lldb-dap/Breakpoint.cpp|   8 +-
 lldb/tools/lldb-dap/Breakpoint.h  |   9 +-
 lldb/tools/lldb-dap/BreakpointBase.cpp|   4 +-
 lldb/tools/lldb-dap/BreakpointBase.h  |  12 +-
 lldb/tools/lldb-dap/DAP.cpp   |  22 +-
 lldb/tools/lldb-dap/DAPForward.h  |   1 +
 lldb/tools/lldb-dap/ExceptionBreakpoint.cpp   |   6 +-
 lldb/tools/lldb-dap/ExceptionBreakpoint.h |  12 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.cpp|   7 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.h  |   4 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.cpp |  13 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.h   |  14 +-
 lldb/tools/lldb-dap/JSONUtils.cpp |  64 ---
 lldb/tools/lldb-dap/JSONUtils.h   |  11 -
 lldb/tools/lldb-dap/SourceBreakpoint.cpp  |  17 +-
 lldb/tools/lldb-dap/SourceBreakpoint.h|   3 +-
 lldb/tools/lldb-dap/Watchpoint.cpp|   9 +-
 lldb/tools/lldb-dap/Watchpoint.h  |   8 +-
 lldb/tools/lldb-dap/lldb-dap.cpp  | 495 --
 19 files changed, 318 insertions(+), 401 deletions(-)

diff --git a/lldb/tools/lldb-dap/Breakpoint.cpp 
b/lldb/tools/lldb-dap/Breakpoint.cpp
index 9ea7a42ca85a1e..aee2f87e2cc23e 100644
--- a/lldb/tools/lldb-dap/Breakpoint.cpp
+++ b/lldb/tools/lldb-dap/Breakpoint.cpp
@@ -7,11 +7,13 @@
 
//===--===//
 
 #include "Breakpoint.h"
-#include "DAP.h"
-#include "JSONUtils.h"
+
 #include "lldb/API/SBBreakpointLocation.h"
 #include "llvm/ADT/StringExtras.h"
 
+#include "DAP.h"
+#include "JSONUtils.h"
+
 using namespace lldb_dap;
 
 void Breakpoint::SetCondition() { bp.SetCondition(condition.c_str()); }
@@ -51,7 +53,7 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) 
{
 
   if (bp_addr.IsValid()) {
 std::string formatted_addr =
-"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(g_dap.target));
+"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(bp.GetTarget()));
 object.try_emplace("instructionReference", formatted_addr);
 auto line_entry = bp_addr.GetLineEntry();
 const auto line = line_entry.GetLine();
diff --git a/lldb/tools/lldb-dap/Breakpoint.h b/lldb/tools/lldb-dap/Breakpoint.h
index ee9d3736d6190f..cffeb2fab1f0ef 100644
--- a/lldb/tools/lldb-dap/Breakpoint.h
+++ b/lldb/tools/lldb-dap/Breakpoint.h
@@ -9,18 +9,19 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 
-#include "BreakpointBase.h"
 #include "lldb/API/SBBreakpoint.h"
 
+#include "BreakpointBase.h"
+
 namespace lldb_dap {
 
 struct Breakpoint : public BreakpointBase {
   // The LLDB breakpoint associated wit this source breakpoint
   lldb::SBBreakpoint bp;
 
-  Breakpoint() = default;
-  Breakpoint(const llvm::json::Object &obj) : BreakpointBase(obj){};
-  Breakpoint(lldb::SBBreakpoint bp) : bp(bp) {}
+  Breakpoint(DAP &d) : BreakpointBase(d) {}
+  Breakpoint(DAP &d, const llvm::json::Object &obj) : BreakpointBase(d, obj) {}
+  Breakpoint(DAP &d, lldb::SBBreakpoint bp) : BreakpointBase(d), bp(bp) {}
 
   void SetCondition() override;
   void SetHitCondition() override;
diff --git a/lldb/tools/lldb-dap/BreakpointBase.cpp 
b/lldb/tools/lldb-dap/BreakpointBase.cpp
index f3cb06a3562d48..c5d7a9778df018 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.cpp
+++ b/lldb/tools/lldb-dap/BreakpointBase.cpp
@@ -11,8 +11,8 @@
 
 using namespace lldb_dap;
 
-BreakpointBase::BreakpointBase(const llvm::json::Object &obj)
-: condition(std::string(GetString(obj, "condition"))),
+BreakpointBase::BreakpointBase(DAP &d, const llvm::json::Object &obj)
+: dap(d), condition(std::string(GetString(obj, "condition"))),
   hitCondition(std::string(GetString(obj, "hitCondition"))) {}
 
 void BreakpointBase::UpdateBreakpoint(const BreakpointBase &request_bp) {
diff --git a/lldb/tools/lldb-dap/BreakpointBase.h 
b/lldb/tools/lldb-dap/BreakpointBase.h
index 79301480e0e588..bb660ddc451bd5 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.h
+++ b/lldb/tools/lldb-dap/BreakpointBase.h
@@ -9,12 +9,17 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 
-#include "llvm/Support/JSON.h"
 #include 
 
+#include "llvm/Support/JSON.h"
+
+#include "DAPForward.h"
+
 namespace lldb_dap {
 
 struct BreakpointBase {
+  // Associated DAP session.
+  DAP &dap;
 
   // An optional expression for conditional breakpoints.
   std::strin

[Lldb-commits] [lldb] [lldb-dap] Refactoring breakpoints to not use the `g_dap` reference. (PR #115208)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti updated 
https://github.com/llvm/llvm-project/pull/115208

>From 125c8976906ff25da6e212dff21d1b129575bd28 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Wed, 6 Nov 2024 09:36:48 -0800
Subject: [PATCH 01/11] [lldb-dap] Refactoring breakpoints to not use the
 `g_dap` reference.

Instead, when a breakpoint is constructed it will be passed a DAP reference 
that it should use for its lifetime.

This is part of a larger refactor to remove the global `g_dap` variable in 
favor of managing instances.
---
 lldb/tools/lldb-dap/Breakpoint.cpp|   8 +-
 lldb/tools/lldb-dap/Breakpoint.h  |   9 +-
 lldb/tools/lldb-dap/BreakpointBase.cpp|   4 +-
 lldb/tools/lldb-dap/BreakpointBase.h  |  12 +-
 lldb/tools/lldb-dap/DAP.cpp   |  22 +-
 lldb/tools/lldb-dap/DAPForward.h  |   1 +
 lldb/tools/lldb-dap/ExceptionBreakpoint.cpp   |   6 +-
 lldb/tools/lldb-dap/ExceptionBreakpoint.h |  12 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.cpp|   7 +-
 lldb/tools/lldb-dap/FunctionBreakpoint.h  |   4 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.cpp |  13 +-
 lldb/tools/lldb-dap/InstructionBreakpoint.h   |  14 +-
 lldb/tools/lldb-dap/JSONUtils.cpp |  64 ---
 lldb/tools/lldb-dap/JSONUtils.h   |  11 -
 lldb/tools/lldb-dap/SourceBreakpoint.cpp  |  17 +-
 lldb/tools/lldb-dap/SourceBreakpoint.h|   3 +-
 lldb/tools/lldb-dap/Watchpoint.cpp|   9 +-
 lldb/tools/lldb-dap/Watchpoint.h  |   8 +-
 lldb/tools/lldb-dap/lldb-dap.cpp  | 495 --
 19 files changed, 318 insertions(+), 401 deletions(-)

diff --git a/lldb/tools/lldb-dap/Breakpoint.cpp 
b/lldb/tools/lldb-dap/Breakpoint.cpp
index 9ea7a42ca85a1e..aee2f87e2cc23e 100644
--- a/lldb/tools/lldb-dap/Breakpoint.cpp
+++ b/lldb/tools/lldb-dap/Breakpoint.cpp
@@ -7,11 +7,13 @@
 
//===--===//
 
 #include "Breakpoint.h"
-#include "DAP.h"
-#include "JSONUtils.h"
+
 #include "lldb/API/SBBreakpointLocation.h"
 #include "llvm/ADT/StringExtras.h"
 
+#include "DAP.h"
+#include "JSONUtils.h"
+
 using namespace lldb_dap;
 
 void Breakpoint::SetCondition() { bp.SetCondition(condition.c_str()); }
@@ -51,7 +53,7 @@ void Breakpoint::CreateJsonObject(llvm::json::Object &object) 
{
 
   if (bp_addr.IsValid()) {
 std::string formatted_addr =
-"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(g_dap.target));
+"0x" + llvm::utohexstr(bp_addr.GetLoadAddress(bp.GetTarget()));
 object.try_emplace("instructionReference", formatted_addr);
 auto line_entry = bp_addr.GetLineEntry();
 const auto line = line_entry.GetLine();
diff --git a/lldb/tools/lldb-dap/Breakpoint.h b/lldb/tools/lldb-dap/Breakpoint.h
index ee9d3736d6190f..cffeb2fab1f0ef 100644
--- a/lldb/tools/lldb-dap/Breakpoint.h
+++ b/lldb/tools/lldb-dap/Breakpoint.h
@@ -9,18 +9,19 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINT_H
 
-#include "BreakpointBase.h"
 #include "lldb/API/SBBreakpoint.h"
 
+#include "BreakpointBase.h"
+
 namespace lldb_dap {
 
 struct Breakpoint : public BreakpointBase {
   // The LLDB breakpoint associated wit this source breakpoint
   lldb::SBBreakpoint bp;
 
-  Breakpoint() = default;
-  Breakpoint(const llvm::json::Object &obj) : BreakpointBase(obj){};
-  Breakpoint(lldb::SBBreakpoint bp) : bp(bp) {}
+  Breakpoint(DAP &d) : BreakpointBase(d) {}
+  Breakpoint(DAP &d, const llvm::json::Object &obj) : BreakpointBase(d, obj) {}
+  Breakpoint(DAP &d, lldb::SBBreakpoint bp) : BreakpointBase(d), bp(bp) {}
 
   void SetCondition() override;
   void SetHitCondition() override;
diff --git a/lldb/tools/lldb-dap/BreakpointBase.cpp 
b/lldb/tools/lldb-dap/BreakpointBase.cpp
index f3cb06a3562d48..c5d7a9778df018 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.cpp
+++ b/lldb/tools/lldb-dap/BreakpointBase.cpp
@@ -11,8 +11,8 @@
 
 using namespace lldb_dap;
 
-BreakpointBase::BreakpointBase(const llvm::json::Object &obj)
-: condition(std::string(GetString(obj, "condition"))),
+BreakpointBase::BreakpointBase(DAP &d, const llvm::json::Object &obj)
+: dap(d), condition(std::string(GetString(obj, "condition"))),
   hitCondition(std::string(GetString(obj, "hitCondition"))) {}
 
 void BreakpointBase::UpdateBreakpoint(const BreakpointBase &request_bp) {
diff --git a/lldb/tools/lldb-dap/BreakpointBase.h 
b/lldb/tools/lldb-dap/BreakpointBase.h
index 79301480e0e588..bb660ddc451bd5 100644
--- a/lldb/tools/lldb-dap/BreakpointBase.h
+++ b/lldb/tools/lldb-dap/BreakpointBase.h
@@ -9,12 +9,17 @@
 #ifndef LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 #define LLDB_TOOLS_LLDB_DAP_BREAKPOINTBASE_H
 
-#include "llvm/Support/JSON.h"
 #include 
 
+#include "llvm/Support/JSON.h"
+
+#include "DAPForward.h"
+
 namespace lldb_dap {
 
 struct BreakpointBase {
+  // Associated DAP session.
+  DAP &dap;
 
   // An optional expression for conditional breakpoints.
   std::str

[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)


Changes

This is part of a larger refactor to remove the global `g_dap` variable.

---

Patch is 25.94 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/115561.diff


3 Files Affected:

- (modified) lldb/tools/lldb-dap/JSONUtils.cpp (+44-51) 
- (modified) lldb/tools/lldb-dap/JSONUtils.h (+41-13) 
- (modified) lldb/tools/lldb-dap/lldb-dap.cpp (+17-13) 


``diff
diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index a7300abae0eac8..6ca4dfb4711a13 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -154,7 +154,7 @@ DecodeMemoryReference(llvm::StringRef memoryReference) {
 std::vector GetStrings(const llvm::json::Object *obj,
 llvm::StringRef key) {
   std::vector strs;
-  auto json_array = obj->getArray(key);
+  const auto *json_array = obj->getArray(key);
   if (!json_array)
 return strs;
   for (const auto &value : *json_array) {
@@ -210,12 +210,6 @@ static bool IsClassStructOrUnionType(lldb::SBType t) {
 /// glance.
 static std::optional
 TryCreateAutoSummaryForContainer(lldb::SBValue &v) {
-  // We gate this feature because it performs GetNumChildren(), which can
-  // cause performance issues because LLDB needs to complete possibly huge
-  // types.
-  if (!g_dap.enable_auto_variable_summaries)
-return std::nullopt;
-
   if (!v.MightHaveChildren())
 return std::nullopt;
   /// As this operation can be potentially slow, we limit the total time spent
@@ -271,10 +265,7 @@ TryCreateAutoSummaryForContainer(lldb::SBValue &v) {
 
 /// Try to create a summary string for the given value that doesn't have a
 /// summary of its own.
-static std::optional TryCreateAutoSummary(lldb::SBValue value) {
-  if (!g_dap.enable_auto_variable_summaries)
-return std::nullopt;
-
+static std::optional TryCreateAutoSummary(lldb::SBValue &value) {
   // We use the dereferenced value for generating the summary.
   if (value.GetType().IsPointerType() || value.GetType().IsReferenceType())
 value = value.Dereference();
@@ -485,10 +476,12 @@ static std::string ConvertDebugInfoSizeToString(uint64_t 
debug_info) {
   }
   return oss.str();
 }
-llvm::json::Value CreateModule(lldb::SBModule &module) {
+
+llvm::json::Value CreateModule(lldb::SBTarget &target, lldb::SBModule &module) 
{
   llvm::json::Object object;
-  if (!module.IsValid())
+  if (!target.IsValid() || !module.IsValid())
 return llvm::json::Value(std::move(object));
+
   const char *uuid = module.GetUUIDString();
   object.try_emplace("id", uuid ? std::string(uuid) : std::string(""));
   object.try_emplace("name", std::string(module.GetFileSpec().GetFilename()));
@@ -514,7 +507,7 @@ llvm::json::Value CreateModule(lldb::SBModule &module) {
 object.try_emplace("symbolStatus", "Symbols not found.");
   }
   std::string loaded_addr = std::to_string(
-  module.GetObjectFileHeaderAddress().GetLoadAddress(g_dap.target));
+  module.GetObjectFileHeaderAddress().GetLoadAddress(target));
   object.try_emplace("addressRange", loaded_addr);
   std::string version_str;
   uint32_t version_nums[3];
@@ -705,7 +698,7 @@ llvm::json::Value CreateSource(llvm::StringRef source_path) 
{
   return llvm::json::Value(std::move(source));
 }
 
-std::optional CreateSource(lldb::SBFrame &frame) {
+static std::optional CreateSource(lldb::SBFrame &frame) {
   auto line_entry = frame.GetLineEntry();
   // A line entry of 0 indicates the line is compiler generated i.e. no source
   // file is associated with the frame.
@@ -776,15 +769,15 @@ std::optional 
CreateSource(lldb::SBFrame &frame) {
 //   },
 //   "required": [ "id", "name", "line", "column" ]
 // }
-llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
+llvm::json::Value CreateStackFrame(lldb::SBFrame &frame,
+   lldb::SBFormat &format) {
   llvm::json::Object object;
   int64_t frame_id = MakeDAPFrameID(frame);
   object.try_emplace("id", frame_id);
 
   std::string frame_name;
   lldb::SBStream stream;
-  if (g_dap.frame_format &&
-  frame.GetDescriptionWithFormat(g_dap.frame_format, stream).Success()) {
+  if (format && frame.GetDescriptionWithFormat(format, stream).Success()) {
 frame_name = stream.GetData();
 
 // `function_name` can be a nullptr, which throws an error when assigned to
@@ -801,7 +794,7 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
   }
 
   // We only include `[opt]` if a custom frame format is not specified.
-  if (!g_dap.frame_format && frame.GetFunction().GetIsOptimized())
+  if (!format && frame.GetFunction().GetIsOptimized())
 frame_name += " [opt]";
 
   EmplaceSafeString(object, "name", frame_name);
@@ -835,11 +828,11 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
   return llvm::json::Value(std::move(object));
 }
 
-llvm::json::Value CreateExtendedStackFrameLabel(ll

[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti ready_for_review 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti created 
https://github.com/llvm/llvm-project/pull/115561

This is part of a larger refactor to remove the global `g_dap` variable.

>From 3105fc424d4c712d90f10b771d4644c0e97355c4 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Thu, 7 Nov 2024 13:06:01 -0800
Subject: [PATCH] [lldb-da] Refactoring JSONUtils to not use `g_dap` and
 instead passing in required arguments.

This is part of a larger refactor to remove the global `g_dap` variable.
---
 lldb/tools/lldb-dap/JSONUtils.cpp | 95 ++-
 lldb/tools/lldb-dap/JSONUtils.h   | 54 +-
 lldb/tools/lldb-dap/lldb-dap.cpp  | 30 +-
 3 files changed, 102 insertions(+), 77 deletions(-)

diff --git a/lldb/tools/lldb-dap/JSONUtils.cpp 
b/lldb/tools/lldb-dap/JSONUtils.cpp
index a7300abae0eac8..6ca4dfb4711a13 100644
--- a/lldb/tools/lldb-dap/JSONUtils.cpp
+++ b/lldb/tools/lldb-dap/JSONUtils.cpp
@@ -154,7 +154,7 @@ DecodeMemoryReference(llvm::StringRef memoryReference) {
 std::vector GetStrings(const llvm::json::Object *obj,
 llvm::StringRef key) {
   std::vector strs;
-  auto json_array = obj->getArray(key);
+  const auto *json_array = obj->getArray(key);
   if (!json_array)
 return strs;
   for (const auto &value : *json_array) {
@@ -210,12 +210,6 @@ static bool IsClassStructOrUnionType(lldb::SBType t) {
 /// glance.
 static std::optional
 TryCreateAutoSummaryForContainer(lldb::SBValue &v) {
-  // We gate this feature because it performs GetNumChildren(), which can
-  // cause performance issues because LLDB needs to complete possibly huge
-  // types.
-  if (!g_dap.enable_auto_variable_summaries)
-return std::nullopt;
-
   if (!v.MightHaveChildren())
 return std::nullopt;
   /// As this operation can be potentially slow, we limit the total time spent
@@ -271,10 +265,7 @@ TryCreateAutoSummaryForContainer(lldb::SBValue &v) {
 
 /// Try to create a summary string for the given value that doesn't have a
 /// summary of its own.
-static std::optional TryCreateAutoSummary(lldb::SBValue value) {
-  if (!g_dap.enable_auto_variable_summaries)
-return std::nullopt;
-
+static std::optional TryCreateAutoSummary(lldb::SBValue &value) {
   // We use the dereferenced value for generating the summary.
   if (value.GetType().IsPointerType() || value.GetType().IsReferenceType())
 value = value.Dereference();
@@ -485,10 +476,12 @@ static std::string ConvertDebugInfoSizeToString(uint64_t 
debug_info) {
   }
   return oss.str();
 }
-llvm::json::Value CreateModule(lldb::SBModule &module) {
+
+llvm::json::Value CreateModule(lldb::SBTarget &target, lldb::SBModule &module) 
{
   llvm::json::Object object;
-  if (!module.IsValid())
+  if (!target.IsValid() || !module.IsValid())
 return llvm::json::Value(std::move(object));
+
   const char *uuid = module.GetUUIDString();
   object.try_emplace("id", uuid ? std::string(uuid) : std::string(""));
   object.try_emplace("name", std::string(module.GetFileSpec().GetFilename()));
@@ -514,7 +507,7 @@ llvm::json::Value CreateModule(lldb::SBModule &module) {
 object.try_emplace("symbolStatus", "Symbols not found.");
   }
   std::string loaded_addr = std::to_string(
-  module.GetObjectFileHeaderAddress().GetLoadAddress(g_dap.target));
+  module.GetObjectFileHeaderAddress().GetLoadAddress(target));
   object.try_emplace("addressRange", loaded_addr);
   std::string version_str;
   uint32_t version_nums[3];
@@ -705,7 +698,7 @@ llvm::json::Value CreateSource(llvm::StringRef source_path) 
{
   return llvm::json::Value(std::move(source));
 }
 
-std::optional CreateSource(lldb::SBFrame &frame) {
+static std::optional CreateSource(lldb::SBFrame &frame) {
   auto line_entry = frame.GetLineEntry();
   // A line entry of 0 indicates the line is compiler generated i.e. no source
   // file is associated with the frame.
@@ -776,15 +769,15 @@ std::optional 
CreateSource(lldb::SBFrame &frame) {
 //   },
 //   "required": [ "id", "name", "line", "column" ]
 // }
-llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
+llvm::json::Value CreateStackFrame(lldb::SBFrame &frame,
+   lldb::SBFormat &format) {
   llvm::json::Object object;
   int64_t frame_id = MakeDAPFrameID(frame);
   object.try_emplace("id", frame_id);
 
   std::string frame_name;
   lldb::SBStream stream;
-  if (g_dap.frame_format &&
-  frame.GetDescriptionWithFormat(g_dap.frame_format, stream).Success()) {
+  if (format && frame.GetDescriptionWithFormat(format, stream).Success()) {
 frame_name = stream.GetData();
 
 // `function_name` can be a nullptr, which throws an error when assigned to
@@ -801,7 +794,7 @@ llvm::json::Value CreateStackFrame(lldb::SBFrame &frame) {
   }
 
   // We only include `[opt]` if a custom frame format is not specified.
-  if (!g_dap.frame_format && frame.GetFunction().GetIsOptimized())
+  if (!format && frame.GetFunction().GetIsOptimized())
 frame_name += " [opt]";
 
   EmplaceSa

[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti unassigned 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti unassigned 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Walter Erquinigo via lldb-commits


@@ -1465,11 +1462,7 @@ CreateRunInTerminalReverseRequest(const 
llvm::json::Object &launch_request,
 llvm::StringRef key = envs.GetNameAtIndex(index);
 llvm::StringRef value = envs.GetValueAtIndex(index);
 
-if (key.empty())
-  g_dap.SendOutput(OutputType::Stderr,
-   "empty environment variable for value: \"" +
-   value.str() + '\"');
-else

walter-erquinigo wrote:

Why did you remove this?

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo edited 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo commented:

Save one comment, everything else seems good

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/99891
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread via lldb-commits

https://github.com/CarolineConcatto approved this pull request.


https://github.com/llvm/llvm-project/pull/114293
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Have disassembler show load addresses when using a core file (PR #115453)

2024-11-08 Thread Pavel Labath via lldb-commits

https://github.com/labath created 
https://github.com/llvm/llvm-project/pull/115453

We got a bug report that the disassember output was not relocated (i.e. a load 
address) for a core file (like it is for a live process). It turns out this 
behavior it depends on whether the instructions were read from an executable 
file or from process memory (a core file will not typically contain the memory 
image for segments backed by an executable file).

It's unclear whether this behavior is intentional, or if it was just trying to 
handle the case where we're dissassembling a module without a process, but I 
think it's undesirable. What makes it particularly confusing is that the 
instruction addresses are relocated in this case (unlike the when we don't have 
a process), so with large files and adresses it gets very hard to see whether 
the relocation has been applied or not.

This patch removes the data_from_file check so that the instruction is 
relocated regardless of where it was read from. It will still not get relocated 
for the raw module use case, as those can't be relocated anywhere as they don't 
have a load address.

>From 55e493a4752a8a31ec1fb970b1d4f821109749b1 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Fri, 8 Nov 2024 10:44:54 +0100
Subject: [PATCH] [lldb] Have disassembler show load addresses when using a
 core file

We got a bug report that the disassember output was not relocated (i.e.
a load address) for a core file (like it is for a live process). It
turns out this behavior it depends on whether the instructions were read
from an executable file or from process memory (a core file will not
typically contain the memory image for segments backed by an executable
file).

It's unclear whether this behavior is intentional, or if it was just
trying to handle the case where we're dissassembling a module without a
process, but I think it's undesirable. What makes it particularly
confusing is that the instruction addresses are relocated in this case
(unlike the when we don't have a process), so with large files and
adresses it gets very hard to see whether the relocation has been
applied or not.

This patch removes the data_from_file check so that the instruction is
relocated regardless of where it was read from. It will still not get
relocated for the raw module use case, as those can't be relocated
anywhere as they don't have a load address.
---
 .../Disassembler/LLVMC/DisassemblerLLVMC.cpp  | 11 --
 .../Commands/command-disassemble-process.yaml | 20 +--
 .../test/Shell/Commands/command-disassemble.s | 10 +-
 3 files changed, 19 insertions(+), 22 deletions(-)

diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp 
b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index 31edd8d46c444e..08264d837f9c23 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -583,7 +583,6 @@ class InstructionLLVMC : public lldb_private::Instruction {
 lldb::addr_t pc = m_address.GetFileAddress();
 m_using_file_addr = true;
 
-const bool data_from_file = disasm->m_data_from_file;
 bool use_hex_immediates = true;
 Disassembler::HexImmediateStyle hex_style = Disassembler::eHexStyleC;
 
@@ -593,12 +592,10 @@ class InstructionLLVMC : public lldb_private::Instruction 
{
 use_hex_immediates = target->GetUseHexImmediates();
 hex_style = target->GetHexImmediateStyle();
 
-if (!data_from_file) {
-  const lldb::addr_t load_addr = m_address.GetLoadAddress(target);
-  if (load_addr != LLDB_INVALID_ADDRESS) {
-pc = load_addr;
-m_using_file_addr = false;
-  }
+const lldb::addr_t load_addr = m_address.GetLoadAddress(target);
+if (load_addr != LLDB_INVALID_ADDRESS) {
+  pc = load_addr;
+  m_using_file_addr = false;
 }
   }
 }
diff --git a/lldb/test/Shell/Commands/command-disassemble-process.yaml 
b/lldb/test/Shell/Commands/command-disassemble-process.yaml
index 75be1a42fb196d..ce1b37bc8aea7a 100644
--- a/lldb/test/Shell/Commands/command-disassemble-process.yaml
+++ b/lldb/test/Shell/Commands/command-disassemble-process.yaml
@@ -20,7 +20,7 @@
 
 # CHECK:   (lldb) disassemble
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: ->  0x4004 <+2>: addb   %al, (%rdx)
 # CHECK-NEXT: 0x4006 <+4>: addb   %al, (%rbx)
 # CHECK-NEXT: 0x4008 <+6>: addb   %al, (%rsi)
@@ -32,7 +32,7 @@
 # CHECK-NEXT: 0x400a:  addb   %al, (%rdi)
 # CHECK-NEXT: (lldb) disassemble --frame
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: -> 

[Lldb-commits] [lldb] [lldb] Have disassembler show load addresses when using a core file (PR #115453)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)


Changes

We got a bug report that the disassember output was not relocated (i.e. a load 
address) for a core file (like it is for a live process). It turns out this 
behavior it depends on whether the instructions were read from an executable 
file or from process memory (a core file will not typically contain the memory 
image for segments backed by an executable file).

It's unclear whether this behavior is intentional, or if it was just trying to 
handle the case where we're dissassembling a module without a process, but I 
think it's undesirable. What makes it particularly confusing is that the 
instruction addresses are relocated in this case (unlike the when we don't have 
a process), so with large files and adresses it gets very hard to see whether 
the relocation has been applied or not.

This patch removes the data_from_file check so that the instruction is 
relocated regardless of where it was read from. It will still not get relocated 
for the raw module use case, as those can't be relocated anywhere as they don't 
have a load address.

---
Full diff: https://github.com/llvm/llvm-project/pull/115453.diff


3 Files Affected:

- (modified) lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp 
(+4-7) 
- (modified) lldb/test/Shell/Commands/command-disassemble-process.yaml (+10-10) 
- (modified) lldb/test/Shell/Commands/command-disassemble.s (+5-5) 


``diff
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp 
b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index 31edd8d46c444e..08264d837f9c23 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -583,7 +583,6 @@ class InstructionLLVMC : public lldb_private::Instruction {
 lldb::addr_t pc = m_address.GetFileAddress();
 m_using_file_addr = true;
 
-const bool data_from_file = disasm->m_data_from_file;
 bool use_hex_immediates = true;
 Disassembler::HexImmediateStyle hex_style = Disassembler::eHexStyleC;
 
@@ -593,12 +592,10 @@ class InstructionLLVMC : public lldb_private::Instruction 
{
 use_hex_immediates = target->GetUseHexImmediates();
 hex_style = target->GetHexImmediateStyle();
 
-if (!data_from_file) {
-  const lldb::addr_t load_addr = m_address.GetLoadAddress(target);
-  if (load_addr != LLDB_INVALID_ADDRESS) {
-pc = load_addr;
-m_using_file_addr = false;
-  }
+const lldb::addr_t load_addr = m_address.GetLoadAddress(target);
+if (load_addr != LLDB_INVALID_ADDRESS) {
+  pc = load_addr;
+  m_using_file_addr = false;
 }
   }
 }
diff --git a/lldb/test/Shell/Commands/command-disassemble-process.yaml 
b/lldb/test/Shell/Commands/command-disassemble-process.yaml
index 75be1a42fb196d..ce1b37bc8aea7a 100644
--- a/lldb/test/Shell/Commands/command-disassemble-process.yaml
+++ b/lldb/test/Shell/Commands/command-disassemble-process.yaml
@@ -20,7 +20,7 @@
 
 # CHECK:   (lldb) disassemble
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: ->  0x4004 <+2>: addb   %al, (%rdx)
 # CHECK-NEXT: 0x4006 <+4>: addb   %al, (%rbx)
 # CHECK-NEXT: 0x4008 <+6>: addb   %al, (%rsi)
@@ -32,7 +32,7 @@
 # CHECK-NEXT: 0x400a:  addb   %al, (%rdi)
 # CHECK-NEXT: (lldb) disassemble --frame
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: ->  0x4004 <+2>: addb   %al, (%rdx)
 # CHECK-NEXT: 0x4006 <+4>: addb   %al, (%rbx)
 # CHECK-NEXT: 0x4008 <+6>: addb   %al, (%rsi)
@@ -44,13 +44,13 @@
 # CHECK-NEXT: 0x400a:  addb   %al, (%rdi)
 # CHECK-NEXT: (lldb) disassemble --address 0x4004
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: ->  0x4004 <+2>: addb   %al, (%rdx)
 # CHECK-NEXT: 0x4006 <+4>: addb   %al, (%rbx)
 # CHECK-NEXT: 0x4008 <+6>: addb   %al, (%rsi)
 # CHECK-NEXT: (lldb) disassemble --count 7
 # CHECK-NEXT: command-disassemble-process.exe`main:
-# CHECK-NEXT: 0x4002 <+0>: addb   %al, (%rcx)
+# CHECK-NEXT: 0x4002 <+0>: jmp0x4004 ; <+2>
 # CHECK-NEXT: ->  0x4004 <+2>: addb   %al, (%rdx)
 # CHECK-NEXT: 0x4006 <+4>: addb   %al, (%rbx)
 # CHECK-NEXT: 0x4008 <+6>: addb   %al, (%rsi)
@@ -81,32 +81,32 @@ Sections:
   - Name:.text
 Type:SHT_PROGBITS
 Flags:   [ SHF_ALLOC, SHF_EXECINSTR ]
-Address: 0x4000
+Address: 0x
 AddressAlign:0x0

[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of Windows host (PR #115337)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman updated 
https://github.com/llvm/llvm-project/pull/115337

>From d9f799f02fb47804d4e35c5fd73433280b650257 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Thu, 7 Nov 2024 20:22:57 +0400
Subject: [PATCH 1/2] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler
 decorator in case of Windows host

Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of Windows host.
---
 .../Python/lldbsuite/test/decorators.py   | 39 +++
 1 file changed, 31 insertions(+), 8 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 34319e203a3177..d4c5e61a8fd95a 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -989,13 +989,27 @@ def skipUnlessAArch64MTELinuxCompiler(func):
 
 def is_toolchain_with_mte():
 compiler_path = lldbplatformutil.getCompiler()
-compiler = os.path.basename(compiler_path)
-f = tempfile.NamedTemporaryFile()
+f_src = tempfile.NamedTemporaryFile(delete=False)
+f_out = tempfile.NamedTemporaryFile(delete=False)
 if lldbplatformutil.getPlatform() == "windows":
 return "MTE tests are not compatible with 'windows'"
 
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
+# Note hostos may be Windows.
+f_src.close()
+f_out.close()
+
+with open(f_src.name, "w") as f:
+f.write("int main() {}")
+cmd = f"{compiler_path} -x c -o {f_out.name} {f_src.name}"
 if os.popen(cmd).close() is not None:
+try:
+os.remove(f_src.name)
+except OSError:
+pass
+try:
+os.remove(f_out.name)
+except OSError:
+pass
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
 return None
@@ -1010,12 +1024,21 @@ def is_toolchain_with_mte():
 int main() {
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
-cmd = "echo '%s' | %s -march=armv8.5-a+memtag -x c -o %s -" % (
-test_src,
-compiler_path,
-f.name,
+with open(f_src.name, "w") as f:
+f.write(test_src)
+cmd = (
+f"{compiler_path} -march=armv8.5-a+memtag -x c -o {f_out.name} 
{f_src.name}"
 )
-if os.popen(cmd).close() is not None:
+res = os.popen(cmd).close()
+try:
+os.remove(f_src.name)
+except OSError:
+pass
+try:
+os.remove(f_out.name)
+except OSError:
+pass
+if res is not None:
 return "Toolchain does not support MTE"
 return None
 

>From d54ea2ab1df3543ec66a41cead686b129cbf63a9 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Fri, 8 Nov 2024 14:50:16 +0400
Subject: [PATCH 2/2] Updated with subprocess.run(cmd, input=...)

---
 .../Python/lldbsuite/test/decorators.py   | 40 +--
 1 file changed, 9 insertions(+), 31 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index d4c5e61a8fd95a..0bb9ab9f5f8929 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -989,27 +989,16 @@ def skipUnlessAArch64MTELinuxCompiler(func):
 
 def is_toolchain_with_mte():
 compiler_path = lldbplatformutil.getCompiler()
-f_src = tempfile.NamedTemporaryFile(delete=False)
-f_out = tempfile.NamedTemporaryFile(delete=False)
+f = tempfile.NamedTemporaryFile(delete=False)
 if lldbplatformutil.getPlatform() == "windows":
 return "MTE tests are not compatible with 'windows'"
 
 # Note hostos may be Windows.
-f_src.close()
-f_out.close()
+f.close()
 
-with open(f_src.name, "w") as f:
-f.write("int main() {}")
-cmd = f"{compiler_path} -x c -o {f_out.name} {f_src.name}"
-if os.popen(cmd).close() is not None:
-try:
-os.remove(f_src.name)
-except OSError:
-pass
-try:
-os.remove(f_out.name)
-except OSError:
-pass
+cmd = f"{compiler_path} -x c -o {f.name} -"
+if subprocess.run(cmd, input="int main() {}".encode()).returncode != 0:
+os.remove(f.name)
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
 return None
@@ -1024,21 +1013,10 @@ def is_toolchain_with_mte():
 int main() {
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
-with open(f_src.name, "w"

[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of Windows host (PR #115337)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits


@@ -1010,12 +1024,21 @@ def is_toolchain_with_mte():
 int main() {
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
-cmd = "echo '%s' | %s -march=armv8.5-a+memtag -x c -o %s -" % (
-test_src,
-compiler_path,
-f.name,
+with open(f_src.name, "w") as f:
+f.write(test_src)

slydiman wrote:

Updated. Thanks.

https://github.com/llvm/llvm-project/pull/115337
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [lldb] [llvm] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2 (PR #114293)

2024-11-08 Thread via lldb-commits

https://github.com/SpencerAbson updated 
https://github.com/llvm/llvm-project/pull/114293

>From 9798e21e38dfba285550d8c2b1738f08da197e80 Mon Sep 17 00:00:00 2001
From: Spencer Abson 
Date: Wed, 30 Oct 2024 18:06:15 +
Subject: [PATCH 1/8] [AArch64] Reduce +sve2-aes to an alias of +sve-aes+sve2

- Introduce the ammended feature flag for FEAT_SVE_AES, 'sve-aes'
- Make the existing sve2-aes flag as an alias of +sve2+sve-aes
- The exising __ARM_FEATURE_SVE2_AES macro must not be effected by this change, 
so an effort
  has been made to ensure it is defined when we have supplied target features 
+sve-aes and +sve2
  by any method.
---
 clang/lib/Basic/Targets/AArch64.cpp   | 11 +--
 clang/lib/Basic/Targets/AArch64.h |  2 +-
 .../Driver/aarch64-implied-sve-features.c | 11 ---
 .../print-supported-extensions-aarch64.c  |  5 ++--
 .../Preprocessor/aarch64-target-features.c| 12 
 llvm/lib/Target/AArch64/AArch64Features.td|  9 --
 .../AArch64/AsmParser/AArch64AsmParser.cpp|  1 +
 .../TargetParser/TargetParserTest.cpp | 29 +++
 8 files changed, 61 insertions(+), 19 deletions(-)

diff --git a/clang/lib/Basic/Targets/AArch64.cpp 
b/clang/lib/Basic/Targets/AArch64.cpp
index 3d8de0294d4ba3..6033a0439a99af 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -473,7 +473,7 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions 
&Opts,
   if (HasSVE2p1)
 Builder.defineMacro("__ARM_FEATURE_SVE2p1", "1");
 
-  if (HasSVE2 && HasSVE2AES)
+  if (HasSVE2 && HasSVEAES)
 Builder.defineMacro("__ARM_FEATURE_SVE2_AES", "1");
 
   if (HasSVE2 && HasSVE2BitPerm)
@@ -769,7 +769,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const 
{
   .Case("f32mm", FPU & SveMode && HasMatmulFP32)
   .Case("f64mm", FPU & SveMode && HasMatmulFP64)
   .Case("sve2", FPU & SveMode && HasSVE2)
-  .Case("sve2-pmull128", FPU & SveMode && HasSVE2AES)
+  .Case("sve2-pmull128", FPU & SveMode && HasSVEAES && HasSVE2)
   .Case("sve2-bitperm", FPU & SveMode && HasSVE2BitPerm)
   .Case("sve2-sha3", FPU & SveMode && HasSVE2SHA3)
   .Case("sve2-sm4", FPU & SveMode && HasSVE2SM4)
@@ -861,12 +861,17 @@ bool 
AArch64TargetInfo::handleTargetFeatures(std::vector &Features,
   HasSVE2 = true;
   HasSVE2p1 = true;
 }
+if (Feature == "+sve-aes") {
+  FPU |= NeonMode;
+  HasAES = true;
+  HasSVEAES = true;
+}
 if (Feature == "+sve2-aes") {
   FPU |= NeonMode;
   FPU |= SveMode;
   HasFullFP16 = true;
   HasSVE2 = true;
-  HasSVE2AES = true;
+  HasSVEAES = true;
 }
 if (Feature == "+sve2-sha3") {
   FPU |= NeonMode;
diff --git a/clang/lib/Basic/Targets/AArch64.h 
b/clang/lib/Basic/Targets/AArch64.h
index ea3e4015d84265..4c25bdb5bb16df 100644
--- a/clang/lib/Basic/Targets/AArch64.h
+++ b/clang/lib/Basic/Targets/AArch64.h
@@ -78,7 +78,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public 
TargetInfo {
   bool HasBFloat16 = false;
   bool HasSVE2 = false;
   bool HasSVE2p1 = false;
-  bool HasSVE2AES = false;
+  bool HasSVEAES = false;
   bool HasSVE2SHA3 = false;
   bool HasSVE2SM4 = false;
   bool HasSVEB16B16 = false;
diff --git a/clang/test/Driver/aarch64-implied-sve-features.c 
b/clang/test/Driver/aarch64-implied-sve-features.c
index f04e1a785673b8..5da138a70a8fbf 100644
--- a/clang/test/Driver/aarch64-implied-sve-features.c
+++ b/clang/test/Driver/aarch64-implied-sve-features.c
@@ -36,7 +36,7 @@
 // SVE2-BITPERM-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" 
"-target-feature" "-sve2-bitperm"
 
 // RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-aes+nosve2-aes 
%s -### 2>&1 | FileCheck %s --check-prefix=SVE2-AES-REVERT
-// SVE2-AES-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" 
"-target-feature" "-sve2-aes"
+// SVE2-AES-REVERT: "-target-feature" "+sve" "-target-feature" "+sve-aes" 
"-target-feature" "+sve2" "-target-feature" "-sve2-aes"
 
 // RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-sha3+nosve2-sha3 
%s -### 2>&1 | FileCheck %s --check-prefix=SVE2-SHA3-REVERT
 // SVE2-SHA3-REVERT: "-target-feature" "+sve" "-target-feature" "+sve2" 
"-target-feature" "-sve2-sha3"
@@ -47,8 +47,11 @@
 // RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-sha3 %s -### 
2>&1 | FileCheck %s --check-prefix=SVE2-SHA3
 // SVE2-SHA3: "-target-feature" "+sve" "-target-feature" "+sve2" 
"-target-feature" "+sve2-sha3"
 
+// RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve-aes %s -### 2>&1 
| FileCheck %s --check-prefix=SVE-AES
+// SVE-AES: "-target-feature" "+aes"{{.*}} "-target-feature" "+sve-aes"
+
 // RUN: %clang --target=aarch64-linux-gnu -march=armv8-a+sve2-aes %s -### 2>&1 
| FileCheck %s --check-prefix=SVE2-AES
-// SVE2-AES: "-target-feature" "+sve" "-target-feature" "+sve2" 
"-target-feature" "+sve2-aes"
+// SVE2-AES: "-target-feature" "+sve" "-target-feature" "+

[Lldb-commits] [lldb] df3f18b - [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of Windows host (#115337)

2024-11-08 Thread via lldb-commits

Author: Dmitry Vasilyev
Date: 2024-11-08T15:59:05+04:00
New Revision: df3f18b071d853896318d2d37186fc6289ffdb2b

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

LOG: [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of 
Windows host (#115337)

Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of
Windows host.

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/decorators.py

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 34319e203a3177..0bb9ab9f5f8929 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -989,13 +989,16 @@ def skipUnlessAArch64MTELinuxCompiler(func):
 
 def is_toolchain_with_mte():
 compiler_path = lldbplatformutil.getCompiler()
-compiler = os.path.basename(compiler_path)
-f = tempfile.NamedTemporaryFile()
+f = tempfile.NamedTemporaryFile(delete=False)
 if lldbplatformutil.getPlatform() == "windows":
 return "MTE tests are not compatible with 'windows'"
 
-cmd = "echo 'int main() {}' | %s -x c -o %s -" % (compiler_path, 
f.name)
-if os.popen(cmd).close() is not None:
+# Note hostos may be Windows.
+f.close()
+
+cmd = f"{compiler_path} -x c -o {f.name} -"
+if subprocess.run(cmd, input="int main() {}".encode()).returncode != 0:
+os.remove(f.name)
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
 return None
@@ -1010,12 +1013,10 @@ def is_toolchain_with_mte():
 int main() {
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
-cmd = "echo '%s' | %s -march=armv8.5-a+memtag -x c -o %s -" % (
-test_src,
-compiler_path,
-f.name,
-)
-if os.popen(cmd).close() is not None:
+cmd = f"{compiler_path} -march=armv8.5-a+memtag -x c -o {f.name} -"
+res = subprocess.run(cmd, input=test_src.encode())
+os.remove(f.name)
+if res.returncode != 0:
 return "Toolchain does not support MTE"
 return None
 



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


[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator in case of Windows host (PR #115337)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman closed 
https://github.com/llvm/llvm-project/pull/115337
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 39bce77 - [lldb][test] TestConstStaticIntegralMember.py: XFAIL on Darwin for older compiler verions

2024-11-08 Thread Michael Buch via lldb-commits

Author: Michael Buch
Date: 2024-11-08T11:59:08Z
New Revision: 39bce77bd6cdb334810ed95249683484e44c1165

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

LOG: [lldb][test] TestConstStaticIntegralMember.py: XFAIL on Darwin for older 
compiler verions

Follow-up to https://github.com/llvm/llvm-project/pull/111859. Prior
to this PR we would never run these tests with DWARFv5 on older Clang
versions (since default wasn't DWARFv5 on macOS until recently). The
patch explicitly started running some of these tests with DWARFv5.
These were failing on the macOS matrix bot (with Clang-15/Clang-17).

```
==
FAIL: test_inline_static_members_dwarf5_dsym 
(TestConstStaticIntegralMember.TestCase)
--
Traceback (most recent call last):
  File 
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py",
 line 1769, in test_method
return attrvalue(self)
  File 
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py",
 line 150, in test_inline_static_members_dwarf5
self.check_inline_static_members("-gdwarf-5")
  File 
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py",
 line 129, in check_inline_static_members
self.check_global_var("A::int_val", "const int", "1")
  File 
"/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py",
 line 118, in check_global_var
self.assertGreaterEqual(len(var_list), 1)
AssertionError: 0 not greater than or equal to 1
```

Added: 


Modified: 

lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py

Removed: 




diff  --git 
a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
 
b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
index cb01c7fc3612ce..1584d48e8e2d70 100644
--- 
a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ 
b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -146,6 +146,7 @@ def check_inline_static_members(self, flags):
 @skipIfWindows
 # On linux this passes due to the manual index
 @expectedFailureDarwin(debug_info=no_match(["dsym"]))
+@expectedFailureDarwin(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
 def test_inline_static_members_dwarf5(self):
 self.check_inline_static_members("-gdwarf-5")
 
@@ -199,6 +200,7 @@ def check_shadowed_static_inline_members(self, flags):
 @skipIfWindows
 # On linux this passes due to the manual index
 @expectedFailureDarwin(debug_info=no_match(["dsym"]))
+@expectedFailureDarwin(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
 def test_shadowed_static_inline_members_dwarf5(self):
 self.check_shadowed_static_inline_members("-gdwarf-5")
 



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


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman created 
https://github.com/llvm/llvm-project/pull/115470

Fixed TestTargetCommand.py in case of Windows host and Linux target.

>From 284853a9b9c2d2a38dcfb2a1acb0caed523d8e75 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Fri, 8 Nov 2024 16:16:59 +0400
Subject: [PATCH] [lldb] Fixed TestTargetCommand.py in case of Windows host and
 Linux target

---
 lldb/test/API/commands/target/basic/TestTargetCommand.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py 
b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index cb7a5f33f6643e..cd4885544cf46c 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -417,7 +417,7 @@ def test_target_create_nonexistent_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
@@ -440,7 +440,7 @@ def test_target_create_nonexistent_sym_file(self):
 ],
 )
 
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
@@ -451,7 +451,7 @@ def test_target_create_invalid_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()

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


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)


Changes

Fixed TestTargetCommand.py in case of Windows host and Linux target.

---
Full diff: https://github.com/llvm/llvm-project/pull/115470.diff


1 Files Affected:

- (modified) lldb/test/API/commands/target/basic/TestTargetCommand.py (+3-3) 


``diff
diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py 
b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index cb7a5f33f6643e..cd4885544cf46c 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -417,7 +417,7 @@ def test_target_create_nonexistent_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
@@ -440,7 +440,7 @@ def test_target_create_nonexistent_sym_file(self):
 ],
 )
 
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
@@ -451,7 +451,7 @@ def test_target_create_invalid_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=['windows'])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()

``




https://github.com/llvm/llvm-project/pull/115470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread Pavel Labath via lldb-commits

https://github.com/labath approved this pull request.


https://github.com/llvm/llvm-project/pull/115470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Michael Buch via lldb-commits
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= 
Message-ID:
In-Reply-To: 



@@ -2771,8 +2771,14 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 ast, llvm::cast(qual_type)->getModifiedType(),
 allow_completion);
 
-  case clang::Type::MemberPointer:
+  case clang::Type::MemberPointer: {
+auto *MPT = qual_type.getTypePtr()->castAs();
+if (MPT->getClass()->isRecordType())
+  GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+allow_completion);

Michael137 wrote:

Technically we need to run the completion only on MS-ABI. Though I *think* this 
shouldn't be too expensive since member pointers aren't a very common code 
path, so probably not worth guarding this on the target ABI. But should we add 
a comment here saying we need this type to be completed because of MS-ABI?

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread via lldb-commits

github-actions[bot] wrote:




:warning: Python code formatter, darker found issues in your code. :warning:



You can test this locally with the following command:


``bash
darker --check --diff -r 
34bf9dd6d39cb2bf75731cea7a26c3563720cb67...284853a9b9c2d2a38dcfb2a1acb0caed523d8e75
 lldb/test/API/commands/target/basic/TestTargetCommand.py
``





View the diff from darker here.


``diff
--- TestTargetCommand.py2024-11-08 12:16:59.00 +
+++ TestTargetCommand.py2024-11-08 12:20:49.909224 +
@@ -415,11 +415,11 @@
 ": (No such file or directory|The system cannot find the file 
specified)",
 ],
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIf(hostoslist=['windows'])
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
 os.chmod(tf.name, stat.S_IWRITE)
 self.expect(
@@ -438,22 +438,22 @@
 "Cannot open '",
 ": (No such file or directory|The system cannot find the file 
specified)",
 ],
 )
 
-@skipIf(hostoslist=['windows'])
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
 self.expect(
 "target create -c '" + invalid_core_path + "'",
 error=True,
 substrs=["Unknown core file format '"],
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIf(hostoslist=['windows'])
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()
 os.chmod(tf.name, stat.S_IWRITE)
 self.expect(

``




https://github.com/llvm/llvm-project/pull/115470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Michael Buch via lldb-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= 
Message-ID:
In-Reply-To: 


https://github.com/Michael137 approved this pull request.


https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb/DWARF] Cache negative results of variable parsing (PR #108810)

2024-11-08 Thread Pavel Labath via lldb-commits

https://github.com/labath closed 
https://github.com/llvm/llvm-project/pull/108810
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Add timed callbacks to the MainLoop class (PR #112895)

2024-11-08 Thread Pavel Labath via lldb-commits

https://github.com/labath closed 
https://github.com/llvm/llvm-project/pull/112895
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 6e4cd46 - [lldb] s/assertEquals/assertEqual TestDAP_sendEvent

2024-11-08 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2024-11-08T13:25:23+01:00
New Revision: 6e4cd463e580046feb66597a61db352c63fd783b

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

LOG: [lldb] s/assertEquals/assertEqual TestDAP_sendEvent

New unittest versions don't have the "s" version.

Added: 


Modified: 
lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py 
b/lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py
index de47651bb2fa1b..ce262be1618616 100644
--- a/lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py
+++ b/lldb/test/API/tools/lldb-dap/send-event/TestDAP_sendEvent.py
@@ -38,12 +38,12 @@ def test_send_event(self):
 custom_event = self.dap_server.wait_for_event(
 filter=["my-custom-event-no-body"]
 )
-self.assertEquals(custom_event["event"], "my-custom-event-no-body")
+self.assertEqual(custom_event["event"], "my-custom-event-no-body")
 self.assertIsNone(custom_event.get("body", None))
 
 custom_event = 
self.dap_server.wait_for_event(filter=["my-custom-event"])
-self.assertEquals(custom_event["event"], "my-custom-event")
-self.assertEquals(custom_event["body"], custom_event_body)
+self.assertEqual(custom_event["event"], "my-custom-event")
+self.assertEqual(custom_event["body"], custom_event_body)
 
 def test_send_internal_event(self):
 """



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


[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (PR #115480)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman closed 
https://github.com/llvm/llvm-project/pull/115480
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman updated 
https://github.com/llvm/llvm-project/pull/115470

>From e3501b22f7571017c184705ac8792777cf6b2d3e Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Fri, 8 Nov 2024 16:16:59 +0400
Subject: [PATCH] [lldb] Fixed TestTargetCommand.py in case of Windows host and
 Linux target

---
 lldb/test/API/commands/target/basic/TestTargetCommand.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py 
b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index cb7a5f33f6643e..953b59d729bfab 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -417,7 +417,7 @@ def test_target_create_nonexistent_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
@@ -440,7 +440,7 @@ def test_target_create_nonexistent_sym_file(self):
 ],
 )
 
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
@@ -451,7 +451,7 @@ def test_target_create_invalid_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()

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


[Lldb-commits] [lldb] 32c744a - [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (#115480)

2024-11-08 Thread via lldb-commits

Author: Dmitry Vasilyev
Date: 2024-11-08T17:44:51+04:00
New Revision: 32c744ae339dc356060636bcdf75a5e2a67fca00

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

LOG: [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (#115480)

It is broken after #115337

https://lab.llvm.org/buildbot/#/builders/195/builds/794

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/decorators.py

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 0bb9ab9f5f8929..c48c0b2f779449 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -997,7 +997,10 @@ def is_toolchain_with_mte():
 f.close()
 
 cmd = f"{compiler_path} -x c -o {f.name} -"
-if subprocess.run(cmd, input="int main() {}".encode()).returncode != 0:
+if (
+subprocess.run(cmd, shell=True, input="int main() 
{}".encode()).returncode
+!= 0
+):
 os.remove(f.name)
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
@@ -1014,7 +1017,7 @@ def is_toolchain_with_mte():
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
 cmd = f"{compiler_path} -march=armv8.5-a+memtag -x c -o {f.name} -"
-res = subprocess.run(cmd, input=test_src.encode())
+res = subprocess.run(cmd, shell=True, input=test_src.encode())
 os.remove(f.name)
 if res.returncode != 0:
 return "Toolchain does not support MTE"



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


[Lldb-commits] [lldb] 34bf9dd - [lldb][test] TestConstStaticIntegralMember.py: fix XFAIL decorators

2024-11-08 Thread Michael Buch via lldb-commits

Author: Michael Buch
Date: 2024-11-08T12:07:34Z
New Revision: 34bf9dd6d39cb2bf75731cea7a26c3563720cb67

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

LOG: [lldb][test] TestConstStaticIntegralMember.py: fix XFAIL decorators

The `compiler` parameter is not supported in the `expectedFailureDarwin`
decorator.

Change the decorator to `expectedFailureAll`, which is fine because
this only affects the `dsym` variant (which is only a macOS variant).

Added: 


Modified: 

lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py

Removed: 




diff  --git 
a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
 
b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
index 1584d48e8e2d70..c79cf19f36aafd 100644
--- 
a/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
+++ 
b/lldb/test/API/lang/cpp/const_static_integral_member/TestConstStaticIntegralMember.py
@@ -146,7 +146,7 @@ def check_inline_static_members(self, flags):
 @skipIfWindows
 # On linux this passes due to the manual index
 @expectedFailureDarwin(debug_info=no_match(["dsym"]))
-@expectedFailureDarwin(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
+@expectedFailureAll(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
 def test_inline_static_members_dwarf5(self):
 self.check_inline_static_members("-gdwarf-5")
 
@@ -200,7 +200,7 @@ def check_shadowed_static_inline_members(self, flags):
 @skipIfWindows
 # On linux this passes due to the manual index
 @expectedFailureDarwin(debug_info=no_match(["dsym"]))
-@expectedFailureDarwin(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
+@expectedFailureAll(debug_info=["dsym"], compiler=["clang"], 
compiler_version=["<", "19.0"])
 def test_shadowed_static_inline_members_dwarf5(self):
 self.check_shadowed_static_inline_members("-gdwarf-5")
 



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


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Michael Buch via lldb-commits
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= ,
Stefan =?utf-8?q?Gränitz?= 
Message-ID:
In-Reply-To: 



@@ -2,23 +2,58 @@
 
 // Itanium ABI:
 // RUN: %clang --target=x86_64-pc-linux -gdwarf -c -o %t_linux.o %s
-// RUN: %lldb -f %t_linux.o -b -o "target variable mp" | FileCheck %s
+// RUN: %lldb -f %t_linux.o -b -o "target variable s1 s2 m1 m2 v1 v2 v3 v4" | 
FileCheck --check-prefix=CHECK-GNU %s
 //
-// CHECK: (char SI::*) mp = 0x
+// CHECK-GNU: (void (Single1::*)()) s1 = 0x
+// CHECK-GNU: (void (Single2::*)()) s2 = 0x
+// CHECK-GNU: (void (Multiple1::*)()) m1 = 0x
+// CHECK-GNU: (void (Multiple2::*)()) m2 = 0x
+// CHECK-GNU: (void (Virtual1::*)()) v1 = 0x
+// CHECK-GNU: (void (Virtual2::*)()) v2 = 0x
+// CHECK-GNU: (void (Virtual3::*)()) v3 = 0x
+// CHECK-GNU: (void (Virtual4::*)()) v4 = 0x
 
 // Microsoft ABI:
-// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj -- %s
-// RUN: lld-link /out:%t_win.exe %t_win.obj /nodefaultlib /entry:main /debug
-// RUN: %lldb -f %t_win.exe -b -o "target variable mp" | FileCheck 
--check-prefix=CHECK-MSVC %s
+// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj /GS- 
-- %s

Michael137 wrote:

Why the `/GS-` here?

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman updated 
https://github.com/llvm/llvm-project/pull/115470

>From cae969003805b2b41d6b6176253e6296f976d518 Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Fri, 8 Nov 2024 16:16:59 +0400
Subject: [PATCH] [lldb] Fixed TestTargetCommand.py in case of Windows host and
 Linux target

---
 lldb/test/API/commands/target/basic/TestTargetCommand.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py 
b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index cb7a5f33f6643e..953b59d729bfab 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -417,7 +417,7 @@ def test_target_create_nonexistent_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
@@ -440,7 +440,7 @@ def test_target_create_nonexistent_sym_file(self):
 ],
 )
 
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
@@ -451,7 +451,7 @@ def test_target_create_invalid_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()

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


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits


@@ -2,23 +2,58 @@
 
 // Itanium ABI:
 // RUN: %clang --target=x86_64-pc-linux -gdwarf -c -o %t_linux.o %s
-// RUN: %lldb -f %t_linux.o -b -o "target variable mp" | FileCheck %s
+// RUN: %lldb -f %t_linux.o -b -o "target variable s1 s2 m1 m2 v1 v2 v3 v4" | 
FileCheck --check-prefix=CHECK-GNU %s
 //
-// CHECK: (char SI::*) mp = 0x
+// CHECK-GNU: (void (Single1::*)()) s1 = 0x
+// CHECK-GNU: (void (Single2::*)()) s2 = 0x
+// CHECK-GNU: (void (Multiple1::*)()) m1 = 0x
+// CHECK-GNU: (void (Multiple2::*)()) m2 = 0x
+// CHECK-GNU: (void (Virtual1::*)()) v1 = 0x
+// CHECK-GNU: (void (Virtual2::*)()) v2 = 0x
+// CHECK-GNU: (void (Virtual3::*)()) v3 = 0x
+// CHECK-GNU: (void (Virtual4::*)()) v4 = 0x
 
 // Microsoft ABI:
-// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj -- %s
-// RUN: lld-link /out:%t_win.exe %t_win.obj /nodefaultlib /entry:main /debug
-// RUN: %lldb -f %t_win.exe -b -o "target variable mp" | FileCheck 
--check-prefix=CHECK-MSVC %s
+// RUN: %clang_cl --target=x86_64-windows-msvc -c -gdwarf -o %t_win.obj /GS- 
-- %s

weliveindetail wrote:

It tells the compiler not to inject stack protection guards. Otherwise we had 
to link against system libs. It's used in a number of tests as well as 
https://github.com/llvm/llvm-project/blob/release/19.x/lldb/test/Shell/helper/build.py#L677

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits

https://github.com/weliveindetail updated 
https://github.com/llvm/llvm-project/pull/115177

From 32d7b7d5261e651851e5a36c5fd5ae9d927a9fb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 15:45:03 +0100
Subject: [PATCH 1/6] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with
 DWARF on Windows

---
 .../Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp  | 5 +
 lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp  | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index a30d898a93cc4d..319540389c05ee 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2138,6 +2138,11 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   if (record_decl)
 GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
+  // TODO: Only necessary if we target the Microsoft C++ ABI
+  auto IM = record_decl->calculateInheritanceModel();
+  record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
+  m_ast.getASTContext(), true, {}, 
clang::MSInheritanceAttr::Spelling(IM)));
+
   // Now parse all contained types inside of the class. We make forward
   // declarations to all classes, but we need the CXXRecordDecl to have decls
   // for all contained types because we don't get asked for them via the
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index f5063175d6e070..a1e224a395e69f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -2771,8 +2771,14 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 ast, llvm::cast(qual_type)->getModifiedType(),
 allow_completion);
 
-  case clang::Type::MemberPointer:
+  case clang::Type::MemberPointer: {
+auto *MPT = qual_type.getTypePtr()->castAs();
+if (MPT->getClass()->isRecordType())
+  GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+allow_completion);
+
 return !qual_type.getTypePtr()->isIncompleteType();
+  }
 
   default:
 break;

From 651ec094a624c76ba2087b803890e74acd66e6a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 17:22:27 +0100
Subject: [PATCH 2/6] Check for MS C++ ABI in DWARF parser

---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp   | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 319540389c05ee..9676ba27c555fb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -43,6 +43,7 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/Type.h"
+#include "clang/Basic/Specifiers.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Demangle/Demangle.h"
 
@@ -2138,10 +2139,15 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   if (record_decl)
 GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
-  // TODO: Only necessary if we target the Microsoft C++ ABI
-  auto IM = record_decl->calculateInheritanceModel();
-  record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
-  m_ast.getASTContext(), true, {}, 
clang::MSInheritanceAttr::Spelling(IM)));
+  // DWARF doesn't have the attribute, but we can infer the value the same way
+  // as Clang Sema does. It's required to calculate the size of pointers to
+  // member functions of this type.
+  if (m_ast.getASTContext().getTargetInfo().getCXXABI().isMicrosoft()) {
+auto IM = record_decl->calculateInheritanceModel();
+record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
+m_ast.getASTContext(), true, {},
+clang::MSInheritanceAttr::Spelling(IM)));
+  }
 
   // Now parse all contained types inside of the class. We make forward
   // declarations to all classes, but we need the CXXRecordDecl to have decls

From a43ba8d756edc5cee6fbc1beb586e38d12ea589f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 18:24:12 +0100
Subject: [PATCH 3/6] Extend test coverage

---
 .../SymbolFile/DWARF/x86/member-pointers.cpp  | 45 +++
 1 file changed, 36 insertions(+), 9 deletions(-)

diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp 
b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
index c7bd95774d33f7..463b19c5a866ff 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
@@ -2,23 +2,50 @@
 
 // Itanium ABI:
 

[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits


@@ -2771,8 +2771,14 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 ast, llvm::cast(qual_type)->getModifiedType(),
 allow_completion);
 
-  case clang::Type::MemberPointer:
+  case clang::Type::MemberPointer: {
+auto *MPT = qual_type.getTypePtr()->castAs();
+if (MPT->getClass()->isRecordType())
+  GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+allow_completion);

weliveindetail wrote:

That right! In fact, it was quite simple, so I did both.

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (PR #115480)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman created 
https://github.com/llvm/llvm-project/pull/115480

It is broken after #115337

https://lab.llvm.org/buildbot/#/builders/195/builds/794

>From 091a21534bfdb043b3e9bea7156bcb483b179b1e Mon Sep 17 00:00:00 2001
From: Dmitry Vasilyev 
Date: Fri, 8 Nov 2024 17:22:43 +0400
Subject: [PATCH] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator

It is broken after #115337

https://lab.llvm.org/buildbot/#/builders/195/builds/794
---
 lldb/packages/Python/lldbsuite/test/decorators.py | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 0bb9ab9f5f8929..c48c0b2f779449 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -997,7 +997,10 @@ def is_toolchain_with_mte():
 f.close()
 
 cmd = f"{compiler_path} -x c -o {f.name} -"
-if subprocess.run(cmd, input="int main() {}".encode()).returncode != 0:
+if (
+subprocess.run(cmd, shell=True, input="int main() 
{}".encode()).returncode
+!= 0
+):
 os.remove(f.name)
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
@@ -1014,7 +1017,7 @@ def is_toolchain_with_mte():
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
 cmd = f"{compiler_path} -march=armv8.5-a+memtag -x c -o {f.name} -"
-res = subprocess.run(cmd, input=test_src.encode())
+res = subprocess.run(cmd, shell=True, input=test_src.encode())
 os.remove(f.name)
 if res.returncode != 0:
 return "Toolchain does not support MTE"

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


[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (PR #115480)

2024-11-08 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)


Changes

It is broken after #115337

https://lab.llvm.org/buildbot/#/builders/195/builds/794

---
Full diff: https://github.com/llvm/llvm-project/pull/115480.diff


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/decorators.py (+5-2) 


``diff
diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 0bb9ab9f5f8929..c48c0b2f779449 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -997,7 +997,10 @@ def is_toolchain_with_mte():
 f.close()
 
 cmd = f"{compiler_path} -x c -o {f.name} -"
-if subprocess.run(cmd, input="int main() {}".encode()).returncode != 0:
+if (
+subprocess.run(cmd, shell=True, input="int main() 
{}".encode()).returncode
+!= 0
+):
 os.remove(f.name)
 # Cannot compile at all, don't skip the test
 # so that we report the broken compiler normally.
@@ -1014,7 +1017,7 @@ def is_toolchain_with_mte():
 void* ptr = __arm_mte_create_random_tag((void*)(0), 0);
 }"""
 cmd = f"{compiler_path} -march=armv8.5-a+memtag -x c -o {f.name} -"
-res = subprocess.run(cmd, input=test_src.encode())
+res = subprocess.run(cmd, shell=True, input=test_src.encode())
 os.remove(f.name)
 if res.returncode != 0:
 return "Toolchain does not support MTE"

``




https://github.com/llvm/llvm-project/pull/115480
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Stefan Gränitz via lldb-commits

https://github.com/weliveindetail updated 
https://github.com/llvm/llvm-project/pull/115177

From 32d7b7d5261e651851e5a36c5fd5ae9d927a9fb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 15:45:03 +0100
Subject: [PATCH 1/8] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with
 DWARF on Windows

---
 .../Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp  | 5 +
 lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp  | 8 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index a30d898a93cc4d..319540389c05ee 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -2138,6 +2138,11 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   if (record_decl)
 GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
+  // TODO: Only necessary if we target the Microsoft C++ ABI
+  auto IM = record_decl->calculateInheritanceModel();
+  record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
+  m_ast.getASTContext(), true, {}, 
clang::MSInheritanceAttr::Spelling(IM)));
+
   // Now parse all contained types inside of the class. We make forward
   // declarations to all classes, but we need the CXXRecordDecl to have decls
   // for all contained types because we don't get asked for them via the
diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index f5063175d6e070..a1e224a395e69f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -2771,8 +2771,14 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 ast, llvm::cast(qual_type)->getModifiedType(),
 allow_completion);
 
-  case clang::Type::MemberPointer:
+  case clang::Type::MemberPointer: {
+auto *MPT = qual_type.getTypePtr()->castAs();
+if (MPT->getClass()->isRecordType())
+  GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+allow_completion);
+
 return !qual_type.getTypePtr()->isIncompleteType();
+  }
 
   default:
 break;

From 651ec094a624c76ba2087b803890e74acd66e6a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 17:22:27 +0100
Subject: [PATCH 2/8] Check for MS C++ ABI in DWARF parser

---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp   | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 319540389c05ee..9676ba27c555fb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -43,6 +43,7 @@
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
 #include "clang/AST/Type.h"
+#include "clang/Basic/Specifiers.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Demangle/Demangle.h"
 
@@ -2138,10 +2139,15 @@ bool DWARFASTParserClang::CompleteRecordType(const 
DWARFDIE &die,
   if (record_decl)
 GetClangASTImporter().SetRecordLayout(record_decl, layout_info);
 
-  // TODO: Only necessary if we target the Microsoft C++ ABI
-  auto IM = record_decl->calculateInheritanceModel();
-  record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
-  m_ast.getASTContext(), true, {}, 
clang::MSInheritanceAttr::Spelling(IM)));
+  // DWARF doesn't have the attribute, but we can infer the value the same way
+  // as Clang Sema does. It's required to calculate the size of pointers to
+  // member functions of this type.
+  if (m_ast.getASTContext().getTargetInfo().getCXXABI().isMicrosoft()) {
+auto IM = record_decl->calculateInheritanceModel();
+record_decl->addAttr(clang::MSInheritanceAttr::CreateImplicit(
+m_ast.getASTContext(), true, {},
+clang::MSInheritanceAttr::Spelling(IM)));
+  }
 
   // Now parse all contained types inside of the class. We make forward
   // declarations to all classes, but we need the CXXRecordDecl to have decls

From a43ba8d756edc5cee6fbc1beb586e38d12ea589f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Gr=C3=A4nitz?= 
Date: Wed, 6 Nov 2024 18:24:12 +0100
Subject: [PATCH 3/8] Extend test coverage

---
 .../SymbolFile/DWARF/x86/member-pointers.cpp  | 45 +++
 1 file changed, 36 insertions(+), 9 deletions(-)

diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp 
b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
index c7bd95774d33f7..463b19c5a866ff 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/member-pointers.cpp
@@ -2,23 +2,50 @@
 
 // Itanium ABI:
 

[Lldb-commits] [lldb] [lldb] Infer MSInheritanceAttr for CXXRecordDecl with DWARF on Windows (PR #115177)

2024-11-08 Thread Michael Buch via lldb-commits
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= ,
Stefan =?utf-8?q?Gr=C3=A4nitz?= 
Message-ID:
In-Reply-To: 



@@ -2771,8 +2771,14 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
 ast, llvm::cast(qual_type)->getModifiedType(),
 allow_completion);
 
-  case clang::Type::MemberPointer:
+  case clang::Type::MemberPointer: {
+auto *MPT = qual_type.getTypePtr()->castAs();
+if (MPT->getClass()->isRecordType())
+  GetCompleteRecordType(ast, clang::QualType(MPT->getClass(), 0),
+allow_completion);

Michael137 wrote:

thanks!

https://github.com/llvm/llvm-project/pull/115177
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] d5677b6 - [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (#115470)

2024-11-08 Thread via lldb-commits

Author: Dmitry Vasilyev
Date: 2024-11-08T18:11:59+04:00
New Revision: d5677b630d0faf38e2e92797415ff80676f86063

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

LOG: [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target 
(#115470)

Fixed TestTargetCommand.py in case of Windows host and Linux target.

Added: 


Modified: 
lldb/test/API/commands/target/basic/TestTargetCommand.py

Removed: 




diff  --git a/lldb/test/API/commands/target/basic/TestTargetCommand.py 
b/lldb/test/API/commands/target/basic/TestTargetCommand.py
index cb7a5f33f6643e..953b59d729bfab 100644
--- a/lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ b/lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -417,7 +417,7 @@ def test_target_create_nonexistent_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_core_file(self):
 tf = tempfile.NamedTemporaryFile()
@@ -440,7 +440,7 @@ def test_target_create_nonexistent_sym_file(self):
 ],
 )
 
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_invalid_core_file(self):
 invalid_core_path = os.path.join(self.getSourceDir(), 
"invalid_core_file")
@@ -451,7 +451,7 @@ def test_target_create_invalid_core_file(self):
 )
 
 # Write only files don't seem to be supported on Windows.
-@skipIfWindows
+@skipIf(hostoslist=["windows"])
 @no_debug_info_test
 def test_target_create_unreadable_sym_file(self):
 tf = tempfile.NamedTemporaryFile()



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


[Lldb-commits] [lldb] [lldb] Fixed TestTargetCommand.py in case of Windows host and Linux target (PR #115470)

2024-11-08 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman closed 
https://github.com/llvm/llvm-project/pull/115470
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb] Fixed the @skipUnlessAArch64MTELinuxCompiler decorator (PR #115480)

2024-11-08 Thread Vladislav Dzhidzhoev via lldb-commits

https://github.com/dzhidzhoev approved this pull request.


https://github.com/llvm/llvm-project/pull/115480
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits


@@ -1465,11 +1462,7 @@ CreateRunInTerminalReverseRequest(const 
llvm::json::Object &launch_request,
 llvm::StringRef key = envs.GetNameAtIndex(index);
 llvm::StringRef value = envs.GetValueAtIndex(index);
 
-if (key.empty())
-  g_dap.SendOutput(OutputType::Stderr,
-   "empty environment variable for value: \"" +
-   value.str() + '\"');
-else

ashgti wrote:

I guess I wasn't really sure why this is a warning.

In lldb I can use `settings set target.env-vars FOO=` and there isn't any 
warnings when I run a process and having an empty env isn't an issue on mac or 
linux as far as I can tell. 

I also don't see any mentions of why this was added in 
github.com/llvm/llvm-project/pull/106919 I could move the warning into 
lldb-dap.cpp after we call this helper.

https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb][ObjC] Fix method list entry offset calculation (PR #115571)

2024-11-08 Thread Adrian Prantl via lldb-commits

https://github.com/adrian-prantl approved this pull request.


https://github.com/llvm/llvm-project/pull/115571
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via lldb-commits

wlei-llvm wrote:

> > > > > > Ping @wlei-llvm
> > > > > 
> > > > > 
> > > > > Sorry for the delay. The new version addressed my last comment (with 
> > > > > just minor nits). However, I didn't fully follow the new features 
> > > > > related to `ProbeMatchSpecs` stuffs. Could you add more descriptions 
> > > > > to the diff summary? Or if it’s not a lot of work, could we split it 
> > > > > into two patches? We could commit the first part, and I will review 
> > > > > the second part separately.
> > > > 
> > > > 
> > > > NVM, I think now I get what `ProbeMatchSpecs` does, it's a vector 
> > > > because a function can have multiple sections(function split)
> > > 
> > > 
> > > Thank you for reviewing and sorry for the delay from my end, was busy 
> > > with profile quality work.
> > > ProbeMatchSpecs is a mechanism to match probes belonging to another 
> > > binary function. I'm going to utilize it in probe-based function matching 
> > > (#100446). For example:
> > > source function:
> > > ```
> > > void foo() {
> > >   bar();
> > > }
> > > ```
> > > 
> > > 
> > > 
> > >   
> > > 
> > > 
> > >   
> > > 
> > > 
> > > 
> > >   
> > > profiled binary: bar is not inlined => have top-level function bar new 
> > > binary (where the profile is applied to): bar is inlined into foo.
> > > Right now, BOLT does 1:1 matching between profile functions and binary 
> > > functions based on the name. #100446 will extend this to N:M where 
> > > multiple profiles can be matched to one binary function (as in the 
> > > example above where binary function foo would use profiles for foo and 
> > > bar), and one profile can be matched to multiple binary functions (eg if 
> > > bar was inlined into multiple functions).
> > > In this diff, ProbeMatchSpecs would only have one BinaryFunctionProfile 
> > > (existing name-based matching).
> > 
> > 
> > Thanks for the explanation! I was confused of the use of `ProbeMatchSpecs`, 
> > it would be great to add more descriptions in the diff summary or somewhere 
> > in the comments, or in the another patch when it's used(IMO if we add a 
> > feature, but we doesn't use it in the patch, it should be in the future 
> > patch when it's used)
> 
> Thank you. Added description of ProbeMatchSpecs to the summary. I decided to 
> introduce it in this diff because there's tight coupling between probe-based 
> block matching and function matching. This way, probe-based function matching 
> would not need to change how block matching works.

Makes sense, thanks for clarifying!

https://github.com/llvm/llvm-project/pull/99891
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Lei Wang via lldb-commits

https://github.com/wlei-llvm approved this pull request.

LGTM, thanks for addressing the comments!

https://github.com/llvm/llvm-project/pull/99891
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] [lldb-da] Refactoring JSONUtils to not use `g_dap` and instead passing in required arguments. (PR #115561)

2024-11-08 Thread John Harrison via lldb-commits

https://github.com/ashgti edited 
https://github.com/llvm/llvm-project/pull/115561
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [clang] [compiler-rt] [libc] [lld] [lldb] [llvm] [mlir] [BOLT] Match blocks with pseudo probes (PR #99891)

2024-11-08 Thread Amir Ayupov via lldb-commits

https://github.com/aaupov edited https://github.com/llvm/llvm-project/pull/99891
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


  1   2   >