[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo updated 
https://github.com/llvm/llvm-project/pull/68013

>From a472a16e6032ce0cef0acae6957f690f7e6cc4a3 Mon Sep 17 00:00:00 2001
From: walter erquinigo 
Date: Mon, 2 Oct 2023 13:56:00 -0400
Subject: [PATCH] [LLDB] Allow specifying a custom exports file

LLDB has the cmake flag `LLDB_EXPORT_ALL_SYMBOLS` that exports the lldb, 
lldb_private namespaces, as well as other symbols like python and lua (see 
`third-party/llvm-project/lldb/source/API/liblldb-private.exports`). However, 
not all symbols in lldb fall into these categories and in order to get access 
to some symbols that live in plugin folders (like dwarf parsing symbols), it's 
useful to be able to specify a custom exports file giving more control to the 
developer using lldb as a library.

This adds the new cmake flag `LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE` that is 
used when `LLDB_EXPORT_ALL_SYMBOLS` is enabled to specify that custom exports 
file.

This is a follow up of https://github.com/llvm/llvm-project/pull/67851
---
 lldb/cmake/modules/LLDBConfig.cmake |  5 -
 lldb/source/API/CMakeLists.txt  | 13 ++---
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index 380016ce48015fa..ce5e666a6f5e1ac 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -123,7 +123,10 @@ if(APPLE AND CMAKE_GENERATOR STREQUAL Xcode)
 endif()
 
 set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
-  "Causes lldb to export all symbols when building liblldb.")
+  "Causes lldb to export some private symbols when building liblldb. See 
lldb/source/API/liblldb-private.exports for the full list of symbols that get 
exported.")
+
+set(LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE "" CACHE PATH
+  "When `LLDB_EXPORT_ALL_SYMBOLS` is enabled, this specifies the exports file 
to use when building liblldb.")
 
 if ((NOT MSVC) OR MSVC12)
   add_definitions( -DHAVE_ROUND )
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 7cfa3aaafdae188..a574a461d4920ae 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -177,11 +177,18 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
 # from working on some systems but limits the liblldb size.
 MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb 
namespace")
 add_llvm_symbol_exports(liblldb 
${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
-  else()
-# Don't use an explicit export.  Instead, tell the linker to
-# export all symbols.
+  elseif (NOT LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE)
+# Don't use an explicit export. Instead, tell the linker to export all 
symbols.
 MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and 
lldb_private namespaces")
+MESSAGE(WARNING "Private LLDB symbols frequently change and no API 
stability is guaranteed. "
+"Only the SB API is guaranteed to be stable.")
 add_llvm_symbol_exports(liblldb 
${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
+  else ()
+MESSAGE("-- Symbols (liblldb): exporting all symbols specified in the 
exports "
+" file '${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}'")
+MESSAGE(WARNING "Private LLDB symbols frequently change and no API 
stability is guaranteed. "
+"Only the SB API is guaranteed to be stable.")
+add_llvm_symbol_exports(liblldb "${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}")
   endif()
   set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
 elseif (LLDB_EXPORT_ALL_SYMBOLS)

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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Walter Erquinigo via lldb-commits

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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo updated 
https://github.com/llvm/llvm-project/pull/68013

>From d557ea59b9c24387244280566260c33ac6bb9367 Mon Sep 17 00:00:00 2001
From: walter erquinigo 
Date: Mon, 2 Oct 2023 13:56:00 -0400
Subject: [PATCH] [LLDB] Allow specifying a custom exports file

LLDB has the cmake flag `LLDB_EXPORT_ALL_SYMBOLS` that exports the lldb, 
lldb_private namespaces, as well as other symbols like python and lua (see 
`third-party/llvm-project/lldb/source/API/liblldb-private.exports`). However, 
not all symbols in lldb fall into these categories and in order to get access 
to some symbols that live in plugin folders (like dwarf parsing symbols), it's 
useful to be able to specify a custom exports file giving more control to the 
developer using lldb as a library.

This adds the new cmake flag `LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE` that is 
used when `LLDB_EXPORT_ALL_SYMBOLS` is enabled to specify that custom exports 
file.

This is a follow up of https://github.com/llvm/llvm-project/pull/67851
---
 lldb/cmake/modules/LLDBConfig.cmake |  3 +++
 lldb/source/API/CMakeLists.txt  | 13 ++---
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index 380016ce48015fa..264eed1ad82012f 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -125,6 +125,9 @@ endif()
 set(LLDB_EXPORT_ALL_SYMBOLS 0 CACHE BOOL
   "Causes lldb to export all symbols when building liblldb.")
 
+set(LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE "" CACHE PATH
+  "When `LLDB_EXPORT_ALL_SYMBOLS` is enabled, this specifies the exports file 
to use when building liblldb.")
+
 if ((NOT MSVC) OR MSVC12)
   add_definitions( -DHAVE_ROUND )
 endif()
diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 7cfa3aaafdae188..a574a461d4920ae 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -177,11 +177,18 @@ if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
 # from working on some systems but limits the liblldb size.
 MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb 
namespace")
 add_llvm_symbol_exports(liblldb 
${CMAKE_CURRENT_SOURCE_DIR}/liblldb.exports)
-  else()
-# Don't use an explicit export.  Instead, tell the linker to
-# export all symbols.
+  elseif (NOT LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE)
+# Don't use an explicit export. Instead, tell the linker to export all 
symbols.
 MESSAGE("-- Symbols (liblldb): exporting all symbols from the lldb and 
lldb_private namespaces")
+MESSAGE(WARNING "Private LLDB symbols frequently change and no API 
stability is guaranteed. "
+"Only the SB API is guaranteed to be stable.")
 add_llvm_symbol_exports(liblldb 
${CMAKE_CURRENT_SOURCE_DIR}/liblldb-private.exports)
+  else ()
+MESSAGE("-- Symbols (liblldb): exporting all symbols specified in the 
exports "
+" file '${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}'")
+MESSAGE(WARNING "Private LLDB symbols frequently change and no API 
stability is guaranteed. "
+"Only the SB API is guaranteed to be stable.")
+add_llvm_symbol_exports(liblldb "${LLDB_EXPORT_ALL_SYMBOLS_EXPORTS_FILE}")
   endif()
   set_target_properties(liblldb_exports PROPERTIES FOLDER "lldb misc")
 elseif (LLDB_EXPORT_ALL_SYMBOLS)

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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Walter Erquinigo via lldb-commits

walter-erquinigo wrote:

I'll add the warning as you guys mention. That'll set clear expectations on 
what users will be getting.

Besides that, @bulbazord , the current symbols getting exported by 
`third-party/llvm-project/lldb/source/API/liblldb-private.exports` are not all 
the symbols, but just some. Some folks like me need access to symbols from 
specific plugins that don't use the lldb_private namespace, so being able to 
replace the list that the file mentioned above exports is fundamental.

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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread via lldb-commits

jimingham wrote:

That sounds appropriate to me.

Jim

> On Oct 4, 2023, at 3:03 PM, Alex Langford ***@***.***> wrote:
> 
> 
> I think we need to make it clear wherever in the build system that the knob 
> for turning on these exports lives that you use these symbols at your own 
> risk, and we guarantee NO ABI stability for anything but the SB API's. We 
> know that on this list but somebody getting the sources might think this was 
> a supported configuration and be sad further down the line. Jim
> 
> In that case, maybe we should emit a CMake warning instead of just an info 
> message?
> 
> —
> Reply to this email directly, view it on GitHub 
> , or 
> unsubscribe 
> .
> You are receiving this because you are on a team that was mentioned.
> 



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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Alex Langford via lldb-commits

bulbazord wrote:

> I think we need to make it clear wherever in the build system that the knob 
> for turning on these exports lives that you use these symbols at your own 
> risk, and we guarantee NO ABI stability for anything but the SB API's. We 
> know that on this list but somebody getting the sources might think this was 
> a supported configuration and be sad further down the line. Jim

In that case, maybe we should emit a CMake warning instead of just an info 
message? 

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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread via lldb-commits

jimingham wrote:

I think we need to make it clear wherever in the build system that the knob for 
turning on these exports lives that you use these symbols at your own risk, and 
we guarantee NO ABI stability for anything but the SB API's.  We know that on 
this list but somebody getting the sources might think this was a supported 
configuration and be sad further down the line.

Jim


> On Oct 4, 2023, at 2:43 PM, Alex Langford ***@***.***> wrote:
> 
> 
> Personally I have no qualms about this. It's just an option that lets you 
> choose which symbols to export. We already allow exporting every symbol, why 
> not just some of them? I would be careful though, since we don't guarantee 
> any stability for lldb_private (including things from plugins) relying on 
> this could come back to bite you.
> 
> —
> Reply to this email directly, view it on GitHub 
> , or 
> unsubscribe 
> .
> You are receiving this because you are on a team that was mentioned.
> 



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


[Lldb-commits] [lldb] [LLDB] Allow specifying a custom exports file (PR #68013)

2023-10-04 Thread Alex Langford via lldb-commits

bulbazord wrote:

Personally I have no qualms about this. It's just an option that lets you 
choose which symbols to export. We already allow exporting every symbol, why 
not just some of them? I would be careful though, since we don't guarantee any 
stability for lldb_private (including things from plugins) relying on this 
could come back to bite you.

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


[Lldb-commits] [lldb] Add the ability to get a C++ vtable ValueObject from another ValueObj… (PR #67599)

2023-10-04 Thread via lldb-commits

jimingham wrote:

The other bit that we mentioned in the course of this review was showing 
invalid vtables.  You still have the code that just makes an error in the child 
creation if you can't look up the value that a vtable slot is pointing to.  It 
would be better to make the child and report that it looks bogus somehow.

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


[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)

2023-10-04 Thread José Lira Junior via lldb-commits


@@ -8,18 +8,21 @@
 
 #include "CommandOptionsProcessLaunch.h"
 
+#include "lldb/Core/Module.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/OptionParser.h"
 #include "lldb/Interpreter/CommandCompletions.h"
 #include "lldb/Interpreter/CommandObject.h"
 #include "lldb/Interpreter/CommandOptionArgumentTable.h"
 #include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Target.h"
-
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SetVector.h"

junior-jl wrote:

Done!

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


[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)

2023-10-04 Thread José Lira Junior via lldb-commits

https://github.com/junior-jl updated 
https://github.com/llvm/llvm-project/pull/67019

From 6de148adcdd1eedea7e23b4e267c6f42bb68bc45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20L=2E=20Junior?= 
Date: Tue, 3 Oct 2023 15:28:45 -0300
Subject: [PATCH 1/3] [lldb] add stop-at-user-entry option to process launch

---
 lldb/include/lldb/Target/Language.h   |  4 ++
 lldb/include/lldb/Target/Target.h |  2 +
 .../Commands/CommandOptionsProcessLaunch.cpp  | 13 +-
 lldb/source/Commands/Options.td   |  4 ++
 .../Language/CPlusPlus/CPlusPlusLanguage.h|  2 +
 .../Plugins/Language/ObjC/ObjCLanguage.h  |  2 +
 .../ObjCPlusPlus/ObjCPlusPlusLanguage.h   |  2 +
 lldb/source/Target/Target.cpp | 42 +++
 .../command-process-launch-user-entry.test|  8 
 9 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 
lldb/test/Shell/Commands/command-process-launch-user-entry.test

diff --git a/lldb/include/lldb/Target/Language.h 
b/lldb/include/lldb/Target/Language.h
index a6b9ccaf31b3c42..d53089ba4a59974 100644
--- a/lldb/include/lldb/Target/Language.h
+++ b/lldb/include/lldb/Target/Language.h
@@ -160,6 +160,10 @@ class Language : public PluginInterface {
 
   virtual lldb::LanguageType GetLanguageType() const = 0;
 
+  // Implement this function to return the user-defined entry point name
+  // for the language
+  virtual llvm::StringRef GetUserEntryPointName() const { return {}; }
+
   virtual bool IsTopLevelFunction(Function );
 
   virtual bool IsSourceFile(llvm::StringRef file_path) const = 0;
diff --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index e9e531d0e12640a..82a343ee03fb516 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -654,6 +654,8 @@ class Target : public std::enable_shared_from_this,
 
   lldb::BreakpointSP GetBreakpointByID(lldb::break_id_t break_id);
 
+  lldb::BreakpointSP CreateBreakpointAtUserEntry();
+
   // Use this to create a file and line breakpoint to a given module or all
   // module it is nullptr
   lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
diff --git a/lldb/source/Commands/CommandOptionsProcessLaunch.cpp 
b/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
index 85ad8ff5e07132c..3055e4ca45bd230 100644
--- a/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
+++ b/lldb/source/Commands/CommandOptionsProcessLaunch.cpp
@@ -8,6 +8,7 @@
 
 #include "CommandOptionsProcessLaunch.h"
 
+#include "lldb/Core/Module.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/OptionParser.h"
@@ -15,11 +16,13 @@
 #include "lldb/Interpreter/CommandObject.h"
 #include "lldb/Interpreter/CommandOptionArgumentTable.h"
 #include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Target.h"
-
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SetVector.h"
 
 using namespace llvm;
 using namespace lldb;
@@ -38,7 +41,13 @@ Status CommandOptionsProcessLaunch::SetOptionValue(
   case 's': // Stop at program entry point
 launch_info.GetFlags().Set(eLaunchFlagStopAtEntry);
 break;
-
+  case 'm': // Stop at user entry point
+  {
+TargetSP target_sp =
+execution_context ? execution_context->GetTargetSP() : TargetSP();
+target_sp->CreateBreakpointAtUserEntry();
+break;
+  }
   case 'i': // STDIN for read only
   {
 FileAction action;
diff --git a/lldb/source/Commands/Options.td b/lldb/source/Commands/Options.td
index 04830b8b990efae..dd4cf5c4dc043e7 100644
--- a/lldb/source/Commands/Options.td
+++ b/lldb/source/Commands/Options.td
@@ -675,6 +675,10 @@ let Command = "platform shell" in {
 let Command = "process launch" in {
   def process_launch_stop_at_entry : Option<"stop-at-entry", "s">,
 Desc<"Stop at the entry point of the program when launching a process.">;
+  def process_launch_stop_at_user_entry : Option<"stop-at-user-entry", "m">,
+Desc<"Stop at the user entry point when launching a process. For C based "
+"languages this will be the 'main' function, but this might differ for "
+"other languages.">;
   def process_launch_disable_aslr : Option<"disable-aslr", "A">, 
Arg<"Boolean">,
 Desc<"Set whether to disable address space layout randomization when 
launching a process.">;
   def process_launch_plugin : Option<"plugin", "P">, Arg<"Plugin">,
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h 
b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
index 7712a60b7795951..623d481bf117f48 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h
@@ -103,6 +103,8 @@ class CPlusPlusLanguage : public Language {
 return lldb::eLanguageTypeC_plus_plus;
   }
 
+  

[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)

2023-10-04 Thread Walter Erquinigo via lldb-commits


@@ -18,7 +18,9 @@
 #include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
 #include 
 
+namespace lldb_plugin::dwarf {

walter-erquinigo wrote:

This is possible after the switch to c++17, and that's probably why no one else 
is using it in LLDB. There's no explicit llvm coding convention for this. I'm 
fine with splitting it into two lines if you want.

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


[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)

2023-10-04 Thread Greg Clayton via lldb-commits


@@ -18,7 +18,9 @@
 #include "llvm/DebugInfo/DWARF/DWARFLocationExpression.h"
 #include 
 
+namespace lldb_plugin::dwarf {

clayborg wrote:

Do we do this anywhere else? Should this be split into:
```
namespace lldb_plugin {
namespace dwarf {
```
Not sure if there is a llvm coding convention for this?

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


[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)

2023-10-04 Thread Greg Clayton via lldb-commits

https://github.com/clayborg commented:

I have no issues with putting this into a namespace either. Just a question in 
my inline comment

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


[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)

2023-10-04 Thread Greg Clayton via lldb-commits

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


[Lldb-commits] [lldb] Add the ability to get a C++ vtable ValueObject from another ValueObj… (PR #67599)

2023-10-04 Thread via lldb-commits

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

LGTM

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


[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)

2023-10-04 Thread Greg Clayton via lldb-commits
=?utf-8?q?Jos=C3=A9?= L. Junior 
Message-ID:
In-Reply-To: 


https://github.com/clayborg commented:

Just remove the includes that are no longer needed and this is good to go!

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


[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)

2023-10-04 Thread Greg Clayton via lldb-commits
=?utf-8?q?José?= L. Junior 
Message-ID:
In-Reply-To: 



@@ -8,18 +8,21 @@
 
 #include "CommandOptionsProcessLaunch.h"
 
+#include "lldb/Core/Module.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/HostInfo.h"
 #include "lldb/Host/OptionParser.h"
 #include "lldb/Interpreter/CommandCompletions.h"
 #include "lldb/Interpreter/CommandObject.h"
 #include "lldb/Interpreter/CommandOptionArgumentTable.h"
 #include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/Language.h"
 #include "lldb/Target/Platform.h"
 #include "lldb/Target/Target.h"
-
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/SetVector.h"

clayborg wrote:

we can remove this and the above includes now that we are doing the heavy work 
in Target.cpp

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


[Lldb-commits] [lldb] [lldb] add stop-at-user-entry option to process launch (PR #67019)

2023-10-04 Thread Greg Clayton via lldb-commits
=?utf-8?q?José?= L. Junior 
Message-ID:
In-Reply-To: 


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


[Lldb-commits] [lldb] Add the ability to get a C++ vtable ValueObject from another ValueObj… (PR #67599)

2023-10-04 Thread via lldb-commits

jeffreytan81 wrote:

> > > > * Can we test this during multiple inheritance? Should we print 
> > > > multiple vtables?
> > > >   [Greg] I can add a test for this and make sure things works when 
> > > > dynamic typing is on and off. We won't print multiple vtables, as each 
> > > > class has only 1 vtable, it will just include all of the virtual 
> > > > methods needed for any inherited classes.
> > 
> > 
> > I remember some compiler's multi-inheritance implementation is putting one 
> > vtable_ptr in object for each parent class. Maybe not in clang?
> 
> Each class has a single vtable and this table will contain a copy of all 
> vtables that are needed for each class.

I was talking about https://shaharmike.com/cpp/vtable-part2/ which there can be 
multiple vtable_ptr(s) in object and multiple vtables. But I think you are 
right that we only care showing the final merged vtable from most derived child 
class not other vtables containing non-virtual thunk methods. 

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


[Lldb-commits] [lldb] [LLDB][NFC] Create a namespace for the DWARF plugin (PR #68150)

2023-10-04 Thread Alex Langford via lldb-commits

bulbazord wrote:

I have no problem with putting things form SymbolFileDWARF into its own 
namespace. Let's wait a bit though to see if anyone else has any opinions.

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Greg Clayton via lldb-commits

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

Looks good!

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


[Lldb-commits] [lldb] Add the ability to get a C++ vtable ValueObject from another ValueObj… (PR #67599)

2023-10-04 Thread Greg Clayton via lldb-commits

https://github.com/clayborg commented:

I think all review comments have been taken into account. Anything else needed?

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


[Lldb-commits] [lldb] [lldb-vscode] Update installation instructions (PR #68234)

2023-10-04 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb


Changes

lldb-vscode had installation instructions based on creating a folder inside 
~/.vscode/extensions, which no longer works. A different installation mechanism 
is needed based on a VSCode command. More can be read in the contents of this 
patch.

Closes https://github.com/llvm/llvm-project/issues/63655


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


1 Files Affected:

- (modified) lldb/tools/lldb-vscode/README.md (+60-55) 


``diff
diff --git a/lldb/tools/lldb-vscode/README.md b/lldb/tools/lldb-vscode/README.md
index 154ccefc5f59798..6f930293126d53e 100644
--- a/lldb/tools/lldb-vscode/README.md
+++ b/lldb/tools/lldb-vscode/README.md
@@ -1,18 +1,20 @@
 
 # Table of Contents
 
-- [Introduction](#Introduction)
-- [Installation](#Installation-Visual-Studio-Code)
+- [Table of Contents](#table-of-contents)
+- [Introduction](#introduction)
+- [Installation for Visual Studio Code](#installation-for-visual-studio-code)
 - [Configurations](#configurations)
-   - [Launch Configuration Settings](#launch-configuration-settings)
-   - [Attach Configuration Settings](#attach-configuration-settings)
-   - [Example configurations](#example-configurations)
-   - [Launching](#launching)
-   - [Attach to process using process ID](#attach-using-pid)
-   - [Attach to process by name](#attach-by-name)
-   - [Loading a core file](#loading-a-core-file)
-- [Custom Debugger Commands](#custom-debugger-commands)
-  - [startDebugging](#startDebugging)
+  - [Launch Configuration Settings](#launch-configuration-settings)
+  - [Attaching Settings](#attaching-settings)
+  - [Example configurations](#example-configurations)
+- [Launching](#launching)
+- [Attach using PID](#attach-using-pid)
+- [Attach by Name](#attach-by-name)
+- [Loading a Core File](#loading-a-core-file)
+- [Custom debugger commands](#custom-debugger-commands)
+  - [startDebugging](#startdebugging)
+  - [repl-mode](#repl-mode)
 
 # Introduction
 
@@ -24,52 +26,57 @@ get a full featured debugger with a well defined protocol.
 
 # Installation for Visual Studio Code
 
-Installing the plug-in involves creating a directory in the 
`~/.vscode/extensions` folder and copying the package.json file that is in the 
same directory as this
-documentation into it, and copying to symlinking a lldb-vscode binary into
-the `bin` directory inside the plug-in directory.
-
-If you want to make a stand alone plug-in that you can send to others on unix 
systems:
-
-```
-$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
-$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
-$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
-$ cp /path/to/a/built/lldb-vscode .
-$ cp /path/to/a/built/liblldb.so .
+Installing the plug-in involves creating a directory in any location outside of
+`~/.vscode/extensions`. For example, `~/vscode-lldb` is a valid one. You'll 
also
+need a subfolder `bin`, e.g. `~/vscode-lldb/bin`. Then copy the `package.json`
+file that is in the same directory as this documentation into it, and symlink
+the `lldb-vscode` binary into the `bin` directory inside the plug-in directory.
+
+Finally, on VS Code, execute the command
+`Developer: Install Extension from Location` and pick the folder you just
+created, which would be `~/vscode-lldb` following the example above.
+
+If you want to make a stand alone plug-in that you can send to others on UNIX
+systems:
+
+```bash
+mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
+cp package.json ~/llvm-org.lldb-vscode-0.1.0
+cd ~/llvm-org.lldb-vscode-0.1.0/bin
+cp /path/to/a/built/lldb-vscode .
+cp /path/to/a/built/liblldb.so .
 ```
 
-It is important to note that the directory `~/.vscode/extensions` works for 
users logged in locally to the machine. If you are remoting into the box using 
Visual Studio Code's Remote plugins (SSH, WSL, Docker) it will look for 
extensions on `~/.vscode-server/extensions` only and you will not see your just 
installed lldb-vscode plug-in. If you want this plugin to be visible to 
remoting users, you will need to either repeat the process above for the 
`~/.vscode-server` folder or create a symbolic link from it to 
`~/.vscode/extensions`:
+If you want to make a stand alone plug-in that you can send to others on macOS
+systems:
 
-```
-$ cd ~/.vscode-server/extensions
-$ ln -s ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0  
llvm-org.lldb-vscode-0.1.0
+```bash
+mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
+cp package.json ~/llvm-org.lldb-vscode-0.1.0
+cd ~/llvm-org.lldb-vscode-0.1.0/bin
+cp /path/to/a/built/lldb-vscode .
+rsync -av /path/to/a/built/LLDB.framework LLDB.framework
 ```
 
-If you want to make a stand alone plug-in that you can send to others on macOS 
systems:
-
-```
-$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
-$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
-$ cd 

[Lldb-commits] [lldb] [lldb-vscode] Update installation instructions (PR #68234)

2023-10-04 Thread Walter Erquinigo via lldb-commits

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


[Lldb-commits] [lldb] [lldb-vscode] Update installation instructions (PR #68234)

2023-10-04 Thread Walter Erquinigo via lldb-commits

https://github.com/walter-erquinigo created 
https://github.com/llvm/llvm-project/pull/68234

lldb-vscode had installation instructions based on creating a folder inside 
~/.vscode/extensions, which no longer works. A different installation mechanism 
is needed based on a VSCode command. More can be read in the contents of this 
patch.

Closes https://github.com/llvm/llvm-project/issues/63655


>From 8eafc95bc1a3804557adab55db997cb6ac3d37e5 Mon Sep 17 00:00:00 2001
From: walter erquinigo 
Date: Wed, 4 Oct 2023 12:55:16 -0400
Subject: [PATCH] [lldb-vscode] Update installation instructions

lldb-vscode had installation instructions based on creating a folder inside 
~/.vscode/extensions, which no longer works. A different installation mechanism 
is needed based on a VSCode command. More can be read in the contents of this 
patch.

Closes https://github.com/llvm/llvm-project/issues/63655
---
 lldb/tools/lldb-vscode/README.md | 115 ---
 1 file changed, 60 insertions(+), 55 deletions(-)

diff --git a/lldb/tools/lldb-vscode/README.md b/lldb/tools/lldb-vscode/README.md
index 154ccefc5f59798..6f930293126d53e 100644
--- a/lldb/tools/lldb-vscode/README.md
+++ b/lldb/tools/lldb-vscode/README.md
@@ -1,18 +1,20 @@
 
 # Table of Contents
 
-- [Introduction](#Introduction)
-- [Installation](#Installation-Visual-Studio-Code)
+- [Table of Contents](#table-of-contents)
+- [Introduction](#introduction)
+- [Installation for Visual Studio Code](#installation-for-visual-studio-code)
 - [Configurations](#configurations)
-   - [Launch Configuration Settings](#launch-configuration-settings)
-   - [Attach Configuration Settings](#attach-configuration-settings)
-   - [Example configurations](#example-configurations)
-   - [Launching](#launching)
-   - [Attach to process using process ID](#attach-using-pid)
-   - [Attach to process by name](#attach-by-name)
-   - [Loading a core file](#loading-a-core-file)
-- [Custom Debugger Commands](#custom-debugger-commands)
-  - [startDebugging](#startDebugging)
+  - [Launch Configuration Settings](#launch-configuration-settings)
+  - [Attaching Settings](#attaching-settings)
+  - [Example configurations](#example-configurations)
+- [Launching](#launching)
+- [Attach using PID](#attach-using-pid)
+- [Attach by Name](#attach-by-name)
+- [Loading a Core File](#loading-a-core-file)
+- [Custom debugger commands](#custom-debugger-commands)
+  - [startDebugging](#startdebugging)
+  - [repl-mode](#repl-mode)
 
 # Introduction
 
@@ -24,52 +26,57 @@ get a full featured debugger with a well defined protocol.
 
 # Installation for Visual Studio Code
 
-Installing the plug-in involves creating a directory in the 
`~/.vscode/extensions` folder and copying the package.json file that is in the 
same directory as this
-documentation into it, and copying to symlinking a lldb-vscode binary into
-the `bin` directory inside the plug-in directory.
-
-If you want to make a stand alone plug-in that you can send to others on unix 
systems:
-
-```
-$ mkdir -p ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
-$ cp package.json ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0
-$ cd ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
-$ cp /path/to/a/built/lldb-vscode .
-$ cp /path/to/a/built/liblldb.so .
+Installing the plug-in involves creating a directory in any location outside of
+`~/.vscode/extensions`. For example, `~/vscode-lldb` is a valid one. You'll 
also
+need a subfolder `bin`, e.g. `~/vscode-lldb/bin`. Then copy the `package.json`
+file that is in the same directory as this documentation into it, and symlink
+the `lldb-vscode` binary into the `bin` directory inside the plug-in directory.
+
+Finally, on VS Code, execute the command
+`Developer: Install Extension from Location` and pick the folder you just
+created, which would be `~/vscode-lldb` following the example above.
+
+If you want to make a stand alone plug-in that you can send to others on UNIX
+systems:
+
+```bash
+mkdir -p ~/llvm-org.lldb-vscode-0.1.0/bin
+cp package.json ~/llvm-org.lldb-vscode-0.1.0
+cd ~/llvm-org.lldb-vscode-0.1.0/bin
+cp /path/to/a/built/lldb-vscode .
+cp /path/to/a/built/liblldb.so .
 ```
 
-It is important to note that the directory `~/.vscode/extensions` works for 
users logged in locally to the machine. If you are remoting into the box using 
Visual Studio Code's Remote plugins (SSH, WSL, Docker) it will look for 
extensions on `~/.vscode-server/extensions` only and you will not see your just 
installed lldb-vscode plug-in. If you want this plugin to be visible to 
remoting users, you will need to either repeat the process above for the 
`~/.vscode-server` folder or create a symbolic link from it to 
`~/.vscode/extensions`:
+If you want to make a stand alone plug-in that you can send to others on macOS
+systems:
 
-```
-$ cd ~/.vscode-server/extensions
-$ ln -s ~/.vscode/extensions/llvm-org.lldb-vscode-0.1.0  

[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Michael Buch via lldb-commits

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Michael Buch via lldb-commits


@@ -519,6 +519,33 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const 
SymbolContext ,
   return UpdateSymbolContextScopeForType(sc, die, type_sp);
 }
 
+static std::optional

Michael137 wrote:

The integer types are a bit inconsistent (but this didn't change with this 
patch).

* `ParseInheritance` stores the value in an `off_t`. Then passes it to 
`clang::CharUnits::fromQuantity` which takes an `int64_t`
* The Rust `Variant` support stores offsets as uint32_t, and so does 
`MemberAttributes`. But `FormValue::Unsigned()` returns a uint64_t.

Would be nice to make this consistent eventually

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Felipe de Azevedo Piovezan via lldb-commits

felipepiovezan wrote:

this must have felt good to fix!

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Felipe de Azevedo Piovezan via lldb-commits

felipepiovezan wrote:

![image](https://github.com/llvm/llvm-project/assets/5406686/f95b5fa5-8aa6-45fc-9996-6dea8d97a4d6)


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


[Lldb-commits] [lldb] [clang] Choose non-templated ctor as deduction guide unambiguously (PR #66487)

2023-10-04 Thread Erich Keane via lldb-commits
Botond =?utf-8?q?István_Hprváth?=,
Botond =?utf-8?q?István_Hprváth?Message-ID:
In-Reply-To: 


erichkeane wrote:

Ah, I see, apologies.  I thought you meant the resign/etc complaint meant you 
couldn't commit through the UI.

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


[Lldb-commits] [lldb] [clang] Choose non-templated ctor as deduction guide unambiguously (PR #66487)

2023-10-04 Thread via lldb-commits
Botond =?utf-8?q?István_Hprváth?=,
Botond =?utf-8?q?István_Hprváth?Message-ID:
In-Reply-To: 


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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb


Changes

Currently this non-trivial calculation is repeated multiple times, making it 
hard to reason about when the `byte_offset`/`member_byte_offset` is being set 
or not.

This patch simply moves all those instances of the same calculation into a 
helper function.

We return an optional to remain an NFC patch. Default initializing the offset 
would make sense but requires further analysis and can be done in a follow-up 
patch.

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


1 Files Affected:

- (modified) lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(+39-87) 


``diff
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 37fb16d4e0351c9..005711d6f488c7f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -519,6 +519,33 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const 
SymbolContext ,
   return UpdateSymbolContextScopeForType(sc, die, type_sp);
 }
 
+static std::optional
+ExtractDataMemberLocation(DWARFDIE const , DWARFFormValue const 
_value,
+  ModuleSP module_sp) {
+  // With DWARF 3 and later, if the value is an integer constant,
+  // this form value is the offset in bytes from the beginning of
+  // the containing entity.
+  if (!form_value.BlockData())
+return form_value.Unsigned();
+
+  Value initialValue(0);
+  Value memberOffset(0);
+  const DWARFDataExtractor _info_data = die.GetData();
+  uint32_t block_length = form_value.Unsigned();
+  uint32_t block_offset =
+  form_value.BlockData() - debug_info_data.GetDataStart();
+  if (!DWARFExpression::Evaluate(
+  nullptr, // ExecutionContext *
+  nullptr, // RegisterContext *
+  module_sp, DataExtractor(debug_info_data, block_offset, 
block_length),
+  die.GetCU(), eRegisterKindDWARF, , nullptr, 
memberOffset,
+  nullptr)) {
+return {};
+  }
+
+  return memberOffset.ResolveValue(nullptr).UInt();
+}
+
 lldb::TypeSP
 DWARFASTParserClang::ParseTypeModifier(const SymbolContext ,
const DWARFDIE ,
@@ -1406,26 +1433,9 @@ void DWARFASTParserClang::ParseInheritance(
 encoding_form = form_value;
 break;
   case DW_AT_data_member_location:
-if (form_value.BlockData()) {
-  Value initialValue(0);
-  Value memberOffset(0);
-  const DWARFDataExtractor _info_data = die.GetData();
-  uint32_t block_length = form_value.Unsigned();
-  uint32_t block_offset =
-  form_value.BlockData() - debug_info_data.GetDataStart();
-  if (DWARFExpression::Evaluate(
-  nullptr, nullptr, module_sp,
-  DataExtractor(debug_info_data, block_offset, block_length),
-  die.GetCU(), eRegisterKindDWARF, , nullptr,
-  memberOffset, nullptr)) {
-member_byte_offset = memberOffset.ResolveValue(nullptr).UInt();
-  }
-} else {
-  // With DWARF 3 and later, if the value is an integer constant,
-  // this form value is the offset in bytes from the beginning of
-  // the containing entity.
-  member_byte_offset = form_value.Unsigned();
-}
+if (auto maybe_offset =
+ExtractDataMemberLocation(die, form_value, module_sp))
+  member_byte_offset = *maybe_offset;
 break;
 
   case DW_AT_accessibility:
@@ -2557,29 +2567,9 @@ VariantMember::VariantMember(DWARFDIE , 
lldb::ModuleSP module_sp) {
 break;
 
   case DW_AT_data_member_location:
-if (form_value.BlockData()) {
-  Value initialValue(0);
-  Value memberOffset(0);
-  const DWARFDataExtractor _info_data = die.GetData();
-  uint32_t block_length = form_value.Unsigned();
-  uint32_t block_offset =
-  form_value.BlockData() - debug_info_data.GetDataStart();
-  if (DWARFExpression::Evaluate(
-  nullptr, // ExecutionContext *
-  nullptr, // RegisterContext *
-  module_sp,
-  DataExtractor(debug_info_data, block_offset,
-block_length),
-  die.GetCU(), eRegisterKindDWARF, , nullptr,
-  memberOffset, nullptr)) {
-byte_offset = memberOffset.ResolveValue(nullptr).UInt();
-  }
-} else {
-  // With DWARF 3 and later, if the value is an integer constant,
-  // this form value is the offset in bytes from the beginning of
-  // the containing entity.
-  byte_offset = form_value.Unsigned();
-}
+if (auto maybe_offset =
+ 

[Lldb-commits] [lldb] [lldb][DWARFASTParserClang][NFCI] Extract DW_AT_data_member_location calculation logic (PR #68231)

2023-10-04 Thread Michael Buch via lldb-commits

https://github.com/Michael137 created 
https://github.com/llvm/llvm-project/pull/68231

Currently this non-trivial calculation is repeated multiple times, making it 
hard to reason about when the `byte_offset`/`member_byte_offset` is being set 
or not.

This patch simply moves all those instances of the same calculation into a 
helper function.

We return an optional to remain an NFC patch. Default initializing the offset 
would make sense but requires further analysis and can be done in a follow-up 
patch.

>From 6fd2c0e25ea49f4b9a2ca0ad645811910cd9b1f8 Mon Sep 17 00:00:00 2001
From: Michael Buch 
Date: Wed, 4 Oct 2023 16:57:22 +0100
Subject: [PATCH] [lldb][DWARFASTParserClang][NFCI] Extract
 DW_AT_data_member_location calculation logic

Currently this non-trivial calculation is repeated multiple times,
making it hard to reason about when the `byte_offset`/`member_byte_offset`
is being set or not.

This patch simply moves all those instances of the same calculation into
a helper function.

We return an optional to remain an NFC patch. Default initializing the
offset would make sense but requires further analysis and can be done
in a follow-up patch.
---
 .../SymbolFile/DWARF/DWARFASTParserClang.cpp  | 126 ++
 1 file changed, 39 insertions(+), 87 deletions(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 37fb16d4e0351c9..005711d6f488c7f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -519,6 +519,33 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const 
SymbolContext ,
   return UpdateSymbolContextScopeForType(sc, die, type_sp);
 }
 
+static std::optional
+ExtractDataMemberLocation(DWARFDIE const , DWARFFormValue const 
_value,
+  ModuleSP module_sp) {
+  // With DWARF 3 and later, if the value is an integer constant,
+  // this form value is the offset in bytes from the beginning of
+  // the containing entity.
+  if (!form_value.BlockData())
+return form_value.Unsigned();
+
+  Value initialValue(0);
+  Value memberOffset(0);
+  const DWARFDataExtractor _info_data = die.GetData();
+  uint32_t block_length = form_value.Unsigned();
+  uint32_t block_offset =
+  form_value.BlockData() - debug_info_data.GetDataStart();
+  if (!DWARFExpression::Evaluate(
+  nullptr, // ExecutionContext *
+  nullptr, // RegisterContext *
+  module_sp, DataExtractor(debug_info_data, block_offset, 
block_length),
+  die.GetCU(), eRegisterKindDWARF, , nullptr, 
memberOffset,
+  nullptr)) {
+return {};
+  }
+
+  return memberOffset.ResolveValue(nullptr).UInt();
+}
+
 lldb::TypeSP
 DWARFASTParserClang::ParseTypeModifier(const SymbolContext ,
const DWARFDIE ,
@@ -1406,26 +1433,9 @@ void DWARFASTParserClang::ParseInheritance(
 encoding_form = form_value;
 break;
   case DW_AT_data_member_location:
-if (form_value.BlockData()) {
-  Value initialValue(0);
-  Value memberOffset(0);
-  const DWARFDataExtractor _info_data = die.GetData();
-  uint32_t block_length = form_value.Unsigned();
-  uint32_t block_offset =
-  form_value.BlockData() - debug_info_data.GetDataStart();
-  if (DWARFExpression::Evaluate(
-  nullptr, nullptr, module_sp,
-  DataExtractor(debug_info_data, block_offset, block_length),
-  die.GetCU(), eRegisterKindDWARF, , nullptr,
-  memberOffset, nullptr)) {
-member_byte_offset = memberOffset.ResolveValue(nullptr).UInt();
-  }
-} else {
-  // With DWARF 3 and later, if the value is an integer constant,
-  // this form value is the offset in bytes from the beginning of
-  // the containing entity.
-  member_byte_offset = form_value.Unsigned();
-}
+if (auto maybe_offset =
+ExtractDataMemberLocation(die, form_value, module_sp))
+  member_byte_offset = *maybe_offset;
 break;
 
   case DW_AT_accessibility:
@@ -2557,29 +2567,9 @@ VariantMember::VariantMember(DWARFDIE , 
lldb::ModuleSP module_sp) {
 break;
 
   case DW_AT_data_member_location:
-if (form_value.BlockData()) {
-  Value initialValue(0);
-  Value memberOffset(0);
-  const DWARFDataExtractor _info_data = die.GetData();
-  uint32_t block_length = form_value.Unsigned();
-  uint32_t block_offset =
-  form_value.BlockData() - debug_info_data.GetDataStart();
-  if (DWARFExpression::Evaluate(
-  nullptr, // ExecutionContext *
-  nullptr, // RegisterContext *
-  module_sp,
-  

[Lldb-commits] [lldb] [lldb] Expose Platform::Attach through the SB API (PR #68050)

2023-10-04 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

Thank you @antmox and @DavidSpickett for following up on this. 

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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread via lldb-commits
Botond =?utf-8?q?Istv=C3=A1n_Hprv=C3=A1th?=,
Botond =?utf-8?q?Istv=C3=A1n_Hprv=C3=A1th?=
Message-ID:
In-Reply-To: 


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

> TIL there is no way to resign a review here like there was on Phab...

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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread via lldb-commits
Botond =?utf-8?q?István_Hprváth?=,
Botond =?utf-8?q?István_Hprváth?Message-ID:
In-Reply-To: 


https://github.com/whisperity commented:

LGTM with previous discussion. I will do the commit... On the UI... 
:slightly_smiling_face:

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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] 19141c4 - [lldb] Mark operator== const to avoid ambiguity in C++20. (#68224)

2023-10-04 Thread via lldb-commits

Author: Samira Bazuzi
Date: 2023-10-04T09:04:13-07:00
New Revision: 19141c4172ea5a4979fa0419dcf712d3f0cadefc

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

LOG: [lldb] Mark operator== const to avoid ambiguity in C++20. (#68224)

C++20 will automatically generate an operator== with reversed operand
order, which is ambiguous with the written operator== when one argument
is marked const and the other isn't.

These operators currently trigger -Wambiguous-reversed-operator at usage
sites lldb/source/Symbol/SymbolFileOnDemand.cpp:68 and
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:1286.

Added: 


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

lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
lldb/source/Utility/XcodeSDK.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/XcodeSDK.h 
b/lldb/include/lldb/Utility/XcodeSDK.h
index 878b131a1814536..f8528995d549c9c 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -69,7 +69,7 @@ class XcodeSDK {
 
   XcodeSDK =(const XcodeSDK );
   XcodeSDK(const XcodeSDK&) = default;
-  bool operator==(const XcodeSDK );
+  bool operator==(const XcodeSDK ) const;
 
   /// Return parsed SDK type and version number.
   Info Parse() const;

diff  --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 378b2472278605d..5aeaf3ae24d7c7b 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -606,8 +606,8 @@ void 
DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId(
   m_load_process_stop_id = stop_id;
 }
 
-bool DynamicLoaderDarwinKernel::KextImageInfo::
-operator==(const KextImageInfo ) {
+bool DynamicLoaderDarwinKernel::KextImageInfo::operator==(
+const KextImageInfo ) const {
   if (m_uuid.IsValid() || rhs.GetUUID().IsValid()) {
 return m_uuid == rhs.GetUUID();
   }

diff  --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index 38a60d154820a96..000c382b2c01117 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -176,7 +176,7 @@ class DynamicLoaderDarwinKernel : public 
lldb_private::DynamicLoader {
 
 void SetProcessStopId(uint32_t stop_id);
 
-bool operator==(const KextImageInfo );
+bool operator==(const KextImageInfo ) const;
 
 uint32_t GetAddressByteSize(); // as determined by Mach-O header
 

diff  --git a/lldb/source/Utility/XcodeSDK.cpp 
b/lldb/source/Utility/XcodeSDK.cpp
index 84f3ccbd01e2d07..154ddbebe8b30d5 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -56,7 +56,7 @@ XcodeSDK::XcodeSDK(XcodeSDK::Info info) : 
m_name(GetName(info.type).str()) {
 
 XcodeSDK ::operator=(const XcodeSDK ) = default;
 
-bool XcodeSDK::operator==(const XcodeSDK ) {
+bool XcodeSDK::operator==(const XcodeSDK ) const {
   return m_name == other.m_name;
 }
 



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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread via lldb-commits
Botond =?utf-8?q?István_Hprváth?=,
Botond =?utf-8?q?István_Hprváth?Message-ID:
In-Reply-To: 


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


[Lldb-commits] [lldb] [mlir][sparse] Print new syntax (PR #68130)

2023-10-04 Thread Yinying Li via lldb-commits

https://github.com/yinying-lisa-li updated 
https://github.com/llvm/llvm-project/pull/68130

>From 47b34bb327e1078678d3ba0c96ebce3fc89cf2ae Mon Sep 17 00:00:00 2001
From: Yinying Li 
Date: Tue, 3 Oct 2023 16:43:50 +
Subject: [PATCH 1/5] [mlir][sparse] Print new syntax

Printing changes from #sparse_tensor.encoding<{ lvlTypes = [ "compressed" ] }> 
to map = (d0) -> (d0 : compressed). Level properties, ELL and slice are also 
supported.
---
 .../mlir/Dialect/SparseTensor/IR/Enums.h  |  20 +--
 .../SparseTensor/IR/SparseTensorDialect.cpp   |  64 ---
 mlir/test/Dialect/SparseTensor/codegen.mlir   |   8 +-
 .../SparseTensor/roundtrip_encoding.mlir  |  32 ++--
 .../Dialect/SparseTensor/sparse_reshape.mlir  |   8 +-
 .../SparseTensor/sparse_tensor_reshape.mlir   |   2 +-
 .../python/dialects/sparse_tensor/dialect.py  | 160 +-
 7 files changed, 159 insertions(+), 135 deletions(-)

diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h 
b/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
index bc351ec52c0946b..2920ef79f461c6a 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
@@ -215,29 +215,29 @@ constexpr const char *toMLIRString(DimLevelType dlt) {
   case DimLevelType::Compressed:
 return "compressed";
   case DimLevelType::CompressedNu:
-return "compressed_nu";
+return "compressed(nonunique)";
   case DimLevelType::CompressedNo:
-return "compressed_no";
+return "compressed(nonordered)";
   case DimLevelType::CompressedNuNo:
-return "compressed_nu_no";
+return "compressed(nonunique, nonordered)";
   case DimLevelType::Singleton:
 return "singleton";
   case DimLevelType::SingletonNu:
-return "singleton_nu";
+return "singleton(nonunique)";
   case DimLevelType::SingletonNo:
-return "singleton_no";
+return "singleton(nonordered)";
   case DimLevelType::SingletonNuNo:
-return "singleton_nu_no";
+return "singleton(nonunique, nonordered)";
   case DimLevelType::LooseCompressed:
 return "loose_compressed";
   case DimLevelType::LooseCompressedNu:
-return "loose_compressed_nu";
+return "loose_compressed(nonunique)";
   case DimLevelType::LooseCompressedNo:
-return "loose_compressed_no";
+return "loose_compressed(nonordered)";
   case DimLevelType::LooseCompressedNuNo:
-return "loose_compressed_nu_no";
+return "loose_compressed(nonunique, nonordered)";
   case DimLevelType::TwoOutOfFour:
-return "compressed24";
+return "block2_4";
   }
   return "";
 }
diff --git a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp 
b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
index 3897e1b9ea3597c..4c8dccdda6c0c7c 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -586,30 +586,56 @@ Attribute SparseTensorEncodingAttr::parse(AsmParser 
, Type type) {
 }
 
 void SparseTensorEncodingAttr::print(AsmPrinter ) const {
-  // Print the struct-like storage in dictionary fashion.
-  printer << "<{ lvlTypes = [ ";
-  llvm::interleaveComma(getLvlTypes(), printer, [&](DimLevelType dlt) {
-printer << "\"" << toMLIRString(dlt) << "\"";
-  });
-  printer << " ]";
+  auto map = static_cast(getDimToLvl());
+  auto lvlTypes = getLvlTypes();
+  // Empty affine map indicates identity map
+  if (!map) {
+map = AffineMap::getMultiDimIdentityMap(getLvlTypes().size(), 
getContext());
+  }
+  // Modified version of AsmPrinter::Impl::printAffineMap.
+  printer << "<{ map = ";
+  // Symbolic identifiers.
+  if (map.getNumSymbols() != 0) {
+printer << '[';
+for (unsigned i = 0; i < map.getNumSymbols() - 1; ++i)
+  printer << 's' << i << ", ";
+if (map.getNumSymbols() >= 1)
+  printer << 's' << map.getNumSymbols() - 1;
+printer << ']';
+  }
+  // Dimension identifiers.
+  printer << '(';
+  auto dimSlices = getDimSlices();
+  if (!dimSlices.empty()) {
+for (unsigned i = 0; i < map.getNumDims() - 1; ++i)
+  printer << 'd' << i << " : " << dimSlices[i] << ", ";
+if (map.getNumDims() >= 1)
+  printer << 'd' << map.getNumDims() - 1 << " : "
+  << dimSlices[map.getNumDims() - 1];
+  } else {
+for (unsigned i = 0; i < map.getNumDims() - 1; ++i)
+  printer << 'd' << i << ", ";
+if (map.getNumDims() >= 1)
+  printer << 'd' << map.getNumDims() - 1;
+  }
+  printer << ')';
+  // Level format and properties.
+  printer << " -> (";
+  for (unsigned i = 0; i < map.getNumResults() - 1; ++i) {
+map.getResult(i).print(printer.getStream());
+printer << " : " << toMLIRString(lvlTypes[i]) << ", ";
+  }
+  if (map.getNumResults() >= 1) {
+auto lastIndex = map.getNumResults() - 1;
+map.getResult(lastIndex).print(printer.getStream());
+printer << " : " << toMLIRString(lvlTypes[lastIndex]);
+  }
+  printer << ')';
   // Print remaining members only for non-default values.
-  if 

[Lldb-commits] [lldb] [mlir][sparse] Print new syntax (PR #68130)

2023-10-04 Thread Yinying Li via lldb-commits

https://github.com/yinying-lisa-li updated 
https://github.com/llvm/llvm-project/pull/68130

>From 47b34bb327e1078678d3ba0c96ebce3fc89cf2ae Mon Sep 17 00:00:00 2001
From: Yinying Li 
Date: Tue, 3 Oct 2023 16:43:50 +
Subject: [PATCH 1/4] [mlir][sparse] Print new syntax

Printing changes from #sparse_tensor.encoding<{ lvlTypes = [ "compressed" ] }> 
to map = (d0) -> (d0 : compressed). Level properties, ELL and slice are also 
supported.
---
 .../mlir/Dialect/SparseTensor/IR/Enums.h  |  20 +--
 .../SparseTensor/IR/SparseTensorDialect.cpp   |  64 ---
 mlir/test/Dialect/SparseTensor/codegen.mlir   |   8 +-
 .../SparseTensor/roundtrip_encoding.mlir  |  32 ++--
 .../Dialect/SparseTensor/sparse_reshape.mlir  |   8 +-
 .../SparseTensor/sparse_tensor_reshape.mlir   |   2 +-
 .../python/dialects/sparse_tensor/dialect.py  | 160 +-
 7 files changed, 159 insertions(+), 135 deletions(-)

diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h 
b/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
index bc351ec52c0946b..2920ef79f461c6a 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
@@ -215,29 +215,29 @@ constexpr const char *toMLIRString(DimLevelType dlt) {
   case DimLevelType::Compressed:
 return "compressed";
   case DimLevelType::CompressedNu:
-return "compressed_nu";
+return "compressed(nonunique)";
   case DimLevelType::CompressedNo:
-return "compressed_no";
+return "compressed(nonordered)";
   case DimLevelType::CompressedNuNo:
-return "compressed_nu_no";
+return "compressed(nonunique, nonordered)";
   case DimLevelType::Singleton:
 return "singleton";
   case DimLevelType::SingletonNu:
-return "singleton_nu";
+return "singleton(nonunique)";
   case DimLevelType::SingletonNo:
-return "singleton_no";
+return "singleton(nonordered)";
   case DimLevelType::SingletonNuNo:
-return "singleton_nu_no";
+return "singleton(nonunique, nonordered)";
   case DimLevelType::LooseCompressed:
 return "loose_compressed";
   case DimLevelType::LooseCompressedNu:
-return "loose_compressed_nu";
+return "loose_compressed(nonunique)";
   case DimLevelType::LooseCompressedNo:
-return "loose_compressed_no";
+return "loose_compressed(nonordered)";
   case DimLevelType::LooseCompressedNuNo:
-return "loose_compressed_nu_no";
+return "loose_compressed(nonunique, nonordered)";
   case DimLevelType::TwoOutOfFour:
-return "compressed24";
+return "block2_4";
   }
   return "";
 }
diff --git a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp 
b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
index 3897e1b9ea3597c..4c8dccdda6c0c7c 100644
--- a/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
+++ b/mlir/lib/Dialect/SparseTensor/IR/SparseTensorDialect.cpp
@@ -586,30 +586,56 @@ Attribute SparseTensorEncodingAttr::parse(AsmParser 
, Type type) {
 }
 
 void SparseTensorEncodingAttr::print(AsmPrinter ) const {
-  // Print the struct-like storage in dictionary fashion.
-  printer << "<{ lvlTypes = [ ";
-  llvm::interleaveComma(getLvlTypes(), printer, [&](DimLevelType dlt) {
-printer << "\"" << toMLIRString(dlt) << "\"";
-  });
-  printer << " ]";
+  auto map = static_cast(getDimToLvl());
+  auto lvlTypes = getLvlTypes();
+  // Empty affine map indicates identity map
+  if (!map) {
+map = AffineMap::getMultiDimIdentityMap(getLvlTypes().size(), 
getContext());
+  }
+  // Modified version of AsmPrinter::Impl::printAffineMap.
+  printer << "<{ map = ";
+  // Symbolic identifiers.
+  if (map.getNumSymbols() != 0) {
+printer << '[';
+for (unsigned i = 0; i < map.getNumSymbols() - 1; ++i)
+  printer << 's' << i << ", ";
+if (map.getNumSymbols() >= 1)
+  printer << 's' << map.getNumSymbols() - 1;
+printer << ']';
+  }
+  // Dimension identifiers.
+  printer << '(';
+  auto dimSlices = getDimSlices();
+  if (!dimSlices.empty()) {
+for (unsigned i = 0; i < map.getNumDims() - 1; ++i)
+  printer << 'd' << i << " : " << dimSlices[i] << ", ";
+if (map.getNumDims() >= 1)
+  printer << 'd' << map.getNumDims() - 1 << " : "
+  << dimSlices[map.getNumDims() - 1];
+  } else {
+for (unsigned i = 0; i < map.getNumDims() - 1; ++i)
+  printer << 'd' << i << ", ";
+if (map.getNumDims() >= 1)
+  printer << 'd' << map.getNumDims() - 1;
+  }
+  printer << ')';
+  // Level format and properties.
+  printer << " -> (";
+  for (unsigned i = 0; i < map.getNumResults() - 1; ++i) {
+map.getResult(i).print(printer.getStream());
+printer << " : " << toMLIRString(lvlTypes[i]) << ", ";
+  }
+  if (map.getNumResults() >= 1) {
+auto lastIndex = map.getNumResults() - 1;
+map.getResult(lastIndex).print(printer.getStream());
+printer << " : " << toMLIRString(lvlTypes[lastIndex]);
+  }
+  printer << ')';
   // Print remaining members only for non-default values.
-  if 

[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread Botond István Hprváth via lldb-commits


@@ -85,3 +85,38 @@ int main() {
 
 
 }
+
+namespace deduceTemplatedConstructor{

HoBoIs wrote:

Done

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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread via lldb-commits
Botond =?utf-8?q?Istv=C3=A1n_Hprv=C3=A1th?=
Message-ID:
In-Reply-To: 


https://github.com/whisperity requested changes to this pull request.


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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread Samira Bazuzi via lldb-commits

bazuzi wrote:

Thanks, Jonas. Can you also merge for me? I don't have write access.

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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread Samira Bazuzi via lldb-commits

bazuzi wrote:

@JDevlieghere @labath Are either of you able to review?

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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb


Changes

C++20 will automatically generate an operator== with reversed operand order, 
which is ambiguous with the written operator== when one argument is marked 
const and the other isn't.

These operators currently trigger -Wambiguous-reversed-operator at usage sites 
lldb/source/Symbol/SymbolFileOnDemand.cpp:68 and 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:1286.

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


4 Files Affected:

- (modified) lldb/include/lldb/Utility/XcodeSDK.h (+1-1) 
- (modified) 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
(+2-2) 
- (modified) 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h 
(+1-1) 
- (modified) lldb/source/Utility/XcodeSDK.cpp (+1-1) 


``diff
diff --git a/lldb/include/lldb/Utility/XcodeSDK.h 
b/lldb/include/lldb/Utility/XcodeSDK.h
index 878b131a1814536..f8528995d549c9c 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -69,7 +69,7 @@ class XcodeSDK {
 
   XcodeSDK =(const XcodeSDK );
   XcodeSDK(const XcodeSDK&) = default;
-  bool operator==(const XcodeSDK );
+  bool operator==(const XcodeSDK ) const;
 
   /// Return parsed SDK type and version number.
   Info Parse() const;
diff --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 378b2472278605d..5aeaf3ae24d7c7b 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -606,8 +606,8 @@ void 
DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId(
   m_load_process_stop_id = stop_id;
 }
 
-bool DynamicLoaderDarwinKernel::KextImageInfo::
-operator==(const KextImageInfo ) {
+bool DynamicLoaderDarwinKernel::KextImageInfo::operator==(
+const KextImageInfo ) const {
   if (m_uuid.IsValid() || rhs.GetUUID().IsValid()) {
 return m_uuid == rhs.GetUUID();
   }
diff --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index 38a60d154820a96..000c382b2c01117 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -176,7 +176,7 @@ class DynamicLoaderDarwinKernel : public 
lldb_private::DynamicLoader {
 
 void SetProcessStopId(uint32_t stop_id);
 
-bool operator==(const KextImageInfo );
+bool operator==(const KextImageInfo ) const;
 
 uint32_t GetAddressByteSize(); // as determined by Mach-O header
 
diff --git a/lldb/source/Utility/XcodeSDK.cpp b/lldb/source/Utility/XcodeSDK.cpp
index 84f3ccbd01e2d07..154ddbebe8b30d5 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -56,7 +56,7 @@ XcodeSDK::XcodeSDK(XcodeSDK::Info info) : 
m_name(GetName(info.type).str()) {
 
 XcodeSDK ::operator=(const XcodeSDK ) = default;
 
-bool XcodeSDK::operator==(const XcodeSDK ) {
+bool XcodeSDK::operator==(const XcodeSDK ) const {
   return m_name == other.m_name;
 }
 

``




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


[Lldb-commits] [lldb] [lldb] Mark operator== const to avoid ambiguity in C++20. (PR #68224)

2023-10-04 Thread Samira Bazuzi via lldb-commits

https://github.com/bazuzi created 
https://github.com/llvm/llvm-project/pull/68224

C++20 will automatically generate an operator== with reversed operand order, 
which is ambiguous with the written operator== when one argument is marked 
const and the other isn't.

These operators currently trigger -Wambiguous-reversed-operator at usage sites 
lldb/source/Symbol/SymbolFileOnDemand.cpp:68 and 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:1286.

>From f87e05395e499069178660a2b614ae3ac7f887c2 Mon Sep 17 00:00:00 2001
From: Samira Bazuzi 
Date: Wed, 4 Oct 2023 10:06:14 -0400
Subject: [PATCH] [lldb] Mark operator== const to avoid ambiguity in C++20.

C++20 will automatically generate an operator== with reversed operand order, 
which is ambiguous with the written operator== when one argument is marked 
const and the other isn't.

These operators currently trigger -Wambiguous-reversed-operator at usage
sites lldb/source/Symbol/SymbolFileOnDemand.cpp:68 and 
lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp:1286.
---
 lldb/include/lldb/Utility/XcodeSDK.h  | 2 +-
 .../DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp | 4 ++--
 .../DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h   | 2 +-
 lldb/source/Utility/XcodeSDK.cpp  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lldb/include/lldb/Utility/XcodeSDK.h 
b/lldb/include/lldb/Utility/XcodeSDK.h
index 878b131a1814536..f8528995d549c9c 100644
--- a/lldb/include/lldb/Utility/XcodeSDK.h
+++ b/lldb/include/lldb/Utility/XcodeSDK.h
@@ -69,7 +69,7 @@ class XcodeSDK {
 
   XcodeSDK =(const XcodeSDK );
   XcodeSDK(const XcodeSDK&) = default;
-  bool operator==(const XcodeSDK );
+  bool operator==(const XcodeSDK ) const;
 
   /// Return parsed SDK type and version number.
   Info Parse() const;
diff --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 378b2472278605d..5aeaf3ae24d7c7b 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -606,8 +606,8 @@ void 
DynamicLoaderDarwinKernel::KextImageInfo::SetProcessStopId(
   m_load_process_stop_id = stop_id;
 }
 
-bool DynamicLoaderDarwinKernel::KextImageInfo::
-operator==(const KextImageInfo ) {
+bool DynamicLoaderDarwinKernel::KextImageInfo::operator==(
+const KextImageInfo ) const {
   if (m_uuid.IsValid() || rhs.GetUUID().IsValid()) {
 return m_uuid == rhs.GetUUID();
   }
diff --git 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index 38a60d154820a96..000c382b2c01117 100644
--- 
a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ 
b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -176,7 +176,7 @@ class DynamicLoaderDarwinKernel : public 
lldb_private::DynamicLoader {
 
 void SetProcessStopId(uint32_t stop_id);
 
-bool operator==(const KextImageInfo );
+bool operator==(const KextImageInfo ) const;
 
 uint32_t GetAddressByteSize(); // as determined by Mach-O header
 
diff --git a/lldb/source/Utility/XcodeSDK.cpp b/lldb/source/Utility/XcodeSDK.cpp
index 84f3ccbd01e2d07..154ddbebe8b30d5 100644
--- a/lldb/source/Utility/XcodeSDK.cpp
+++ b/lldb/source/Utility/XcodeSDK.cpp
@@ -56,7 +56,7 @@ XcodeSDK::XcodeSDK(XcodeSDK::Info info) : 
m_name(GetName(info.type).str()) {
 
 XcodeSDK ::operator=(const XcodeSDK ) = default;
 
-bool XcodeSDK::operator==(const XcodeSDK ) {
+bool XcodeSDK::operator==(const XcodeSDK ) const {
   return m_name == other.m_name;
 }
 

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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread Botond István Hprváth via lldb-commits

HoBoIs wrote:

@erichkeane @shafik I don't have write access. Could you merge if there is 
nothing to be done?

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


[Lldb-commits] [lldb] [lldb] Expose Platform::Attach through the SB API (PR #68050)

2023-10-04 Thread antoine moynault via lldb-commits

antmox wrote:

Yes, thanks @DavidSpickett

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


[Lldb-commits] [lldb] [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (PR #68210)

2023-10-04 Thread David Spickett via lldb-commits

DavidSpickett wrote:

No warning present in https://lab.llvm.org/buildbot/#/builders/17/builds/44083 
or https://lab.llvm.org/buildbot/#/builders/219/builds/6093. So this worked.

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


[Lldb-commits] [lldb] [lldb] Expose Platform::Attach through the SB API (PR #68050)

2023-10-04 Thread David Spickett via lldb-commits

DavidSpickett wrote:

I've skipped it entirely in 
https://github.com/llvm/llvm-project/commit/ceec9a7874af2eea8b00b5616fad388ccfa2b4f3.

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


[Lldb-commits] [lldb] ceec9a7 - [lldb][test] Skip platform attach test on Windows

2023-10-04 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2023-10-04T12:46:35Z
New Revision: ceec9a7874af2eea8b00b5616fad388ccfa2b4f3

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

LOG: [lldb][test] Skip platform attach test on Windows

This can pass but every so often times out:
https://lab.llvm.org/buildbot/#/builders/219/builds/6092

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
index 2aaf962b9e4f9a5..3aeb87874bdfa87 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
@@ -7,6 +7,7 @@
 
 class TestPlatformAttach(GDBRemoteTestBase):
 @skipIfRemote
+@skipIfWindows
 def test_attach(self):
 """Test attaching by name"""
 



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


[Lldb-commits] [lldb] e00f227 - [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (#68210)

2023-10-04 Thread via lldb-commits

Author: aokblast
Date: 2023-10-04T08:12:27-04:00
New Revision: e00f2272d640ad5e8eda8982cd616d3ae56036b7

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

LOG: [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (#68210)

Added: 


Modified: 

lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
 
b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index bbb83ff0a118400..a1bf8efb064b614 100644
--- 
a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -536,7 +536,7 @@ bool DynamicLoaderFreeBSDKernel::ParseKmods(Address 
linker_files_head_addr) {
 return false;
   LLDB_LOGF(
   log,
-  "Kmod-changed breakpoint hit, there are %lu kernel modules currently.\n",
+  "Kmod-changed breakpoint hit, there are %zu kernel modules currently.\n",
   linker_files_list.size());
 
   ModuleList  = m_process->GetTarget().GetImages();



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


[Lldb-commits] [lldb] [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (PR #68210)

2023-10-04 Thread Ed Maste via lldb-commits

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


[Lldb-commits] [lldb] [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (PR #68210)

2023-10-04 Thread David Spickett via lldb-commits

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

`%zu` is used a lot elsewhere for logs and prints, none of which I've seen warn 
across Linaro's bots. So this LGTM, thanks for the fix.

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


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-04 Thread via lldb-commits

aokblast wrote:

I send another PR in [68210](https://github.com/llvm/llvm-project/pull/68210). 
I don't know if it is the correct way to fix this problem.

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


[Lldb-commits] [lldb] [lldb][FreeBSD] fix i386 size_t error when using LLDB_LOGF (PR #68210)

2023-10-04 Thread via lldb-commits

https://github.com/aokblast created 
https://github.com/llvm/llvm-project/pull/68210

None

>From 9df1a71c17219216bc34e9e750a26c5a874abc17 Mon Sep 17 00:00:00 2001
From: SHENG-YI HONG 
Date: Wed, 4 Oct 2023 19:55:50 +0800
Subject: [PATCH] fix i386 size_t error when printing value

---
 .../DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
 
b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
index bbb83ff0a118400..a1bf8efb064b614 100644
--- 
a/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
+++ 
b/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp
@@ -536,7 +536,7 @@ bool DynamicLoaderFreeBSDKernel::ParseKmods(Address 
linker_files_head_addr) {
 return false;
   LLDB_LOGF(
   log,
-  "Kmod-changed breakpoint hit, there are %lu kernel modules currently.\n",
+  "Kmod-changed breakpoint hit, there are %zu kernel modules currently.\n",
   linker_files_list.size());
 
   ModuleList  = m_process->GetTarget().GetImages();

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


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-04 Thread Ed Maste via lldb-commits

emaste wrote:

I'm not sure why @aokblast's reply didn't appear here, but indeed `%zu` is the 
right format specifier.

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


[Lldb-commits] [lldb] d918b81 - [lldb] [debugserver] Add spaces between sentences in a CMake warning. NFC.

2023-10-04 Thread Martin Storsjö via lldb-commits

Author: Martin Storsjö
Date: 2023-10-04T14:34:12+03:00
New Revision: d918b813c852fb4632875c683f4b9552eddea30d

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

LOG: [lldb] [debugserver] Add spaces between sentences in a CMake warning. NFC.

Added: 


Modified: 
lldb/tools/debugserver/source/CMakeLists.txt

Removed: 




diff  --git a/lldb/tools/debugserver/source/CMakeLists.txt 
b/lldb/tools/debugserver/source/CMakeLists.txt
index 43accc363ef3cb9..f0b9756becab6e6 100644
--- a/lldb/tools/debugserver/source/CMakeLists.txt
+++ b/lldb/tools/debugserver/source/CMakeLists.txt
@@ -19,8 +19,8 @@ endfunction()
 
 function(get_debugserver_codesign_identity result)
   string(CONCAT not_found_help
-"This will cause failures in the test suite."
-"Pass '-DLLDB_USE_SYSTEM_DEBUGSERVER=ON' to use the system one instead."
+"This will cause failures in the test suite. "
+"Pass '-DLLDB_USE_SYSTEM_DEBUGSERVER=ON' to use the system one instead. "
 "See 'Code Signing on macOS' in the documentation."
   )
 



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


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-04 Thread via lldb-commits

aokblast wrote:

I think the answer is %z from cpp reference as the following screenshot shows.
I will check the whole code to prevent issues like this.

![CleanShot 2023-10-04 at 19 17 
55](https://github.com/llvm/llvm-project/assets/16476727/8ffdc723-18c5-410a-84d9-40bf0620dd6f)


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


[Lldb-commits] [lldb] [lldb][FreeBSD] Add dynamic loader handle class for FreeBSD Kernel (PR #67106)

2023-10-04 Thread David Spickett via lldb-commits

DavidSpickett wrote:

FYI on our Windows on Arm (aka AArch64) bot we got this warning:
```
[4840/6117] Building CXX object 
tools\lldb\source\Plugins\DynamicLoader\FreeBSD-Kernel\CMakeFiles\lldbPluginDynamicLoaderFreeBSDKernel.dir\DynamicLoaderFreeBSDKernel.cpp.obj
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\source\Plugins\DynamicLoader\FreeBSD-Kernel\DynamicLoaderFreeBSDKernel.cpp(540,7):
 warning: format specifies type 'unsigned long' but the argument has type 
'std::vector::size_type' (aka 
'unsigned long long') [-Wformat]
  linker_files_list.size());
  ^~~~
C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\include\lldb/Utility/Log.h(353,48):
 note: expanded from macro 'LLDB_LOGF'
  log_private->Formatf(__FILE__, __func__, __VA_ARGS__);   \
   ^~~
1 warning generated.
```
And this one on the 32 bit Arm Linux bot:
```
../llvm-project/lldb/source/Plugins/DynamicLoader/FreeBSD-Kernel/DynamicLoaderFreeBSDKernel.cpp:540:7:
 warning: format specifies type 'unsigned long' but the argument has type 
'size_type' (aka 'unsigned int') [-Wformat]
1 warning generated.
```
AArch64 Linux was fine. So I assume each one is using one of `unsigned int`, 
`unsigned long` or `unsigned long long` for its size types.

There is probably a way to print that in a portable way but I don't recall it 
at the moment.

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


[Lldb-commits] [lldb] 75f295c - [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (#68193)

2023-10-04 Thread via lldb-commits

Author: antoine moynault
Date: 2023-10-04T12:13:31+02:00
New Revision: 75f295c2455131993f9c945320736b84c5fcf99c

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

LOG: [lldb][test] Remove expected failure marker for TestPlatformAttach on 
windows (#68193)

Looks like this test passes since #68050.

Added: 


Modified: 
lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py

Removed: 




diff  --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
index d62e86b2a3c1d20..2aaf962b9e4f9a5 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
@@ -7,7 +7,6 @@
 
 class TestPlatformAttach(GDBRemoteTestBase):
 @skipIfRemote
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr52451")
 def test_attach(self):
 """Test attaching by name"""
 



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


[Lldb-commits] [lldb] [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (PR #68193)

2023-10-04 Thread antoine moynault via lldb-commits

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


[Lldb-commits] [lldb] [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (PR #68193)

2023-10-04 Thread antoine moynault via lldb-commits

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


[Lldb-commits] [lldb] [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (PR #68193)

2023-10-04 Thread David Spickett via lldb-commits

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

Might as well go ahead and try this. If it's still unstable by end of your work 
day, add a skipifwindows and let Jonas look into it.

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


[Lldb-commits] [lldb] [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (PR #68193)

2023-10-04 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb


Changes


Looks like this test pass since #68050.

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


1 Files Affected:

- (modified) 
lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py (-1) 


``diff
diff --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
index d62e86b2a3c1d20..2aaf962b9e4f9a5 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
@@ -7,7 +7,6 @@
 
 class TestPlatformAttach(GDBRemoteTestBase):
 @skipIfRemote
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr52451")
 def test_attach(self):
 """Test attaching by name"""
 

``




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


[Lldb-commits] [lldb] [lldb][test] Remove expected failure marker for TestPlatformAttach on windows (PR #68193)

2023-10-04 Thread antoine moynault via lldb-commits

https://github.com/antmox created 
https://github.com/llvm/llvm-project/pull/68193


Looks like this test pass since #68050.

>From 24ae4ebf70c2b6884b31ca99a72eb0ba16bddf33 Mon Sep 17 00:00:00 2001
From: Antoine Moynault 
Date: Wed, 4 Oct 2023 09:27:46 +
Subject: [PATCH] [lldb][test] Remove expected failure marker for
 TestPlatformAttach on windows

Looks like this test pass since #68050.
---
 .../API/functionalities/gdb_remote_client/TestPlatformAttach.py  | 1 -
 1 file changed, 1 deletion(-)

diff --git 
a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py 
b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
index d62e86b2a3c1d20..2aaf962b9e4f9a5 100644
--- a/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
+++ b/lldb/test/API/functionalities/gdb_remote_client/TestPlatformAttach.py
@@ -7,7 +7,6 @@
 
 class TestPlatformAttach(GDBRemoteTestBase):
 @skipIfRemote
-@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr52451")
 def test_attach(self):
 """Test attaching by name"""
 

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


[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread Botond István Hprváth via lldb-commits

https://github.com/HoBoIs updated 
https://github.com/llvm/llvm-project/pull/66487

From 258462cc65403af147bb47cbeb95210df8e18cd3 Mon Sep 17 00:00:00 2001
From: hobois 
Date: Fri, 15 Sep 2023 09:28:21 +0200
Subject: [PATCH 1/5] Choose the correct deduction guide

If there are two guides, one of them generated from a non-templated constructor
and the other from a templated constructor, then the standard gives priority to
the first. Clang detected ambiguity before, now the correct guide is chosen.

As an unrelated minor change, fix the issue #64020, which could've led to
incorrect behavior if further development inserted code after a call to
isAddressSpaceSubsetOf() which specified the two parameters in the wrong order.
---
 clang/lib/Sema/SemaOverload.cpp | 17 -
 clang/lib/Sema/SemaTemplateInstantiateDecl.cpp  |  2 +-
 .../over.match.class.deduct/p2.cpp  | 10 ++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 45a9e5dc98c032d..1bb81238520173a 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -10153,6 +10153,21 @@ bool clang::isBetterOverloadCandidate(
   //  -- F1 is the copy deduction candidate(16.3.1.8) and F2 is not
   if (Guide1->getDeductionCandidateKind() == DeductionCandidate::Copy)
 return true;
+  if (Guide2->getDeductionCandidateKind() == DeductionCandidate::Copy)
+return false;
+
+  //  --F1 is generated from a non-template constructor and F2 is generated
+  //  from a constructor template
+  const auto *Constructor1 = Guide1->getCorrespondingConstructor();
+  const auto *Constructor2 = Guide2->getCorrespondingConstructor();
+  if (Constructor1 && Constructor2) {
+bool isC1Templated = Constructor1->getTemplatedKind() !=
+ FunctionDecl::TemplatedKind::TK_NonTemplate;
+bool isC2Templated = Constructor2->getTemplatedKind() !=
+ FunctionDecl::TemplatedKind::TK_NonTemplate;
+if (isC1Templated != isC2Templated)
+  return isC2Templated;
+  }
 }
   }
 
@@ -10196,7 +10211,7 @@ bool clang::isBetterOverloadCandidate(
 if (AS1 != AS2) {
   if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
 return true;
-  if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
+  if (Qualifiers::isAddressSpaceSupersetOf(AS1, AS2))
 return false;
 }
   }
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp 
b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 9e5f85b0f9166bd..b9c4a9db842b9ee 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2129,7 +2129,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(
 Function = CXXDeductionGuideDecl::Create(
 SemaRef.Context, DC, D->getInnerLocStart(),
 InstantiatedExplicitSpecifier, NameInfo, T, TInfo,
-D->getSourceRange().getEnd(), /*Ctor=*/nullptr,
+D->getSourceRange().getEnd(), DGuide->getCorrespondingConstructor(),
 DGuide->getDeductionCandidateKind());
 Function->setAccess(D->getAccess());
   } else {
diff --git 
a/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
 
b/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
index 4eac0a1ac510f1d..d939d724dc7a0fd 100644
--- 
a/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
+++ 
b/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
@@ -85,3 +85,13 @@ int main() {
 
 
 }
+
+namespace deduceTemplatedConstructor{
+template  struct A {
+  A(T, T, int);
+  template
+A(int, T, U);
+};
+
+A x(1, 2, 3);   // no-error
+}

From 877678b01d05eb301ac49a2a39186a743ca9012d Mon Sep 17 00:00:00 2001
From: hobois 
Date: Tue, 3 Oct 2023 18:20:11 +0200
Subject: [PATCH 2/5] Added the fix to relasenotes

---
 clang/docs/ReleaseNotes.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 6be824771c583be..84eb3301deb4b37 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -390,6 +390,11 @@ Bug Fixes to C++ Support
   we now produce a diagnostic. Fixes:
   (`#65522 `_)
 
+- Fixed a bug where clang incorrectly considered implicitly generated deduction
+  guides from a non-templated constructor and a templated constructor as 
ambiguous,
+  rather than prefer the non-templated constructor as specified in 
+  [standard.group]p3
+
 Bug Fixes to AST Handling
 ^
 - Fixed an import failure of recursive friend class template.

From fc425a9be52b9278cd66e123019da2aaa3a0ee9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Botond=20Istv=C3=A1n=20Hprv=C3=A1th?=
 <56926027+hob...@users.noreply.github.com>
Date: Tue, 3 Oct 

[Lldb-commits] [lldb] [lldb] Expose Platform::Attach through the SB API (PR #68050)

2023-10-04 Thread David Spickett via lldb-commits

DavidSpickett wrote:

@antmox You could remove the expected failure marker and see what the result is 
then. It will be less confusing.

It may be that it does pass, but occasionally times out for another reason. 
Though that is weird given that all the server parts involved are mocks.

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


[Lldb-commits] [lldb] [lldb] Expose Platform::Attach through the SB API (PR #68050)

2023-10-04 Thread antoine moynault via lldb-commits

antmox wrote:

Hi! Could this commit cause the lldb-aarch64-windows bot failure ?
https://lab.llvm.org/buildbot/#/builders/219/builds/6086
https://lab.llvm.org/buildbot/#/builders/219/builds/6076
Not sure if it's an unexpected pass or a timeout.
Could you please take a look ?

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


[Lldb-commits] [lldb] [lldb][AArch64] Add isAArch64SMEFA64 check to SME testing (PR #68094)

2023-10-04 Thread David Spickett via lldb-commits

https://github.com/DavidSpickett updated 
https://github.com/llvm/llvm-project/pull/68094

>From 3816b0fbc31825d3878b031a49fb78dd7c256278 Mon Sep 17 00:00:00 2001
From: David Spickett 
Date: Tue, 3 Oct 2023 11:44:17 +0100
Subject: [PATCH 1/3] [lldb][AArch64] Add isAArch64SMEFA64 check to SME testing

FEAT_SME_FA64 (smefa64 in Linux cpuinfo) allows the use of the full
A64 instruction set while in streaming SVE mode.

See https://developer.arm.com/documentation/ddi0616/latest/ for
details.

This means for example if we want to write to the ffr register during
or use floating point registers while in streaming mode, we need this extension.

I initially was using QEMU which has it by default, and switched to
Arm's FVP which does not. So this change adds a more strict check and
converts most of the tests to use that.

It would be possible in some cases to avoid the offending instructions
but it would be a lot of effort and liable to fail randomly as the C
library changes.

It is also my assumption that the majority of systems will have
smefa64 as QEMU has chosen to have. If I turn out to be wrong, we
can make the effort to get the tests working without smefa64.
---
 lldb/packages/Python/lldbsuite/test/lldbtest.py|  6 ++
 .../aarch64_dynamic_regset/TestArm64DynamicRegsets.py  |  4 ++--
 .../rw_access_dynamic_resize/TestSVEThreadedDynamic.py | 10 ++
 .../rw_access_static_config/TestSVERegisters.py|  5 +++--
 .../aarch64_sve_simd_registers/TestSVESIMDRegisters.py |  5 +++--
 .../za_dynamic_resize/TestZAThreadedDynamic.py |  6 --
 .../aarch64_za_register/za_dynamic_resize/main.c   |  1 +
 .../za_save_restore/TestZARegisterSaveRestore.py   |  4 ++--
 8 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/lldbtest.py 
b/lldb/packages/Python/lldbsuite/test/lldbtest.py
index c8670b208ec3f0c..2f4130d3ce68ae0 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbtest.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbtest.py
@@ -1271,6 +1271,12 @@ def isAArch64SVE(self):
 def isAArch64SME(self):
 return self.isAArch64() and "sme" in self.getCPUInfo()
 
+def isAArch64SMEFA64(self):
+# smefa64 allows the use of the full A64 instruction set in streaming
+# mode. This is required by certain test programs to setup register
+# state.
+return self.isAArch64SME() and "smefa64" in self.getCPUInfo()
+
 def isAArch64MTE(self):
 return self.isAArch64() and "mte" in self.getCPUInfo()
 
diff --git 
a/lldb/test/API/commands/register/register/aarch64_dynamic_regset/TestArm64DynamicRegsets.py
 
b/lldb/test/API/commands/register/register/aarch64_dynamic_regset/TestArm64DynamicRegsets.py
index 2fb8b33126417c2..0ad69c268a9fd29 100644
--- 
a/lldb/test/API/commands/register/register/aarch64_dynamic_regset/TestArm64DynamicRegsets.py
+++ 
b/lldb/test/API/commands/register/register/aarch64_dynamic_regset/TestArm64DynamicRegsets.py
@@ -142,8 +142,8 @@ def make_za_value(self, vl, generator):
 def test_aarch64_dynamic_regset_config_sme(self):
 """Test AArch64 Dynamic Register sets configuration, but only SME
 registers."""
-if not self.isAArch64SME():
-self.skipTest("SME must be present.")
+if not self.isAArch64SMEFA64():
+self.skipTest("SME and the smefa64 extension must be present")
 
 register_sets = self.setup_register_config_test("sme")
 
diff --git 
a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
 
b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
index 8bcb76776459d01..b19039f0b5212b4 100644
--- 
a/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
+++ 
b/lldb/test/API/commands/register/register/aarch64_sve_registers/rw_access_dynamic_resize/TestSVEThreadedDynamic.py
@@ -108,8 +108,9 @@ def run_sve_test(self, mode):
 if (mode == Mode.SVE) and not self.isAArch64SVE():
 self.skipTest("SVE registers must be supported.")
 
-if (mode == Mode.SSVE) and not self.isAArch64SME():
-self.skipTest("Streaming SVE registers must be supported.")
+if (mode == Mode.SSVE) and not self.isAArch64SMEFA64():
+self.skipTest("Streaming SVE registers must be supported and the "
+  "smefa64 extension must be present.")
 
 self.build_for_mode(mode)
 
@@ -201,8 +202,9 @@ def test_ssve_registers_dynamic_config(self):
 
 def setup_svg_test(self, mode):
 # Even when running in SVE mode, we need access to SVG for these tests.
-if not self.isAArch64SME():
-self.skipTest("Streaming SVE registers must be present.")
+if not self.isAArch64SMEFA64():
+self.skipTest("Streaming SVE registers must be present and the "
+

[Lldb-commits] [lldb] Bugfix for chosing the correct deduction guide (PR #66487)

2023-10-04 Thread Botond István Hprváth via lldb-commits

https://github.com/HoBoIs updated 
https://github.com/llvm/llvm-project/pull/66487

From 258462cc65403af147bb47cbeb95210df8e18cd3 Mon Sep 17 00:00:00 2001
From: hobois 
Date: Fri, 15 Sep 2023 09:28:21 +0200
Subject: [PATCH 1/4] Choose the correct deduction guide

If there are two guides, one of them generated from a non-templated constructor
and the other from a templated constructor, then the standard gives priority to
the first. Clang detected ambiguity before, now the correct guide is chosen.

As an unrelated minor change, fix the issue #64020, which could've led to
incorrect behavior if further development inserted code after a call to
isAddressSpaceSubsetOf() which specified the two parameters in the wrong order.
---
 clang/lib/Sema/SemaOverload.cpp | 17 -
 clang/lib/Sema/SemaTemplateInstantiateDecl.cpp  |  2 +-
 .../over.match.class.deduct/p2.cpp  | 10 ++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 45a9e5dc98c032d..1bb81238520173a 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -10153,6 +10153,21 @@ bool clang::isBetterOverloadCandidate(
   //  -- F1 is the copy deduction candidate(16.3.1.8) and F2 is not
   if (Guide1->getDeductionCandidateKind() == DeductionCandidate::Copy)
 return true;
+  if (Guide2->getDeductionCandidateKind() == DeductionCandidate::Copy)
+return false;
+
+  //  --F1 is generated from a non-template constructor and F2 is generated
+  //  from a constructor template
+  const auto *Constructor1 = Guide1->getCorrespondingConstructor();
+  const auto *Constructor2 = Guide2->getCorrespondingConstructor();
+  if (Constructor1 && Constructor2) {
+bool isC1Templated = Constructor1->getTemplatedKind() !=
+ FunctionDecl::TemplatedKind::TK_NonTemplate;
+bool isC2Templated = Constructor2->getTemplatedKind() !=
+ FunctionDecl::TemplatedKind::TK_NonTemplate;
+if (isC1Templated != isC2Templated)
+  return isC2Templated;
+  }
 }
   }
 
@@ -10196,7 +10211,7 @@ bool clang::isBetterOverloadCandidate(
 if (AS1 != AS2) {
   if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
 return true;
-  if (Qualifiers::isAddressSpaceSupersetOf(AS2, AS1))
+  if (Qualifiers::isAddressSpaceSupersetOf(AS1, AS2))
 return false;
 }
   }
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp 
b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 9e5f85b0f9166bd..b9c4a9db842b9ee 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -2129,7 +2129,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(
 Function = CXXDeductionGuideDecl::Create(
 SemaRef.Context, DC, D->getInnerLocStart(),
 InstantiatedExplicitSpecifier, NameInfo, T, TInfo,
-D->getSourceRange().getEnd(), /*Ctor=*/nullptr,
+D->getSourceRange().getEnd(), DGuide->getCorrespondingConstructor(),
 DGuide->getDeductionCandidateKind());
 Function->setAccess(D->getAccess());
   } else {
diff --git 
a/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
 
b/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
index 4eac0a1ac510f1d..d939d724dc7a0fd 100644
--- 
a/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
+++ 
b/clang/test/CXX/over/over.match/over.match.funcs/over.match.class.deduct/p2.cpp
@@ -85,3 +85,13 @@ int main() {
 
 
 }
+
+namespace deduceTemplatedConstructor{
+template  struct A {
+  A(T, T, int);
+  template
+A(int, T, U);
+};
+
+A x(1, 2, 3);   // no-error
+}

From 877678b01d05eb301ac49a2a39186a743ca9012d Mon Sep 17 00:00:00 2001
From: hobois 
Date: Tue, 3 Oct 2023 18:20:11 +0200
Subject: [PATCH 2/4] Added the fix to relasenotes

---
 clang/docs/ReleaseNotes.rst | 5 +
 1 file changed, 5 insertions(+)

diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 6be824771c583be..84eb3301deb4b37 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -390,6 +390,11 @@ Bug Fixes to C++ Support
   we now produce a diagnostic. Fixes:
   (`#65522 `_)
 
+- Fixed a bug where clang incorrectly considered implicitly generated deduction
+  guides from a non-templated constructor and a templated constructor as 
ambiguous,
+  rather than prefer the non-templated constructor as specified in 
+  [standard.group]p3
+
 Bug Fixes to AST Handling
 ^
 - Fixed an import failure of recursive friend class template.

From fc425a9be52b9278cd66e123019da2aaa3a0ee9f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Botond=20Istv=C3=A1n=20Hprv=C3=A1th?=
 <56926027+hob...@users.noreply.github.com>
Date: Tue, 3 Oct