Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] Use CFPropertyListCreateData in debugserver (NFC) #112262

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

JDevlieghere
Copy link
Member

CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use CFPropertyListCreateData instead.

@JDevlieghere JDevlieghere changed the title [lldb] Use CFPropertyListCreateData in debug server (NFC) [lldb] Use CFPropertyListCreateData in debugserver (NFC) Oct 14, 2024
@llvmbot llvmbot added the lldb label Oct 14, 2024
@llvmbot
Copy link
Member

llvmbot commented Oct 14, 2024

@llvm/pr-subscribers-lldb

Author: Jonas Devlieghere (JDevlieghere)

Changes

CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use CFPropertyListCreateData instead.


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

4 Files Affected:

  • (modified) lldb/cmake/modules/LLDBConfig.cmake (-2)
  • (modified) lldb/source/Host/CMakeLists.txt (+3)
  • (modified) lldb/source/Host/macosx/objcxx/CMakeLists.txt (+3-1)
  • (modified) lldb/tools/debugserver/source/RNBServices.cpp (+2-2)
diff --git a/lldb/cmake/modules/LLDBConfig.cmake b/lldb/cmake/modules/LLDBConfig.cmake
index a60921990cf775..93ccd9c479c2b8 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -188,7 +188,6 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/../clang/include")
 
 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
   # Disable GCC warnings
-  append("-Wno-deprecated-declarations" CMAKE_CXX_FLAGS)
   append("-Wno-unknown-pragmas" CMAKE_CXX_FLAGS)
   append("-Wno-strict-aliasing" CMAKE_CXX_FLAGS)
 
@@ -198,7 +197,6 @@ endif()
 
 # Disable Clang warnings
 if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  append("-Wno-deprecated-register" CMAKE_CXX_FLAGS)
   append("-Wno-vla-extension" CMAKE_CXX_FLAGS)
 endif()
 
diff --git a/lldb/source/Host/CMakeLists.txt b/lldb/source/Host/CMakeLists.txt
index c2e091ee8555b7..04090349cdd20c 100644
--- a/lldb/source/Host/CMakeLists.txt
+++ b/lldb/source/Host/CMakeLists.txt
@@ -177,3 +177,6 @@ add_lldb_library(lldbHost NO_PLUGIN_DEPENDENCIES
     Support
   )
 
+if (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  target_compile_options(lldbHost PRIVATE "-Wno-deprecated-declarations")
+endif()
diff --git a/lldb/source/Host/macosx/objcxx/CMakeLists.txt b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
index 273999f24380e5..1e693bed12ce15 100644
--- a/lldb/source/Host/macosx/objcxx/CMakeLists.txt
+++ b/lldb/source/Host/macosx/objcxx/CMakeLists.txt
@@ -16,4 +16,6 @@ add_lldb_library(lldbHostMacOSXObjCXX NO_PLUGIN_DEPENDENCIES
     TargetParser
   )
 
-target_compile_options(lldbHostMacOSXObjCXX PRIVATE -fno-objc-exceptions)
+target_compile_options(lldbHostMacOSXObjCXX PRIVATE
+  -fno-objc-exceptions
+  -Wno-deprecated-declarations)
diff --git a/lldb/tools/debugserver/source/RNBServices.cpp b/lldb/tools/debugserver/source/RNBServices.cpp
index 6e4b55e3e6466d..bb57fb5ea027eb 100644
--- a/lldb/tools/debugserver/source/RNBServices.cpp
+++ b/lldb/tools/debugserver/source/RNBServices.cpp
@@ -208,8 +208,8 @@ int ListApplications(std::string &plist, bool opt_runningApps,
   GetProcesses(plistMutableArray.get(), all_users);
 #endif
 
-  CFReleaser<CFDataRef> plistData(
-      ::CFPropertyListCreateXMLData(alloc, plistMutableArray.get()));
+  CFReleaser<CFDataRef> plistData(::CFPropertyListCreateData(
+      alloc, plistMutableArray.get(), kCFPropertyListXMLFormat_v1_0, 0, NULL));
 
   // write plist to service port
   if (plistData.get() != NULL) {

CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.
@JDevlieghere JDevlieghere force-pushed the use-CFPropertyListCreateData branch from 9048d3a to 325d131 Compare October 14, 2024 21:19
Copy link
Collaborator

@jasonmolenda jasonmolenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, honestly i'm not sure we even use ListApplications in debugserver any longer, but this looks correct.

@JDevlieghere JDevlieghere merged commit 9cc6e6f into llvm:main Oct 14, 2024
5 of 6 checks passed
@JDevlieghere JDevlieghere deleted the use-CFPropertyListCreateData branch October 14, 2024 21:30
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.
bricknerb pushed a commit to bricknerb/llvm-project that referenced this pull request Oct 17, 2024
CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.
JDevlieghere added a commit to swiftlang/llvm-project that referenced this pull request Oct 22, 2024
CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.

(cherry picked from commit 9cc6e6f)
EricWF pushed a commit to efcs/llvm-project that referenced this pull request Oct 22, 2024
CFPropertyListCreateXMLData has been deprecated since macOS 10.10. Use
CFPropertyListCreateData instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants