[llvm-branch-commits] [compiler-rt] [compiler-rt] [rtsan] Revert openat interceptor that breaks fortify-source builds (PR #100876)

2024-07-27 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny milestoned 
https://github.com/llvm/llvm-project/pull/100876
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [compiler-rt] [rtsan] Revert openat interceptor that breaks fortify-source builds (PR #100876)

2024-07-27 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny created 
https://github.com/llvm/llvm-project/pull/100876

Remove the openat interceptor from the 19.x branch, as it currently breaks 
builds against fortify-sources glibc, and full rtsan will not be included in 
this version anyway.

Suggested by Chris Apple in
https://github.com/llvm/llvm-project/issues/100754#issuecomment-2254169856

Bug #100754

From 33627d3d2be8c1b1d219ed712ca6e79f3fe50555 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Sat, 27 Jul 2024 17:04:45 +0200
Subject: [PATCH] [compiler-rt] [rtsan] Revert openat interceptor that breaks
 fortify-source builds

Remove the openat interceptor from the 19.x branch, as it currently
breaks builds against fortify-sources glibc, and full rtsan will not
be included in this version anyway.

Patch provided by Chris Apple in
https://github.com/llvm/llvm-project/issues/100754#issuecomment-2254169856

Bug #100754
---
 compiler-rt/lib/rtsan/rtsan_interceptors.cpp  | 15 ---
 .../lib/rtsan/tests/rtsan_test_interceptors.cpp   |  6 --
 2 files changed, 21 deletions(-)

diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp 
b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
index 4d5423ec629d2..e513d72d95814 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors.cpp
@@ -69,20 +69,6 @@ INTERCEPTOR(int, open, const char *path, int oflag, ...) {
   return result;
 }
 
-INTERCEPTOR(int, openat, int fd, const char *path, int oflag, ...) {
-  // TODO Establish whether we should intercept here if the flag contains
-  // O_NONBLOCK
-  ExpectNotRealtime("openat");
-
-  va_list args;
-  va_start(args, oflag);
-  mode_t mode = va_arg(args, int);
-  va_end(args);
-
-  const int result = REAL(openat)(fd, path, oflag, mode);
-  return result;
-}
-
 INTERCEPTOR(int, creat, const char *path, mode_t mode) {
   // TODO Establish whether we should intercept here if the flag contains
   // O_NONBLOCK
@@ -385,7 +371,6 @@ void __rtsan::InitializeInterceptors() {
 #endif
 
   INTERCEPT_FUNCTION(open);
-  INTERCEPT_FUNCTION(openat);
   INTERCEPT_FUNCTION(close);
   INTERCEPT_FUNCTION(fopen);
   INTERCEPT_FUNCTION(fread);
diff --git a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp 
b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp
index f5b016089087d..a5318a52e45c5 100644
--- a/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp
+++ b/compiler-rt/lib/rtsan/tests/rtsan_test_interceptors.cpp
@@ -178,12 +178,6 @@ TEST_F(RtsanFileTest, OpenDiesWhenRealtime) {
   ExpectNonRealtimeSurvival(func);
 }
 
-TEST_F(RtsanFileTest, OpenatDiesWhenRealtime) {
-  auto func = [this]() { openat(0, GetTemporaryFilePath(), O_RDONLY); };
-  ExpectRealtimeDeath(func, "openat");
-  ExpectNonRealtimeSurvival(func);
-}
-
 TEST_F(RtsanFileTest, OpenCreatesFileWithProperMode) {
   const int mode = S_IRGRP | S_IROTH | S_IRUSR | S_IWUSR;
 

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


[llvm-branch-commits] [compiler-rt] [compiler-rt] [rtsan] Revert openat interceptor that breaks fortify-source builds (PR #100876)

2024-07-27 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny edited 
https://github.com/llvm/llvm-project/pull/100876
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [compiler-rt] [rtsan] Revert openat interceptor that breaks fortify-source builds (PR #100876)

2024-07-27 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

(I have confirmed that this fixes the build on top of 19.x branch for me)

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


[llvm-branch-commits] [llvm] release/19.x: [llvm-exegesis] Use correct rseq struct size (#100804) (PR #100896)

2024-07-27 Thread Michał Górny via llvm-branch-commits

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


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


[llvm-branch-commits] release/19.x: [llvm-exegesis] Use correct rseq struct size (#100804) (PR #100885)

2024-07-29 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

I think it opened #100896 instead. Maybe it was because the other PR has 
`/cherry-pick` command twice.

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


[llvm-branch-commits] [openmp] Revert "release/18.x: [openmp] __kmp_x86_cpuid fix for i386/PIC builds. (#84626)" (PR #85527)

2024-03-16 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny milestoned 
https://github.com/llvm/llvm-project/pull/85527
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] 5aefc8d - [llvm] [cmake] Remove obsolete /usr/local hack for *BSD

2021-01-12 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2021-01-12T19:26:04+01:00
New Revision: 5aefc8dc4d14ad04259ab8ae0b2e0da2596d66f7

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

LOG: [llvm] [cmake] Remove obsolete /usr/local hack for *BSD

Remove the hack adding /usr/local paths on FreeBSD and DragonFlyBSD.
It does not seem to be necessary today, and it breaks cross builds.

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

Added: 


Modified: 
llvm/CMakeLists.txt

Removed: 




diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index ee1b646ab651..26a7029afefd 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -911,13 +911,6 @@ if(LLVM_TARGET_IS_CROSSCOMPILE_HOST)
 # (this is a variable that CrossCompile sets on recursive invocations)
 endif()
 
-if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-  # On FreeBSD, /usr/local/* is not used by default. In order to build LLVM
-  # with libxml2, iconv.h, etc., we must add /usr/local paths.
-  include_directories(SYSTEM "/usr/local/include")
-  link_directories("/usr/local/lib")
-endif(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
-
 if( ${CMAKE_SYSTEM_NAME} MATCHES SunOS )
# special hack for Solaris to handle crazy system sys/regset.h
include_directories("${LLVM_MAIN_INCLUDE_DIR}/llvm/Support/Solaris")



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


[llvm-branch-commits] [lldb] d5317b4 - [Process/NetBSD] Copy changes from FreeBSDRemote and reformat

2021-01-02 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2021-01-02T19:15:12+01:00
New Revision: d5317b41c5857df4d4b2a382abcd58b81d2dcb18

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

LOG: [Process/NetBSD] Copy changes from FreeBSDRemote and reformat

Copy changes, including:

- NativeProcessNetBSD::GetLoadedModuleFileSpec()
  and NativeProcessNetBSD::GetFileLoadAddress() methods

- split x86 register sets by CPU extensions

- use offset/size-based register reading/writing

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

Added: 


Modified: 
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.h
lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

lldb/test/API/tools/lldb-server/registers-target-xml-reading/TestGdbRemoteTargetXmlPacket.py

Removed: 




diff  --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp 
b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
index 75d0d0a37fae..57f0eb3cceb6 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -213,7 +213,7 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) {
 
   LLDB_LOG(log, "got SIGTRAP, pid = {0}, lwpid = {1}, si_code = {2}", pid,
info.psi_lwpid, info.psi_siginfo.si_code);
-  NativeThreadNetBSD* thread = nullptr;
+  NativeThreadNetBSD *thread = nullptr;
 
   if (info.psi_lwpid > 0) {
 for (const auto &t : m_threads) {
@@ -224,8 +224,7 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) {
   static_cast(t.get())->SetStoppedWithNoReason();
 }
 if (!thread)
-  LLDB_LOG(log,
-   "thread not found in m_threads, pid = {0}, LWP = {1}", pid,
+  LLDB_LOG(log, "thread not found in m_threads, pid = {0}, LWP = {1}", pid,
info.psi_lwpid);
   }
 
@@ -266,30 +265,27 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) 
{
 }
 
 switch (pst.pe_report_event) {
-  case PTRACE_LWP_CREATE: {
-LLDB_LOG(log,
- "monitoring new thread, pid = {0}, LWP = {1}", pid,
- pst.pe_lwp);
-NativeThreadNetBSD& t = AddThread(pst.pe_lwp);
-error = t.CopyWatchpointsFrom(
-static_cast(*GetCurrentThread()));
-if (error.Fail()) {
-  LLDB_LOG(log,
-   "failed to copy watchpoints to new thread {0}: {1}",
-   pst.pe_lwp, error);
-  SetState(StateType::eStateInvalid);
-  return;
-}
-  } break;
-  case PTRACE_LWP_EXIT:
-LLDB_LOG(log,
- "removing exited thread, pid = {0}, LWP = {1}", pid,
- pst.pe_lwp);
-RemoveThread(pst.pe_lwp);
-break;
+case PTRACE_LWP_CREATE: {
+  LLDB_LOG(log, "monitoring new thread, pid = {0}, LWP = {1}", pid,
+   pst.pe_lwp);
+  NativeThreadNetBSD &t = AddThread(pst.pe_lwp);
+  error = t.CopyWatchpointsFrom(
+  static_cast(*GetCurrentThread()));
+  if (error.Fail()) {
+LLDB_LOG(log, "failed to copy watchpoints to new thread {0}: {1}",
+ pst.pe_lwp, error);
+SetState(StateType::eStateInvalid);
+return;
+  }
+} break;
+case PTRACE_LWP_EXIT:
+  LLDB_LOG(log, "removing exited thread, pid = {0}, LWP = {1}", pid,
+   pst.pe_lwp);
+  RemoveThread(pst.pe_lwp);
+  break;
 }
 
-error = PtraceWrapper(PT_CONTINUE, pid, reinterpret_cast(1), 0);
+error = PtraceWrapper(PT_CONTINUE, pid, reinterpret_cast(1), 0);
 if (error.Fail())
   SetState(StateType::eStateInvalid);
 return;
@@ -301,12 +297,13 @@ void NativeProcessNetBSD::MonitorSIGTRAP(lldb::pid_t pid) 
{
 auto ®ctx = static_cast(
 thread->GetRegisterContext());
 uint32_t wp_index = LLDB_INVALID_INDEX32;
-Status error = regctx.GetWatchpointHitIndex(wp_index,
-(uintptr_t)info.psi_siginfo.si_addr);
+Status error = regctx.GetWatchpointHitIndex(
+wp_index, (uintptr_t)info.psi_siginfo.si_addr);
 if (error.Fail())
   LLDB_LOG(log,
"received error while checking for watchpoint hits, pid = "
-   "{0}, LWP = {1}, error = {2}", pid, info.psi_lwpid, error);
+   "{0}, LWP = {1}, error = {2}",
+   pid, info.psi_lwpid, error);
 if (wp_index != LLDB_INVALID_INDEX32) {
   thread->SetStoppedByWatchpoint(wp_index);
   regctx.ClearWatchpointHit(wp_index);
@@ -494,16 +491,14 @@ Status NativeProces

[llvm-branch-commits] [lldb] b9bfe8a - [lldb] [debugserver] Add stN aliases for stmmN for compatibility

2021-01-06 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2021-01-07T02:10:38+01:00
New Revision: b9bfe8a75306b211dc53291d28a31c0f37be2a2c

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

LOG: [lldb] [debugserver] Add stN aliases for stmmN for compatibility

Add stN aliases for the FPU (stmmN) registers on MacOSX.  This should
improve compatibility between MacOSX and other platforms, and partially
fix x86*-fp-write tests without having to duplicate them.  Note that
the tests are currently still broken due to ftag incompatibility.

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

Added: 


Modified: 
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/CMakeLists.txt
lldb/test/Shell/Register/x86-multithread-write.test
lldb/test/Shell/lit.cfg.py
lldb/test/Shell/lit.site.cfg.py.in
lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Removed: 




diff  --git 
a/lldb/test/API/commands/register/register/register_command/TestRegisters.py 
b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
index 0b53fa684c288..fa8e99aefa6ab 100644
--- a/lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -320,10 +320,12 @@ def fp_register_write(self):
 ]
 
 st0regname = None
-if currentFrame.FindRegister("st0").IsValid():
-st0regname = "st0"
-elif currentFrame.FindRegister("stmm0").IsValid():
+# Darwin is using stmmN by default but support stN as an alias.
+# Therefore, we need to check for stmmN first.
+if currentFrame.FindRegister("stmm0").IsValid():
 st0regname = "stmm0"
+elif currentFrame.FindRegister("st0").IsValid():
+st0regname = "st0"
 if st0regname is not None:
 # reg  value
 # must-have

diff  --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index 9d17009df2cad..79fa05f2df29f 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -166,6 +166,7 @@ llvm_canonicalize_cmake_booleans(
   LLDB_ENABLE_LZMA
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_SHARED_LIBS
+  LLDB_USE_SYSTEM_DEBUGSERVER
   LLDB_IS_64_BITS)
 
 # Configure the individual test suites.

diff  --git a/lldb/test/Shell/Register/x86-multithread-write.test 
b/lldb/test/Shell/Register/x86-multithread-write.test
index bf0cd33c44e00..cc02b323c7263 100644
--- a/lldb/test/Shell/Register/x86-multithread-write.test
+++ b/lldb/test/Shell/Register/x86-multithread-write.test
@@ -1,6 +1,6 @@
 # XFAIL: system-windows
-# XFAIL: system-darwin
 # REQUIRES: native && (target-x86 || target-x86_64)
+# UNSUPPORTED: system-debugserver
 # RUN: %clangxx_host %p/Inputs/x86-multithread-write.cpp -o %t -pthread
 # RUN: %lldb -b -s %s %t | FileCheck %s
 

diff  --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 7b179c587f712..83e3ef6782adc 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -120,6 +120,9 @@ def calculate_arch_features(arch_string):
 if find_executable('xz') != None:
 config.available_features.add('xz')
 
+if config.lldb_system_debugserver:
+config.available_features.add('system-debugserver')
+
 # NetBSD permits setting dbregs either if one is root
 # or if user_set_dbregs is enabled
 can_set_dbregs = True

diff  --git a/lldb/test/Shell/lit.site.cfg.py.in 
b/lldb/test/Shell/lit.site.cfg.py.in
index 6cddd3937628d..868f0b6e7b268 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -22,6 +22,7 @@ config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.lldb_enable_lua = @LLDB_ENABLE_LUA@
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
+config.lldb_system_debugserver = @LLDB_USE_SYSTEM_DEBUGSERVER@
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", 
"lldb-shell")
 config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", 
"lldb-shell")

diff  --git a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp 
b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
index 27bc75110620a..2b1d360dcae5f 100644
--- a/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
@@ -1356,28 +1356,28 @@ const DNBRegisterInfo 
DNBArchImplI386::g_fpu_registers_no_avx[] = {
  FPU_SIZE_UINT(mxcsrmask), FPU_OFFSET(mxcsrmask), INVALID_NUB_REGNUM,
  INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, 

[llvm-branch-commits] [clang] df3182a - [clang] [test] Skip hip-fpie-option.hip if default-pie

2022-02-25 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2022-02-25T21:02:00+01:00
New Revision: df3182a7df1913f8503fda9bb4553297f0b8571b

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

LOG: [clang] [test] Skip hip-fpie-option.hip if default-pie

Skip the hip-fpie-option.hip Driver test if default-pie-on-linux
is used.  This test currently relies on default-no-pie, and it has been
changed to require default-pie in main.

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

Added: 


Modified: 
clang/test/Driver/hip-fpie-option.hip

Removed: 




diff  --git a/clang/test/Driver/hip-fpie-option.hip 
b/clang/test/Driver/hip-fpie-option.hip
index 2e296a099dea..69a2954f6a90 100644
--- a/clang/test/Driver/hip-fpie-option.hip
+++ b/clang/test/Driver/hip-fpie-option.hip
@@ -1,4 +1,5 @@
 // REQUIRES: clang-driver, amdgpu-registered-target
+// UNSUPPORTED: default-pie-on-linux
 
 // -fPIC and -fPIE only affects host relocation model.
 // device compilation always uses PIC. 



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


[llvm-branch-commits] [lldb] 8666b90 - [lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hit

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T09:31:10+01:00
New Revision: 8666b9057f23badfe90548297f3c01937daa4a9c

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

LOG: [lldb] [POSIX-DYLD] Add libraries from initial rendezvous brkpt hit

Explicitly consider the libraries reported on the initial rendezvous
breakpoint hit added.  This is necessary on FreeBSD since the dynamic
loader issues only a single 'consistent' state rendezvous breakpoint hit
for all the libraries present in DT_NEEDED.  It is also helpful on Linux
where it ensures that ld-linux is considered loaded as well
as the shared system libraries reported afterwards.

Reenable memory maps on FreeBSD since this fixed the issue triggered
by them.

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

Added: 


Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
lldb/test/API/api/multithreaded/TestMultithreaded.py

lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

lldb/test/API/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py
lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test

Removed: 




diff  --git 
a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index ac60af5336ed..01f746ada3ba 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -76,7 +76,8 @@ DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process 
*process)
   m_load_offset(LLDB_INVALID_ADDRESS), m_entry_point(LLDB_INVALID_ADDRESS),
   m_auxv(), m_dyld_bid(LLDB_INVALID_BREAK_ID),
   m_vdso_base(LLDB_INVALID_ADDRESS),
-  m_interpreter_base(LLDB_INVALID_ADDRESS) {}
+  m_interpreter_base(LLDB_INVALID_ADDRESS), m_initial_modules_added(false) 
{
+}
 
 DynamicLoaderPOSIXDYLD::~DynamicLoaderPOSIXDYLD() {
   if (m_dyld_bid != LLDB_INVALID_BREAK_ID) {
@@ -418,14 +419,38 @@ void DynamicLoaderPOSIXDYLD::RefreshModules() {
 
   ModuleList &loaded_modules = m_process->GetTarget().GetImages();
 
-  if (m_rendezvous.ModulesDidLoad()) {
+  if (m_rendezvous.ModulesDidLoad() || !m_initial_modules_added) {
 ModuleList new_modules;
 
-E = m_rendezvous.loaded_end();
-for (I = m_rendezvous.loaded_begin(); I != E; ++I) {
+// If this is the first time rendezvous breakpoint fires, we need
+// to take care of adding all the initial modules reported by
+// the loader.  This is necessary to list ld-linux.so on Linux,
+// and all DT_NEEDED entries on *BSD.
+if (m_initial_modules_added) {
+  I = m_rendezvous.loaded_begin();
+  E = m_rendezvous.loaded_end();
+} else {
+  I = m_rendezvous.begin();
+  E = m_rendezvous.end();
+  m_initial_modules_added = true;
+}
+for (; I != E; ++I) {
   ModuleSP module_sp =
   LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true);
   if (module_sp.get()) {
+if (module_sp->GetObjectFile()->GetBaseAddress().GetLoadAddress(
+&m_process->GetTarget()) == m_interpreter_base &&
+module_sp != m_interpreter_module.lock()) {
+  // If this is a duplicate instance of ld.so, unload it.  We may end 
up
+  // with it if we load it via a 
diff erent path than before (symlink
+  // vs real path).
+  // TODO: remove this once we either fix library matching or avoid
+  // loading the interpreter when setting the rendezvous breakpoint.
+  UnloadSections(module_sp);
+  loaded_modules.Remove(module_sp);
+  continue;
+}
+
 loaded_modules.AppendIfNeeded(module_sp);
 new_modules.Append(module_sp);
   }
@@ -544,6 +569,7 @@ ModuleSP DynamicLoaderPOSIXDYLD::LoadInterpreterModule() {
 true /* notify */)) {
 UpdateLoadedSections(module_sp, LLDB_INVALID_ADDRESS, m_interpreter_base,
  false);
+m_interpreter_module = module_sp;
 return module_sp;
   }
   return nullptr;

diff  --git 
a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
index a7fcdfbadeaf..61567801fdd0 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
+++ b/lldb/source/Plugins/DynamicLoader

[llvm-branch-commits] [lldb] dbfdb13 - [lldb] [POSIX-DYLD] Update the cached exe path after attach

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T09:31:22+01:00
New Revision: dbfdb139f75470a9abc78e7c9faf743fdd963c2d

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

LOG: [lldb] [POSIX-DYLD] Update the cached exe path after attach

Fix the POSIX-DYLD plugin to update the cached executable path after
attaching.  Previously, the path was cached in DYLDRendezvous
constructor and not updated afterwards.  This meant that if LLDB was
attaching to a process (e.g. via connecting to lldb-server), the code
stored the empty path before DidAttach() resolved it.  The fix updates
the cached path in DidAttach().

This fixes a new instance of https://llvm.org/pr17880

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

Added: 


Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
lldb/test/API/commands/process/attach/TestProcessAttach.py
lldb/test/API/commands/process/attach/main.cpp

Removed: 




diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index 15b3805003a5..866acbddbdc8 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -94,12 +94,13 @@ DYLDRendezvous::DYLDRendezvous(Process *process)
 : m_process(process), m_rendezvous_addr(LLDB_INVALID_ADDRESS), m_current(),
   m_previous(), m_loaded_modules(), m_soentries(), m_added_soentries(),
   m_removed_soentries() {
-  Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
-
   m_thread_info.valid = false;
+  UpdateExecutablePath();
+}
 
-  // Cache a copy of the executable path
+void DYLDRendezvous::UpdateExecutablePath() {
   if (m_process) {
+Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
 Module *exe_mod = m_process->GetTarget().GetExecutableModulePointer();
 if (exe_mod) {
   m_exe_file_spec = exe_mod->GetPlatformFileSpec();

diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
index b028120eb0d4..3e88d88f407a 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
@@ -60,6 +60,9 @@ class DYLDRendezvous {
 
   DYLDRendezvous(lldb_private::Process *process);
 
+  /// Update the cached executable path.
+  void UpdateExecutablePath();
+
   /// Update the internal snapshot of runtime linker rendezvous and recompute
   /// the currently loaded modules.
   ///

diff  --git 
a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 01f746ada3ba..160faa74af23 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -102,6 +102,7 @@ void DynamicLoaderPOSIXDYLD::DidAttach() {
 
   ModuleSP executable_sp = GetTargetExecutable();
   ResolveExecutableModule(executable_sp);
+  m_rendezvous.UpdateExecutablePath();
 
   // find the main process load offset
   addr_t load_offset = ComputeLoadOffset();

diff  --git a/lldb/test/API/commands/process/attach/TestProcessAttach.py 
b/lldb/test/API/commands/process/attach/TestProcessAttach.py
index 5dfec5c76339..88429333edd3 100644
--- a/lldb/test/API/commands/process/attach/TestProcessAttach.py
+++ b/lldb/test/API/commands/process/attach/TestProcessAttach.py
@@ -20,6 +20,13 @@ class ProcessAttachTestCase(TestBase):
 
 NO_DEBUG_INFO_TESTCASE = True
 
+def setUp(self):
+# Call super's setUp().
+TestBase.setUp(self)
+# Find the line number to break for main.c.
+self.line = line_number('main.cpp',
+'// Waiting to be attached...')
+
 @skipIfiOSSimulator
 def test_attach_to_process_by_id(self):
 """Test attach by process id"""
@@ -77,6 +84,28 @@ def test_attach_to_process_by_name(self):
 process = target.GetProcess()
 self.assertTrue(process, PROCESS_IS_VALID)
 
+def test_attach_to_process_by_id_correct_executable_offset(self):
+"""
+Test that after attaching to a process the executable offset
+is determined correctly on FreeBSD.  This is a regression test
+for dyld plugin getting the correct executable path,
+and therefore being able to identify it in the module list.
+"""
+
+self.build()
+exe = self.getBuildArtifact(exe_name)
+
+# In order to reproduce, w

[llvm-branch-commits] [lldb] 5644035 - [lldb] [unittests] Add tests for NetBSD register offsets/sizes

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T13:55:42+01:00
New Revision: 56440359d093ea6f8e9c91064fdd47928cf07092

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

LOG: [lldb] [unittests] Add tests for NetBSD register offsets/sizes

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

Added: 
lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp
lldb/unittests/Process/Utility/RegisterContextNetBSDTest_x86_64.cpp

Modified: 
lldb/unittests/Process/Utility/CMakeLists.txt

Removed: 




diff  --git a/lldb/unittests/Process/Utility/CMakeLists.txt 
b/lldb/unittests/Process/Utility/CMakeLists.txt
index 78e29ed262c9..8e4696b7211d 100644
--- a/lldb/unittests/Process/Utility/CMakeLists.txt
+++ b/lldb/unittests/Process/Utility/CMakeLists.txt
@@ -1,7 +1,19 @@
+set(NETBSD_SOURCES
+  RegisterContextNetBSDTest_i386.cpp
+  RegisterContextNetBSDTest_x86_64.cpp)
+
+if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+  list(APPEND PLATFORM_SOURCES ${NETBSD_SOURCES})
+endif()
+
+set(LLVM_OPTIONAL_SOURCES
+  ${NETBSD_SOURCES})
+
 add_lldb_unittest(ProcessUtilityTests
   RegisterContextTest.cpp
   RegisterContextFreeBSDTest.cpp
   LinuxProcMapsTest.cpp
+  ${PLATFORM_SOURCES}
 
   LINK_LIBS
 lldbPluginProcessUtility)

diff  --git a/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp 
b/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp
new file mode 100644
index ..07e09d34d191
--- /dev/null
+++ b/lldb/unittests/Process/Utility/RegisterContextNetBSDTest_i386.cpp
@@ -0,0 +1,118 @@
+//===-- RegisterContextNetBSDTest_i386.cpp 
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#if defined(__i386__) || defined(__x86_64__)
+
+// clang-format off
+#include 
+#include 
+// clang-format on
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+
+#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+#include "Plugins/Process/Utility/RegisterContextNetBSD_i386.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+static std::pair GetRegParams(RegisterInfoInterface &ctx,
+  uint32_t reg) {
+  const RegisterInfo &info = ctx.GetRegisterInfo()[reg];
+  return {info.byte_offset, info.byte_size};
+}
+
+#define EXPECT_OFF(regname, offset, size)  
\
+  EXPECT_THAT(GetRegParams(reg_ctx, lldb_##regname),   
\
+  ::testing::Pair(offset + base_offset, size))
+
+#define EXPECT_GPR_I386(regname)   
\
+  EXPECT_THAT(GetRegParams(reg_ctx, lldb_##regname##_i386),
\
+  ::testing::Pair(offsetof(reg, r_##regname), \
+  sizeof(reg::r_##regname)))
+#define EXPECT_DBR_I386(num)   
\
+  EXPECT_OFF(dr##num##_i386, offsetof(dbreg, dr[num]),\
+ sizeof(dbreg::dr[num]))
+
+TEST(RegisterContextNetBSDTest, i386) {
+  ArchSpec arch{"i686-unknown-netbsd"};
+  RegisterContextNetBSD_i386 reg_ctx{arch};
+
+  EXPECT_GPR_I386(eax);
+  EXPECT_GPR_I386(ecx);
+  EXPECT_GPR_I386(edx);
+  EXPECT_GPR_I386(ebx);
+  EXPECT_GPR_I386(esp);
+  EXPECT_GPR_I386(ebp);
+  EXPECT_GPR_I386(esi);
+  EXPECT_GPR_I386(edi);
+  EXPECT_GPR_I386(eip);
+  EXPECT_GPR_I386(eflags);
+  EXPECT_GPR_I386(cs);
+  EXPECT_GPR_I386(ss);
+  EXPECT_GPR_I386(ds);
+  EXPECT_GPR_I386(es);
+  EXPECT_GPR_I386(fs);
+  EXPECT_GPR_I386(gs);
+
+  // fctrl is the first FPR field, it is used to determine offset of the whole
+  // FPR struct
+  size_t base_offset = reg_ctx.GetRegisterInfo()[lldb_fctrl_i386].byte_offset;
+
+  // assert against FXSAVE struct
+  EXPECT_OFF(fctrl_i386, 0x00, 2);
+  EXPECT_OFF(fstat_i386, 0x02, 2);
+  // TODO: This is a known bug, abridged ftag should is 8 bits in length.
+  EXPECT_OFF(ftag_i386, 0x04, 2);
+  EXPECT_OFF(fop_i386, 0x06, 2);
+  // NB: Technically fiseg/foseg are 16-bit long and the higher 16 bits
+  // are reserved.  However, we use them to access/recombine 64-bit FIP/FDP.
+  EXPECT_OFF(fioff_i386, 0x08, 4);
+  EXPECT_OFF(fiseg_i386, 0x0C, 4);
+  EXPECT_OFF(fooff_i386, 0x10, 4);
+  EXPECT_OFF(foseg_i386, 0x14, 4);
+  EXPECT_OFF(mxcsr_i386, 0x18, 4);
+  EXPECT_OFF(mxcsrmask_i386, 0x1C, 4);
+  EXPECT_OFF(st0_i386, 0x20, 10);
+  EXPECT_OFF(st1_i386, 0x30, 10);
+  EXPECT_OFF(st2_i386, 0x40, 10);
+  EXPECT_OFF(st3_i386, 0x50, 10);
+  EXPECT_OFF(st4_i386, 0x60, 10);
+  EXPECT_OFF(st5_i386, 0x70, 10);
+  EXPECT_OFF(st6_i386

[llvm-branch-commits] [lldb] 37f99a5 - [lldb] [unittests] Filter FreeBSD through CMake rather than #ifdef

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T13:55:42+01:00
New Revision: 37f99a56065209627020428cecb78f55dfa90580

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

LOG: [lldb] [unittests] Filter FreeBSD through CMake rather than #ifdef

Added: 


Modified: 
lldb/unittests/Process/Utility/CMakeLists.txt
lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp

Removed: 




diff  --git a/lldb/unittests/Process/Utility/CMakeLists.txt 
b/lldb/unittests/Process/Utility/CMakeLists.txt
index 8e4696b7211d..772e781b5cc5 100644
--- a/lldb/unittests/Process/Utility/CMakeLists.txt
+++ b/lldb/unittests/Process/Utility/CMakeLists.txt
@@ -1,17 +1,21 @@
+set(FREEBSD_SOURCES
+  RegisterContextFreeBSDTest.cpp)
 set(NETBSD_SOURCES
   RegisterContextNetBSDTest_i386.cpp
   RegisterContextNetBSDTest_x86_64.cpp)
 
-if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
+if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  list(APPEND PLATFORM_SOURCES ${FREEBSD_SOURCES})
+elseif (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   list(APPEND PLATFORM_SOURCES ${NETBSD_SOURCES})
 endif()
 
 set(LLVM_OPTIONAL_SOURCES
+  ${FREEBSD_SOURCES}
   ${NETBSD_SOURCES})
 
 add_lldb_unittest(ProcessUtilityTests
   RegisterContextTest.cpp
-  RegisterContextFreeBSDTest.cpp
   LinuxProcMapsTest.cpp
   ${PLATFORM_SOURCES}
 

diff  --git a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp 
b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
index 7d875c9bd8a1..fe516d537662 100644
--- a/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
+++ b/lldb/unittests/Process/Utility/RegisterContextFreeBSDTest.cpp
@@ -6,8 +6,6 @@
 //
 
//===--===//
 
-#if defined(__FreeBSD__)
-
 // clang-format off
 #include 
 #include 
@@ -233,5 +231,3 @@ TEST(RegisterContextFreeBSDTest, i386) {
 }
 
 #endif // defined(__i386__) || defined(__x86_64__)
-
-#endif // defined(__FreeBSD__)



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


[llvm-branch-commits] [lldb] 835f8de - [lldb] [Process/FreeBSDRemote] Use RegSetKind consistently [NFC]

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T18:01:46+01:00
New Revision: 835f8de8508953f4624534e36d54cd256e8800c9

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

LOG: [lldb] [Process/FreeBSDRemote] Use RegSetKind consistently [NFC]

Use RegSetKind enum for register sets everything, rather than int.
Always spell it as 'RegSetKind', without unnecessary 'enum'.  Add
missing switch case.  While at it, use uint32_t for regnums
consistently.

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

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.h

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index 740ac522d303..b3b4a6cb0578 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -303,8 +303,9 @@ 
NativeRegisterContextFreeBSD_x86_64::GetRegisterSet(uint32_t set_index) const {
   }
 }
 
-llvm::Optional
-NativeRegisterContextFreeBSD_x86_64::GetSetForNativeRegNum(int reg_num) const {
+llvm::Optional
+NativeRegisterContextFreeBSD_x86_64::GetSetForNativeRegNum(
+uint32_t reg_num) const {
   switch (GetRegisterInfoInterface().GetTargetArchitecture().GetMachine()) {
   case llvm::Triple::x86:
 if (reg_num >= k_first_gpr_i386 && reg_num <= k_last_gpr_i386)
@@ -341,7 +342,7 @@ 
NativeRegisterContextFreeBSD_x86_64::GetSetForNativeRegNum(int reg_num) const {
   llvm_unreachable("Register does not belong to any register set");
 }
 
-Status NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet(uint32_t set) {
+Status NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet(RegSetKind set) {
   switch (set) {
   case GPRegSet:
 return NativeProcessFreeBSD::PtraceWrapper(PT_GETREGS, m_thread.GetID(),
@@ -382,7 +383,7 @@ Status 
NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet(uint32_t set) {
   llvm_unreachable("NativeRegisterContextFreeBSD_x86_64::ReadRegisterSet");
 }
 
-Status NativeRegisterContextFreeBSD_x86_64::WriteRegisterSet(uint32_t set) {
+Status NativeRegisterContextFreeBSD_x86_64::WriteRegisterSet(RegSetKind set) {
   switch (set) {
   case GPRegSet:
 return NativeProcessFreeBSD::PtraceWrapper(PT_SETREGS, m_thread.GetID(),
@@ -428,7 +429,7 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const 
RegisterInfo *reg_info,
 return error;
   }
 
-  llvm::Optional opt_set = GetSetForNativeRegNum(reg);
+  llvm::Optional opt_set = GetSetForNativeRegNum(reg);
   if (!opt_set) {
 // This is likely an internal register for lldb use only and should not be
 // directly queried.
@@ -437,7 +438,7 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const 
RegisterInfo *reg_info,
 return error;
   }
 
-  enum RegSetKind set = opt_set.getValue();
+  RegSetKind set = opt_set.getValue();
   error = ReadRegisterSet(set);
   if (error.Fail())
 return error;
@@ -494,7 +495,7 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
 return error;
   }
 
-  llvm::Optional opt_set = GetSetForNativeRegNum(reg);
+  llvm::Optional opt_set = GetSetForNativeRegNum(reg);
   if (!opt_set) {
 // This is likely an internal register for lldb use only and should not be
 // directly queried.
@@ -503,7 +504,7 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
 return error;
   }
 
-  enum RegSetKind set = opt_set.getValue();
+  RegSetKind set = opt_set.getValue();
   error = ReadRegisterSet(set);
   if (error.Fail())
 return error;
@@ -610,7 +611,7 @@ llvm::Error 
NativeRegisterContextFreeBSD_x86_64::CopyHardwareWatchpointsFrom(
 }
 
 uint8_t *
-NativeRegisterContextFreeBSD_x86_64::GetOffsetRegSetData(uint32_t set,
+NativeRegisterContextFreeBSD_x86_64::GetOffsetRegSetData(RegSetKind set,
  size_t reg_offset) {
   uint8_t *base;
   switch (set) {
@@ -625,6 +626,8 @@ 
NativeRegisterContextFreeBSD_x86_64::GetOffsetRegSetData(uint32_t set,
 break;
   case YMMRegSet:
 llvm_unreachable("GetRegSetData() is unsuitable for this regset.");
+  case MPXRegSet:
+llvm_unreachable("MPX regset should have returned error");
   }
   assert(reg_offset >= m_regset_offsets[set]);
   return base + (reg_offset - m_regset_offsets[set]);

diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.h
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.h
index b70fa962707d..673cffd6e849 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemo

[llvm-branch-commits] [lldb] 9ead4e7 - [lldb] [Process/FreeBSDRemote] Replace GetRegisterSetCount()

2020-12-17 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-17T18:01:14+01:00
New Revision: 9ead4e7b4a68d162122d861f5d5b6a3baf8d23c1

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

LOG: [lldb] [Process/FreeBSDRemote] Replace GetRegisterSetCount()

Replace the wrong code in GetRegisterSetCount() with a constant return.
The original code passed register index in place of register set index,
effectively getting always true.  Correcting the code to check for
register set existence is not possible as LLDB supports only eliminating
last register sets.  Just return the full number for now which should
be NFC.

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

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index 8f1ba2eb4137..740ac522d303 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -288,13 +288,7 @@ 
NativeRegisterContextFreeBSD_x86_64::NativeRegisterContextFreeBSD_x86_64(
 }
 
 uint32_t NativeRegisterContextFreeBSD_x86_64::GetRegisterSetCount() const {
-  uint32_t sets = 0;
-  for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) {
-if (GetSetForNativeRegNum(set_index))
-  ++sets;
-  }
-
-  return sets;
+  return k_num_register_sets;
 }
 
 const RegisterSet *



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


[llvm-branch-commits] [lldb] 9956233 - [lldb] [test] Update test status for NetBSD

2020-12-20 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-20T11:32:43+01:00
New Revision: 99562332e3de19da9da1714a58b5cc2d24724ef5

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

LOG: [lldb] [test] Update test status for NetBSD

Added: 


Modified: 
lldb/test/API/api/multiple-targets/TestMultipleTargets.py
lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py
lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py
lldb/test/API/commands/expression/radar_9531204/TestPrintfAfterUp.py
lldb/test/API/commands/expression/save_jit_objects/TestSaveJITObjects.py
lldb/test/API/commands/expression/test/TestExprs.py
lldb/test/API/commands/gui/viewlarge/TestGuiViewLarge.py
lldb/test/API/commands/process/attach/TestProcessAttach.py

lldb/test/API/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py

lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/test/API/functionalities/completion/TestCompletion.py

lldb/test/API/functionalities/dlopen_other_executable/TestDlopenOtherExecutable.py
lldb/test/API/functionalities/inferior-assert/TestInferiorAssert.py

lldb/test/API/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferiorStep.py

lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentBreakpointDelayBreakpointOneSignal.py

lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentSignalDelayBreak.py

lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneDelaySignal.py

lldb/test/API/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py

lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py

lldb/test/API/functionalities/thread/state_after_expression/TestStateAfterExpression.py

lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
lldb/test/API/functionalities/unwind/noreturn/TestNoreturnUnwind.py
lldb/test/API/lang/c/conflicting-symbol/TestConflictingSymbol.py
lldb/test/API/lang/c/const_variables/TestConstVariables.py
lldb/test/API/lang/c/function_types/TestFunctionTypes.py
lldb/test/API/lang/c/global_variables/TestGlobalVariables.py
lldb/test/API/lang/c/shared_lib/TestSharedLib.py
lldb/test/API/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
lldb/test/API/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
lldb/test/API/lang/cpp/stl/TestStdCXXDisassembly.py
lldb/test/API/lang/cpp/this/TestCPPThis.py
lldb/test/API/python_api/event/TestEvents.py
lldb/test/API/python_api/lldbutil/iter/TestRegistersIterator.py
lldb/test/API/python_api/thread/TestThreadAPI.py
lldb/test/API/tools/lldb-server/TestGdbRemote_vContThreads.py

lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setExceptionBreakpoints.py
lldb/test/API/tools/lldb-vscode/disconnect/TestVSCode_disconnect.py
lldb/test/Shell/Recognizer/assert.test
lldb/test/Shell/Reproducer/Functionalities/TestExpressionEvaluation.test
lldb/test/Shell/ScriptInterpreter/Lua/watchpoint_callback.test

Removed: 




diff  --git a/lldb/test/API/api/multiple-targets/TestMultipleTargets.py 
b/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
index eebaea3c4fd2..7931cc4be050 100644
--- a/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
+++ b/lldb/test/API/api/multiple-targets/TestMultipleTargets.py
@@ -21,6 +21,7 @@ class TestMultipleTargets(TestBase):
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr20282")
+@expectedFlakeyNetBSD
 def test_multiple_targets(self):
 env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
 

diff  --git 
a/lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py 
b/lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py
index 87e7386c3dcb..6647176e7a18 100644
--- a/lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py
+++ b/lldb/test/API/commands/expression/call-restarts/TestCallThatRestarts.py
@@ -25,7 +25,7 @@ def setUp(self):
 @skipIfDarwin  # llvm.org/pr19246: intermittent failure
 @skipIfWindows  # Test relies on signals, unsupported on Windows
 @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246")
-@expectedFailureNetBSD
+@expectedFlakeyNetBSD
 def test(self):
 """Test calling function that hits a signal and restarts."""
 self.build()

diff  --git 
a/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py 
b/lldb/test/API/commands/expression/ir-interpreter/TestIRInterpreter.py
index 5efbba90ccba..16c88c53ef1a 100644
--- a/lldb/t

[llvm-branch-commits] [lldb] bd2e833 - [lldb] [Process/FreeBSDRemote] Remove anonymous namespace

2020-12-21 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-21T22:26:54+01:00
New Revision: bd2e8ece6afa8a6c1975d19d403d63349414

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

LOG: [lldb] [Process/FreeBSDRemote] Remove anonymous namespace

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index b3b4a6cb0578..d5052e7d1b3a 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -29,9 +29,6 @@
 using namespace lldb_private;
 using namespace lldb_private::process_freebsd;
 
-// Private namespace.
-
-namespace {
 // x86 64-bit general purpose registers.
 static const uint32_t g_gpr_regnums_x86_64[] = {
 lldb_rax_x86_64,lldb_rbx_x86_64,lldb_rcx_x86_64, lldb_rdx_x86_64,
@@ -138,7 +135,7 @@ static_assert((sizeof(g_dbr_regnums_x86_64) / 
sizeof(g_dbr_regnums_x86_64[0])) -
   "g_dbr_regnums_x86_64 has wrong number of register infos");
 
 // x86 32-bit general purpose registers.
-const uint32_t g_gpr_regnums_i386[] = {
+static const uint32_t g_gpr_regnums_i386[] = {
 lldb_eax_i386,  lldb_ebx_i386,lldb_ecx_i386, lldb_edx_i386,
 lldb_edi_i386,  lldb_esi_i386,lldb_ebp_i386, lldb_esp_i386,
 lldb_eip_i386,  lldb_eflags_i386, lldb_cs_i386,  lldb_fs_i386,
@@ -155,7 +152,7 @@ static_assert((sizeof(g_gpr_regnums_i386) / 
sizeof(g_gpr_regnums_i386[0])) -
   "g_gpr_regnums_i386 has wrong number of register infos");
 
 // x86 32-bit floating point registers.
-const uint32_t g_fpu_regnums_i386[] = {
+static const uint32_t g_fpu_regnums_i386[] = {
 lldb_fctrl_i386,lldb_fstat_i386, lldb_ftag_i386,  lldb_fop_i386,
 lldb_fiseg_i386,lldb_fioff_i386, lldb_foseg_i386, lldb_fooff_i386,
 lldb_mxcsr_i386,lldb_mxcsrmask_i386, lldb_st0_i386,   lldb_st1_i386,
@@ -236,7 +233,6 @@ static const RegisterSet 
g_reg_sets_x86_64[k_num_register_sets] = {
 };
 
 #define REG_CONTEXT_SIZE (GetRegisterInfoInterface().GetGPRSize())
-} // namespace
 
 NativeRegisterContextFreeBSD *
 NativeRegisterContextFreeBSD::CreateHostNativeRegisterContextFreeBSD(



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


[llvm-branch-commits] [lldb] 8aea95f - [lldb] Reland "Use translated full ftag values"

2020-11-21 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-21T17:11:38+01:00
New Revision: 8aea95f3cb4ef72cc9146ca5a01af15f036acd19

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

LOG: [lldb] Reland "Use translated full ftag values"

Translate between abridged and full ftag values in order to expose
the latter in the gdb-remote protocol while the former are used by
FXSAVE/XSAVE...  This matches the gdb behavior.

The Shell/Register tests now rely on the new behavior, and therefore
are run on non-Darwin systems only.  The Python (API) test relies
on the legacy behavior, and is run on Darwin only.

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

Added: 
lldb/source/Plugins/Process/Utility/RegisterContext_x86.cpp
lldb/unittests/Process/Utility/RegisterContextTest.cpp

Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
lldb/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
lldb/source/Plugins/Process/Utility/CMakeLists.txt
lldb/source/Plugins/Process/Utility/RegisterContext_x86.h
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/Shell/Register/x86-64-fp-read.test
lldb/test/Shell/Register/x86-64-fp-write.test
lldb/test/Shell/Register/x86-fp-read.test
lldb/test/Shell/Register/x86-fp-write.test
lldb/unittests/Process/Utility/CMakeLists.txt

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index ea2494dabf27..ea5400c55713 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -451,10 +451,16 @@ NativeRegisterContextFreeBSD_x86_64::ReadRegister(const 
RegisterInfo *reg_info,
   switch (set) {
   case GPRegSet:
   case FPRegSet:
-  case DBRegSet:
-reg_value.SetBytes(GetOffsetRegSetData(set, reg_info->byte_offset),
-   reg_info->byte_size, endian::InlHostByteOrder());
+  case DBRegSet: {
+void *data = GetOffsetRegSetData(set, reg_info->byte_offset);
+FXSAVE *fpr = reinterpret_cast(m_fpr.data());
+if (data == &fpr->ftag) // ftag
+  reg_value.SetUInt16(
+  AbridgedToFullTagWord(fpr->ftag, fpr->fstat, fpr->stmm));
+else
+  reg_value.SetBytes(data, reg_info->byte_size, 
endian::InlHostByteOrder());
 break;
+  }
   case YMMRegSet: {
 llvm::Optional ymm_reg = GetYMMSplitReg(reg);
 if (!ymm_reg) {
@@ -511,10 +517,15 @@ Status NativeRegisterContextFreeBSD_x86_64::WriteRegister(
   switch (set) {
   case GPRegSet:
   case FPRegSet:
-  case DBRegSet:
-::memcpy(GetOffsetRegSetData(set, reg_info->byte_offset),
- reg_value.GetBytes(), reg_value.GetByteSize());
+  case DBRegSet: {
+void *data = GetOffsetRegSetData(set, reg_info->byte_offset);
+FXSAVE *fpr = reinterpret_cast(m_fpr.data());
+if (data == &fpr->ftag) // ftag
+  fpr->ftag = FullToAbridgedTagWord(reg_value.GetAsUInt16());
+else
+  ::memcpy(data, reg_value.GetBytes(), reg_value.GetByteSize());
 break;
+  }
   case YMMRegSet: {
 llvm::Optional ymm_reg = GetYMMSplitReg(reg);
 if (!ymm_reg) {

diff  --git 
a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp 
b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index 20cd5e3f62ff..6462441249c0 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -530,6 +530,13 @@ NativeRegisterContextLinux_x86_64::ReadRegister(const 
RegisterInfo *reg_info,
   assert((reg_info->byte_offset - m_fctrl_offset_in_userarea) < sizeof(FPR));
   uint8_t *src = (uint8_t *)m_xstate.get() + reg_info->byte_offset -
  m_fctrl_offset_in_userarea;
+
+  if (src == reinterpret_cast(&m_xstate->fxsave.ftag)) {
+reg_value.SetUInt16(AbridgedToFullTagWord(
+m_xstate->fxsave.ftag, m_xstate->fxsave.fstat, m_xstate->fxsave.stmm));
+return error;
+  }
+
   switch (reg_info->byte_size) {
   case 1:
 reg_value.SetUInt8(*(uint8_t *)src);
@@ -639,23 +646,28 @@ Status NativeRegisterContextLinux_x86_64::WriteRegister(
  sizeof(FPR));
   uint8_t *dst = (uint8_t *)m_xstate.get() + reg_info->byte_offset -
  m_fctrl_offset_in_userarea;
-  switch (reg_info->byte_size) {
-  case 1:
-*(uint8_t *)dst = reg_value.GetAsUInt8();
-break;
-  case 2:
-*(uint16_t *)dst = reg_value.GetAsUInt16();
-break;

[llvm-branch-commits] [lldb] 7b7c372 - [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T09:22:41+01:00
New Revision: 7b7c372e3fcadfd5ee6ab3fb68d9f0f1c25e0247

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

LOG: [lldb] [Process/FreeBSD] Add missing 'override' kws to POSIXStopInfo

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

Added: 


Modified: 
lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h 
b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
index 88fb7f31fe06..5a022c485b68 100644
--- a/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ b/lldb/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -34,13 +34,13 @@ class POSIXLimboStopInfo : public POSIXStopInfo {
 
   ~POSIXLimboStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 
//===--===//
@@ -54,13 +54,13 @@ class POSIXNewThreadStopInfo : public POSIXStopInfo {
 
   ~POSIXNewThreadStopInfo();
 
-  lldb::StopReason GetStopReason() const;
+  lldb::StopReason GetStopReason() const override;
 
-  const char *GetDescription();
+  const char *GetDescription() override;
 
-  bool ShouldStop(lldb_private::Event *event_ptr);
+  bool ShouldStop(lldb_private::Event *event_ptr) override;
 
-  bool ShouldNotify(lldb_private::Event *event_ptr);
+  bool ShouldNotify(lldb_private::Event *event_ptr) override;
 };
 
 #endif



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


[llvm-branch-commits] [lldb] 8f2f9a8 - [lldb] [Process/Utility] Declare register overlaps between ST and MM

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T09:23:14+01:00
New Revision: 8f2f9a82e2cc333d36ddd1b6bb0523623e065cdc

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

LOG: [lldb] [Process/Utility] Declare register overlaps between ST and MM

Explicitly declare register overlaps/invalidation between ST(i) and MMi
registers.

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

Added: 


Modified: 
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.h
lldb/source/Plugins/Process/Utility/RegisterInfos_i386.h
lldb/source/Plugins/Process/Utility/RegisterInfos_x86_64.h

Removed: 




diff  --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp 
b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
index bf9282d8c0cc..2c7f63503d7c 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
@@ -286,6 +286,74 @@ uint32_t RegisterContextPOSIX_x86::g_invalidate_fip[] = {
 uint32_t RegisterContextPOSIX_x86::g_invalidate_fdp[] = {
 lldb_fdp_x86_64, lldb_fooff_x86_64, lldb_foseg_x86_64, 
LLDB_INVALID_REGNUM};
 
+uint32_t RegisterContextPOSIX_x86::g_contained_st0_32[] = {lldb_st0_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st1_32[] = {lldb_st1_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st2_32[] = {lldb_st2_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st3_32[] = {lldb_st3_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st4_32[] = {lldb_st4_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st5_32[] = {lldb_st5_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st6_32[] = {lldb_st6_i386,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st7_32[] = {lldb_st7_i386,
+   
LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st0_32[] = {
+lldb_st0_i386, lldb_mm0_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st1_32[] = {
+lldb_st1_i386, lldb_mm1_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st2_32[] = {
+lldb_st2_i386, lldb_mm2_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st3_32[] = {
+lldb_st3_i386, lldb_mm3_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st4_32[] = {
+lldb_st4_i386, lldb_mm4_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st5_32[] = {
+lldb_st5_i386, lldb_mm5_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st6_32[] = {
+lldb_st6_i386, lldb_mm6_i386, LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_invalidate_st7_32[] = {
+lldb_st7_i386, lldb_mm7_i386, LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_contained_st0_64[] = {lldb_st0_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st1_64[] = {lldb_st1_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st2_64[] = {lldb_st2_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st3_64[] = {lldb_st3_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st4_64[] = {lldb_st4_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st5_64[] = {lldb_st5_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st6_64[] = {lldb_st6_x86_64,
+   
LLDB_INVALID_REGNUM};
+uint32_t RegisterContextPOSIX_x86::g_contained_st7_64[] = {lldb_st7_x86_64,
+   
LLDB_INVALID_REGNUM};
+
+uint32_t RegisterContextPOSIX_x86::g_invalidat

[llvm-branch-commits] [lldb] 9367b57 - [lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing registers

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T09:26:23+01:00
New Revision: 9367b57dadb7a8515fa454cb4bb8e4cc45bf57d2

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

LOG: [lldb] [test] Fix qRegisterInfo lldb-server tests to handle missing 
registers

Fix qRegisterInfo tests to handle Exx error response when querying
registers that are not supported on the platform in question.  This
is how FreeBSD and NetBSD platforms reporting missing registers right
now, and there certainly is value from verifying the remaining
registers.

This change fixes the test for FreeBSD but NetBSD has other regressions
that still need to be researched.

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

Added: 


Modified: 
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py 
b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
index 13fe9c3c0398..9fb8cc1892ea 100644
--- a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -585,9 +585,15 @@ def 
p_returns_correct_data_size_for_each_qRegisterInfo(self):
 p_response = context.get("p_response")
 self.assertIsNotNone(p_response)
 
+# Skip erraneous (unsupported) registers.
+# TODO: remove this once we make unsupported registers disappear.
+if p_response.startswith("E") and len(p_response) == 3:
+continue
+
 if "dynamic_size_dwarf_expr_bytes" in reg_info:
 self.updateRegInfoBitsize(reg_info, byte_order)
-self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8)
+self.assertEqual(len(p_response), 2 * int(reg_info["bitsize"]) / 8,
+ reg_info)
 
 # Increment loop
 reg_index += 1
@@ -601,7 +607,7 @@ def 
test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_debugserver(
 self.set_inferior_startup_launch()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_launch_llgs(
 self):
@@ -619,7 +625,7 @@ def 
test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_debugserver(
 self.set_inferior_startup_attach()
 self.p_returns_correct_data_size_for_each_qRegisterInfo()
 
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_p_returns_correct_data_size_for_each_qRegisterInfo_attach_llgs(
 self):



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


[llvm-branch-commits] [lldb] 8018e7b - [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T09:28:20+01:00
New Revision: 8018e7b447dacb37a520fe989ab42c0586730961

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

LOG: [lldb] [Process/FreeBSDRemote] Fix regset names and related tests

Restore Linux-alike regset names for AVX/MPX registers
as TestLldbGdbServer seems to depend on them.  At the same time, fix
TestRegisters to be aware that they are not available on FreeBSD
and NetBSD, at least until we figure out a better way of reporting
unsupported register sets.

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

Added: 


Modified: 

lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
index ea5400c55713..8f1ba2eb4137 100644
--- 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
+++ 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp
@@ -215,9 +215,9 @@ static const RegisterSet 
g_reg_sets_i386[k_num_register_sets] = {
 {"Floating Point Registers", "fpu", k_num_fpr_registers_i386,
  g_fpu_regnums_i386},
 {"Debug Registers", "dbr", k_num_dbr_registers_i386, g_dbr_regnums_i386},
-{"Extended AVX registers", "avx", k_num_avx_registers_i386,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_i386,
  g_avx_regnums_i386},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_i386,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_i386,
  g_mpx_regnums_i386},
 };
 
@@ -229,9 +229,9 @@ static const RegisterSet 
g_reg_sets_x86_64[k_num_register_sets] = {
  g_fpu_regnums_x86_64},
 {"Debug Registers", "dbr", k_num_dbr_registers_x86_64,
  g_dbr_regnums_x86_64},
-{"Extended AVX registers", "avx", k_num_avx_registers_x86_64,
+{"Advanced Vector Extensions", "avx", k_num_avx_registers_x86_64,
  g_avx_regnums_x86_64},
-{"Extended MPX registers", "mpx", k_num_mpx_registers_x86_64,
+{"Memory Protection Extensions", "mpx", k_num_mpx_registers_x86_64,
  g_mpx_regnums_x86_64},
 };
 

diff  --git 
a/lldb/test/API/commands/register/register/register_command/TestRegisters.py 
b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
index 98024a83bf42..5e26f3317b41 100644
--- a/lldb/test/API/commands/register/register/register_command/TestRegisters.py
+++ b/lldb/test/API/commands/register/register/register_command/TestRegisters.py
@@ -404,7 +404,12 @@ def fp_register_write(self):
 for registerSet in registerSets:
 if 'advanced vector extensions' in 
registerSet.GetName().lower():
 has_avx = True
-if 'memory protection extension' in 
registerSet.GetName().lower():
+# FreeBSD/NetBSD reports missing register sets 
diff erently
+# at the moment and triggers false positive here.
+# TODO: remove FreeBSD/NetBSD exception when we make 
unsupported
+# register groups correctly disappear.
+if ('memory protection extension' in 
registerSet.GetName().lower()
+and self.getPlatform() not in ["freebsd", "netbsd"]):
 has_mpx = True
 
 if has_avx:

diff  --git a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py 
b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
index 9fb8cc1892ea..609931e1f892 100644
--- a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -433,7 +433,7 @@ def qRegisterInfo_contains_avx_registers(self):
 "Advanced Vector Extensions" in register_sets)
 
 @expectedFailureAll(oslist=["windows"]) # no avx for now.
-@expectedFailureAll(oslist=["freebsd", "netbsd"])
+@expectedFailureAll(oslist=["netbsd"])
 @llgs_test
 def test_qRegisterInfo_contains_avx_registers_llgs(self):
 self.init_llgs_test()



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


[llvm-branch-commits] [lldb] 18e4272 - [lldb] Prevent 'process connect' from using local-only plugins

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T09:48:55+01:00
New Revision: 18e4272a4fe4667a44f4d323140645a83ddfd864

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

LOG: [lldb] Prevent 'process connect' from using local-only plugins

Add a 'can_connect' parameter to Process plugin initialization, and use
it to filter plugins to these capable of remote connections.  This is
used to prevent 'process connect' from picking up a plugin that can only
be used locally, e.g. the legacy FreeBSD plugin.

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

Added: 


Modified: 
lldb/include/lldb/Target/Process.h
lldb/include/lldb/Target/ProcessTrace.h
lldb/include/lldb/Target/Target.h
lldb/include/lldb/lldb-private-interfaces.h
lldb/source/API/SBTarget.cpp
lldb/source/Commands/CommandObjectTarget.cpp
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
lldb/source/Plugins/Process/FreeBSD/ProcessFreeBSD.h
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.h
lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
lldb/source/Plugins/Process/elf-core/ProcessElfCore.h
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
lldb/source/Plugins/Process/mach-core/ProcessMachCore.h
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
lldb/source/Plugins/Process/minidump/ProcessMinidump.h
lldb/source/Target/Platform.cpp
lldb/source/Target/Process.cpp
lldb/source/Target/ProcessTrace.cpp
lldb/source/Target/Target.cpp
lldb/source/Target/TraceSessionFileParser.cpp
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
lldb/test/Shell/Commands/command-process-connect.test

Removed: 




diff  --git a/lldb/include/lldb/Target/Process.h 
b/lldb/include/lldb/Target/Process.h
index 7f1e1e876556..744deab276c4 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -537,7 +537,8 @@ class Process : public 
std::enable_shared_from_this,
   static lldb::ProcessSP FindPlugin(lldb::TargetSP target_sp,
 llvm::StringRef plugin_name,
 lldb::ListenerSP listener_sp,
-const FileSpec *crash_file_path);
+const FileSpec *crash_file_path,
+bool can_connect);
 
   /// Static function that can be used with the \b host function
   /// Host::StartMonitoringChildProcess ().

diff  --git a/lldb/include/lldb/Target/ProcessTrace.h 
b/lldb/include/lldb/Target/ProcessTrace.h
index f947fbe8cdb4..53b3e704c17b 100644
--- a/lldb/include/lldb/Target/ProcessTrace.h
+++ b/lldb/include/lldb/Target/ProcessTrace.h
@@ -77,7 +77,8 @@ class ProcessTrace : public PostMortemProcess {
 private:
   static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp,
 lldb::ListenerSP listener_sp,
-const FileSpec *crash_file_path);
+const FileSpec *crash_file_path,
+bool can_connect);
 };
 
 } // namespace lldb_private

diff  --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index f77917a8812f..47568c9e4429 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -573,7 +573,8 @@ class Target : public std::enable_shared_from_this,
   // used.
   const lldb::ProcessSP &CreateProcess(lldb::ListenerSP listener_sp,
llvm::StringRef plugin_name,
-   const FileSpec *crash_file);
+   const FileSpec *crash_file,
+   bool can_connect);
 
   const lldb::ProcessSP &GetProcessSP() const;
 

diff  --git a/lldb/include/lldb/lldb-private-interfaces.h 
b/lldb/include/lldb/lldb-private-interfaces.h
index 1a4eaba7cc5e..df33f8af0e14 100644
--- a/lldb/include/lldb/lldb-private-interfaces.h
+++ b/lldb/include/lldb/lldb-private-interfaces.h
@@ -76,7 +76,7 @@ typedef lldb::PlatformSP (*PlatformCreateInstance)(bool force,
const ArchSpec *arch);
 typedef l

[llvm-branch-commits] [lldb] a8f6f4e - [lldb] [test] Restore Windows-skip on 'process connect' tests

2020-11-23 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-11-23T14:27:32+01:00
New Revision: a8f6f4e8733cd601246ddc3e391cd82236231846

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

LOG: [lldb] [test] Restore Windows-skip on 'process connect' tests

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
lldb/test/Shell/Commands/command-process-connect.test

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
index e9152f02a15e..c2d06ad5d67e 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestProcessConnect.py
@@ -33,6 +33,7 @@ def test_gdb_remote_async(self):
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
+@skipIfWindows
 def test_process_connect_sync(self):
 """Test the gdb-remote command in synchronous mode"""
 try:
@@ -43,6 +44,7 @@ def test_process_connect_sync(self):
 finally:
 self.dbg.GetSelectedPlatform().DisconnectRemote()
 
+@skipIfWindows
 @skipIfReproducer # Reproducer don't support async.
 def test_process_connect_async(self):
 """Test the gdb-remote command in asynchronous mode"""

diff  --git a/lldb/test/Shell/Commands/command-process-connect.test 
b/lldb/test/Shell/Commands/command-process-connect.test
index c4761360d541..30782243d4ed 100644
--- a/lldb/test/Shell/Commands/command-process-connect.test
+++ b/lldb/test/Shell/Commands/command-process-connect.test
@@ -1,3 +1,5 @@
+# UNSUPPORTED: system-windows
+
 # Synchronous
 # RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect 
connect://localhost:4321' 2>&1 | FileCheck %s
 



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


[llvm-branch-commits] [lldb] e1f613c - [lldb] [test] Reenable two passing tests on FreeBSD

2020-12-01 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-01T23:25:45+01:00
New Revision: e1f613ce3c61d0664fd3cff663f290cf1c2b9696

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

LOG: [lldb] [test] Reenable two passing tests on FreeBSD

[Reenable TestReproducerAttach and TestThreadSpecificBpPlusCondition
on FreeBSD -- both seem to pass correctly now.

Added: 


Modified: 
lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py

lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py 
b/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py
index e6bb9c6a1672..a1cfcd20013e 100644
--- a/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py
+++ b/lldb/test/API/functionalities/reproducers/attach/TestReproducerAttach.py
@@ -15,7 +15,6 @@ class ReproducerAttachTestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 NO_DEBUG_INFO_TESTCASE = True
 
-@skipIfFreeBSD
 @skipIfNetBSD
 @skipIfWindows
 @skipIfRemote

diff  --git 
a/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
 
b/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
index 126ad9e97ee5..ee7398ae5dfc 100644
--- 
a/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
+++ 
b/lldb/test/API/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
@@ -16,10 +16,8 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 # test frequently times out or hangs
-@skipIf(oslist=['windows', 'freebsd'])
 @skipIfDarwin
 # hits break in another thread in testrun
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522')
 @add_test_categories(['pyapi'])
 @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], 
archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563348') # Two threads 
seem to end up with the same my_value when built for armv7.
 @expectedFailureNetBSD



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


[llvm-branch-commits] [lldb] 266c90f - [lldb] [test] Link FreeBSD test failures to bugs

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T09:56:50+01:00
New Revision: 266c90fec899356aa2c88f1e614d40d554db6fb3

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

LOG: [lldb] [test] Link FreeBSD test failures to bugs

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

Added: 


Modified: 
lldb/test/API/api/multithreaded/TestMultithreaded.py

lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py

lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
lldb/test/API/commands/register/register/register_command/TestRegisters.py
lldb/test/API/commands/target/create-deps/TestTargetCreateDeps.py

lldb/test/API/functionalities/breakpoint/breakpoint_callback_command_source/TestBreakpointCallbackCommandSource.py

lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py

lldb/test/API/functionalities/dlopen_other_executable/TestDlopenOtherExecutable.py

lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py
lldb/test/API/functionalities/return-value/TestReturnValue.py

lldb/test/API/functionalities/thread/create_after_attach/TestCreateAfterAttach.py

lldb/test/API/functionalities/thread/exit_during_expression/TestExitDuringExpression.py

lldb/test/API/functionalities/thread/state_after_expression/TestStateAfterExpression.py
lldb/test/API/lang/c/conflicting-symbol/TestConflictingSymbol.py
lldb/test/API/python_api/event/TestEvents.py
lldb/test/API/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
lldb/test/API/tools/lldb-server/register-reading/TestGdbRemoteGPacket.py
lldb/test/API/tools/lldb-vscode/breakpoint/TestVSCode_setBreakpoints.py
lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py

Removed: 




diff  --git a/lldb/test/API/api/multithreaded/TestMultithreaded.py 
b/lldb/test/API/api/multithreaded/TestMultithreaded.py
index 1dc44b9a9448..c6c75de386fa 100644
--- a/lldb/test/API/api/multithreaded/TestMultithreaded.py
+++ b/lldb/test/API/api/multithreaded/TestMultithreaded.py
@@ -31,7 +31,7 @@ def setUp(self):
 @skipIfNoSBHeaders
 # clang-cl does not support throw or catch (llvm.org/pr24538)
 @skipIfWindows
-@expectedFailureAll(oslist=['freebsd'])
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48370')
 def test_python_stop_hook(self):
 """Test that you can run a python command in a stop-hook when stdin is 
File based. """
 self.build_and_test('driver.cpp test_stop-hook.cpp',

diff  --git 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
index b932abab82a2..d95e69fc8aa5 100644
--- 
a/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
+++ 
b/lldb/test/API/commands/expression/multiline-navigation/TestMultilineNavigation.py
@@ -18,7 +18,7 @@ class TestCase(PExpectTest):
 # under ASAN on a loaded machine..
 @skipIfAsan
 @skipIfEditlineSupportMissing
-@expectedFailureAll(oslist=['freebsd'])
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
 def test_nav_arrow_up(self):
 """Tests that we can navigate back to the previous line with the up 
arrow"""
 self.launch()
@@ -41,7 +41,7 @@ def test_nav_arrow_up(self):
 
 @skipIfAsan
 @skipIfEditlineSupportMissing
-@expectedFailureAll(oslist=['freebsd'])
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48316')
 def test_nav_arrow_down(self):
 """Tests that we can navigate to the next line with the down arrow"""
 self.launch()

diff  --git 
a/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
 
b/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
index 9ade3dba12c5..ca0990ed47e9 100644
--- 
a/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
+++ 
b/lldb/test/API/commands/process/launch-with-shellexpand/TestLaunchWithShellExpand.py
@@ -20,7 +20,7 @@ class LaunchWithShellExpandTestCase(TestBase):
 "windows",
 "linux",
 "freebsd"],
-bugnumber="llvm.org/pr24778 llvm.org/pr22627")
+bugnumber="llvm.org/pr24778 llvm.org/pr22627 llvm.org/pr48349")
 @skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so 
arg expansion won't happen
 @expectedFailureNetBSD
 def test(self):

diff  --git 
a/lldb/test/API/commands/register/re

[llvm-branch-commits] [lldb] 09b0883 - [lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T09:56:51+01:00
New Revision: 09b08833f301ea375137931d26b7193101f82ceb

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

LOG: [lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action

Explicitly consider the libraries reported on the initial eTakeSnapshot
action added, through adding them to the added soentry list
in DYLDRendezvous::SaveSOEntriesFromRemote().  This is necessary
on FreeBSD since the dynamic loader issues only a single 'consistent'
state rendezvous breakpoint hit for all the libraries present
in DT_NEEDED (while Linux issues an added-consistent event pair).

Reenable memory maps on FreeBSD since this fixed the issue triggered
by them.

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

Added: 


Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
lldb/test/API/api/multithreaded/TestMultithreaded.py

lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

lldb/test/API/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py
lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test

Removed: 




diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index 15b3805003a5..c06d640c654c 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -295,8 +295,15 @@ bool DYLDRendezvous::SaveSOEntriesFromRemote(
   return false;
 
 // Only add shared libraries and not the executable.
-if (!SOEntryIsMainExecutable(entry))
+if (!SOEntryIsMainExecutable(entry)) {
   m_soentries.push_back(entry);
+  // This function is called only once, at the very beginning
+  // of the program.  Make sure to add all soentries that are
+  // already present at this point.  This is necessary to cover
+  // DT_NEEDED on FreeBSD since (unlike Linux) it does not report
+  // loading these libraries separately.
+  m_added_soentries.push_back(entry);
+}
   }
 
   m_loaded_modules = module_list;

diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
index fd3c05ab411e..b8ddd1a013e3 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
@@ -485,9 +485,6 @@ Status NativeProcessFreeBSD::Kill() {
 Status NativeProcessFreeBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
  MemoryRegionInfo &range_info) 
{
 
-  // TODO: figure out why it breaks stuff
-  return Status("currently breaks determining module list");
-
   if (m_supports_mem_region == LazyBool::eLazyBoolNo) {
 // We're done.
 return Status("unsupported");

diff  --git a/lldb/test/API/api/multithreaded/TestMultithreaded.py 
b/lldb/test/API/api/multithreaded/TestMultithreaded.py
index c6c75de386fa..60c2c3b372cb 100644
--- a/lldb/test/API/api/multithreaded/TestMultithreaded.py
+++ b/lldb/test/API/api/multithreaded/TestMultithreaded.py
@@ -31,7 +31,6 @@ def setUp(self):
 @skipIfNoSBHeaders
 # clang-cl does not support throw or catch (llvm.org/pr24538)
 @skipIfWindows
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48370')
 def test_python_stop_hook(self):
 """Test that you can run a python command in a stop-hook when stdin is 
File based. """
 self.build_and_test('driver.cpp test_stop-hook.cpp',

diff  --git 
a/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 
b/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
index 81c3798ebba7..4439607d91cf 100644
--- 
a/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ 
b/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -15,7 +15,6 @@ class TestBreakpointInGlobalConstructors(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 NO_DEBUG_INFO_TESTCASE = True
 
-@expectedFailureAll(oslist=["freebsd"], bugnumber='llvm.org/pr48373')
 @expectedFailureNetBSD
 def test(self):
 self.build()

diff  --git a/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py 
b/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
index 

[llvm-branch-commits] [lldb] 276638e - [lldb] [Process/FreeBSDRemote] Implement GetLoadedModuleFileSpec() and GetFileLoadAddress()

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T09:56:51+01:00
New Revision: 276638ecaf226a9931c55e835f18b592bdfbea86

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

LOG: [lldb] [Process/FreeBSDRemote] Implement GetLoadedModuleFileSpec() and 
GetFileLoadAddress()

Copy the Linux implementation of GetLoadedModuleFileSpec()
and GetFileLoadAddress() into NativeProcessFreeBSD.  This does not seem
to change anything at the moment but reducing the differences between
the plugins should help us in the long term.

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

Added: 


Modified: 
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h

Removed: 




diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
index b8ddd1a013e3..163093c2ab1f 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
@@ -630,14 +630,40 @@ Status NativeProcessFreeBSD::SetBreakpoint(lldb::addr_t 
addr, uint32_t size,
 
 Status NativeProcessFreeBSD::GetLoadedModuleFileSpec(const char *module_path,
  FileSpec &file_spec) {
-  return Status("Unimplemented");
+  Status error = PopulateMemoryRegionCache();
+  if (error.Fail())
+return error;
+
+  FileSpec module_file_spec(module_path);
+  FileSystem::Instance().Resolve(module_file_spec);
+
+  file_spec.Clear();
+  for (const auto &it : m_mem_region_cache) {
+if (it.second.GetFilename() == module_file_spec.GetFilename()) {
+  file_spec = it.second;
+  return Status();
+}
+  }
+  return Status("Module file (%s) not found in process' memory map!",
+module_file_spec.GetFilename().AsCString());
 }
 
 Status
 NativeProcessFreeBSD::GetFileLoadAddress(const llvm::StringRef &file_name,
  lldb::addr_t &load_addr) {
   load_addr = LLDB_INVALID_ADDRESS;
-  return Status();
+  Status error = PopulateMemoryRegionCache();
+  if (error.Fail())
+return error;
+
+  FileSpec file(file_name);
+  for (const auto &it : m_mem_region_cache) {
+if (it.second == file) {
+  load_addr = it.first.GetRange().GetRangeBase();
+  return Status();
+}
+  }
+  return Status("No load address found for file %s.", file_name.str().c_str());
 }
 
 void NativeProcessFreeBSD::SigchldHandler() {

diff  --git a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
index 4b6e9af140d0..3c7a9400f9c4 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.h
@@ -67,9 +67,13 @@ class NativeProcessFreeBSD : public NativeProcessELF {
   Status SetBreakpoint(lldb::addr_t addr, uint32_t size,
bool hardware) override;
 
+  // The two following methods are probably not necessary and probably
+  // will never be called.  Nevertheless, we implement them right now
+  // to reduce the 
diff erences between 
diff erent platforms and reduce
+  // the risk of the lack of implementation actually breaking something,
+  // at least for the time being.
   Status GetLoadedModuleFileSpec(const char *module_path,
  FileSpec &file_spec) override;
-
   Status GetFileLoadAddress(const llvm::StringRef &file_name,
 lldb::addr_t &load_addr) override;
 



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


[llvm-branch-commits] [lldb] 1a1cc0b - [lldb] [Platform/POSIX] Use gdb-remote plugin when attaching

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T09:56:51+01:00
New Revision: 1a1cc0ba7db549025ab1a504633ae4554042fd60

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

LOG: [lldb] [Platform/POSIX] Use gdb-remote plugin when attaching

Force gdb-remote plugin when attaching using the derivatives
of PlatformPOSIX class.  This is consistent with the behavior
for launching processes (via DebugProcess() method) and guarantees
consistent plugin choice on FreeBSD.

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

Added: 


Modified: 
lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
lldb/test/API/commands/process/attach-resume/TestAttachResume.py
lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py

Removed: 




diff  --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp 
b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index f717eaa2b47d..cad5a803ec2e 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -388,8 +388,7 @@ lldb::ProcessSP PlatformPOSIX::Attach(ProcessAttachInfo 
&attach_info,
 
   process_sp =
   target->CreateProcess(attach_info.GetListenerForProcess(debugger),
-attach_info.GetProcessPluginName(), nullptr,
-false);
+"gdb-remote", nullptr, true);
 
   if (process_sp) {
 ListenerSP listener_sp = attach_info.GetHijackListener();

diff  --git a/lldb/test/API/commands/process/attach-resume/TestAttachResume.py 
b/lldb/test/API/commands/process/attach-resume/TestAttachResume.py
index ff1bb8c6921d..a73b6566c747 100644
--- a/lldb/test/API/commands/process/attach-resume/TestAttachResume.py
+++ b/lldb/test/API/commands/process/attach-resume/TestAttachResume.py
@@ -18,7 +18,6 @@ class AttachResumeTestCase(TestBase):
 NO_DEBUG_INFO_TESTCASE = True
 
 @skipIfRemote
-@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr19310')
 @expectedFailureNetBSD
 @skipIfWindows # llvm.org/pr24778, llvm.org/pr21753
 @skipIfReproducer # FIXME: Unexpected packet during (active) replay

diff  --git 
a/lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py 
b/lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py
index 10edae860ed4..51681d65d210 100644
--- a/lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py
+++ b/lldb/test/API/functionalities/deleted-executable/TestDeletedExecutable.py
@@ -19,7 +19,6 @@ class TestDeletedExecutable(TestBase):
 @expectedFailureAll(oslist=["linux"],
 triple=no_match('aarch64-.*-android'))
 # determining the architecture of the process fails
-@expectedFailureAll(oslist=["freebsd"], bugnumber="llvm.org/pr48374")
 @skipIfReproducer # File synchronization is not supported during replay.
 def test(self):
 self.build()



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


[llvm-branch-commits] [lldb] 77f0ea4 - [lldb] [test] Fix continue_to_breakpoint() args in TestThreadStepOut

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T09:56:51+01:00
New Revision: 77f0ea4b5b978c7caa0788ae8b1a2429089021bd

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

LOG: [lldb] [test] Fix continue_to_breakpoint() args in TestThreadStepOut

The test is skipped/xfailing on all platforms, so it seems that the API
got out of sync.  Fix that so it returns to a 'proper' failure
on FreeBSD.

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

Added: 


Modified: 
lldb/test/API/functionalities/thread/step_out/TestThreadStepOut.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/thread/step_out/TestThreadStepOut.py 
b/lldb/test/API/functionalities/thread/step_out/TestThreadStepOut.py
index eb2d264ec2e3..e273cc4be31b 100644
--- a/lldb/test/API/functionalities/thread/step_out/TestThreadStepOut.py
+++ b/lldb/test/API/functionalities/thread/step_out/TestThreadStepOut.py
@@ -145,7 +145,8 @@ def step_out_test(self, step_out_func):
 if len(breakpoint_threads) == 1:
 success = thread.Suspend()
 self.assertTrue(success, "Couldn't suspend a thread")
-bkpt_threads = lldbutil.continue_to_breakpoint(bkpt)
+bkpt_threads = 
lldbutil.continue_to_breakpoint(self.inferior_process,
+   bkpt)
 self.assertEqual(len(bkpt_threads), 1, "Second thread stopped")
 success = thread.Resume()
 self.assertTrue(success, "Couldn't resume a thread")



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


[llvm-branch-commits] [lldb] cf884c1 - [lldb] [test] Remove duplicate xfail for Testtypedef

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T11:22:06+01:00
New Revision: cf884c1035c79973e7297fcd13495b78e00ef919

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

LOG: [lldb] [test] Remove duplicate xfail for Testtypedef

The @expectedFailureAll(compiler="clang") decorator works correctly
on FreeBSD these days, so it is sufficient.

Added: 


Modified: 
lldb/test/API/lang/c/typedef/Testtypedef.py

Removed: 




diff  --git a/lldb/test/API/lang/c/typedef/Testtypedef.py 
b/lldb/test/API/lang/c/typedef/Testtypedef.py
index cbbb6362381e..29a3c5af9e4a 100644
--- a/lldb/test/API/lang/c/typedef/Testtypedef.py
+++ b/lldb/test/API/lang/c/typedef/Testtypedef.py
@@ -13,9 +13,6 @@ class TypedefTestCase(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @expectedFailureAll(compiler="clang", bugnumber="llvm.org/pr19238")
-@expectedFailureAll(
-oslist=["freebsd"],
-bugnumber="llvm.org/pr25626 expectedFailureClang fails on FreeBSD")
 def test_typedef(self):
 """Test 'image lookup -t a' and check for correct display at 
diff erent scopes."""
 self.build()



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


[llvm-branch-commits] [lldb] 733e2ae - Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot action"

2020-12-07 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-07T15:58:49+01:00
New Revision: 733e2ae8cdf3d13e0a1ef9878e8500f446ffa699

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

LOG: Revert "[lldb] [POSIX-DYLD] Add libraries from initial eTakeSnapshot 
action"

This reverts commit 09b08833f301ea375137931d26b7193101f82ceb.

This code is wrong on Linux, and causes ld-linux and linux-vdso to be
reported twice.  I need to work on it more.

Added: 


Modified: 
lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
lldb/test/API/api/multithreaded/TestMultithreaded.py

lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
lldb/test/API/tools/lldb-server/TestLldbGdbServer.py

lldb/test/API/tools/lldb-server/libraries-svr4/TestGdbRemoteLibrariesSvr4Support.py
lldb/test/Shell/Unwind/thread-step-out-ret-addr-check.test

Removed: 




diff  --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp 
b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index c06d640c654c..15b3805003a5 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -295,15 +295,8 @@ bool DYLDRendezvous::SaveSOEntriesFromRemote(
   return false;
 
 // Only add shared libraries and not the executable.
-if (!SOEntryIsMainExecutable(entry)) {
+if (!SOEntryIsMainExecutable(entry))
   m_soentries.push_back(entry);
-  // This function is called only once, at the very beginning
-  // of the program.  Make sure to add all soentries that are
-  // already present at this point.  This is necessary to cover
-  // DT_NEEDED on FreeBSD since (unlike Linux) it does not report
-  // loading these libraries separately.
-  m_added_soentries.push_back(entry);
-}
   }
 
   m_loaded_modules = module_list;

diff  --git 
a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp 
b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
index 163093c2ab1f..e6abab848e12 100644
--- a/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSDRemote/NativeProcessFreeBSD.cpp
@@ -485,6 +485,9 @@ Status NativeProcessFreeBSD::Kill() {
 Status NativeProcessFreeBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
  MemoryRegionInfo &range_info) 
{
 
+  // TODO: figure out why it breaks stuff
+  return Status("currently breaks determining module list");
+
   if (m_supports_mem_region == LazyBool::eLazyBoolNo) {
 // We're done.
 return Status("unsupported");

diff  --git a/lldb/test/API/api/multithreaded/TestMultithreaded.py 
b/lldb/test/API/api/multithreaded/TestMultithreaded.py
index 60c2c3b372cb..c6c75de386fa 100644
--- a/lldb/test/API/api/multithreaded/TestMultithreaded.py
+++ b/lldb/test/API/api/multithreaded/TestMultithreaded.py
@@ -31,6 +31,7 @@ def setUp(self):
 @skipIfNoSBHeaders
 # clang-cl does not support throw or catch (llvm.org/pr24538)
 @skipIfWindows
+@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr48370')
 def test_python_stop_hook(self):
 """Test that you can run a python command in a stop-hook when stdin is 
File based. """
 self.build_and_test('driver.cpp test_stop-hook.cpp',

diff  --git 
a/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
 
b/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
index 4439607d91cf..81c3798ebba7 100644
--- 
a/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ 
b/lldb/test/API/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -15,6 +15,7 @@ class TestBreakpointInGlobalConstructors(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 NO_DEBUG_INFO_TESTCASE = True
 
+@expectedFailureAll(oslist=["freebsd"], bugnumber='llvm.org/pr48373')
 @expectedFailureNetBSD
 def test(self):
 self.build()

diff  --git a/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py 
b/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
index 61e64d44e794..36984b3d1666 100644
--- a/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
+++ b/lldb/test/API/functionalities/memory-region/TestMemoryRegion.py
@@ -23,6 +23,7 @@ def setUp(self):
 'main.cpp',
 '// Run here before printing memory regions')
 
+@expectedFailureAll(oslist=["freebsd"])
   

[llvm-branch-commits] [lldb] 25c40a4 - [lldb] [docs] Add a manpage for lldb-server

2020-12-10 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-10T15:02:25+01:00
New Revision: 25c40a45999e59e3b2902cd91373cd47e7a93488

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

LOG: [lldb] [docs] Add a manpage for lldb-server

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

Added: 
lldb/docs/man/lldb-server.rst

Modified: 
lldb/docs/conf.py

Removed: 




diff  --git a/lldb/docs/conf.py b/lldb/docs/conf.py
index cdab1b00e1b7..4d894bf050da 100644
--- a/lldb/docs/conf.py
+++ b/lldb/docs/conf.py
@@ -246,7 +246,9 @@
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
-man_pages = [('man/lldb', 'lldb', u'LLDB Documentation', [u'LLVM project'], 1)]
+man_pages = [('man/lldb', 'lldb', u'LLDB Documentation', [u'LLVM project'], 1),
+ ('man/lldb-server', 'lldb-server', u'LLDB Documentation', [u'LLVM 
project'], 1),
+ ]
 
 # If true, show URL addresses after external links.
 #man_show_urls = False

diff  --git a/lldb/docs/man/lldb-server.rst b/lldb/docs/man/lldb-server.rst
new file mode 100644
index ..a67c00b305f6
--- /dev/null
+++ b/lldb/docs/man/lldb-server.rst
@@ -0,0 +1,209 @@
+:orphan:
+
+lldb-server -- Server for LLDB Debugging Sessions
+=
+
+.. program:: lldb-server
+
+SYNOPSIS
+
+
+| :program:`lldb-server` v[ersion]
+| :program:`lldb-server` g[dbserver] [*options*]
+| :program:`lldb-server` p[latform] [*options*]
+
+DESCRIPTION
+---
+
+:program:`lldb-server` provides the server counterpart of the LLVM debugger.
+The server runs and monitors the debugged program, while the user interfaces
+with it via a client, either running locally or connecting remotely.
+
+All of the code in the LLDB project is available under the Apache 2.0 License
+with LLVM exceptions.
+
+COMMANDS
+
+
+The first argument to lldb-server specifies a command to run.
+
+.. option:: v[ersion]
+
+ Prints lldb-server version and exits.
+
+.. option:: g[dbserver]
+
+ Runs the server using the gdb-remote protocol. LLDB can afterwards
+ connect to the server using *gdb-remote* command.
+
+.. option:: p[latform]
+
+ Runs the platform server. LLDB can afterwards connect to the server using
+ *platform select*, followed by *platform connect*.
+
+GDBSERVER COMMAND
+-
+
+| :program:`lldb-server` g[dbserver] [*options*] [[*host*]:*port*] [[--] 
*program* *args*...]
+
+CONNECTION
+~~
+
+.. option:: host:port
+
+ Specifies the hostname and TCP port to listen on. Obligatory unless another
+ listening option is used. If host is empty, *localhost* will be used.  If port
+ is zero, a random port will be selected, and written as specified by --pipe
+ or --named-pipe options.
+
+.. option:: --fd 
+
+ Communicate over the given file descriptor instead of sockets.
+
+.. option:: --named-pipe 
+
+ Write the listening port number to the specified named pipe.
+
+.. option:: --pipe 
+
+ Write the listening port number to the specified pipe (fd).
+
+.. option:: --reverse-connect
+
+ Connect to the client instead of passively waiting for a connection. In this
+ case, [host]:port denotes the remote address to connect to.
+
+GENERAL OPTIONS
+~~~
+
+.. option:: --help
+
+ Prints out the usage information and exits.
+
+.. option:: --log-channels 
+
+ Channels to log. A colon-separated list of entries. Each entry starts with
+ a channel followed by a space-separated list of categories.
+
+.. option:: --log-file 
+
+ Destination file to log to. If empty, log to stderr.
+
+.. option:: --setsid
+
+ Run lldb-server in a new session.
+
+TARGET SELECTION
+
+
+.. option:: --attach 
+
+ Attach to the process given by a (numeric) process id or a name.
+
+.. option:: -- program args
+
+ Launch a program for debugging.
+
+If neither of target options are used, :program:`lldb-server` is started
+without a specific target. It can be afterwards instructed by the client
+to launch or attach.
+
+PLATFORM COMMAND
+
+
+| :program:`lldb-server` p[latform] [*options*] --server --listen 
[[*host*]:*port*]
+
+CONNECTION
+~~
+
+.. option:: --server
+
+ Run in server mode, handling multiple connections. If this is not specified,
+ lldb-server will accept only one connection and exit when it is finished.
+
+.. option:: --listen :
+
+ Hostname and port to listen on. Obligatory. If *port* is zero, a random port
+ will be used.
+
+.. option:: --socket-file 
+
+ Write the listening socket port number to the specified file.
+
+GENERAL OPTIONS
+~~~
+
+.. option:: --log-channels 
+
+ Channels to log. A colon-separated list of entries. Each entry starts with
+ a channel followed by a space-separated list of categories.
+
+.. option:: 

[llvm-branch-commits] [lldb] 0cd8686 - [lldb] [Process/FreeBSD] Add more 'override' keywords

2020-12-13 Thread Michał Górny via llvm-branch-commits

Author: Michał Górny
Date: 2020-12-13T09:59:32+01:00
New Revision: 0cd8686043f962d20395fde382af3af14042d4ed

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

LOG: [lldb] [Process/FreeBSD] Add more 'override' keywords

Added: 


Modified: 
lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp

Removed: 




diff  --git a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp 
b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
index 2c7c948f1059..4637458b53c3 100644
--- a/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -215,7 +215,7 @@ class ReadOperation : public Operation {
   : m_addr(addr), m_buff(buff), m_size(size), m_error(error),
 m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::addr_t m_addr;
@@ -240,7 +240,7 @@ class WriteOperation : public Operation {
   : m_addr(addr), m_buff(buff), m_size(size), m_error(error),
 m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::addr_t m_addr;
@@ -303,7 +303,7 @@ class WriteRegOperation : public Operation {
 const RegisterValue &value, bool &result)
   : m_tid(tid), m_offset(offset), m_value(value), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -336,7 +336,7 @@ class ReadDebugRegOperation : public Operation {
   : m_tid(tid), m_offset(offset), m_size(size), m_value(value),
 m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -369,7 +369,7 @@ class WriteDebugRegOperation : public Operation {
  const RegisterValue &value, bool &result)
   : m_tid(tid), m_offset(offset), m_value(value), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -400,7 +400,7 @@ class ReadGPROperation : public Operation {
   ReadGPROperation(lldb::tid_t tid, void *buf, bool &result)
   : m_tid(tid), m_buf(buf), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -426,7 +426,7 @@ class ReadFPROperation : public Operation {
   ReadFPROperation(lldb::tid_t tid, void *buf, bool &result)
   : m_tid(tid), m_buf(buf), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -448,7 +448,7 @@ class WriteGPROperation : public Operation {
   WriteGPROperation(lldb::tid_t tid, void *buf, bool &result)
   : m_tid(tid), m_buf(buf), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -470,7 +470,7 @@ class WriteFPROperation : public Operation {
   WriteFPROperation(lldb::tid_t tid, void *buf, bool &result)
   : m_tid(tid), m_buf(buf), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -492,7 +492,7 @@ class ResumeOperation : public Operation {
   ResumeOperation(uint32_t signo, bool &result)
   : m_signo(signo), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   uint32_t m_signo;
@@ -522,7 +522,7 @@ class SingleStepOperation : public Operation {
   SingleStepOperation(uint32_t signo, bool &result)
   : m_signo(signo), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   uint32_t m_signo;
@@ -549,7 +549,7 @@ class LwpInfoOperation : public Operation {
   LwpInfoOperation(lldb::tid_t tid, void *info, bool &result, int &ptrace_err)
   : m_tid(tid), m_info(info), m_result(result), m_err(ptrace_err) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -577,7 +577,7 @@ class ThreadSuspendOperation : public Operation {
   ThreadSuspendOperation(lldb::tid_t tid, bool suspend, bool &result)
   : m_tid(tid), m_suspend(suspend), m_result(result) {}
 
-  void Execute(ProcessMonitor *monitor);
+  void Execute(ProcessMonitor *monitor) override;
 
 private:
   lldb::tid_t m_tid;
@@ -596,7 +596,7 @@ class EventMessageOperation : public Operation {
   EventMessageOperation(lldb::tid_t tid, unsigned long *mes

[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-15 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny created 
https://github.com/llvm/llvm-project/pull/112364

This is a backport of 387b37af1aabf325e9be844361564dfad8d45c75 for 19.x, 
adjusted to add new Triple::EnvironmentType members at the end to avoid 
breaking backwards ABI compatibility.

Gentoo is planning to introduce a `*t64` suffix for triples that will be used 
by 32-bit platforms that use 64-bit `time_t`. Add support for parsing and 
accepting these triples, and while at it make clang automatically enable the 
necessary glibc feature macros when this suffix is used.

From 2c7139ea394c3caeb0e51064542423f332ca15f7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Mon, 14 Oct 2024 13:18:04 +0200
Subject: [PATCH] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples
 (64-bit time_t ABIs)"

This is a backport of 387b37af1aabf325e9be844361564dfad8d45c75 for 19.x,
adjusted to add new Triple::EnvironmentType members at the end to avoid
breaking backwards ABI compatibility.

Gentoo is planning to introduce a `*t64` suffix for triples that will be
used by 32-bit platforms that use 64-bit `time_t`. Add support for
parsing and accepting these triples, and while at it make clang
automatically enable the necessary glibc feature macros when this suffix
is used.
---
 clang/lib/Basic/Targets/ARM.cpp|  2 +
 clang/lib/Basic/Targets/OSTargets.h|  4 ++
 clang/lib/CodeGen/CodeGenModule.cpp|  5 +-
 clang/lib/CodeGen/Targets/ARM.cpp  |  3 ++
 clang/lib/Driver/Driver.cpp|  5 +-
 clang/lib/Driver/ToolChains/Arch/ARM.cpp   |  7 +++
 clang/lib/Driver/ToolChains/Gnu.cpp|  2 +
 clang/lib/Driver/ToolChains/Linux.cpp  |  1 +
 clang/test/Preprocessor/time64.c   | 12 +
 llvm/include/llvm/TargetParser/Triple.h| 35 ++---
 llvm/lib/Target/ARM/ARMSubtarget.h |  4 +-
 llvm/lib/Target/ARM/ARMTargetMachine.cpp   |  2 +
 llvm/lib/Target/ARM/ARMTargetMachine.h |  1 +
 llvm/lib/TargetParser/ARMTargetParser.cpp  |  3 ++
 llvm/lib/TargetParser/Triple.cpp   |  6 +++
 llvm/unittests/TargetParser/TripleTest.cpp | 58 ++
 16 files changed, 138 insertions(+), 12 deletions(-)
 create mode 100644 clang/test/Preprocessor/time64.c

diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp
index 7423626d7c3cbf..e55feedbd5c6f9 100644
--- a/clang/lib/Basic/Targets/ARM.cpp
+++ b/clang/lib/Basic/Targets/ARM.cpp
@@ -311,7 +311,9 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
 switch (Triple.getEnvironment()) {
 case llvm::Triple::Android:
 case llvm::Triple::GNUEABI:
+case llvm::Triple::GNUEABIT64:
 case llvm::Triple::GNUEABIHF:
+case llvm::Triple::GNUEABIHFT64:
 case llvm::Triple::MuslEABI:
 case llvm::Triple::MuslEABIHF:
 case llvm::Triple::OpenHOS:
diff --git a/clang/lib/Basic/Targets/OSTargets.h 
b/clang/lib/Basic/Targets/OSTargets.h
index 5f27c3469f861d..357c1965057c9b 100644
--- a/clang/lib/Basic/Targets/OSTargets.h
+++ b/clang/lib/Basic/Targets/OSTargets.h
@@ -337,6 +337,10 @@ class LLVM_LIBRARY_VISIBILITY LinuxTargetInfo : public 
OSTargetInfo {
   Builder.defineMacro("_GNU_SOURCE");
 if (this->HasFloat128)
   Builder.defineMacro("__FLOAT128__");
+if (Triple.isTime64ABI()) {
+  Builder.defineMacro("_FILE_OFFSET_BITS", "64");
+  Builder.defineMacro("_TIME_BITS", "64");
+}
   }
 
 public:
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp 
b/clang/lib/CodeGen/CodeGenModule.cpp
index cf5e29e5a3db8d..8d9beab9fa7f88 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -177,10 +177,7 @@ createTargetCodeGenInfo(CodeGenModule &CGM) {
 else if (ABIStr == "aapcs16")
   Kind = ARMABIKind::AAPCS16_VFP;
 else if (CodeGenOpts.FloatABI == "hard" ||
- (CodeGenOpts.FloatABI != "soft" &&
-  (Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
-   Triple.getEnvironment() == llvm::Triple::MuslEABIHF ||
-   Triple.getEnvironment() == llvm::Triple::EABIHF)))
+ (CodeGenOpts.FloatABI != "soft" && Triple.isHardFloatABI()))
   Kind = ARMABIKind::AAPCS_VFP;
 
 return createARMTargetCodeGenInfo(CGM, Kind);
diff --git a/clang/lib/CodeGen/Targets/ARM.cpp 
b/clang/lib/CodeGen/Targets/ARM.cpp
index d032b88d7683cd..457d761039a08d 100644
--- a/clang/lib/CodeGen/Targets/ARM.cpp
+++ b/clang/lib/CodeGen/Targets/ARM.cpp
@@ -35,7 +35,9 @@ class ARMABIInfo : public ABIInfo {
 case llvm::Triple::EABI:
 case llvm::Triple::EABIHF:
 case llvm::Triple::GNUEABI:
+case llvm::Triple::GNUEABIT64:
 case llvm::Triple::GNUEABIHF:
+case llvm::Triple::GNUEABIHFT64:
 case llvm::Triple::MuslEABI:
 case llvm::Triple::MuslEABIHF:
   return true;
@@ -48,6 +50,7 @@ class ARMABIInfo : public ABIInfo {
 switch (getTarget().getTriple().getEnvironment()) {
 case llvm::Triple::EABIHF:
 case llvm::Triple::GNUEABIHF:
+ 

[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-15 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny milestoned 
https://github.com/llvm/llvm-project/pull/112364
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] release/19.x: [NFC] fix build failure (#100993) (PR #112551)

2024-10-16 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

CC @chenzheng1030 @aaronpuchert 

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


[llvm-branch-commits] [compiler-rt] release/19.x: Undef _TIME_BITS along with _FILE_OFFSET_BITS (PR #112247)

2024-10-16 Thread Michał Górny via llvm-branch-commits

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


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


[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-29 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

Added support for Gentoo Linux triplets suffixed `-gnut64`, `-gnueabit64` and 
`-gnueabihft64`. On these targets, clang automatically defines 
`-D_TIME_BITS=64` to use 64-bit `time_t` type from glibc.

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


[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-30 Thread Michał Górny via llvm-branch-commits


@@ -294,7 +294,11 @@ class Triple {
 
 PAuthTest,
 
-LastEnvironmentType = PAuthTest
+GNUT64,
+GNUEABIT64,
+GNUEABIHFT64,
+
+LastEnvironmentType = GNUEABIHFT64

mgorny wrote:

The change wasn't meant to break API or ABI compatibility, and whether it did 
is at least controversial. What Zig is doing here is quite uncommon.

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


[llvm-branch-commits] [compiler-rt] release/19.x: [compiler-rt] [test] Fix using toolchains that rely on Clang default configs (#113491) (PR #114229)

2024-10-30 Thread Michał Górny via llvm-branch-commits

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

LGTM

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


[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-30 Thread Michał Górny via llvm-branch-commits


@@ -294,7 +294,11 @@ class Triple {
 
 PAuthTest,
 
-LastEnvironmentType = PAuthTest
+GNUT64,
+GNUEABIT64,
+GNUEABIHFT64,
+
+LastEnvironmentType = GNUEABIHFT64

mgorny wrote:

For the record, Gentoo has already backported it to 18.x as well (I was 
literally waiting for the patch to be merged as a confirmation that this 
approach is good).

My alternative idea would be to limit the changes to accept `*t64` but return 
one of the existing enum values, i.e. `-gnut64` would return `::GNU` and so on. 
We'd lose the ability to customize clang behavior on it, but at least it won't 
refuse to work right away.

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


[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-28 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

> Correct me if I am wrong, but this seems like an added feature and not a 
> regression or critical fix? it's a pretty big patch and while it's most 
> likely is "safe" it would still fall outside our current definition of 
> backports?

Without this change, you can't use clang at all, because it rejects the host 
triplet.

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


[llvm-branch-commits] [clang] [llvm] [LLVM] [Clang] Backport "Support for Gentoo `*t64` triples (64-bit time_t ABIs)" (PR #112364)

2024-10-28 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

Just to clarify my concise reply (I was in a hurry): right now (FWICS since 
clang 17), clang rejects the host triplet we'd like to use as invalid, i.e.:

```
clang: error: version 't32' in target triple 'i686-pc-linux-gnut32' is invalid
clang: error: no input files
```

So at least *some* patch is needed to make it work at all. And since we're 
changing it anyway, I don't think there's a major risk in backporting the whole 
thing — and it would at least have the advantage of preserving consistent 
behavior across clang versions (i.e. not having clang 20 that applies time64 
flags, and clang 19 that doesn't reject the triplet but doesn't apply the 
flags).

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


[llvm-branch-commits] [llvm] release/19.x: [NFC] fix build failure (#100993) (PR #112551)

2024-10-26 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

@arsenm, does the above comment answer your concerns? If so, could you please 
approve it before the next release.

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


[llvm-branch-commits] [libcxx] [libcxxabi] release/19.x: [libc++] Fix broken configuration system-libcxxabi on Apple (#110920) (PR #115892)

2024-11-15 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

> Can someone confirm that the CI test failures are not important in this case?

It seems to be a timeout/CI problem ("agent lost"), rather than an actual 
failure.

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


[llvm-branch-commits] [llvm] [19.x] Backport standalone build fixes for offload (PR #118643)

2024-12-04 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny milestoned 
https://github.com/llvm/llvm-project/pull/118643
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [19.x] Backport standalone build fixes for offload (PR #118643)

2024-12-04 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny edited 
https://github.com/llvm/llvm-project/pull/118643
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [19.x] Backport standalone build fixes for offload (PR #118643)

2024-12-04 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny created 
https://github.com/llvm/llvm-project/pull/118643

Backport the changes from #104647 and part of the changes from #118173. Note 
that I've cherry-picked the individual changes here since merging #118173 
wholesale makes automatic merge adds some stuff that weren't present in 19.x. 
With these changes, I can build and run x86-64 tests of offload in a standalone 
build, i.e. 19.x becomes in line with main.

From 07abb45d6c2d74c98e379b47b3cc36214752174c Mon Sep 17 00:00:00 2001
From: estewart08 
Date: Mon, 19 Aug 2024 17:59:21 -0500
Subject: [PATCH 1/6] [offload] - Fix issue with standalone debug offload build
 (#104647)

Error: CommandLine Error: Option 'attributor-manifest-internal'
registered more than once

During the standalone debug build of offload the above error is seen at
app runtime when using a prebuilt llvm with LLVM_LINK_LLVM_DYLIB=ON.
This is caused by linking both libLLVM.so and various archives that are
found via llvm_map_components_to_libnames for jit support.
---
 offload/plugins-nextgen/common/CMakeLists.txt | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/offload/plugins-nextgen/common/CMakeLists.txt 
b/offload/plugins-nextgen/common/CMakeLists.txt
index 284f98875170cd..aea20c6ec31435 100644
--- a/offload/plugins-nextgen/common/CMakeLists.txt
+++ b/offload/plugins-nextgen/common/CMakeLists.txt
@@ -11,13 +11,15 @@ add_dependencies(PluginCommon intrinsics_gen)
 
 # Only enable JIT for those targets that LLVM can support.
 set(supported_jit_targets AMDGPU NVPTX)
-foreach(target IN LISTS supported_jit_targets)
-  if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD)
- target_compile_definitions(PluginCommon PRIVATE 
"LIBOMPTARGET_JIT_${target}")
-llvm_map_components_to_libnames(llvm_libs ${target})
-target_link_libraries(PluginCommon PRIVATE ${llvm_libs})
-  endif()
-endforeach()
+if (NOT LLVM_LINK_LLVM_DYLIB)
+  foreach(target IN LISTS supported_jit_targets)
+if("${target}" IN_LIST LLVM_TARGETS_TO_BUILD)
+  target_compile_definitions(PluginCommon PRIVATE 
"LIBOMPTARGET_JIT_${target}")
+  llvm_map_components_to_libnames(llvm_libs ${target})
+  target_link_libraries(PluginCommon PRIVATE ${llvm_libs})
+endif()
+  endforeach()
+endif()
 
 # Include the RPC server from the `libc` project if availible.
 if(TARGET llvmlibc_rpc_server AND ${LIBOMPTARGET_GPU_LIBC_SUPPORT})

From c6daa28d9358ac0e13dcf47809728bf43e63c205 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Sat, 30 Nov 2024 12:32:57 +0100
Subject: [PATCH 2/6] [offload] Include CheckCXXCompilerFlag in CMake

Include CheckCXXCompilerFlag before it is used in the top-level CMake
file.  This fixes standalone builds, but it is also cleaner than
assuming that some previous CMake file will include it for us.
---
 offload/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index 4cd97a6a5ff63d..3ba892c76c8b8e 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -127,6 +127,7 @@ include(LibomptargetGetDependencies)
 # Set up testing infrastructure.
 include(OpenMPTesting)
 
+include(CheckCXXCompilerFlag)
 check_cxx_compiler_flag(-Werror=global-constructors OFFLOAD_HAVE_WERROR_CTOR)
 
 # LLVM source tree is required at build time for libomptarget

From 50190568f5e75e874ad3463540e85fca46f21ad5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Sat, 30 Nov 2024 15:32:39 +0100
Subject: [PATCH 3/6] [offload] [test] Add "omp" test dependency only when
 present

Add the `omp` target dependency to tests only when the respective target
is present, i.e. when not building standalone against system libomp.
---
 offload/test/CMakeLists.txt | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt
index 3ac5d7907e2cc2..c90ed26389faf6 100644
--- a/offload/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -22,6 +22,11 @@ if(CUDAToolkit_FOUND)
   get_filename_component(CUDA_LIBDIR "${CUDA_cudart_static_LIBRARY}" DIRECTORY)
 endif()
 
+set(OMP_DEPEND)
+if(TARGET omp)
+  set(OMP_DEPEND omp)
+endif()
+
 string(REGEX MATCHALL "([^\ ]+\ |[^\ ]+$)" SYSTEM_TARGETS 
"${LIBOMPTARGET_SYSTEM_TARGETS}")
 foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
   string(STRIP "${CURRENT_TARGET}" CURRENT_TARGET)
@@ -29,7 +34,7 @@ foreach(CURRENT_TARGET IN LISTS SYSTEM_TARGETS)
   add_offload_testsuite(check-libomptarget-${CURRENT_TARGET}
 "Running libomptarget tests"
 ${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET}
-DEPENDS omptarget omp ${LIBOMPTARGET_TESTED_PLUGINS}
+DEPENDS omptarget ${OMP_DEPEND} ${LIBOMPTARGET_TESTED_PLUGINS}
 ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
   list(APPEND LIBOMPTARGET_LIT_TESTSUITES 
${CMAKE_CURRENT_BINARY_DIR}/${CURRENT_TARGET})
 
@@ -43,12 +48,12 @@ add_offload_testsuite(check-libomptarget
   "Running libomptarget tests"
   ${LIBOMPTA

[llvm-branch-commits] [llvm] release/19.x: [cmake] Include GNUInstallDirs before using variables defined by it. (#83807) (PR #121410)

2025-01-06 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

Replaced by #121755.

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


[llvm-branch-commits] [llvm] release/19.x: [cmake] Include GNUInstallDirs before using variables defined by it. (#83807) (PR #121410)

2025-01-06 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny closed 
https://github.com/llvm/llvm-project/pull/121410
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [mlir][cmake] Add missing MLIRTestDialect dependencies (PR #125834)

2025-02-05 Thread Michał Górny via llvm-branch-commits


@@ -27,7 +27,11 @@ add_mlir_library(MLIRTestIR
   TestVisitorsGeneric.cpp
 
   EXCLUDE_FROM_LIBMLIR
+
+  DEPENDS

mgorny wrote:

Don't you need `LINK_LIBS` here too?

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


[llvm-branch-commits] [flang] [mlir] release/20.x: Fixes for flang/mlir dependencies (PR #125837)

2025-02-05 Thread Michał Górny via llvm-branch-commits

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


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


[llvm-branch-commits] [mlir] release/20.x: [mlir][CMake] Fix dependency on MLIRTestDialect in Transforms tests (#125894) (PR #126211)

2025-02-07 Thread Michał Górny via llvm-branch-commits

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


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


[llvm-branch-commits] [llvm] [19.x] Backport standalone build fixes for offload (PR #118643)

2024-12-17 Thread Michał Górny via llvm-branch-commits

mgorny wrote:

Thanks! Since it's a nice setup, and pretty much was broken before, I don't 
think there's a point in a release note.

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


[llvm-branch-commits] [libclc] release/20.x: [libclc] Disable external-calls testing for clspv targets (#127529) (PR #127597)

2025-02-18 Thread Michał Górny via llvm-branch-commits

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


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


[llvm-branch-commits] [libclc] [libclc] Revert the recent breaking changes from CMake from the 21.x release branch (PR #149711)

2025-07-20 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny created 
https://github.com/llvm/llvm-project/pull/149711

Revert the recent batch of changes to the CMake build of libclc that introduced 
significant breakage, notably:
- standalone builds no longer working
- broken symlinks being installed

These changes are nontrivial and were made shortly prior to the branching 
point, so it's better to defer them to 22.x and fix properly than attempt to 
apply more ad hoc fixes.

Fixes #149659
Fixes #149437

From 92b937eb336d235b981b4beaae2c9cabe02914be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Sun, 20 Jul 2025 16:07:23 +0200
Subject: [PATCH 1/5] Revert "[libclc] Move CMake for prepare_builtins to a
 subdirectory (#148815)"

This reverts commit 8a7a64873b13e6fd931b748fbf50b3da26fe7fca.  It broke
standalone builds since the necessary variables are now limited in scope
to `libclc/utils` while they are used in the top-level CMakeLists.
---
 libclc/CMakeLists.txt   | 24 ++--
 libclc/utils/CMakeLists.txt | 24 
 2 files changed, 22 insertions(+), 26 deletions(-)
 delete mode 100644 libclc/utils/CMakeLists.txt

diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index 2570d1a106d21..e2871d1b01a16 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -164,14 +164,34 @@ endif()
 
 list( SORT LIBCLC_TARGETS_TO_BUILD )
 
+# Construct LLVM version define
+set( LLVM_VERSION_DEFINE 
"-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
+
 # This needs to be set before any target that needs it
 # We need to use LLVM_INCLUDE_DIRS here, because if we are linking to an
 # llvm build directory, this includes $src/llvm/include which is where all the
 # headers are not $build/include/ which is what LLVM_INCLUDE_DIR is set to.
 include_directories( ${LLVM_INCLUDE_DIRS} )
 
-# Configure prepare_builtins
-add_subdirectory( utils )
+# Setup prepare_builtins tools
+set(LLVM_LINK_COMPONENTS
+  BitReader
+  BitWriter
+  Core
+  IRReader
+  Support
+)
+if( LIBCLC_STANDALONE_BUILD )
+  add_llvm_executable( prepare_builtins utils/prepare-builtins.cpp )
+  set( prepare_builtins_exe prepare_builtins )
+  set( prepare_builtins_target prepare_builtins )
+else()
+  add_llvm_utility( prepare_builtins utils/prepare-builtins.cpp )
+  setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe 
prepare_builtins_target )
+endif()
+target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
+# These were not properly reported in early LLVM and we don't need them
+target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )
 
 # Setup arch devices
 set( r600--_devices cedar cypress barts cayman )
diff --git a/libclc/utils/CMakeLists.txt b/libclc/utils/CMakeLists.txt
deleted file mode 100644
index ea1d9e9c8ef5f..0
--- a/libclc/utils/CMakeLists.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-# Construct LLVM version define
-set( LLVM_VERSION_DEFINE 
"-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" )
-
-# Setup prepare_builtins tools
-set( LLVM_LINK_COMPONENTS
-  BitReader
-  BitWriter
-  Core
-  IRReader
-  Support
-)
-
-if( LIBCLC_STANDALONE_BUILD )
-  add_llvm_executable( prepare_builtins prepare-builtins.cpp )
-  set( prepare_builtins_exe prepare_builtins )
-  set( prepare_builtins_target prepare_builtins )
-else()
-  add_llvm_utility( prepare_builtins prepare-builtins.cpp )
-  setup_host_tool( prepare_builtins PREPARE_BUILTINS prepare_builtins_exe 
prepare_builtins_target )
-endif()
-
-target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} )
-# These were not properly reported in early LLVM and we don't need them
-target_compile_options( prepare_builtins PRIVATE -fno-rtti -fno-exceptions )

From 3f12831601fcbdc1c610c2d7131661b9990de1b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= 
Date: Sun, 20 Jul 2025 16:07:59 +0200
Subject: [PATCH 2/5] Revert "[libclc] Change symlinks to copies on Windows
 (#147759)"

This reverts commit 9b5959dd9a0eb0fc005b92be7ef7f3a5e3377b81.
---
 libclc/cmake/modules/AddLibclc.cmake | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libclc/cmake/modules/AddLibclc.cmake 
b/libclc/cmake/modules/AddLibclc.cmake
index 056706ee629cd..a8160e04d46a0 100644
--- a/libclc/cmake/modules/AddLibclc.cmake
+++ b/libclc/cmake/modules/AddLibclc.cmake
@@ -425,17 +425,11 @@ function(add_libclc_builtin_set)
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
   endif()
 
-  if(CMAKE_HOST_UNIX OR LLVM_USE_SYMLINKS)
-set(LIBCLC_LINK_OR_COPY create_symlink)
-  else()
-set(LIBCLC_LINK_OR_COPY copy)
-  endif()
-
-  foreach( a IN LISTS ARG_ALIASES )
+  foreach( a ${ARG_ALIASES} )
 set( alias_suffix "${a}-${ARG_TRIPLE}.bc" )
 add_custom_command(
   OUTPUT ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
-  COMMAND ${CMAKE_COMMAND} -E ${LIBCLC_LINK_OR_COPY} 
${libclc_builtins_lib} ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
+   

[llvm-branch-commits] [libclc] [libclc] Revert the recent breaking changes from CMake from the 21.x release branch (PR #149711)

2025-07-20 Thread Michał Górny via llvm-branch-commits

https://github.com/mgorny milestoned 
https://github.com/llvm/llvm-project/pull/149711
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits