[Lldb-commits] [clang] [lldb] [llvm] [AArch64][TargetParser] autogen ArchExtKind enum - renaming (PR #90320)

2024-04-27 Thread Tomas Matheson via lldb-commits

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


[Lldb-commits] [lldb] [PAC][lldb][Dwarf] Support `__ptrauth`-qualified types in user expressions (PR #84387)

2024-04-27 Thread Daniil Kovalev via lldb-commits

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


[Lldb-commits] [lldb] Add ability to specify running LLDB API testsuite by json description (PR #89764)

2024-04-27 Thread via lldb-commits

https://github.com/ita-sc updated 
https://github.com/llvm/llvm-project/pull/89764

>From fc787fcd239649632c3e8cc55f9138acd0b2eab2 Mon Sep 17 00:00:00 2001
From: Ivan Tetyushkin 
Date: Thu, 11 Apr 2024 11:56:12 +0300
Subject: [PATCH] Add ability to specify running LLDB API testsuite by json
 description

This patch adds ability to set up lldb dotest.py command with json format:
[
 {
"test_pack_name": "check-lldb-one", # <- mandatory
"test_pack_desc": "description for test pack", # <- mandatory
"test_compiler": "clang", # <- optional
"test_arch": "x86", # <- optional
"test_simulator": "tvos", # <- optional
"extra_flags": [ # <- optional
  "-static"
],
"skip_categories": [ # <- optional
  "lldb-vscode"
],
"xfail_categories": [ # <- optional
  "watchpoint"
],
"check_all": false # <- mandatory, if we should run it with check-all target
 },
 {...}
]

As result, we will run dotest with additional options
from test_simulator: tvos: --apple-sdk appletvsimulator --platform-name 
tvos-simulator
from test_compiler: --compiler=clang
from test_arch:  --arch x86
from extra_flags: we compile our test binaries with --static.

Note: this patch also adds ability to pass several extra flags to
dotest. It is done by this syntax: start:--option1:option2.

Also we pass skip and xfail categories to dotest.py script
---
 lldb/packages/Python/lldbsuite/test/dotest.py |  7 +-
 lldb/test/API/CMakeLists.txt  | 67 +++
 lldb/test/API/lit.cfg.py  | 28 
 3 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py 
b/lldb/packages/Python/lldbsuite/test/dotest.py
index 2ec4a840b91675..10678d030d7d61 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -336,7 +336,12 @@ def parseOptionsAndInitTestdirs():
 )
 
 if args.E:
-os.environ["CFLAGS_EXTRAS"] = args.E
+args_list = args.E.split(":")
+# Remove first 'start' element, as it was an ancillary item.
+if args_list[0] == "start":
+args_list = args_list[1:]
+
+os.environ["CFLAGS_EXTRAS"] = " ".join(args_list)
 
 if args.dwarf_version:
 configuration.dwarf_version = args.dwarf_version
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 9196f54ce1ae32..11550f1029c1af 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -195,3 +195,70 @@ add_lit_testsuite(check-lldb-api "Running lldb api test 
suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   EXCLUDE_FROM_CHECK_ALL
   DEPENDS lldb-api-test-deps)
+
+if(LLDB_API_JSON_CONFIG)
+  file(READ ${LLDB_API_JSON_CONFIG} API_TEST_CONFIGS)
+  set(IDX 0)
+  while(true)
+macro(set_test_info out_var key)
+  string(JSON ${out_var} ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} 
${IDX} ${key})
+  if (NOT ${ERROR_VAR} MATCHES .*NOTFOUND)
+break()
+  endif()
+endmacro()
+
+set_test_info(TEST_NAME test_pack_name)
+set_test_info(TEST_DESC test_pack_desc)
+set_test_info(CHECK_ALL_NEEDED check_all)
+
+set(TO_PARAMS "" CACHE STRING "internal variable to be given to lit config 
params" FORCE)
+# function to add a separate param to run lit.cfg with.
+function(add_param key substr)
+  string(JSON RES ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} ${IDX} 
${key})
+  if (${ERROR_VAR} MATCHES .*NOTFOUND)
+ list(APPEND TO_PARAMS "${substr}=${RES}")
+  endif()
+  set(TO_PARAMS ${TO_PARAMS} PARENT_SCOPE)
+endfunction()
+# function to add a list of params to run lit.cfg with.
+function (add_list_param key substr)
+  set(LIST_IDX 0)
+  set(FULL_LINE_TO_ADD "")
+  while (true)
+string(JSON RES ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} 
${IDX} ${key} ${LIST_IDX})
+   if (${RES} MATCHES .*NOTFOUND)
+  break()
+   endif()
+list(APPEND FULL_LINE_TO_ADD "${RES}")
+MATH(EXPR LIST_IDX "${LIST_IDX} + 1")
+  endwhile()
+  if (NOT "${FULL_LINE_TO_ADD}" STREQUAL "")
+   string (REPLACE ";" ":" FULL_LINE_TO_ADD_STR "${FULL_LINE_TO_ADD}")
+list(APPEND TO_PARAMS "${substr}=${FULL_LINE_TO_ADD_STR}")
+set(TO_PARAMS ${TO_PARAMS} PARENT_SCOPE)
+  endif()
+endfunction()
+
+add_param(test_compiler "test_compiler")
+add_param(test_arch "test_arch")
+add_param(test_simulator "lldb-run-with-simulator")
+add_list_param(extra_flags "extra_flags")
+add_list_param(skip_categories "skip_categories")
+add_list_param(xfail_categories "xfail_categories")
+
+# Create test targets
+if (CHECK_ALL_NEEDED)
+  add_lit_testsuite(${TEST_NAME}  ${TEST_DESC}
+   ${CMAKE_CURRENT_BINARY_DIR}
+   PARAMS ${TO_PARAMS}
+DEPENDS lldb-api-test-deps)
+else()
+  add_lit_testsuite(${TEST_NAME}  ${TEST_DESC}
+   ${CMAKE_CU

[Lldb-commits] [lldb] Add ability to specify running LLDB API testsuite by json description (PR #89764)

2024-04-27 Thread via lldb-commits

https://github.com/ita-sc updated 
https://github.com/llvm/llvm-project/pull/89764

>From 96e0223fe107b546cf9ce58279542017df1ef992 Mon Sep 17 00:00:00 2001
From: Ivan Tetyushkin 
Date: Thu, 11 Apr 2024 11:56:12 +0300
Subject: [PATCH] Add ability to specify running LLDB API testsuite by json
 description

This patch adds ability to set up lldb dotest.py command with json format:
[
 {
"test_pack_name": "check-lldb-one", # <- mandatory
"test_pack_desc": "description for test pack", # <- mandatory
"test_compiler": "clang", # <- optional
"test_arch": "x86", # <- optional
"test_simulator": "tvos", # <- optional
"extra_flags": [ # <- optional
  "-static"
],
"skip_categories": [ # <- optional
  "lldb-vscode"
],
"xfail_categories": [ # <- optional
  "watchpoint"
],
"check_all": false # <- mandatory, if we should run it with check-all target
 },
 {...}
]

As result, we will run dotest with additional options
from test_simulator: tvos: --apple-sdk appletvsimulator --platform-name 
tvos-simulator
from test_compiler: --compiler=clang
from test_arch:  --arch x86
from extra_flags: we compile our test binaries with --static.

Note: this patch also adds ability to pass several extra flags to
dotest. It is done by this syntax: start:--option1:option2.

Also we pass skip and xfail categories to dotest.py script
---
 lldb/packages/Python/lldbsuite/test/dotest.py |  7 +-
 lldb/test/API/CMakeLists.txt  | 67 +++
 lldb/test/API/lit.cfg.py  | 28 
 3 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py 
b/lldb/packages/Python/lldbsuite/test/dotest.py
index 2ec4a840b91675..10678d030d7d61 100644
--- a/lldb/packages/Python/lldbsuite/test/dotest.py
+++ b/lldb/packages/Python/lldbsuite/test/dotest.py
@@ -336,7 +336,12 @@ def parseOptionsAndInitTestdirs():
 )
 
 if args.E:
-os.environ["CFLAGS_EXTRAS"] = args.E
+args_list = args.E.split(":")
+# Remove first 'start' element, as it was an ancillary item.
+if args_list[0] == "start":
+args_list = args_list[1:]
+
+os.environ["CFLAGS_EXTRAS"] = " ".join(args_list)
 
 if args.dwarf_version:
 configuration.dwarf_version = args.dwarf_version
diff --git a/lldb/test/API/CMakeLists.txt b/lldb/test/API/CMakeLists.txt
index 9196f54ce1ae32..11550f1029c1af 100644
--- a/lldb/test/API/CMakeLists.txt
+++ b/lldb/test/API/CMakeLists.txt
@@ -195,3 +195,70 @@ add_lit_testsuite(check-lldb-api "Running lldb api test 
suite"
   ${CMAKE_CURRENT_BINARY_DIR}
   EXCLUDE_FROM_CHECK_ALL
   DEPENDS lldb-api-test-deps)
+
+if(LLDB_API_JSON_CONFIG)
+  file(READ ${LLDB_API_JSON_CONFIG} API_TEST_CONFIGS)
+  set(IDX 0)
+  while(true)
+macro(set_test_info out_var key)
+  string(JSON ${out_var} ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} 
${IDX} ${key})
+  if (NOT ${ERROR_VAR} MATCHES .*NOTFOUND)
+break()
+  endif()
+endmacro()
+
+set_test_info(TEST_NAME test_pack_name)
+set_test_info(TEST_DESC test_pack_desc)
+set_test_info(CHECK_ALL_NEEDED check_all)
+
+set(TO_PARAMS "" CACHE STRING "internal variable to be given to lit config 
params" FORCE)
+# function to add a separate param to run lit.cfg with.
+function(add_param key substr)
+  string(JSON RES ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} ${IDX} 
${key})
+  if (${ERROR_VAR} MATCHES .*NOTFOUND)
+ list(APPEND TO_PARAMS "${substr}=${RES}")
+  endif()
+  set(TO_PARAMS ${TO_PARAMS} PARENT_SCOPE)
+endfunction()
+# function to add a list of params to run lit.cfg with.
+function (add_list_param key substr)
+  set(LIST_IDX 0)
+  set(FULL_LINE_TO_ADD "")
+  while (true)
+string(JSON RES ERROR_VARIABLE ERROR_VAR GET ${API_TEST_CONFIGS} 
${IDX} ${key} ${LIST_IDX})
+   if (${RES} MATCHES .*NOTFOUND)
+  break()
+   endif()
+list(APPEND FULL_LINE_TO_ADD "${RES}")
+MATH(EXPR LIST_IDX "${LIST_IDX} + 1")
+  endwhile()
+  if (NOT "${FULL_LINE_TO_ADD}" STREQUAL "")
+   string (REPLACE ";" ":" FULL_LINE_TO_ADD_STR "${FULL_LINE_TO_ADD}")
+list(APPEND TO_PARAMS "${substr}=${FULL_LINE_TO_ADD_STR}")
+set(TO_PARAMS ${TO_PARAMS} PARENT_SCOPE)
+  endif()
+endfunction()
+
+add_param(test_compiler "test_compiler")
+add_param(test_arch "test_arch")
+add_param(test_simulator "lldb-run-with-simulator")
+add_list_param(extra_flags "extra_flags")
+add_list_param(skip_categories "skip_categories")
+add_list_param(xfail_categories "xfail_categories")
+
+# Create test targets
+if (CHECK_ALL_NEEDED)
+  add_lit_testsuite(${TEST_NAME}  ${TEST_DESC}
+   ${CMAKE_CURRENT_BINARY_DIR}
+   PARAMS ${TO_PARAMS}
+DEPENDS lldb-api-test-deps)
+else()
+  add_lit_testsuite(${TEST_NAME}  ${TEST_DESC}
+   ${CMAKE_CU