[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Added a check for the specialization existence (PR #154123)

2025-09-11 Thread Michael Buch via lldb-commits

Michael137 wrote:

Can you rebase your PR on `main` and resolve the conflict in 
`TypeSystemClang.cpp`?

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


[Lldb-commits] [lldb] [lldb-dap] Add invalidated event (PR #157530)

2025-09-11 Thread Walter Erquinigo via lldb-commits

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


[Lldb-commits] [lldb] [lldb][test] Re-enable import-std-module tests on Linux (PR #157649)

2025-09-11 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Michael Buch (Michael137)


Changes

This reverts commit 76bd5da3248fd4affedfefec3b2a3e1acbe0a94a.

These were originally skipped for 
https://github.com/llvm/llvm-project/issues/137046 because they were failing on 
Fuchsia buildbots.

I couldn't locally reproduce the Linux failures from back then (and maybe they 
have been fixed by something else since then).

We want to re-enable these tests because they are one of the few API tests in 
the `libcxx` category that we skip on Linux. So the libc++ pre-merge CI doesn't 
catch these test failures. To avoid churn caused by this missing coverage, it 
would be great if we ran these on Linux again.

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


15 Files Affected:

- (modified) 
lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/forward_list-dbg-info-content/TestDbgInfoContentForwardListFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/forward_list/TestForwardListFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/iterator/TestIteratorFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/list-dbg-info-content/TestDbgInfoContentListFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/list/TestListFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/non-module-type-separation/TestNonModuleTypeSeparation.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/shared_ptr-dbg-info-content/TestSharedPtrDbgInfoContentFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/shared_ptr/TestSharedPtrFromStdModule.py
 (+1-2) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/vector-of-vectors/TestVectorOfVectorsFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/weak_ptr-dbg-info-content/TestDbgInfoContentWeakPtrFromStdModule.py
 (-1) 
- (modified) 
lldb/test/API/commands/expression/import-std-module/weak_ptr/TestWeakPtrFromStdModule.py
 (-1) 


``diff
diff --git 
a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
 
b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
index a488276c2e54d..ed028a1a4ea3f 100644
--- 
a/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
+++ 
b/lldb/test/API/commands/expression/import-std-module/array/TestArrayFromStdModule.py
@@ -11,7 +11,6 @@ class TestCase(TestBase):
 @add_test_categories(["libc++"])
 @skipIf(compiler=no_match("clang"))
 @skipIf(macos_version=["<", "15.0"])
-@skipUnlessDarwin
 def test(self):
 self.build()
 
diff --git 
a/lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
 
b/lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
index 38b8508b516df..0fb6e883597d3 100644
--- 
a/lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
+++ 
b/lldb/test/API/commands/expression/import-std-module/deque-basic/TestDequeFromStdModule.py
@@ -11,7 +11,6 @@ class TestBasicDeque(TestBase):
 @add_test_categories(["libc++"])
 @skipIf(compiler=no_match("clang"))
 @skipIf(macos_version=["<", "15.0"])
-@skipUnlessDarwin
 def test(self):
 self.build()
 
diff --git 
a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
 
b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
index 85eaa8fe39ea8..e631a87376372 100644
--- 
a/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
+++ 
b/lldb/test/API/commands/expression/import-std-module/deque-dbg-info-content/TestDbgInfoContentDequeFromStdModule.py
@@ -12,7 +12,6 @@ class TestDbgInfoContentDeque(TestBase):
 @skipIf(compiler=no_match("clang"))
 @skipIf(compiler="clang", compiler_version=["<", "18.0"])
 @skipIf(macos_version=["<", "15.0"])
-@skipUnlessDarwin
 def test(self):
 self.build()
 
diff --git 
a/lldb/test/API/commands/expression/import-std-module/forward_list-dbg-info-content/TestDbgInfoContentForwardListFromStdModule.py
 
b/lldb/test/API/commands/expression/import-

[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-11 Thread Michael Buch via lldb-commits


@@ -218,6 +222,10 @@ def compiler_rt_asan_tests(self):
 
 self.check_traces()
 
+# Make sure we're not stopped in the sanitizer library but instead at 
the

Michael137 wrote:

Should be fixed now. Let me know if you're still seeing issues

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Added a check for the specialization existence (PR #154123)

2025-09-11 Thread via lldb-commits


@@ -599,6 +599,39 @@ TEST_F(DWARFASTParserClangTests, 
TestDefaultTemplateParamParsing) {
   }
 }
 
+TEST_F(DWARFASTParserClangTests, TestSpecDeclExistsError) {
+  // Tests checking error if ClassTemplateSpecializationDecl already exists.

tgs-sc wrote:

Addressed

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


[Lldb-commits] [clang] [lldb] [lldb][Expression] Add structor variant to LLDB's function call labels (PR #149827)

2025-09-11 Thread Michael Buch via lldb-commits

Michael137 wrote:

> Might be fixed next build, I saw the Linux ones fail then go green right 
> after.

Yea I hoped so too, but looks like that test run had both my changes. I think 
this is just not supported on Windows for now (i doubt this worked before the 
tests were added either). I XFAILed them for now in `6dfc255ee103`

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


[Lldb-commits] [lldb] 54b3dc1 - [lldb][NFC] Fix style issues with StackID.h (#157483)

2025-09-11 Thread via lldb-commits

Author: Felipe de Azevedo Piovezan
Date: 2025-09-08T08:47:42-07:00
New Revision: 54b3dc1dad9a28709e880b54a416cdcdb624cad4

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

LOG: [lldb][NFC] Fix style issues with StackID.h (#157483)

Some comments were "suffixed" to member variable declarations; these are
moved to before the variable.

Some constructors and operators were just defaulted and not necessary.

Some comments dividing the class into logical sections, like "//
constructors and destructors", were not applied everywhere. These were
removed. They are used in some parts of LLDB, but are the exception.

An include was not needed.

The operator != can be defined in terms of ==.

Added: 


Modified: 
lldb/include/lldb/Target/StackID.h
lldb/source/Target/StackID.cpp

Removed: 




diff  --git a/lldb/include/lldb/Target/StackID.h 
b/lldb/include/lldb/Target/StackID.h
index fddbc8e48dfdc..c2a5d733dcd69 100644
--- a/lldb/include/lldb/Target/StackID.h
+++ b/lldb/include/lldb/Target/StackID.h
@@ -10,7 +10,6 @@
 #define LLDB_TARGET_STACKID_H
 
 #include "lldb/Core/AddressRange.h"
-#include "lldb/lldb-private.h"
 
 namespace lldb_private {
 
@@ -18,15 +17,11 @@ class Process;
 
 class StackID {
 public:
-  // Constructors and Destructors
   StackID() = default;
 
   explicit StackID(lldb::addr_t pc, lldb::addr_t cfa,
SymbolContextScope *symbol_scope, Process *process);
 
-  StackID(const StackID &rhs)
-  : m_pc(rhs.m_pc), m_cfa(rhs.m_cfa), m_symbol_scope(rhs.m_symbol_scope) {}
-
   ~StackID() = default;
 
   lldb::addr_t GetPC() const { return m_pc; }
@@ -51,41 +46,28 @@ class StackID {
 
   void Dump(Stream *s);
 
-  // Operators
-  const StackID &operator=(const StackID &rhs) {
-if (this != &rhs) {
-  m_pc = rhs.m_pc;
-  m_cfa = rhs.m_cfa;
-  m_symbol_scope = rhs.m_symbol_scope;
-}
-return *this;
-  }
-
 protected:
   friend class StackFrame;
 
   void SetPC(lldb::addr_t pc, Process *process);
   void SetCFA(lldb::addr_t cfa, Process *process);
 
-  lldb::addr_t m_pc =
-  LLDB_INVALID_ADDRESS; // The pc value for the function/symbol for this
-// frame. This will
-  // only get used if the symbol scope is nullptr (the code where we are
-  // stopped is not represented by any function or symbol in any shared
-  // library).
-  lldb::addr_t m_cfa =
-  LLDB_INVALID_ADDRESS; // The call frame address (stack pointer) value
-// at the beginning of the function that uniquely
-// identifies this frame (along with m_symbol_scope
-// below)
-  SymbolContextScope *m_symbol_scope =
-  nullptr; // If nullptr, there is no block or symbol for this frame.
-   // If not nullptr, this will either be the scope for the
-   // lexical block for the frame, or the scope for the
-   // symbol. Symbol context scopes are always be unique
-   // pointers since the are part of the Block and Symbol
-   // objects and can easily be used to tell if a stack ID
-   // is the same as another.
+  /// The pc value for the function/symbol for this frame. This will only get
+  /// used if the symbol scope is nullptr (the code where we are stopped is not
+  /// represented by any function or symbol in any shared library).
+  lldb::addr_t m_pc = LLDB_INVALID_ADDRESS;
+
+  /// The call frame address (stack pointer) value at the beginning of the
+  /// function that uniquely identifies this frame (along with m_symbol_scope
+  /// below)
+  lldb::addr_t m_cfa = LLDB_INVALID_ADDRESS;
+
+  /// If nullptr, there is no block or symbol for this frame. If not nullptr,
+  /// this will either be the scope for the lexical block for the frame, or the
+  /// scope for the symbol. Symbol context scopes are always be unique pointers
+  /// since the are part of the Block and Symbol objects and can easily be used
+  /// to tell if a stack ID is the same as another.
+  SymbolContextScope *m_symbol_scope = nullptr;
 };
 
 bool operator==(const StackID &lhs, const StackID &rhs);

diff  --git a/lldb/source/Target/StackID.cpp b/lldb/source/Target/StackID.cpp
index b1795970802ae..f879276527dda 100644
--- a/lldb/source/Target/StackID.cpp
+++ b/lldb/source/Target/StackID.cpp
@@ -63,16 +63,7 @@ bool lldb_private::operator==(const StackID &lhs, const 
StackID &rhs) {
 }
 
 bool lldb_private::operator!=(const StackID &lhs, const StackID &rhs) {
-  if (lhs.GetCallFrameAddress() != rhs.GetCallFrameAddress())
-return true;
-
-  SymbolContextScope *lhs_scope = lhs.GetSymbolContextScope();
-  SymbolContextScope *rhs_scope = rhs.GetSymbolContextScope();
-
-  if (lhs_scope == nullptr && rhs_scope == nullptr)

[Lldb-commits] [lldb] [lldb][Expression] Reject languages not supported by TypeSystems for expression evaluation (PR #156648)

2025-09-11 Thread via lldb-commits

jimingham wrote:

> > I don't remember how that works in swift, but note, there are two separate 
> > issues with the C family expression parser. One was making local 
> > declarations override ivar references in name resolution in the context of 
> > the expression. That is why we inject variables into the expression by hand 
> > (and is controlled by the target.experimental.inject-local-vars setting). 
> > That's not even necessary, IIRC it's to work around the side effect of the 
> > too much optimizing of the DWARF.
> 
> I don't believe that has anything to do with DWARF -- the debug info 
> describes that situation perfectly. The problem is that when you have code 
> like
> 
> ```
> struct Foo {
>   int bar;
>   void foo() { int bar; ...; }
> };
> ```
> 
> if you stop in `foo` and go `expr bar`, per c++ rules, you'd expect to see 
> the local variable, but clang will not even ask us what `bar` is because it 
> will assume you're referring to the member variable. Injecting the local 
> variable into the expression forces clang to ask us what 
> `__lldb_local_vars::bar` is.
> 
> That said, C doesn't have methods, so maybe this isn't an issue there.
> 
> > But the more important C++ requirement is that we use it to make the 
> > expression
> > local_or_global_variable = 100
> > work correctly without having to pass variable references into the 
> > expression from a separate context as a pointer, which would require that 
> > behind the user's back we would be munging this expression to:
> > *local_or_global_variable_pointer = 100
> > We wanted to avoid having to do that everywhere, and the solution to that 
> > was to use C++ references when a variable was mentioned in an expression. 
> > That's the harder bit you are going to have to solve to get rid of C++ in 
> > the basic C-family expression evaluator.
> 
> Yes, this sounds like a more complicated issue. Perhaps we could fake it by 
> pretending `bar` is a global variable and then rewriting the access in the 
> resulting IR (I think we do something similar for function calls already)?

Clang already has all the code to do this, it just only allows it for C++.  So 
the other option would be to allow C with references.  That's obviously not a 
language feature clang wants to expose, but might be a more robust way of 
handling this than going in to do surgery to the IR after the face.

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


[Lldb-commits] [lldb] [RISCV-LLDB] RISCV feature attribute support and allows overriding additional(default) feature (PR #147990)

2025-09-11 Thread David Spickett via lldb-commits


@@ -0,0 +1,10 @@
+# REQUIRES: target=riscv32-{{.*}}
+
+# RUN: %lldb -b -o "disassemble -b -n main" %p/Inputs/riscv_xqci.out | 
FileCheck %s
+
+# CHECK: 051f 0058   qc.e.li a0, 0x58
+# CHECK: 1516  qc.extu a0, a0, 0x6, 0x0
+
+# RUN: %lldb -b -o "disassemble -b -n main -Y -xqci,+c" 
%p/Inputs/riscv_xqci.out | FileCheck --check-prefix=CHECK-NOXQCI %s
+
+# CHECK-NOXQCI: 

DavidSpickett wrote:

Add CHECK-NOXQCI-NOT to check you don't get some `` **and** the proper 
disassembly here.

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


[Lldb-commits] [lldb] [lldb][test] StepUntil disable test for unsupported linkers. (PR #157474)

2025-09-11 Thread via lldb-commits

github-actions[bot] wrote:




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



You can test this locally with the following command:


``bash
darker --check --diff -r origin/main...HEAD 
lldb/packages/Python/lldbsuite/test/lldbplatformutil.py 
lldb/test/API/functionalities/thread/step_until/TestStepUntil.py 
lldb/test/API/functionalities/thread/step_until/TestStepUntilAPI.py
``

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:





View the diff from darker here.


``diff
--- packages/Python/lldbsuite/test/lldbplatformutil.py  2025-09-09 
10:58:31.00 +
+++ packages/Python/lldbsuite/test/lldbplatformutil.py  2025-09-09 
11:01:06.158335 +
@@ -43,10 +43,11 @@
 # TODO: Add check for other architectures
 test_case.fail(
 "Unsupported architecture for test case (arch: %s)"
 % test_case.getArchitecture()
 )
+
 
 def linker_script_syntax_unsupported() -> Optional[str]:
 """Current versions of mold(2.40.4) and gold(2.44) linker does not support 
some syntax of
 linker scripts, this maybe supported in future versions. check if it 
compiles,
 if not it is not supported.
--- test/API/functionalities/thread/step_until/TestStepUntilAPI.py  
2025-09-09 10:58:31.00 +
+++ test/API/functionalities/thread/step_until/TestStepUntilAPI.py  
2025-09-09 11:01:06.262616 +
@@ -1,6 +1,5 @@
-
 from lldbsuite.test.decorators import *
 from lldbsuite.test.lldbplatformutil import linker_script_syntax_unsupported
 from lldbsuite.test.lldbtest import *
 from lldbsuite.test import lldbutil
 

``




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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Added a check for the specialization existence (PR #154123)

2025-09-11 Thread via lldb-commits


@@ -1873,6 +1874,24 @@ DWARFASTParserClang::ParseStructureLikeDIE(const 
SymbolContext &sc,
 clang_type =
 m_ast.CreateClassTemplateSpecializationType(class_specialization_decl);
 
+// Try to find an existing specialization with these template arguments and
+// template parameter list.
+void *InsertPos = nullptr;
+llvm::ArrayRef args =
+template_param_infos.GetArgs();
+if (!args.empty() &&
+!class_template_decl->findSpecialization(args, InsertPos))
+  // Add this specialization to the class template.
+  class_template_decl->AddSpecialization(class_specialization_decl,
+ InsertPos);

tgs-sc wrote:

And what should we do if we found this specialization?

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


[Lldb-commits] [lldb] [lldb][Instrumentation] Set selected frame to outside sanitizer libraries (PR #133079)

2025-09-11 Thread Michael Buch via lldb-commits

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


[Lldb-commits] [lldb] [lldb-mcp] Auto connect to the first running lldb mcp instance. (PR #157503)

2025-09-11 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)


Changes

This improves the flow by automatically connecting to an exisitng lldb 
instance, if one is found.

Future improvements include:

* Launching a binary if an instance isn't detected.
* Multiplexing if multiple instances are detected.

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


4 Files Affected:

- (modified) lldb/include/lldb/Protocol/MCP/Server.h (+3) 
- (modified) lldb/source/Protocol/MCP/Server.cpp (+60-42) 
- (modified) lldb/tools/lldb-mcp/CMakeLists.txt (+1) 
- (modified) lldb/tools/lldb-mcp/lldb-mcp.cpp (+107-18) 


``diff
diff --git a/lldb/include/lldb/Protocol/MCP/Server.h 
b/lldb/include/lldb/Protocol/MCP/Server.h
index 254b7d9680cd8..567af96530e89 100644
--- a/lldb/include/lldb/Protocol/MCP/Server.h
+++ b/lldb/include/lldb/Protocol/MCP/Server.h
@@ -30,6 +30,9 @@ namespace lldb_protocol::mcp {
 struct ServerInfo {
   std::string connection_uri;
   lldb::pid_t pid;
+
+  static llvm::Error Write(const ServerInfo &);
+  static llvm::Expected> Load();
 };
 llvm::json::Value toJSON(const ServerInfo &);
 bool fromJSON(const llvm::json::Value &, ServerInfo &, llvm::json::Path);
diff --git a/lldb/source/Protocol/MCP/Server.cpp 
b/lldb/source/Protocol/MCP/Server.cpp
index 0381b7f745e98..cb0e1034fe51f 100644
--- a/lldb/source/Protocol/MCP/Server.cpp
+++ b/lldb/source/Protocol/MCP/Server.cpp
@@ -11,62 +11,80 @@
 #include "lldb/Protocol/MCP/Protocol.h"
 #include "llvm/Support/JSON.h"
 
-using namespace lldb_protocol::mcp;
 using namespace llvm;
+using namespace lldb_private;
+using namespace lldb_protocol::mcp;
 
-llvm::json::Value lldb_protocol::mcp::toJSON(const ServerInfo &SM) {
-  return llvm::json::Object{{"connection_uri", SM.connection_uri},
-{"pid", SM.pid}};
+json::Value lldb_protocol::mcp::toJSON(const ServerInfo &SM) {
+  return json::Object{{"connection_uri", SM.connection_uri}, {"pid", SM.pid}};
 }
 
-bool lldb_protocol::mcp::fromJSON(const llvm::json::Value &V, ServerInfo &SM,
-  llvm::json::Path P) {
-  llvm::json::ObjectMapper O(V, P);
+bool lldb_protocol::mcp::fromJSON(const json::Value &V, ServerInfo &SM,
+  json::Path P) {
+  json::ObjectMapper O(V, P);
   return O && O.map("connection_uri", SM.connection_uri) &&
  O.map("pid", SM.pid);
 }
 
-Server::Server(std::string name, std::string version,
-   std::unique_ptr transport_up,
-   lldb_private::MainLoop &loop)
-: m_name(std::move(name)), m_version(std::move(version)),
-  m_transport_up(std::move(transport_up)), m_loop(loop) {
-  AddRequestHandlers();
-}
+llvm::Error ServerInfo::Write(const ServerInfo &info) {
+  std::string buf = formatv("{0}", toJSON(info)).str();
+  size_t num_bytes = buf.size();
 
-void Server::AddRequestHandlers() {
-  AddRequestHandler("initialize", std::bind(&Server::InitializeHandler, this,
-std::placeholders::_1));
-  AddRequestHandler("tools/list", std::bind(&Server::ToolsListHandler, this,
-std::placeholders::_1));
-  AddRequestHandler("tools/call", std::bind(&Server::ToolsCallHandler, this,
-std::placeholders::_1));
-  AddRequestHandler("resources/list", std::bind(&Server::ResourcesListHandler,
-this, std::placeholders::_1));
-  AddRequestHandler("resources/read", std::bind(&Server::ResourcesReadHandler,
-this, std::placeholders::_1));
-}
+  FileSpec user_lldb_dir = HostInfo::GetUserLLDBDir();
 
-llvm::Expected Server::Handle(const Request &request) {
-  auto it = m_request_handlers.find(request.method);
-  if (it != m_request_handlers.end()) {
-llvm::Expected response = it->second(request);
-if (!response)
-  return response;
-response->id = request.id;
-return *response;
-  }
+  Status error(llvm::sys::fs::create_directory(user_lldb_dir.GetPath()));
+  if (error.Fail())
+return error.takeError();
+
+  FileSpec mcp_registry_entry_path = 
user_lldb_dir.CopyByAppendingPathComponent(
+  formatv("lldb-mcp-{0}.json", getpid()).str());
 
-  return llvm::make_error(
-  llvm::formatv("no handler for request: {0}", request.method).str());
+  const File::OpenOptions flags = File::eOpenOptionWriteOnly |
+  File::eOpenOptionCanCreate |
+  File::eOpenOptionTruncate;
+  llvm::Expected file = FileSystem::Instance().Open(
+  mcp_registry_entry_path, flags, lldb::eFilePermissionsFileDefault, 
false);
+  if (!file)
+return file.takeError();
+  if (llvm::Error error = (*file)->Write(buf.data(), num_bytes).takeError())
+return error;
+  return llvm::Error::success();
 }
 
-void Server::Handle(const Notification ¬ification) {
-  auto it = m_notificat

[Lldb-commits] [lldb] [lldb][TypeSystemClang] Added unique builtins types for __bf16 and _Float16 (PR #157674)

2025-09-11 Thread Michael Buch via lldb-commits

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


[Lldb-commits] [lldb] [RISCV-LLDB] RISCV feature attribute support and allows overriding additional(default) feature (PR #147990)

2025-09-11 Thread David Spickett via lldb-commits

DavidSpickett wrote:

Ultimately I won't be casting the deciding vote here as I don't work with 
RISC-V systems. Someone from Apple or perhaps others like @dlav-sc who do use 
them should have the final approvals.

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Added a check for the specialization existence (PR #154123)

2025-09-11 Thread Michael Buch via lldb-commits

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


[Lldb-commits] [lldb] [lldb][DWARFASTParserClang] Added a check for the specialization existence (PR #154123)

2025-09-11 Thread Michael Buch via lldb-commits


@@ -959,6 +959,9 @@ CompilerType 
TypeSystemClang::GetBuiltinTypeForDWARFEncodingAndBitSize(
 if (type_name == "long double" &&
 QualTypeMatchesBitSize(bit_size, ast, ast.LongDoubleTy))
   return GetType(ast.LongDoubleTy);
+if (type_name == "__bf16" &&

Michael137 wrote:

Ideally yes

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


[Lldb-commits] [lldb] [lldb][test] Prevent TestqOffsets.py picking up host binaries (PR #157432)

2025-09-11 Thread Pavel Labath via lldb-commits

https://github.com/labath commented:

would `runCmd("platform select remote-linux")` have the same effect?

That would make the test more realistic, as that's how you would debug a 
non-local process. The problem right now is that lldb selects the host platform 
by default (you could argue that it shouldn't do that for "gdb-remote" 
connections, but that's what it is right now), and unless that platform rejects 
it (which happens when there's a host-binary architecture mismatch), it will 
bind the target to that platform. remote-linux (or maybe `remote-gdb-server` ?) 
is what would get selected then, so this will also make sure the behavior of 
the test is consistent between aarch64 and non-aarch64 runs.

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