[Lldb-commits] [lldb] [lldb][RPC] Upstream RPC server interface emitters (PR #138032)

2025-05-07 Thread David Spickett via lldb-commits


@@ -0,0 +1,592 @@
+//===-- RPCServerSourceEmitter.cpp 
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "RPCServerSourceEmitter.h"
+#include "RPCCommon.h"
+
+#include "clang/AST/AST.h"
+#include "clang/Frontend/CompilerInstance.h"
+
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/raw_ostream.h"
+
+#include 
+
+using namespace clang;
+using namespace lldb_rpc_gen;
+
+// For methods with pointer return types, it's important that we know how big
+// the type of the pointee is. We must correctly size a buffer (in the form of 
a
+// Bytes object) before we can actually use it.
+static const std::map MethodsWithPointerReturnTypes = 
{
+{"_ZN4lldb12SBModuleSpec12GetUUIDBytesEv", 16}, // sizeof(uuid_t) -> 16
+{"_ZNK4lldb8SBModule12GetUUIDBytesEv", 16}, // sizeof(uuid_t) -> 16
+};
+
+void RPCServerSourceEmitter::EmitMethod(const Method &method) {
+  if (method.ContainsFunctionPointerParameter)
+EmitCallbackFunction(method);
+
+  EmitCommentHeader(method);
+  EmitFunctionHeader(method);
+  EmitFunctionBody(method);
+  EmitFunctionFooter();
+}
+
+void RPCServerSourceEmitter::EmitCommentHeader(const Method &method) {
+  std::string CommentLine;
+  llvm::raw_string_ostream CommentStream(CommentLine);
+
+  CommentStream << "// " << method.QualifiedName << "("
+<< method.CreateParamListAsString(eServer) << ")";
+  if (method.IsConst)
+CommentStream << " const";
+
+  EmitLine("//");
+  EmitLine(CommentLine);
+  EmitLine("//");
+}
+
+void RPCServerSourceEmitter::EmitFunctionHeader(const Method &method) {
+  std::string FunctionHeader;
+  llvm::raw_string_ostream FunctionHeaderStream(FunctionHeader);
+  FunctionHeaderStream
+  << "bool rpc_server::" << method.MangledName
+  << "::HandleRPCCall(rpc_common::Connection &connection, RPCStream "
+ "&send, RPCStream &response) {";
+  EmitLine(FunctionHeader);
+  IndentLevel++;
+}
+
+void RPCServerSourceEmitter::EmitFunctionBody(const Method &method) {
+  EmitLine("// 1) Make local storage for incoming function arguments");
+  EmitStorageForParameters(method);
+  EmitLine("// 2) Decode all function arguments");
+  EmitDecodeForParameters(method);
+  EmitLine("// 3) Call the method and encode the return value");
+  EmitMethodCallAndEncode(method);
+}
+
+void RPCServerSourceEmitter::EmitFunctionFooter() {
+  EmitLine("return true;");
+  IndentLevel--;
+  EmitLine("}");
+}
+
+void RPCServerSourceEmitter::EmitStorageForParameters(const Method &method) {
+  // If we have an instance method and it isn't a constructor, we'll need to
+  // emit a "this" pointer.
+  if (method.IsInstance && !method.IsCtor)
+EmitStorageForOneParameter(method.ThisType, "this_ptr", method.Policy,
+   /* IsFollowedByLen = */ false);
+  for (auto Iter = method.Params.begin(); Iter != method.Params.end(); Iter++) 
{
+EmitStorageForOneParameter(Iter->Type, Iter->Name, method.Policy,
+   Iter->IsFollowedByLen);
+// Skip over the length parameter, we don't emit it.
+if (!lldb_rpc_gen::TypeIsConstCharPtrPtr(Iter->Type) &&
+Iter->IsFollowedByLen)
+  Iter++;
+  }
+}
+
+void RPCServerSourceEmitter::EmitStorageForOneParameter(
+QualType ParamType, const std::string &ParamName,
+const PrintingPolicy &Policy, bool IsFollowedByLen) {
+  // First, we consider `const char *`, `const char **`. They have special
+  // server-side types.
+  if (TypeIsConstCharPtr(ParamType)) {
+EmitLine("rpc_common::ConstCharPointer " + ParamName + ";");

DavidSpickett wrote:

Ok, I saw a note about this somewhere and thought it was literally a typedef 
not a wrapper object.

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


[Lldb-commits] [lldb] [lldb][RPC] Upstream RPC server interface emitters (PR #138032)

2025-05-07 Thread David Spickett via lldb-commits


@@ -0,0 +1,592 @@
+//===-- RPCServerSourceEmitter.cpp 
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "RPCServerSourceEmitter.h"
+#include "RPCCommon.h"
+
+#include "clang/AST/AST.h"
+#include "clang/Frontend/CompilerInstance.h"
+
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/raw_ostream.h"
+
+#include 
+
+using namespace clang;
+using namespace lldb_rpc_gen;
+
+// For methods with pointer return types, it's important that we know how big
+// the type of the pointee is. We must correctly size a buffer (in the form of 
a
+// Bytes object) before we can actually use it.
+static const std::map MethodsWithPointerReturnTypes = 
{
+{"_ZN4lldb12SBModuleSpec12GetUUIDBytesEv", 16}, // sizeof(uuid_t) -> 16
+{"_ZNK4lldb8SBModule12GetUUIDBytesEv", 16}, // sizeof(uuid_t) -> 16
+};
+
+void RPCServerSourceEmitter::EmitMethod(const Method &method) {
+  if (method.ContainsFunctionPointerParameter)
+EmitCallbackFunction(method);
+
+  EmitCommentHeader(method);
+  EmitFunctionHeader(method);
+  EmitFunctionBody(method);
+  EmitFunctionFooter();
+}
+
+void RPCServerSourceEmitter::EmitCommentHeader(const Method &method) {
+  std::string CommentLine;
+  llvm::raw_string_ostream CommentStream(CommentLine);
+
+  CommentStream << "// " << method.QualifiedName << "("
+<< method.CreateParamListAsString(eServer) << ")";
+  if (method.IsConst)
+CommentStream << " const";
+
+  EmitLine("//");
+  EmitLine(CommentLine);
+  EmitLine("//");
+}
+
+void RPCServerSourceEmitter::EmitFunctionHeader(const Method &method) {
+  std::string FunctionHeader;
+  llvm::raw_string_ostream FunctionHeaderStream(FunctionHeader);
+  FunctionHeaderStream
+  << "bool rpc_server::" << method.MangledName
+  << "::HandleRPCCall(rpc_common::Connection &connection, RPCStream "
+ "&send, RPCStream &response) {";
+  EmitLine(FunctionHeader);
+  IndentLevel++;
+}
+
+void RPCServerSourceEmitter::EmitFunctionBody(const Method &method) {
+  EmitLine("// 1) Make local storage for incoming function arguments");
+  EmitStorageForParameters(method);
+  EmitLine("// 2) Decode all function arguments");
+  EmitDecodeForParameters(method);
+  EmitLine("// 3) Call the method and encode the return value");
+  EmitMethodCallAndEncode(method);
+}
+
+void RPCServerSourceEmitter::EmitFunctionFooter() {
+  EmitLine("return true;");
+  IndentLevel--;
+  EmitLine("}");
+}
+
+void RPCServerSourceEmitter::EmitStorageForParameters(const Method &method) {
+  // If we have an instance method and it isn't a constructor, we'll need to
+  // emit a "this" pointer.
+  if (method.IsInstance && !method.IsCtor)
+EmitStorageForOneParameter(method.ThisType, "this_ptr", method.Policy,
+   /* IsFollowedByLen = */ false);
+  for (auto Iter = method.Params.begin(); Iter != method.Params.end(); Iter++) 
{
+EmitStorageForOneParameter(Iter->Type, Iter->Name, method.Policy,
+   Iter->IsFollowedByLen);
+// Skip over the length parameter, we don't emit it.
+if (!lldb_rpc_gen::TypeIsConstCharPtrPtr(Iter->Type) &&
+Iter->IsFollowedByLen)
+  Iter++;
+  }
+}
+
+void RPCServerSourceEmitter::EmitStorageForOneParameter(
+QualType ParamType, const std::string &ParamName,
+const PrintingPolicy &Policy, bool IsFollowedByLen) {
+  // First, we consider `const char *`, `const char **`. They have special
+  // server-side types.
+  if (TypeIsConstCharPtr(ParamType)) {
+EmitLine("rpc_common::ConstCharPointer " + ParamName + ";");
+return;
+  } else if (TypeIsConstCharPtrPtr(ParamType)) {
+EmitLine("rpc_common::StringList " + ParamName + ";");
+return;
+  }
+
+  QualType UnderlyingType =
+  lldb_rpc_gen::GetUnqualifiedUnderlyingType(ParamType);
+  const bool IsSBClass = lldb_rpc_gen::TypeIsSBClass(UnderlyingType);
+
+  if (ParamType->isPointerType() && !IsSBClass) {
+// Void pointer with no length is usually a baton for a callback. We're
+// going to hold onto the pointer value so we can send it back to the
+// client-side when we implement callbacks.
+if (ParamType->isVoidPointerType() && !IsFollowedByLen) {
+  EmitLine("void * " + ParamName + " = nullptr;");
+  return;
+}
+
+if (!ParamType->isFunctionPointerType()) {
+  EmitLine("Bytes " + ParamName + ";");
+  return;
+}
+
+assert(ParamType->isFunctionPointerType() && "Unhandled pointer type");
+EmitLine("rpc_common::function_ptr_t " + Pa

[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread Pavel Labath via lldb-commits

https://github.com/labath updated 
https://github.com/llvm/llvm-project/pull/138698



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 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 HEAD~1...HEAD 
lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
``





View the diff from darker here.


``diff
--- TestDynamicValue.py 2025-05-07 09:16:36.00 +
+++ TestDynamicValue.py 2025-05-07 09:18:51.436953 +
@@ -280,11 +280,11 @@
 substrs=["(B *) a", "m_b_value = 10"],
 )
 
 @no_debug_info_test
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
-@expectedFailureDarwin # dynamic loader unloads modules
+@expectedFailureDarwin  # dynamic loader unloads modules
 def test_from_core_file(self):
 """Test fetching C++ dynamic values from core files. Specifically, test
 that we can determine the dynamic type of the value if the core file
 does not contain the type vtable."""
 self.build()

``




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


[Lldb-commits] [lldb] 62385b8 - [lldb][docs] Correct spelling in debugging doc

2025-05-07 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2025-05-07T10:07:02Z
New Revision: 62385b848757f2dc35070eadb2ccd921508497dc

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

LOG: [lldb][docs] Correct spelling in debugging doc

Added: 


Modified: 
lldb/docs/resources/debugging.rst

Removed: 




diff  --git a/lldb/docs/resources/debugging.rst 
b/lldb/docs/resources/debugging.rst
index 990a95f54e07f..ba23759b44cf5 100644
--- a/lldb/docs/resources/debugging.rst
+++ b/lldb/docs/resources/debugging.rst
@@ -236,7 +236,7 @@ in. For example, to find a process that acted as a 
``gdbserver`` instance::
 Remote Debugging
 
 
-If you want to debug part of LLDB running on a remote machine, the principals
+If you want to debug part of LLDB running on a remote machine, the principles
 are the same but we will have to start debug servers, then attach debuggers to
 those servers.
 



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


[Lldb-commits] [lldb] [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (PR #137978)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

(I see the failure on https://lab.llvm.org/buildbot/#/builders/197. I want to 
submit some additional logging code before I revert this.)

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


[Lldb-commits] [clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-07 Thread Rahul Joshi via lldb-commits

https://github.com/jurahul updated 
https://github.com/llvm/llvm-project/pull/138174



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] 1815d62 - [lldb] Add more logging to a unit test

2025-05-07 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T16:11:09+02:00
New Revision: 1815d62d7c43455c55bfc1842e41a25ea04dcb9b

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

LOG: [lldb] Add more logging to a unit test

to debug problems with #137978.

Added: 


Modified: 
lldb/unittests/Host/HostTest.cpp

Removed: 




diff  --git a/lldb/unittests/Host/HostTest.cpp 
b/lldb/unittests/Host/HostTest.cpp
index 9e4390a48fb18..52224bfd28e61 100644
--- a/lldb/unittests/Host/HostTest.cpp
+++ b/lldb/unittests/Host/HostTest.cpp
@@ -106,6 +106,10 @@ TEST(Host, LaunchProcessDuplicatesHandle) {
   Pipe pipe;
   
ASSERT_THAT_ERROR(pipe.CreateNew(/*child_process_inherit=*/false).takeError(),
 llvm::Succeeded());
+  SCOPED_TRACE(llvm::formatv("Pipe handles are: {0}/{1}",
+ (uint64_t)pipe.GetReadPipe(),
+ (uint64_t)pipe.GetWritePipe())
+   .str());
   ProcessLaunchInfo info;
   info.SetExecutableFile(FileSpec(TestMainArgv0),
  /*add_exe_file_as_first_arg=*/true);



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


[Lldb-commits] [lldb] [lldb-dap] Fix the package.json and format lldb-dap typescript. (PR #138918)

2025-05-07 Thread John Harrison via lldb-commits

https://github.com/ashgti updated 
https://github.com/llvm/llvm-project/pull/138918

>From 05b709033990e6cdfd7cb9fdbd7e8eab260e7a62 Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Wed, 7 May 2025 10:46:55 -0700
Subject: [PATCH] [lldb-dap] Fix package.json after a bad merge.

The package.json is currently malformed after a bad merge in 
39e6e888a8155583713e1b8b256119a2be7902e0.
---
 lldb/tools/lldb-dap/package.json | 982 +++
 1 file changed, 491 insertions(+), 491 deletions(-)

diff --git a/lldb/tools/lldb-dap/package.json b/lldb/tools/lldb-dap/package.json
index 4734c9d7277bb..f66badc2a930f 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -242,527 +242,527 @@
   }
 }
   }
-]
-  },
-  "breakpoints": [
-{
-  "language": "ada"
-},
-{
-  "language": "arm"
-},
-{
-  "language": "asm"
-},
-{
-  "language": "c"
-},
-{
-  "language": "cpp"
-},
-{
-  "language": "crystal"
-},
-{
-  "language": "d"
-},
-{
-  "language": "fortan"
-},
-{
-  "language": "fortran-modern"
-},
-{
-  "language": "nim"
-},
-{
-  "language": "objective-c"
-},
-{
-  "language": "objectpascal"
-},
-{
-  "language": "pascal"
-},
-{
-  "language": "rust"
-},
-{
-  "language": "swift"
-}
-  ],
-  "debuggers": [
-{
-  "type": "lldb-dap",
-  "label": "LLDB DAP Debugger",
-  "configurationAttributes": {
-"launch": {
-  "required": [
-"program"
-  ],
-  "properties": {
-"debugAdapterHostname": {
-  "type": "string",
-  "markdownDescription": "The hostname that an existing lldb-dap 
executable is listening on."
-},
-"debugAdapterPort": {
-  "type": "number",
-  "markdownDescription": "The port that an existing lldb-dap 
executable is listening on."
-},
-"debugAdapterExecutable": {
-  "type": "string",
-  "markdownDescription": "The absolute path to the LLDB debug 
adapter executable to use. Overrides any user or workspace settings."
-},
-"debugAdapterArgs": {
-  "type": "array",
-  "items": {
-"type": "string"
+],
+"breakpoints": [
+  {
+"language": "ada"
+  },
+  {
+"language": "arm"
+  },
+  {
+"language": "asm"
+  },
+  {
+"language": "c"
+  },
+  {
+"language": "cpp"
+  },
+  {
+"language": "crystal"
+  },
+  {
+"language": "d"
+  },
+  {
+"language": "fortan"
+  },
+  {
+"language": "fortran-modern"
+  },
+  {
+"language": "nim"
+  },
+  {
+"language": "objective-c"
+  },
+  {
+"language": "objectpascal"
+  },
+  {
+"language": "pascal"
+  },
+  {
+"language": "rust"
+  },
+  {
+"language": "swift"
+  }
+],
+"debuggers": [
+  {
+"type": "lldb-dap",
+"label": "LLDB DAP Debugger",
+"configurationAttributes": {
+  "launch": {
+"required": [
+  "program"
+],
+"properties": {
+  "debugAdapterHostname": {
+"type": "string",
+"markdownDescription": "The hostname that an existing lldb-dap 
executable is listening on."
   },
-  "markdownDescription": "The list of additional arguments used to 
launch the debug adapter executable. Overrides any user or workspace settings."
-},
-"program": {
-  "type": "string",
-  "description": "Path to the program to debug."
-},
-"args": {
-  "type": [
-"array"
-  ],
-  "items": {
-"type": "string"
-  },
-  "description": "Program arguments.",
-  "default": []
-},
-"cwd": {
-  "type": "string",
-  "description": "Program working directory.",
-  "default": "${workspaceRoot}"
-},
-"env": {
-  "anyOf": [
-{
-  "type": "object",
-  "description": "Additional environment variables to set when 
launching the program. E.g. `{ \"FOO\": \"1\" }`",
-  "patternProperties": {
-".*": {
-  "type": "string"
-}
-  },
-  "default": {}
+  "debugAdapterPort": {
+"type": "number",
+"markdownDescription": "The port that an existing lldb-dap 
executable is li

[Lldb-commits] [lldb] [lldb-dap] Fix package.json after a bad merge. (PR #138918)

2025-05-07 Thread John Harrison via lldb-commits

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


[Lldb-commits] [lldb] [lldb-dap] Fix package.json after a bad merge. (PR #138918)

2025-05-07 Thread John Harrison via lldb-commits

ashgti wrote:

> @ashgti Hey John, do you mind splitting this patch?

Sure, I'll make this fixing the package.json.

> As for the package.json, do we have any tests that try to npm build? Should 
> we add them?

I don't think they're run as part of the CI today. We could see if there is 
some way to integrate the npm build / tests into the lldb-dap CI somehow. 

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


[Lldb-commits] [lldb] [lldb-dap] Fix package.json after a bad merge. (PR #138918)

2025-05-07 Thread Jacob Lalonde via lldb-commits

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

Thanks @ashgti!

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


[Lldb-commits] [lldb] [lldb-dap] Format extension typescript. (PR #138925)

2025-05-07 Thread John Harrison via lldb-commits

https://github.com/ashgti created 
https://github.com/llvm/llvm-project/pull/138925

I think the format checker isn't checking typescript files. I ran `npm run 
format` to fix the extenion typescript.

>From 389bcb54b146ff707933146d561a272024f415fb Mon Sep 17 00:00:00 2001
From: John Harrison 
Date: Wed, 7 May 2025 10:52:39 -0700
Subject: [PATCH] [lldb-dap] Format extenison typescript.

I think the format checker isn't checking typescript files. I ran `npm run 
format` to fix the extenion typescript.
---
 .../src-ts/debug-configuration-provider.ts|  96 ++
 .../lldb-dap/src-ts/uri-launch-handler.ts | 168 ++
 2 files changed, 153 insertions(+), 111 deletions(-)

diff --git a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts 
b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
index 8a4089008b2f9..c91b101f4a9ba 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
@@ -21,79 +21,97 @@ async function isServerModeSupported(exe: string): 
Promise {
 }
 
 interface BoolConfig {
-  type: 'boolean';
+  type: "boolean";
   default: boolean;
 }
 interface StringConfig {
-  type: 'string';
+  type: "string";
   default: string;
 }
 interface NumberConfig {
-  type: 'number';
+  type: "number";
   default: number;
 }
 interface StringArrayConfig {
-  type: 'stringArray';
+  type: "stringArray";
   default: string[];
 }
-type DefaultConfig = BoolConfig | NumberConfig | StringConfig | 
StringArrayConfig;
+type DefaultConfig =
+  | BoolConfig
+  | NumberConfig
+  | StringConfig
+  | StringArrayConfig;
 
 const configurations: Record = {
   // Keys for debugger configurations.
-  "commandEscapePrefix": { type: "string", default: "`" },
-  "customFrameFormat": { type: "string", default: "" },
-  "customThreadFormat": { type: "string", default: "" },
-  "detachOnError": { type: "boolean", default: false },
-  "disableASLR": { type: "boolean", default: true },
-  "disableSTDIO": { type: "boolean", default: false },
-  "displayExtendedBacktrace": { type: "boolean", default: false },
-  "enableAutoVariableSummaries": { type: "boolean", default: false },
-  "enableSyntheticChildDebugging": { type: "boolean", default: false },
-  "timeout": { type: "number", default: 30 },
+  commandEscapePrefix: { type: "string", default: "`" },
+  customFrameFormat: { type: "string", default: "" },
+  customThreadFormat: { type: "string", default: "" },
+  detachOnError: { type: "boolean", default: false },
+  disableASLR: { type: "boolean", default: true },
+  disableSTDIO: { type: "boolean", default: false },
+  displayExtendedBacktrace: { type: "boolean", default: false },
+  enableAutoVariableSummaries: { type: "boolean", default: false },
+  enableSyntheticChildDebugging: { type: "boolean", default: false },
+  timeout: { type: "number", default: 30 },
 
   // Keys for platform / target configuration.
-  "platformName": { type: "string", default: "" },
-  "targetTriple": { type: "string", default: "" },
+  platformName: { type: "string", default: "" },
+  targetTriple: { type: "string", default: "" },
 
   // Keys for debugger command hooks.
-  "initCommands": { type: "stringArray", default: [] },
-  "preRunCommands": { type: "stringArray", default: [] },
-  "postRunCommands": { type: "stringArray", default: [] },
-  "stopCommands": { type: "stringArray", default: [] },
-  "exitCommands": { type: "stringArray", default: [] },
-  "terminateCommands": { type: "stringArray", default: [] },
+  initCommands: { type: "stringArray", default: [] },
+  preRunCommands: { type: "stringArray", default: [] },
+  postRunCommands: { type: "stringArray", default: [] },
+  stopCommands: { type: "stringArray", default: [] },
+  exitCommands: { type: "stringArray", default: [] },
+  terminateCommands: { type: "stringArray", default: [] },
 };
 
 export class LLDBDapConfigurationProvider
-  implements vscode.DebugConfigurationProvider {
-  constructor(private readonly server: LLDBDapServer) { }
+  implements vscode.DebugConfigurationProvider
+{
+  constructor(private readonly server: LLDBDapServer) {}
 
   async resolveDebugConfiguration(
 folder: vscode.WorkspaceFolder | undefined,
 debugConfiguration: vscode.DebugConfiguration,
-token?: vscode.CancellationToken): Promise {
-let config = vscode.workspace.getConfiguration('lldb-dap.defaults');
+token?: vscode.CancellationToken,
+  ): Promise {
+let config = vscode.workspace.getConfiguration("lldb-dap.defaults");
 for (const [key, cfg] of Object.entries(configurations)) {
-  if (Reflect.has(debugConfiguration, key)) continue;
+  if (Reflect.has(debugConfiguration, key)) {
+continue;
+  }
   const value = config.get(key);
-  if (value === cfg.default) continue;
+  if (!value || value === cfg.default) {
+continue;
+  }
   switch (cfg.type) {
-case 'string':
-  if (typeof value !== 'string')

[Lldb-commits] [lldb] [lldb-dap] Format extension typescript. (PR #138925)

2025-05-07 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)


Changes

I think the format checker isn't checking typescript files. I ran `npm run 
format` to fix the extenion typescript.

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


2 Files Affected:

- (modified) lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts 
(+57-39) 
- (modified) lldb/tools/lldb-dap/src-ts/uri-launch-handler.ts (+96-72) 


``diff
diff --git a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts 
b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
index 8a4089008b2f9..c91b101f4a9ba 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
@@ -21,79 +21,97 @@ async function isServerModeSupported(exe: string): 
Promise {
 }
 
 interface BoolConfig {
-  type: 'boolean';
+  type: "boolean";
   default: boolean;
 }
 interface StringConfig {
-  type: 'string';
+  type: "string";
   default: string;
 }
 interface NumberConfig {
-  type: 'number';
+  type: "number";
   default: number;
 }
 interface StringArrayConfig {
-  type: 'stringArray';
+  type: "stringArray";
   default: string[];
 }
-type DefaultConfig = BoolConfig | NumberConfig | StringConfig | 
StringArrayConfig;
+type DefaultConfig =
+  | BoolConfig
+  | NumberConfig
+  | StringConfig
+  | StringArrayConfig;
 
 const configurations: Record = {
   // Keys for debugger configurations.
-  "commandEscapePrefix": { type: "string", default: "`" },
-  "customFrameFormat": { type: "string", default: "" },
-  "customThreadFormat": { type: "string", default: "" },
-  "detachOnError": { type: "boolean", default: false },
-  "disableASLR": { type: "boolean", default: true },
-  "disableSTDIO": { type: "boolean", default: false },
-  "displayExtendedBacktrace": { type: "boolean", default: false },
-  "enableAutoVariableSummaries": { type: "boolean", default: false },
-  "enableSyntheticChildDebugging": { type: "boolean", default: false },
-  "timeout": { type: "number", default: 30 },
+  commandEscapePrefix: { type: "string", default: "`" },
+  customFrameFormat: { type: "string", default: "" },
+  customThreadFormat: { type: "string", default: "" },
+  detachOnError: { type: "boolean", default: false },
+  disableASLR: { type: "boolean", default: true },
+  disableSTDIO: { type: "boolean", default: false },
+  displayExtendedBacktrace: { type: "boolean", default: false },
+  enableAutoVariableSummaries: { type: "boolean", default: false },
+  enableSyntheticChildDebugging: { type: "boolean", default: false },
+  timeout: { type: "number", default: 30 },
 
   // Keys for platform / target configuration.
-  "platformName": { type: "string", default: "" },
-  "targetTriple": { type: "string", default: "" },
+  platformName: { type: "string", default: "" },
+  targetTriple: { type: "string", default: "" },
 
   // Keys for debugger command hooks.
-  "initCommands": { type: "stringArray", default: [] },
-  "preRunCommands": { type: "stringArray", default: [] },
-  "postRunCommands": { type: "stringArray", default: [] },
-  "stopCommands": { type: "stringArray", default: [] },
-  "exitCommands": { type: "stringArray", default: [] },
-  "terminateCommands": { type: "stringArray", default: [] },
+  initCommands: { type: "stringArray", default: [] },
+  preRunCommands: { type: "stringArray", default: [] },
+  postRunCommands: { type: "stringArray", default: [] },
+  stopCommands: { type: "stringArray", default: [] },
+  exitCommands: { type: "stringArray", default: [] },
+  terminateCommands: { type: "stringArray", default: [] },
 };
 
 export class LLDBDapConfigurationProvider
-  implements vscode.DebugConfigurationProvider {
-  constructor(private readonly server: LLDBDapServer) { }
+  implements vscode.DebugConfigurationProvider
+{
+  constructor(private readonly server: LLDBDapServer) {}
 
   async resolveDebugConfiguration(
 folder: vscode.WorkspaceFolder | undefined,
 debugConfiguration: vscode.DebugConfiguration,
-token?: vscode.CancellationToken): Promise {
-let config = vscode.workspace.getConfiguration('lldb-dap.defaults');
+token?: vscode.CancellationToken,
+  ): Promise {
+let config = vscode.workspace.getConfiguration("lldb-dap.defaults");
 for (const [key, cfg] of Object.entries(configurations)) {
-  if (Reflect.has(debugConfiguration, key)) continue;
+  if (Reflect.has(debugConfiguration, key)) {
+continue;
+  }
   const value = config.get(key);
-  if (value === cfg.default) continue;
+  if (!value || value === cfg.default) {
+continue;
+  }
   switch (cfg.type) {
-case 'string':
-  if (typeof value !== 'string')
+case "string":
+  if (typeof value !== "string") {
 throw new Error(`Expected ${key} to be a string, got ${value}`);
+  }
   break;
-case 'number':
-  if (typeof value !== '

[Lldb-commits] [lldb] bf59716 - [lldb-dap] Fix package.json after a bad merge. (#138918)

2025-05-07 Thread via lldb-commits

Author: John Harrison
Date: 2025-05-07T10:55:11-07:00
New Revision: bf5971634a9244fd65c1bf8316b3d6ec407783ae

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

LOG: [lldb-dap] Fix package.json after a bad merge. (#138918)

The package.json is currently malformed after a bad merge in
39e6e888a8155583713e1b8b256119a2be7902e0.

Added: 


Modified: 
lldb/tools/lldb-dap/package.json

Removed: 




diff  --git a/lldb/tools/lldb-dap/package.json 
b/lldb/tools/lldb-dap/package.json
index 4734c9d7277bb..f66badc2a930f 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -242,527 +242,527 @@
   }
 }
   }
-]
-  },
-  "breakpoints": [
-{
-  "language": "ada"
-},
-{
-  "language": "arm"
-},
-{
-  "language": "asm"
-},
-{
-  "language": "c"
-},
-{
-  "language": "cpp"
-},
-{
-  "language": "crystal"
-},
-{
-  "language": "d"
-},
-{
-  "language": "fortan"
-},
-{
-  "language": "fortran-modern"
-},
-{
-  "language": "nim"
-},
-{
-  "language": "objective-c"
-},
-{
-  "language": "objectpascal"
-},
-{
-  "language": "pascal"
-},
-{
-  "language": "rust"
-},
-{
-  "language": "swift"
-}
-  ],
-  "debuggers": [
-{
-  "type": "lldb-dap",
-  "label": "LLDB DAP Debugger",
-  "configurationAttributes": {
-"launch": {
-  "required": [
-"program"
-  ],
-  "properties": {
-"debugAdapterHostname": {
-  "type": "string",
-  "markdownDescription": "The hostname that an existing lldb-dap 
executable is listening on."
-},
-"debugAdapterPort": {
-  "type": "number",
-  "markdownDescription": "The port that an existing lldb-dap 
executable is listening on."
-},
-"debugAdapterExecutable": {
-  "type": "string",
-  "markdownDescription": "The absolute path to the LLDB debug 
adapter executable to use. Overrides any user or workspace settings."
-},
-"debugAdapterArgs": {
-  "type": "array",
-  "items": {
-"type": "string"
+],
+"breakpoints": [
+  {
+"language": "ada"
+  },
+  {
+"language": "arm"
+  },
+  {
+"language": "asm"
+  },
+  {
+"language": "c"
+  },
+  {
+"language": "cpp"
+  },
+  {
+"language": "crystal"
+  },
+  {
+"language": "d"
+  },
+  {
+"language": "fortan"
+  },
+  {
+"language": "fortran-modern"
+  },
+  {
+"language": "nim"
+  },
+  {
+"language": "objective-c"
+  },
+  {
+"language": "objectpascal"
+  },
+  {
+"language": "pascal"
+  },
+  {
+"language": "rust"
+  },
+  {
+"language": "swift"
+  }
+],
+"debuggers": [
+  {
+"type": "lldb-dap",
+"label": "LLDB DAP Debugger",
+"configurationAttributes": {
+  "launch": {
+"required": [
+  "program"
+],
+"properties": {
+  "debugAdapterHostname": {
+"type": "string",
+"markdownDescription": "The hostname that an existing lldb-dap 
executable is listening on."
   },
-  "markdownDescription": "The list of additional arguments used to 
launch the debug adapter executable. Overrides any user or workspace settings."
-},
-"program": {
-  "type": "string",
-  "description": "Path to the program to debug."
-},
-"args": {
-  "type": [
-"array"
-  ],
-  "items": {
-"type": "string"
-  },
-  "description": "Program arguments.",
-  "default": []
-},
-"cwd": {
-  "type": "string",
-  "description": "Program working directory.",
-  "default": "${workspaceRoot}"
-},
-"env": {
-  "anyOf": [
-{
-  "type": "object",
-  "description": "Additional environment variables to set when 
launching the program. E.g. `{ \"FOO\": \"1\" }`",
-  "patternProperties": {
-".*": {
-  "type": "string"
-}
-  },
-  "default": {}
+  "debugAdapterPort": {
+

[Lldb-commits] [lldb] [lldb-dap] Fix package.json after a bad merge. (PR #138918)

2025-05-07 Thread John Harrison via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Provide lr value in faulting frame on arm64 (PR #138805)

2025-05-07 Thread Jason Molenda via lldb-commits

jasonmolenda wrote:

FTR that test is skipped on darwin because _sigtramp in libc on aarch64 doesn't 
have any hand-supplied eh_frame right now :/

I have a test case put together, with a few functions written in assembly with 
hand-added cfi directives.  It's probably darwin specific assembly, obviously 
aarch64 only, but it exercises exactly the bug I am fixing.  will wrap it up 
into a proper test in a tiny bit (hopefully tonight)

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


[Lldb-commits] [clang] [lldb] [clang] Add support for `__ptrauth` being applied to integer types (PR #137580)

2025-05-07 Thread Oliver Hunt via lldb-commits

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


[Lldb-commits] [lldb] [lldb][AIX] Support for XCOFF Sections (PR #131304)

2025-05-07 Thread Dhruv Srivastava via lldb-commits


@@ -7,6 +7,9 @@
 # CHECK: Stripped: false
 # CHECK: Type: executable
 # CHECK: Strata: unknown
+# CHECK: Name: .text
+# CHECK-NEXT: code
+# CHECK-NEXT: r-x

DhruvSrivastavaX wrote:

Yes, I was a little hesitant to make it larger as other platform test cases are 
much smaller. 
Sure, I will update this

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


[Lldb-commits] [lldb] df4eac2 - [lldb-dap] Temporarily disable the breakpoint tests

2025-05-07 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2025-05-07T23:08:51-07:00
New Revision: df4eac2f8b6d32772953d3d8063568fe4c0314c1

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

LOG: [lldb-dap] Temporarily disable the breakpoint tests

At least one of these tests is failing every run on GreenDragon:
https://ci.swift.org/view/all/job/llvm.org/view/LLDB/job/as-lldb-cmake/

Added: 


Modified: 
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py 
b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
index 26df2573555df..aae1251b17c93 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
@@ -12,6 +12,7 @@
 import os
 
 
+@skip("Temporarily disable the breakpoint tests")
 class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
 def setUp(self):
 lldbdap_testcase.DAPTestCaseBase.setUp(self)

diff  --git 
a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py 
b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
index 92ac66cd44c5d..4dc8c5b3c7ded 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setExceptionBreakpoints.py
@@ -10,6 +10,7 @@
 import lldbdap_testcase
 
 
+@skip("Temporarily disable the breakpoint tests")
 class TestDAP_setExceptionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
 @skipIfWindows
 def test_functionality(self):

diff  --git 
a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py 
b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
index 946595f639edc..baaca4d974d5d 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setFunctionBreakpoints.py
@@ -10,6 +10,7 @@
 import lldbdap_testcase
 
 
+@skip("Temporarily disable the breakpoint tests")
 class TestDAP_setFunctionBreakpoints(lldbdap_testcase.DAPTestCaseBase):
 @skipIfWindows
 def test_set_and_clear(self):



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


[Lldb-commits] [lldb] [LLDB] Add field member operators to DIL (PR #138093)

2025-05-07 Thread via lldb-commits

https://github.com/cmtice updated 
https://github.com/llvm/llvm-project/pull/138093



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [LLDB] Add field member operators to DIL (PR #138093)

2025-05-07 Thread via lldb-commits


@@ -272,4 +272,204 @@ Interpreter::Visit(const UnaryOpNode *node) {
   m_expr, "invalid ast: unexpected binary operator", node->GetLocation());
 }
 
+lldb::ValueObjectSP
+Interpreter::EvaluateMemberOf(lldb::ValueObjectSP value,
+  const std::vector &path,
+  bool use_synthetic, bool is_dynamic) {

cmtice wrote:

Removed this function so comment doesn't matter now.

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


[Lldb-commits] [lldb] [lldb-dap] Re-enable the lldb-dap tests (PR #138791)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

All the Linux and Windows buildbots are green, but GreenDragon is consistently 
failing with one of the breakpoint tests and it's not immediately obvious what 
the problem is. If I rerun the tests enough times, I can reproduce a failure 
locally. I've disabled those tests in df4eac2f8b6d32772953d3d8063568fe4c0314c1. 

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


[Lldb-commits] [lldb] [LLDB] Add field member operators to DIL (PR #138093)

2025-05-07 Thread via lldb-commits


@@ -88,6 +89,29 @@ class IdentifierNode : public ASTNode {
   std::string m_name;
 };
 
+class MemberOfNode : public ASTNode {
+public:
+  MemberOfNode(uint32_t location, ASTNodeUP base, bool is_arrow,
+   ConstString name)
+  : ASTNode(location, NodeKind::eMemberOfNode), m_base(std::move(base)),
+m_is_arrow(is_arrow), m_field_name(name) { }
+
+  llvm::Expected Accept(Visitor *v) const override;
+
+  ASTNode *base() const { return m_base.get(); }
+  bool IsArrow() const { return m_is_arrow; }

cmtice wrote:

Done.

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


[Lldb-commits] [lldb] [LLDB] Add field member operators to DIL (PR #138093)

2025-05-07 Thread via lldb-commits


@@ -88,6 +89,29 @@ class IdentifierNode : public ASTNode {
   std::string m_name;
 };
 
+class MemberOfNode : public ASTNode {
+public:
+  MemberOfNode(uint32_t location, ASTNodeUP base, bool is_arrow,
+   ConstString name)
+  : ASTNode(location, NodeKind::eMemberOfNode), m_base(std::move(base)),
+m_is_arrow(is_arrow), m_field_name(name) { }
+
+  llvm::Expected Accept(Visitor *v) const override;
+
+  ASTNode *base() const { return m_base.get(); }
+  bool IsArrow() const { return m_is_arrow; }
+  ConstString FieldName() const { return m_field_name; }

cmtice wrote:

Done.

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


[Lldb-commits] [lldb] [lldb] Do not bump memory modificator ID when "internal" debugger memory is updated (PR #129092)

2025-05-07 Thread David Spickett via lldb-commits

DavidSpickett wrote:

Random example - `llvm/test/Analysis/BasicAA/separate_storage.ll`:
```
define i8 @simple_no(ptr %p1, ptr %p2) {
; CHECK-LABEL: @simple_no(
; CHECK-NEXT:  entry:
; CHECK-NEXT:store i8 0, ptr [[P1:%.*]], align 1
; CHECK-NEXT:store i8 1, ptr [[P2:%.*]], align 1
; CHECK-NEXT:[[LOADOFSTORE:%.*]] = load i8, ptr [[P1]], align 1
; CHECK-NEXT:ret i8 [[LOADOFSTORE]]
;
```
https://llvm.org/docs/CommandGuide/FileCheck.html#filecheck-string-substitution-blocks

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


[Lldb-commits] [lldb] [LLDB] Add array subscription and integer parsing to DIL (PR #138551)

2025-05-07 Thread Pavel Labath via lldb-commits


@@ -24,6 +28,8 @@ qualified_id = ["::"] [nested_name_specifier] unqualified_id
 
 identifier = ? C99 Identifier ? ;
 
+numeric_literal = ? C99 Integer constant ? ;

labath wrote:

I don't think you need to write the formal grammar. I'd be fine with just some 
text blurb about the accepted formats. Right now, we don't to anything fancy, 
so you could just say "decimal, hex, (and octal/binary?)" numbers are accepted.

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


[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)

2025-05-07 Thread Hemang Gadhavi via lldb-commits

https://github.com/HemangGadhavi updated 
https://github.com/llvm/llvm-project/pull/138687

>From a47e4642e6ebcbe6b5466ff118968bac83ccf1e9 Mon Sep 17 00:00:00 2001
From: HemangGadhavi 
Date: Tue, 6 May 2025 07:59:45 -0500
Subject: [PATCH] [lldb][AIX] get host info for AIX (cont..)

---
 lldb/source/Host/aix/Host.cpp| 49 +++-
 lldb/source/Host/aix/HostInfoAIX.cpp | 15 +
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Host/aix/Host.cpp b/lldb/source/Host/aix/Host.cpp
index a812e061ccae2..ead8202cbbdef 100644
--- a/lldb/source/Host/aix/Host.cpp
+++ b/lldb/source/Host/aix/Host.cpp
@@ -13,6 +13,7 @@
 #include "lldb/Utility/ProcessInfo.h"
 #include "lldb/Utility/Status.h"
 #include "llvm/BinaryFormat/XCOFF.h"
+#include 
 #include 
 #include 
 
@@ -41,6 +42,14 @@ static ProcessInstanceInfo::timespec 
convert(pr_timestruc64_t t) {
   return ts;
 }
 
+static bool IsDirNumeric(const char *dname) {
+  for (; *dname; dname++) {
+if (!isdigit(*dname))
+  return false;
+  }
+  return true;
+}
+
 static bool GetStatusInfo(::pid_t pid, ProcessInstanceInfo &processInfo,
   ProcessState &State) {
   struct pstatus pstatusData;
@@ -133,7 +142,45 @@ static bool GetProcessAndStatInfo(::pid_t pid,
 
 uint32_t Host::FindProcessesImpl(const ProcessInstanceInfoMatch &match_info,
  ProcessInstanceInfoList &process_infos) {
-  return 0;
+  static const char procdir[] = "/proc/";
+
+  DIR *dirproc = opendir(procdir);
+  if (dirproc) {
+struct dirent *direntry = nullptr;
+const uid_t our_uid = getuid();
+const lldb::pid_t our_pid = getpid();
+bool all_users = match_info.GetMatchAllUsers();
+
+while ((direntry = readdir(dirproc)) != nullptr) {
+  if (!IsDirNumeric(direntry->d_name))
+continue;
+
+  lldb::pid_t pid = atoi(direntry->d_name);
+  // Skip this process.
+  if (pid == our_pid)
+continue;
+
+  ProcessState State;
+  ProcessInstanceInfo process_info;
+  if (!GetProcessAndStatInfo(pid, process_info, State))
+continue;
+
+  if (State == ProcessState::Zombie ||
+  State == ProcessState::TracedOrStopped)
+continue;
+
+  // Check for user match if we're not matching all users and not running
+  // as root.
+  if (!all_users && (our_uid != 0) && (process_info.GetUserID() != 
our_uid))
+continue;
+
+  if (match_info.Matches(process_info)) {
+process_infos.push_back(process_info);
+  }
+}
+closedir(dirproc);
+  }
+  return process_infos.size();
 }
 
 bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {
diff --git a/lldb/source/Host/aix/HostInfoAIX.cpp 
b/lldb/source/Host/aix/HostInfoAIX.cpp
index 61b47462dd647..d720f5c52d3b1 100644
--- a/lldb/source/Host/aix/HostInfoAIX.cpp
+++ b/lldb/source/Host/aix/HostInfoAIX.cpp
@@ -7,6 +7,8 @@
 
//===--===//
 
 #include "lldb/Host/aix/HostInfoAIX.h"
+#include "lldb/Host/posix/Support.h"
+#include 
 
 using namespace lldb_private;
 
@@ -18,5 +20,18 @@ void HostInfoAIX::Terminate() { HostInfoBase::Terminate(); }
 
 FileSpec HostInfoAIX::GetProgramFileSpec() {
   static FileSpec g_program_filespec;
+  struct psinfo psinfoData;
+  auto BufferOrError = getProcFile(getpid(), "psinfo");
+  if (BufferOrError) {
+std::unique_ptr PsinfoBuffer =
+std::move(*BufferOrError);
+memcpy(&psinfoData, PsinfoBuffer->getBufferStart(), sizeof(psinfoData));
+llvm::StringRef exe_path(
+psinfoData.pr_psargs,
+strnlen(psinfoData.pr_psargs, sizeof(psinfoData.pr_psargs)));
+if (!exe_path.empty()) {
+  g_program_filespec.SetFile(exe_path, FileSpec::Style::native);
+}
+  }
   return g_program_filespec;
 }

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


[Lldb-commits] [lldb] [lldb] Fix block address resolution for functions in multiple sections (PR #137955)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [clang] [lldb] [llvm] [mlir] [NFC][Support] Add llvm::uninitialized_copy (PR #138174)

2025-05-07 Thread Rahul Joshi via lldb-commits

jurahul wrote:

Thanks @jpienaar. Given I have 2 approvals, will commit it today.

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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

@DavidSpickett, I am confused by the error on this arm builder: 
https://lab.llvm.org/buildbot/#/builders/18/builds/15619

It says arm is not supported, but I think that error message is coming from 
[here](https://github.com/llvm/llvm-project/blob/3feb8b42e973f935883bc9e779645ecdae1a586d/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp#L168),
 and that switch has a `llvm::Triple::ArchType::arm` case. Do you know how this 
could fire? Is it one of those `armebv7.92+polka_dots` triples that's throwing 
it off somehow?

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


[Lldb-commits] [clang] [lldb] [clang] Add `__ptrauth_restricted_intptr` qualifier (PR #137580)

2025-05-07 Thread Aaron Ballman via lldb-commits

AaronBallman wrote:

Thank you for your patience!

In general, I think adding a new qualifier to Clang needs to come with 
significant justification for the implementation and maintenance costs. In this 
specific case, those costs are somewhat amortized because we already have the 
`__ptrauth` qualifier and this piggybacks off that work. But I don't think the 
benefits justify the costs: if the user writes `__ptrauth` on an integer type, 
we can determine whether that type is "good enough" or not and issue a 
diagnostic for invalid or suspicious uses, same as if the user spelled it 
`__ptrauth_restricted_intptr`. The implementation already has to update 
typechecking in various places regardless of which way we spell the qualifiers, 
so there should not be too much extra implementation burden from only using one 
qualifier.

So on balance, I think we should only upstream the single qualifier and use a 
header file + feature tests for compatibility with older compilers. Is that 
something you can get behind? (You're still the expert in this space, so if I'm 
trivializing concerns, please speak up!)

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


[Lldb-commits] [lldb] [lldb][DataFormatters] Change ExtractIndexFromString to return std::optional (PR #138297)

2025-05-07 Thread Michael Buch via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb-dap] Re-enable the lldb-dap tests (PR #138791)

2025-05-07 Thread David Spickett via lldb-commits

DavidSpickett wrote:

As far as I can know, https://github.com/llvm/llvm-project/pull/138219 went 
onto main, so you can revert my revert to get that back.

Then there was 
https://github.com/llvm/llvm-project/commit/69a0af35a5860156836e9e295ecef9de3474db11,
 which was later reverted in 
https://github.com/llvm/llvm-project/commit/5e70460d0155aacbd926f97a7c059de009b6e22d.
 I saw that cause timeouts on Linux but it didn't change the Windows results.

So it should reproduce with just that first change reapplied to main.

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


[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread David Spickett via lldb-commits

DavidSpickett wrote:

I've reverted this. Please take a look at the logs of 
https://lab.llvm.org/buildbot/#/builders/141/builds/8500 and see if any of it 
makes sense to you.

We didn't have failures on Linux (though a lot of tests are disabled, they 
would be disabled everywhere) so my first instinct would be any construct that 
might be different on Windows.

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


[Lldb-commits] [lldb] [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (PR #137978)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

Thanks.

> Probalby we can remove `#ifndef _WIN32` in 
> lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp, line 928 
> too around `launch_info.AppendDuplicateFileAction((int)pass_comm_fd, 
> (int)pass_comm_fd);`.

Indeed we should. In fact, that function is the reason I'm doing all this. :P

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


[Lldb-commits] [lldb] 18c5ad5 - [lldb] Fix block address resolution for functions in multiple sections (#137955)

2025-05-07 Thread via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T11:18:03+02:00
New Revision: 18c5ad5c6c178365d270439742863e14c8981ea3

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

LOG: [lldb] Fix block address resolution for functions in multiple sections 
(#137955)

Continuing the theme from #116777 and #124931, this patch ensures we
compute the correct address when a functions is spread across multiple
sections. Due to this, it's not sufficient to adjust the offset in the
section+offset pair (Address::Slide). We must actually slide the file
offset and then recompute the section using the result.

I found this out due to a failure to disassemble some parts of the
function, so I'm testing with that, although it's likely there are other
things that were broken due to this.

Added: 
lldb/test/Shell/Commands/command-disassemble-sections.s

Modified: 
lldb/include/lldb/Symbol/Block.h
lldb/source/Symbol/Block.cpp

Removed: 




diff  --git a/lldb/include/lldb/Symbol/Block.h 
b/lldb/include/lldb/Symbol/Block.h
index 501c912b674ac..601895631e148 100644
--- a/lldb/include/lldb/Symbol/Block.h
+++ b/lldb/include/lldb/Symbol/Block.h
@@ -354,7 +354,12 @@ class Block : public UserID, public SymbolContextScope {
   // Member variables.
   SymbolContextScope &m_parent_scope;
   collection m_children;
+
+  /// Address ranges of this block. They are relative to the function entry
+  /// point so one must add/subtract 
GetFunction().GetAddress().GetFileAddress()
+  /// when converting from/to to the AddressRange representation.
   RangeList m_ranges;
+
   lldb::InlineFunctionInfoSP m_inlineInfoSP; ///< Inlined function information.
   lldb::VariableListSP m_variable_list_sp; ///< The variable list for all 
local,
///static and parameter variables

diff  --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp
index 9d01293ea64e0..3de3e5eecbf35 100644
--- a/lldb/source/Symbol/Block.cpp
+++ b/lldb/source/Symbol/Block.cpp
@@ -283,39 +283,43 @@ uint32_t Block::GetRangeIndexContainingAddress(const 
Address &addr) {
   return m_ranges.FindEntryIndexThatContains(file_addr - func_file_addr);
 }
 
+static AddressRange ToAddressRange(const Address &func_addr,
+   const Block::Range &block_range) {
+  assert(func_addr.GetModule());
+  return AddressRange(func_addr.GetFileAddress() + block_range.base,
+  block_range.size,
+  func_addr.GetModule()->GetSectionList());
+}
+
 bool Block::GetRangeAtIndex(uint32_t range_idx, AddressRange &range) {
   if (range_idx >= m_ranges.GetSize())
 return false;
 
-  Function &function = GetFunction();
-  const Range &vm_range = m_ranges.GetEntryRef(range_idx);
-  range.GetBaseAddress() = function.GetAddress();
-  range.GetBaseAddress().Slide(vm_range.GetRangeBase());
-  range.SetByteSize(vm_range.GetByteSize());
+  Address addr = GetFunction().GetAddress();
+  if (!addr.GetModule())
+return false;
+
+  range = ToAddressRange(addr, m_ranges.GetEntryRef(range_idx));
   return true;
 }
 
 AddressRanges Block::GetRanges() {
+  Address addr = GetFunction().GetAddress();
+  if (!addr.GetModule())
+return {};
+
   AddressRanges ranges;
-  Function &function = GetFunction();
-  for (size_t i = 0, e = m_ranges.GetSize(); i < e; ++i) {
-ranges.emplace_back();
-auto &range = ranges.back();
-const Range &vm_range = m_ranges.GetEntryRef(i);
-range.GetBaseAddress() = function.GetAddress();
-range.GetBaseAddress().Slide(vm_range.GetRangeBase());
-range.SetByteSize(vm_range.GetByteSize());
-  }
+  for (size_t i = 0, e = m_ranges.GetSize(); i < e; ++i)
+ranges.push_back(ToAddressRange(addr, m_ranges.GetEntryRef(i)));
   return ranges;
 }
 
 bool Block::GetStartAddress(Address &addr) {
-  if (m_ranges.IsEmpty())
+  Address func_addr = GetFunction().GetAddress();
+  if (!func_addr.GetModule() || m_ranges.IsEmpty())
 return false;
 
-  Function &function = GetFunction();
-  addr = function.GetAddress();
-  addr.Slide(m_ranges.GetEntryRef(0).GetRangeBase());
+  addr = ToAddressRange(func_addr, m_ranges.GetEntryRef(0)).GetBaseAddress();
   return true;
 }
 

diff  --git a/lldb/test/Shell/Commands/command-disassemble-sections.s 
b/lldb/test/Shell/Commands/command-disassemble-sections.s
new file mode 100644
index 0..d278527b898ce
--- /dev/null
+++ b/lldb/test/Shell/Commands/command-disassemble-sections.s
@@ -0,0 +1,110 @@
+## Test disassembling of functions which are spread over multiple sections (ELF
+## segments are modelled as LLDB sections).
+
+
+# REQUIRES: x86, lld
+
+# RUN: split-file %s %t
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %t/file.s -o %t/file.o
+# RUN: ld.lld %t/file.o -o %t/file.out -T %t/file.lds
+# RUN:

[Lldb-commits] [lldb] [lldb][RPC] Upstream RPC server interface emitters (PR #138032)

2025-05-07 Thread David Spickett via lldb-commits


@@ -0,0 +1,592 @@
+//===-- RPCServerSourceEmitter.cpp 
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "RPCServerSourceEmitter.h"
+#include "RPCCommon.h"
+
+#include "clang/AST/AST.h"
+#include "clang/Frontend/CompilerInstance.h"
+
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Support/raw_ostream.h"
+
+#include 
+
+using namespace clang;
+using namespace lldb_rpc_gen;
+
+// For methods with pointer return types, it's important that we know how big
+// the type of the pointee is. We must correctly size a buffer (in the form of 
a
+// Bytes object) before we can actually use it.
+static const std::map MethodsWithPointerReturnTypes = 
{

DavidSpickett wrote:

So even if you did `sizeof(pointee type)`, it could still be pointing to more 
than one `uint8_t`?

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


[Lldb-commits] [lldb] [lldb-dap] Re-enable the lldb-dap tests (PR #138791)

2025-05-07 Thread Ebuka Ezike via lldb-commits

da-viper wrote:

is there a branch tracking the reverted changes #138219, I have an old windows 
10 pc i could use to reproduce it. 

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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] 7c5f5f3 - [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (#137978)

2025-05-07 Thread via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T15:02:45+02:00
New Revision: 7c5f5f3ef83b1d1d43d63862a8431af3dded15bb

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

LOG: [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows 
(#137978)

This is a follow-up to https://github.com/llvm/llvm-project/pull/126935,
which enables passing handles to a child
process on windows systems. Unlike on unix-like systems, the handles
need to be created with the "inheritable" flag because there's to way to
change the flag value after it has been created. This is why I don't
respect the child_process_inherit flag but rather always set the flag to
true. (My next step is to delete the flag entirely.)

This does mean that pipe may be created as inheritable even if its not
necessary, but I think this is offset by the fact that windows (unlike
unixes, which pass all ~O_CLOEXEC descriptors through execve and *all*
descriptors through fork) has a way to specify the precise set of
handles to pass to a specific child process.

If this turns out to be insufficient, instead of a constructor flag, I'd
rather go with creating a separate api to create an inheritable copy of
a handle (as typically, you only want to inherit one end of the pipe).

Added: 


Modified: 
lldb/source/Host/windows/PipeWindows.cpp
lldb/source/Host/windows/ProcessLauncherWindows.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
lldb/tools/lldb-server/lldb-platform.cpp
lldb/unittests/Host/HostTest.cpp

Removed: 




diff  --git a/lldb/source/Host/windows/PipeWindows.cpp 
b/lldb/source/Host/windows/PipeWindows.cpp
index e3f5b629a0590..1f7f6e03519d0 100644
--- a/lldb/source/Host/windows/PipeWindows.cpp
+++ b/lldb/source/Host/windows/PipeWindows.cpp
@@ -88,8 +88,9 @@ Status PipeWindows::CreateNew(llvm::StringRef name,
   std::string pipe_path = g_pipe_name_prefix.str();
   pipe_path.append(name.str());
 
-  SECURITY_ATTRIBUTES sa{sizeof(SECURITY_ATTRIBUTES), 0,
- child_process_inherit ? TRUE : FALSE};
+  // We always create inheritable handles, but we won't pass them to a child
+  // process unless explicitly requested (cf. ProcessLauncherWindows.cpp).
+  SECURITY_ATTRIBUTES sa{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
 
   // Always open for overlapped i/o.  We implement blocking manually in Read
   // and Write.

diff  --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp 
b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index 065ba9271ad0d..bc35667ea9a23 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -10,6 +10,7 @@
 #include "lldb/Host/HostProcess.h"
 #include "lldb/Host/ProcessLaunchInfo.h"
 
+#include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Program.h"
@@ -65,14 +66,23 @@ ProcessLauncherWindows::LaunchProcess(const 
ProcessLaunchInfo &launch_info,
 
   std::string executable;
   std::vector environment;
-  STARTUPINFO startupinfo = {};
+  STARTUPINFOEX startupinfoex = {};
+  STARTUPINFO &startupinfo = startupinfoex.StartupInfo;
   PROCESS_INFORMATION pi = {};
 
   HANDLE stdin_handle = GetStdioHandle(launch_info, STDIN_FILENO);
   HANDLE stdout_handle = GetStdioHandle(launch_info, STDOUT_FILENO);
   HANDLE stderr_handle = GetStdioHandle(launch_info, STDERR_FILENO);
-
-  startupinfo.cb = sizeof(startupinfo);
+  auto close_handles = llvm::make_scope_exit([&] {
+if (stdin_handle)
+  ::CloseHandle(stdin_handle);
+if (stdout_handle)
+  ::CloseHandle(stdout_handle);
+if (stderr_handle)
+  ::CloseHandle(stderr_handle);
+  });
+
+  startupinfo.cb = sizeof(startupinfoex);
   startupinfo.dwFlags |= STARTF_USESTDHANDLES;
   startupinfo.hStdError =
   stderr_handle ? stderr_handle : ::GetStdHandle(STD_ERROR_HANDLE);
@@ -81,6 +91,48 @@ ProcessLauncherWindows::LaunchProcess(const 
ProcessLaunchInfo &launch_info,
   startupinfo.hStdOutput =
   stdout_handle ? stdout_handle : ::GetStdHandle(STD_OUTPUT_HANDLE);
 
+  std::vector inherited_handles;
+  if (startupinfo.hStdError)
+inherited_handles.push_back(startupinfo.hStdError);
+  if (startupinfo.hStdInput)
+inherited_handles.push_back(startupinfo.hStdInput);
+  if (startupinfo.hStdOutput)
+inherited_handles.push_back(startupinfo.hStdOutput);
+
+  size_t attributelist_size = 0;
+  InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
+/*dwAttributeCount=*/1, /*dwFlags=*/0,
+&attributelist_size);
+
+  startupinfoex.lpAttributeList =
+  static_cast(malloc(attributelist_size));
+  auto free_attributelist =
+  llvm::make_scope_exit([&] { free(star

[Lldb-commits] [lldb] 21501d1 - [lldb] Fix dynamic type resolutions for core files (#138698)

2025-05-07 Thread via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T15:02:21+02:00
New Revision: 21501d1cf290a63760904fb125e77b432db49933

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

LOG: [lldb] Fix dynamic type resolutions for core files (#138698)

We're reading from the object's vtable to determine the pointer to the
full object. The vtable is normally in the "rodata" section of the
executable, which is often not included in the core file because it's
not supposed to change and the debugger can extrapolate its contents
from the executable file. We weren't doing that.

This patch changes the read operation to use the target class (which
falls back onto the executable module as expected) and adds the missing
ReadSignedIntegerFromMemory API. The fix is tested by creating a core
(minidump) file which deliberately omits the vtable pointer.

Added: 


Modified: 
lldb/include/lldb/Target/Target.h

lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
lldb/source/Target/Target.cpp
lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py

Removed: 




diff  --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index 73f27dc934b46..0d4e11b65339e 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -1158,6 +1158,11 @@ class Target : public 
std::enable_shared_from_this,
  Status &error,
  bool force_live_memory = false);
 
+  int64_t ReadSignedIntegerFromMemory(const Address &addr,
+  size_t integer_byte_size,
+  int64_t fail_value, Status &error,
+  bool force_live_memory = false);
+
   uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
  size_t integer_byte_size,
  uint64_t fail_value, Status &error,

diff  --git 
a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 
b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 8faf7135217ac..0d068ed5950d5 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -350,7 +350,7 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
   if (offset_to_top_location >= vtable_load_addr)
 return false;
   Status error;
-  const int64_t offset_to_top = m_process->ReadSignedIntegerFromMemory(
+  const int64_t offset_to_top = target.ReadSignedIntegerFromMemory(
   offset_to_top_location, addr_byte_size, INT64_MIN, error);
 
   if (offset_to_top == INT64_MIN)

diff  --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index e90e748191a7e..7f61f8689fb95 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2270,6 +2270,17 @@ size_t Target::ReadScalarIntegerFromMemory(const Address 
&addr, uint32_t byte_si
   return 0;
 }
 
+int64_t Target::ReadSignedIntegerFromMemory(const Address &addr,
+size_t integer_byte_size,
+int64_t fail_value, Status &error,
+bool force_live_memory) {
+  Scalar scalar;
+  if (ReadScalarIntegerFromMemory(addr, integer_byte_size, false, scalar, 
error,
+  force_live_memory))
+return scalar.SLongLong(fail_value);
+  return fail_value;
+}
+
 uint64_t Target::ReadUnsignedIntegerFromMemory(const Address &addr,
size_t integer_byte_size,
uint64_t fail_value, Status 
&error,

diff  --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py 
b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index 634bd13d7c71a..97d539f7a807c 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -279,3 +279,54 @@ def test_from_forward_decl(self):
 "frame var -d run-target --ptr-depth=1 --show-types a",
 substrs=["(B *) a", "m_b_value = 10"],
 )
+
+@no_debug_info_test
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
+@expectedFailureDarwin  # dynamic loader unloads modules
+def test_from_core_file(self):
+"""Test fetching C++ dynamic values from core files. Specifically, test
+that we can determine the dynamic type of the value if the core file
+does not contain the type vtable."""
+sel

[Lldb-commits] [lldb] [lldb] Parse DWARF CFI for discontinuous functions (PR #137006)

2025-05-07 Thread Pavel Labath via lldb-commits


@@ -17,23 +17,32 @@
 image show-unwind --cached true -n foo
 # CHECK: UNWIND PLANS for {{.*}}`foo
 #
-# CHECK:  Assembly language inspection UnwindPlan:
-# CHECK-NEXT: This UnwindPlan originally sourced from assembly insn profiling
-# CHECK-NEXT: This UnwindPlan is sourced from the compiler: no.
-# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: yes.
+# CHECK:  eh_frame UnwindPlan:
+# CHECK-NEXT: This UnwindPlan originally sourced from eh_frame CFI
+# CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.
+# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: no.
 # CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
-# TODO: This address range isn't correct right now. We're just checking that
-# it's a different range from the one in the next query.
-# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 
6-0x0046)
+# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 
6-0x0010)[{{.*}}.text + 17-0x001c)[{{.*}}.text + 
44-0x0037)[{{.*}}.text + 56-0x003d)
+# CHECK-NEXT: row[0]:0: CFA=rsp +8 => rip=[CFA-8]
+# CHECK-NEXT: row[1]:1: CFA=rsp+16 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[2]:   11: CFA=rsp+16 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[3]:   15: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[4]:   38: CFA=rsp+16 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[5]:   42: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[6]:   50: CFA=rsp+32 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-NEXT: row[7]:   54: CFA=rsp +8 => rbx=[CFA-16] rip=[CFA-8]
+# CHECK-EMPTY:
 
 image show-unwind --cached true -n bar
 # CHECK: UNWIND PLANS for {{.*}}`bar
 
-# CHECK:  Assembly language inspection UnwindPlan:
-# CHECK-NEXT: This UnwindPlan originally sourced from assembly insn profiling
-# CHECK-NEXT: This UnwindPlan is sourced from the compiler: no.
-# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: yes.
+# CHECK:  eh_frame UnwindPlan:
+# CHECK-NEXT: This UnwindPlan originally sourced from eh_frame CFI
+# CHECK-NEXT: This UnwindPlan is sourced from the compiler: yes.
+# CHECK-NEXT: This UnwindPlan is valid at all instruction locations: no.
 # CHECK-NEXT: This UnwindPlan is for a trap handler function: no.
-# TODO: This address range isn't correct right now. We're just checking that
-# it's a different range from the one in the previous query.
-# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 
35-0x0033)
+# CHECK-NEXT: Address range of this UnwindPlan: [{{.*}}.text + 
28-0x002c)

labath wrote:

Yeah, it's quite a mess. I've been planning to look into that.

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


[Lldb-commits] [lldb] [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (PR #137978)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Parse DWARF CFI for discontinuous functions (PR #137006)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] d865f32 - [lldb] Parse DWARF CFI for discontinuous functions (#137006)

2025-05-07 Thread via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T15:04:22+02:00
New Revision: d865f32fe820f543f0a53bfeba08774f2c270589

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

LOG: [lldb] Parse DWARF CFI for discontinuous functions (#137006)

This patch uses the previously build infrastructure to parse multiple
FDE entries into a single unwind plan. There is one catch though: we
parse only one FDE entry per unwind range. This is not fully correct
because lldb coalesces adjecant address ranges, which means that
something that originally looked like two separate address ranges (and
two FDE entries) may get merged into one because if the linker decides
to put the two ranges next to each other. In this case, we will ignore
the second FDE entry.

It would be more correct to try to parse another entry when the one we
found turns out to be short, but I'm not doing this (yet), because:
- this is how we've done things so far (although, monolithic functions
are unlikely to have more than one FDE entry)
- in cases where we don't have debug info or (full) symbol tables, we
can end up with "symbols" which appear to span many megabytes
(potentially, the whole module). If we tried to fill short FDE entries,
we could end up parsing the entire eh_frame section in a single go. In a
way, this would be more correct, but it would also probably be very
slow.

I haven't quite decided what to do about this case yet, though it's not
particularly likely to happen in the "production" cases as typically the
functions are split into two parts (hot/cold) instead of one part per
basic block.

Added: 


Modified: 
lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
lldb/source/Symbol/DWARFCallFrameInfo.cpp
lldb/source/Symbol/FuncUnwinders.cpp
lldb/source/Symbol/UnwindTable.cpp
lldb/source/Target/RegisterContextUnwind.cpp
lldb/test/Shell/Unwind/Inputs/basic-block-sections-with-dwarf.s
lldb/test/Shell/Unwind/basic-block-sections-with-dwarf-static.test
lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp

Removed: 




diff  --git a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h 
b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
index 679f652c7f2e0..c214ed1f60919 100644
--- a/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
+++ b/lldb/include/lldb/Symbol/DWARFCallFrameInfo.h
@@ -47,12 +47,15 @@ class DWARFCallFrameInfo {
   /// Return an UnwindPlan based on the call frame information encoded in the
   /// FDE of this DWARFCallFrameInfo section. The returned plan will be valid
   /// (at least) for the given address.
-  bool GetUnwindPlan(const Address &addr, UnwindPlan &unwind_plan);
+  std::unique_ptr GetUnwindPlan(const Address &addr);
 
   /// Return an UnwindPlan based on the call frame information encoded in the
   /// FDE of this DWARFCallFrameInfo section. The returned plan will be valid
-  /// (at least) for some address in the given range.
-  bool GetUnwindPlan(const AddressRange &range, UnwindPlan &unwind_plan);
+  /// (at least) for some address in the given ranges. If no unwind information
+  /// is found, nullptr is returned. \a addr represents the entry point of the
+  /// function. It corresponds to the offset zero in the returned UnwindPlan.
+  std::unique_ptr GetUnwindPlan(llvm::ArrayRef 
ranges,
+const Address &addr);
 
   typedef RangeVector FunctionAddressAndSizeVector;
 

diff  --git a/lldb/source/Symbol/DWARFCallFrameInfo.cpp 
b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
index a763acb1fdf9e..cb8aa8a26c3f1 100644
--- a/lldb/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/lldb/source/Symbol/DWARFCallFrameInfo.cpp
@@ -151,53 +151,57 @@ DWARFCallFrameInfo::DWARFCallFrameInfo(ObjectFile 
&objfile,
SectionSP §ion_sp, Type type)
 : m_objfile(objfile), m_section_sp(section_sp), m_type(type) {}
 
-bool DWARFCallFrameInfo::GetUnwindPlan(const Address &addr,
-   UnwindPlan &unwind_plan) {
-  return GetUnwindPlan(AddressRange(addr, 1), unwind_plan);
+std::unique_ptr
+DWARFCallFrameInfo::GetUnwindPlan(const Address &addr) {
+  return GetUnwindPlan({AddressRange(addr, 1)}, addr);
 }
 
-bool DWARFCallFrameInfo::GetUnwindPlan(const AddressRange &range,
-   UnwindPlan &unwind_plan) {
+std::unique_ptr
+DWARFCallFrameInfo::GetUnwindPlan(llvm::ArrayRef ranges,
+  const Address &addr) {
   FDEEntryMap::Entry fde_entry;
-  Address addr = range.GetBaseAddress();
 
   // Make sure that the Address we're searching for is the same object file as
   // this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
   ModuleSP module_sp = addr.GetModule();
   if (module_sp.get() == nullptr || module_sp->GetObjectFile() == nullptr ||
   

[Lldb-commits] [lldb] [lldb] Call Target::ClearAllLoadedSections earlier (PR #138892)

2025-05-07 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Pavel Labath (labath)


Changes

Minidump files contain explicit information about load addresses of modules, so 
it can load them itself. This works on other platforms, but fails on darwin 
because DynamicLoaderDarwin nukes the loaded module list on initialization 
(which happens after the core file plugin has done its work).

This used to work until #109477, which enabled the dynamic loader 
plugins for minidump files in order to get them to provide access to TLS.

Clearing the load list makes sense, but I think we could do it earlier in the 
process, so that both Process and DynamicLoader plugins get a chance to load 
modules. This patch does that by calling the function early in the 
launch/attach/load core flows.

This fixes TestDynamicValue.py:test_from_core_file on darwin.

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


3 Files Affected:

- (modified) 
lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp (-1) 
- (modified) lldb/source/Target/Process.cpp (+4) 
- (modified) lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py (-1) 


``diff
diff --git 
a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp 
b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index e25c4ff55e408..8bf01aa168342 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -871,7 +871,6 @@ void DynamicLoaderDarwin::PrivateInitialize(Process 
*process) {
StateAsCString(m_process->GetState()));
   Clear(true);
   m_process = process;
-  m_process->GetTarget().ClearAllLoadedSections();
 }
 
 // Member function that gets called when the process state changes.
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 13ff12b4ff953..7c5512598bbb6 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2763,6 +2763,7 @@ Status Process::LaunchPrivate(ProcessLaunchInfo 
&launch_info, StateType &state,
   }
 
   if (state == eStateStopped || state == eStateCrashed) {
+GetTarget().ClearAllLoadedSections();
 DidLaunch();
 
 // Now that we know the process type, update its signal responses from the
@@ -2799,6 +2800,7 @@ Status Process::LaunchPrivate(ProcessLaunchInfo 
&launch_info, StateType &state,
 }
 
 Status Process::LoadCore() {
+  GetTarget().ClearAllLoadedSections();
   Status error = DoLoadCore();
   if (error.Success()) {
 ListenerSP listener_sp(
@@ -3094,6 +3096,8 @@ void Process::CompleteAttach() {
   Log *log(GetLog(LLDBLog::Process | LLDBLog::Target));
   LLDB_LOGF(log, "Process::%s()", __FUNCTION__);
 
+  GetTarget().ClearAllLoadedSections();
+
   // Let the process subclass figure out at much as it can about the process
   // before we go looking for a dynamic loader plug-in.
   ArchSpec process_arch;
diff --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py 
b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index cd95a9ff3fe8c..faa35421ff60b 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -282,7 +282,6 @@ def test_from_forward_decl(self):
 
 @no_debug_info_test
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
-@expectedFailureDarwin  # dynamic loader unloads modules
 @expectedFailureAll(archs=["arm"]) # Minidump saving not implemented
 def test_from_core_file(self):
 """Test fetching C++ dynamic values from core files. Specifically, test

``




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


[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

Looking at the logs, the common theme appears to be that all the test binaries 
exit before they hit any breakpoints. My best guess as to why this is only 
happening on Windows is the way the dynamic loader there works. If that's the 
case, then it means that those tests are missing necessary synchronization and 
we just happen to get away with it on Linux and Darwin.

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


[Lldb-commits] [lldb] [lldb] Call Target::ClearAllLoadedSections earlier (PR #138892)

2025-05-07 Thread Pavel Labath via lldb-commits

https://github.com/labath created 
https://github.com/llvm/llvm-project/pull/138892

Minidump files contain explicit information about load addresses of modules, so 
it can load them itself. This works on other platforms, but fails on darwin 
because DynamicLoaderDarwin nukes the loaded module list on initialization 
(which happens after the core file plugin has done its work).

This used to work until #109477, which enabled the dynamic loader plugins for 
minidump files in order to get them to provide access to TLS.

Clearing the load list makes sense, but I think we could do it earlier in the 
process, so that both Process and DynamicLoader plugins get a chance to load 
modules. This patch does that by calling the function early in the 
launch/attach/load core flows.

This fixes TestDynamicValue.py:test_from_core_file on darwin.

>From 8e2e42ee48cdd660214872e25dcf4ab64445f413 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Wed, 7 May 2025 11:12:22 +0200
Subject: [PATCH] [lldb] Call Target::ClearAllLoadedSections earlier

Minidump files contain explicit information about load addresses of
modules, so it can load them itself. This works on other platforms, but
fails on darwin because DynamicLoaderDarwin nukes the loaded module list
on initialization (which happens after the core file plugin has done its
work).

This used to work until #109477, which enabled the dynamic loader
plugins for minidump files in order to get them to provide access to
TLS.

Clearing the load list makes sense, but I think we could do it earlier
in the process, so that both Process and DynamicLoader plugins get a
chance to load modules. This patch does that by calling the function
early in the launch/attach/load core flows.

This fixes TestDynamicValue.py:test_from_core_file on darwin.
---
 .../Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp | 1 -
 lldb/source/Target/Process.cpp| 4 
 lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py  | 1 -
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp 
b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index e25c4ff55e408..8bf01aa168342 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -871,7 +871,6 @@ void DynamicLoaderDarwin::PrivateInitialize(Process 
*process) {
StateAsCString(m_process->GetState()));
   Clear(true);
   m_process = process;
-  m_process->GetTarget().ClearAllLoadedSections();
 }
 
 // Member function that gets called when the process state changes.
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 13ff12b4ff953..7c5512598bbb6 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2763,6 +2763,7 @@ Status Process::LaunchPrivate(ProcessLaunchInfo 
&launch_info, StateType &state,
   }
 
   if (state == eStateStopped || state == eStateCrashed) {
+GetTarget().ClearAllLoadedSections();
 DidLaunch();
 
 // Now that we know the process type, update its signal responses from the
@@ -2799,6 +2800,7 @@ Status Process::LaunchPrivate(ProcessLaunchInfo 
&launch_info, StateType &state,
 }
 
 Status Process::LoadCore() {
+  GetTarget().ClearAllLoadedSections();
   Status error = DoLoadCore();
   if (error.Success()) {
 ListenerSP listener_sp(
@@ -3094,6 +3096,8 @@ void Process::CompleteAttach() {
   Log *log(GetLog(LLDBLog::Process | LLDBLog::Target));
   LLDB_LOGF(log, "Process::%s()", __FUNCTION__);
 
+  GetTarget().ClearAllLoadedSections();
+
   // Let the process subclass figure out at much as it can about the process
   // before we go looking for a dynamic loader plug-in.
   ArchSpec process_arch;
diff --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py 
b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index cd95a9ff3fe8c..faa35421ff60b 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -282,7 +282,6 @@ def test_from_forward_decl(self):
 
 @no_debug_info_test
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
-@expectedFailureDarwin  # dynamic loader unloads modules
 @expectedFailureAll(archs=["arm"]) # Minidump saving not implemented
 def test_from_core_file(self):
 """Test fetching C++ dynamic values from core files. Specifically, test

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


[Lldb-commits] [lldb] [lldb] Fix offset computation in RegisterContextUnwind (PR #137155)

2025-05-07 Thread Pavel Labath via lldb-commits

https://github.com/labath updated 
https://github.com/llvm/llvm-project/pull/137155



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [lldb] Fix offset computation in RegisterContextUnwind (PR #137155)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Provide lr value in faulting frame on arm64 (PR #138805)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

This makes sense to me, but is there any way to write a test case for it?

It sounds like something similar to [this 
test](https://github.com/llvm/llvm-project/blob/main/lldb/test/Shell/Unwind/signal-in-leaf-function-aarch64.test)
 could work. In fact, given that this test is disabled on darwin, I'm wondering 
if this patch does not fix it by any chance?

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


[Lldb-commits] [lldb] b643a52 - [lldb][debugserver] Add missing include to DNBTimer.h

2025-05-07 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T11:04:51+02:00
New Revision: b643a529dcd2b1b2e4e81c3be427edfcadc6d8fa

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

LOG: [lldb][debugserver] Add missing include to DNBTimer.h

Added: 


Modified: 
lldb/tools/debugserver/source/DNBTimer.h

Removed: 




diff  --git a/lldb/tools/debugserver/source/DNBTimer.h 
b/lldb/tools/debugserver/source/DNBTimer.h
index ad15154245f35..cc409cfa7a57c 100644
--- a/lldb/tools/debugserver/source/DNBTimer.h
+++ b/lldb/tools/debugserver/source/DNBTimer.h
@@ -16,6 +16,7 @@
 #include "DNBDefs.h"
 #include 
 #include 
+#include 
 #include 
 
 class DNBTimer {



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


[Lldb-commits] [lldb] [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (PR #137978)

2025-05-07 Thread Pavel Labath via lldb-commits

https://github.com/labath updated 
https://github.com/llvm/llvm-project/pull/137978

>From 4eb94714ec3c8249fbccb10c2cfd29f8c45b9a07 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Thu, 9 Jan 2025 15:32:11 +0100
Subject: [PATCH 1/2] [lldb] Inherit DuplicateFileAction(HANDLE, HANDLE)
 handles on windows

This is a follow-up to #126935, which enables passing handles to a child
process on windows systems. Unlike on unix-like systems, the handles
need to be created with the "inheritable" flag because there's to way to
change the flag value after it has been created. This is why I don't
respect the child_process_inherit flag but rather always set the flag to
true. (My next step is to delete the flag entirely.)

This does mean that pipe may be created as inheritable even if its not
necessary, but I think this is offset by the fact that windows (unlike
unixes, which pass all ~O_CLOEXEC descriptors through execve and *all*
descriptors through fork) has a way to specify the precise set of
handles to pass to a specific child process.

If this turns out to be insufficient, instead of a constructor flag, I'd
rather go with creating a separate api to create an inheritable copy of
a handle (as typically, you only want to inherit one end of the pipe).
---
 lldb/source/Host/windows/PipeWindows.cpp  |  5 +-
 .../Host/windows/ProcessLauncherWindows.cpp   | 73 +++
 lldb/tools/lldb-server/lldb-platform.cpp  |  2 -
 lldb/unittests/Host/HostTest.cpp  |  2 -
 4 files changed, 63 insertions(+), 19 deletions(-)

diff --git a/lldb/source/Host/windows/PipeWindows.cpp 
b/lldb/source/Host/windows/PipeWindows.cpp
index e3f5b629a0590..1f7f6e03519d0 100644
--- a/lldb/source/Host/windows/PipeWindows.cpp
+++ b/lldb/source/Host/windows/PipeWindows.cpp
@@ -88,8 +88,9 @@ Status PipeWindows::CreateNew(llvm::StringRef name,
   std::string pipe_path = g_pipe_name_prefix.str();
   pipe_path.append(name.str());
 
-  SECURITY_ATTRIBUTES sa{sizeof(SECURITY_ATTRIBUTES), 0,
- child_process_inherit ? TRUE : FALSE};
+  // We always create inheritable handles, but we won't pass them to a child
+  // process unless explicitly requested (cf. ProcessLauncherWindows.cpp).
+  SECURITY_ATTRIBUTES sa{sizeof(SECURITY_ATTRIBUTES), 0, TRUE};
 
   // Always open for overlapped i/o.  We implement blocking manually in Read
   // and Write.
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp 
b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index 065ba9271ad0d..bc35667ea9a23 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -10,6 +10,7 @@
 #include "lldb/Host/HostProcess.h"
 #include "lldb/Host/ProcessLaunchInfo.h"
 
+#include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/Support/ConvertUTF.h"
 #include "llvm/Support/Program.h"
@@ -65,14 +66,23 @@ ProcessLauncherWindows::LaunchProcess(const 
ProcessLaunchInfo &launch_info,
 
   std::string executable;
   std::vector environment;
-  STARTUPINFO startupinfo = {};
+  STARTUPINFOEX startupinfoex = {};
+  STARTUPINFO &startupinfo = startupinfoex.StartupInfo;
   PROCESS_INFORMATION pi = {};
 
   HANDLE stdin_handle = GetStdioHandle(launch_info, STDIN_FILENO);
   HANDLE stdout_handle = GetStdioHandle(launch_info, STDOUT_FILENO);
   HANDLE stderr_handle = GetStdioHandle(launch_info, STDERR_FILENO);
-
-  startupinfo.cb = sizeof(startupinfo);
+  auto close_handles = llvm::make_scope_exit([&] {
+if (stdin_handle)
+  ::CloseHandle(stdin_handle);
+if (stdout_handle)
+  ::CloseHandle(stdout_handle);
+if (stderr_handle)
+  ::CloseHandle(stderr_handle);
+  });
+
+  startupinfo.cb = sizeof(startupinfoex);
   startupinfo.dwFlags |= STARTF_USESTDHANDLES;
   startupinfo.hStdError =
   stderr_handle ? stderr_handle : ::GetStdHandle(STD_ERROR_HANDLE);
@@ -81,6 +91,48 @@ ProcessLauncherWindows::LaunchProcess(const 
ProcessLaunchInfo &launch_info,
   startupinfo.hStdOutput =
   stdout_handle ? stdout_handle : ::GetStdHandle(STD_OUTPUT_HANDLE);
 
+  std::vector inherited_handles;
+  if (startupinfo.hStdError)
+inherited_handles.push_back(startupinfo.hStdError);
+  if (startupinfo.hStdInput)
+inherited_handles.push_back(startupinfo.hStdInput);
+  if (startupinfo.hStdOutput)
+inherited_handles.push_back(startupinfo.hStdOutput);
+
+  size_t attributelist_size = 0;
+  InitializeProcThreadAttributeList(/*lpAttributeList=*/nullptr,
+/*dwAttributeCount=*/1, /*dwFlags=*/0,
+&attributelist_size);
+
+  startupinfoex.lpAttributeList =
+  static_cast(malloc(attributelist_size));
+  auto free_attributelist =
+  llvm::make_scope_exit([&] { free(startupinfoex.lpAttributeList); });
+  if (!InitializeProcThreadAttributeList(startupinfoex.lpAttributeList,
+ /*dwAttributeCount=*/1, /*dwFlags=*/0,
+ 

[Lldb-commits] [lldb] [lldb-dap] Format extension typescript. (PR #138925)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

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

LGTM. Can we automate this with package.json?

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


[Lldb-commits] [lldb] [lldb-dap] Format extension typescript. (PR #138925)

2025-05-07 Thread John Harrison via lldb-commits

ashgti wrote:

I'm not sure, clang-format can format .json and .js/.ts files but I think the 
current config isn't applying it to those files. 

https://github.com/llvm/llvm-project/blob/main/llvm/utils/git/code-format-helper.py
 doesn't apply to those file extensions. We may be able to update that to use 
clang-format for these files, although the `npm run format` script is applying 
the prettier format.

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


[Lldb-commits] [lldb] [lldb] Use -Wno-documentation-deprecated-sync if available (PR #138909)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb-dap] Fix package.json after a bad merge. (PR #138918)

2025-05-07 Thread John Harrison via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Use -Wno-documentation-deprecated-sync if available (PR #138909)

2025-05-07 Thread Kazu Hirata via lldb-commits

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


[Lldb-commits] [lldb] 47218ea - [lldb] Use -Wno-documentation-deprecated-sync if available (#138909)

2025-05-07 Thread via lldb-commits

Author: Kazu Hirata
Date: 2025-05-07T11:14:28-07:00
New Revision: 47218eadd8adf1926ced879caa50b8885d1b070d

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

LOG: [lldb] Use -Wno-documentation-deprecated-sync if available (#138909)

report_fatal_error has been marked "@deprecated" in its comment, but
the function itself is not marked with [[deprecated]] yet.  This
causes warnings like:

  llvm/include/llvm/Support/ErrorHandling.h:61:6: error: declaration
  is marked with '@deprecated' command but does not have a deprecation
  attribute [-Werror,-Wdocumentation-deprecated-sync]

  llvm/include/llvm/Support/Error.h:738:6: error: declaration is
  marked with '@deprecated' command but does not have a deprecation
  attribute [-Werror,-Wdocumentation-deprecated-sync]

This patch disables the warning while we migrate away from
report_fatal_error.

Added: 


Modified: 
lldb/unittests/API/CMakeLists.txt

Removed: 




diff  --git a/lldb/unittests/API/CMakeLists.txt 
b/lldb/unittests/API/CMakeLists.txt
index 8bdc806878239..06ac49244176c 100644
--- a/lldb/unittests/API/CMakeLists.txt
+++ b/lldb/unittests/API/CMakeLists.txt
@@ -16,6 +16,17 @@ if (CXX_SUPPORTS_DOCUMENTATION)
 PRIVATE -Wdocumentation)
 endif()
 
+# Apply -Wno-documentation-deprecated-sync while we migrate away from
+# report_fatal_error in llvm/include/llvm/Support/ErrorHandling.h
+# and llvm/include/llvm/Support/Error.h.
+# Remove this block of code when the migration is complete.
+# See https://github.com/llvm/llvm-project/issues/138914.
+check_cxx_compiler_flag("-Wno-documentation-deprecated-sync"
+CXX_SUPPORTS_NO_DOCUMENTATION_DEPRECATED_SYNC)
+if (CXX_SUPPORTS_NO_DOCUMENTATION_DEPRECATED_SYNC)
+  target_compile_options(APITests
+PRIVATE -Wno-documentation-deprecated-sync)
+endif()
 
 if(Python3_RPATH)
   set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${Python3_RPATH}")



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


[Lldb-commits] [lldb] Reapply "[lldb] Inherit DuplicateFileAction(HANDLE, HANDLE) handles on windows (#137978)" (PR #138896)

2025-05-07 Thread Dmitry Vasilyev via lldb-commits

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

I have tested the failed Host.LaunchProcessDuplicatesHandle test on the setup 
similar to 
[lldb-remote-linux-win](https://lab.llvm.org/buildbot/#/builders/197). It is 
fixed now.

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


[Lldb-commits] [lldb] 854b9e9 - [lldb-dap] Format extension typescript. (#138925)

2025-05-07 Thread via lldb-commits

Author: John Harrison
Date: 2025-05-07T11:49:53-07:00
New Revision: 854b9e931703dd1b9d8a2b0fe8da787f9e26058d

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

LOG: [lldb-dap] Format extension typescript. (#138925)

I think the format checker isn't checking typescript files. I ran `npm
run format` to fix the extenion typescript.

Added: 


Modified: 
lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
lldb/tools/lldb-dap/src-ts/uri-launch-handler.ts

Removed: 




diff  --git a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts 
b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
index 8a4089008b2f9..c91b101f4a9ba 100644
--- a/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
+++ b/lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts
@@ -21,79 +21,97 @@ async function isServerModeSupported(exe: string): 
Promise {
 }
 
 interface BoolConfig {
-  type: 'boolean';
+  type: "boolean";
   default: boolean;
 }
 interface StringConfig {
-  type: 'string';
+  type: "string";
   default: string;
 }
 interface NumberConfig {
-  type: 'number';
+  type: "number";
   default: number;
 }
 interface StringArrayConfig {
-  type: 'stringArray';
+  type: "stringArray";
   default: string[];
 }
-type DefaultConfig = BoolConfig | NumberConfig | StringConfig | 
StringArrayConfig;
+type DefaultConfig =
+  | BoolConfig
+  | NumberConfig
+  | StringConfig
+  | StringArrayConfig;
 
 const configurations: Record = {
   // Keys for debugger configurations.
-  "commandEscapePrefix": { type: "string", default: "`" },
-  "customFrameFormat": { type: "string", default: "" },
-  "customThreadFormat": { type: "string", default: "" },
-  "detachOnError": { type: "boolean", default: false },
-  "disableASLR": { type: "boolean", default: true },
-  "disableSTDIO": { type: "boolean", default: false },
-  "displayExtendedBacktrace": { type: "boolean", default: false },
-  "enableAutoVariableSummaries": { type: "boolean", default: false },
-  "enableSyntheticChildDebugging": { type: "boolean", default: false },
-  "timeout": { type: "number", default: 30 },
+  commandEscapePrefix: { type: "string", default: "`" },
+  customFrameFormat: { type: "string", default: "" },
+  customThreadFormat: { type: "string", default: "" },
+  detachOnError: { type: "boolean", default: false },
+  disableASLR: { type: "boolean", default: true },
+  disableSTDIO: { type: "boolean", default: false },
+  displayExtendedBacktrace: { type: "boolean", default: false },
+  enableAutoVariableSummaries: { type: "boolean", default: false },
+  enableSyntheticChildDebugging: { type: "boolean", default: false },
+  timeout: { type: "number", default: 30 },
 
   // Keys for platform / target configuration.
-  "platformName": { type: "string", default: "" },
-  "targetTriple": { type: "string", default: "" },
+  platformName: { type: "string", default: "" },
+  targetTriple: { type: "string", default: "" },
 
   // Keys for debugger command hooks.
-  "initCommands": { type: "stringArray", default: [] },
-  "preRunCommands": { type: "stringArray", default: [] },
-  "postRunCommands": { type: "stringArray", default: [] },
-  "stopCommands": { type: "stringArray", default: [] },
-  "exitCommands": { type: "stringArray", default: [] },
-  "terminateCommands": { type: "stringArray", default: [] },
+  initCommands: { type: "stringArray", default: [] },
+  preRunCommands: { type: "stringArray", default: [] },
+  postRunCommands: { type: "stringArray", default: [] },
+  stopCommands: { type: "stringArray", default: [] },
+  exitCommands: { type: "stringArray", default: [] },
+  terminateCommands: { type: "stringArray", default: [] },
 };
 
 export class LLDBDapConfigurationProvider
-  implements vscode.DebugConfigurationProvider {
-  constructor(private readonly server: LLDBDapServer) { }
+  implements vscode.DebugConfigurationProvider
+{
+  constructor(private readonly server: LLDBDapServer) {}
 
   async resolveDebugConfiguration(
 folder: vscode.WorkspaceFolder | undefined,
 debugConfiguration: vscode.DebugConfiguration,
-token?: vscode.CancellationToken): Promise {
-let config = vscode.workspace.getConfiguration('lldb-dap.defaults');
+token?: vscode.CancellationToken,
+  ): Promise {
+let config = vscode.workspace.getConfiguration("lldb-dap.defaults");
 for (const [key, cfg] of Object.entries(configurations)) {
-  if (Reflect.has(debugConfiguration, key)) continue;
+  if (Reflect.has(debugConfiguration, key)) {
+continue;
+  }
   const value = config.get(key);
-  if (value === cfg.default) continue;
+  if (!value || value === cfg.default) {
+continue;
+  }
   switch (cfg.type) {
-case 'string':
-  if (typeof value !==

[Lldb-commits] [lldb] [lldb-dap] Format extension typescript. (PR #138925)

2025-05-07 Thread John Harrison via lldb-commits

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


[Lldb-commits] [lldb] [lldb][test] Disable flaky test_qThreadInfo_matches_qC_attach test on AArch64 Linux (PR #138940)

2025-05-07 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Dmitry Vasilyev (slydiman)


Changes

See #138085 for details.
https://lab.llvm.org/buildbot/#/builders/59/builds/16937 
https://lab.llvm.org/buildbot/#/builders/59/builds/17224


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


1 Files Affected:

- (modified) lldb/test/API/tools/lldb-server/TestLldbGdbServer.py (+7) 


``diff
diff --git a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py 
b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
index 2c328125e3058..67690a275f0da 100644
--- a/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
+++ b/lldb/test/API/tools/lldb-server/TestLldbGdbServer.py
@@ -202,6 +202,13 @@ def test_qThreadInfo_matches_qC_launch(self):
 self.set_inferior_startup_launch()
 self.qThreadInfo_matches_qC()
 
+# This test is flaky on AArch64 Linux. Sometimes it causes an unhandled 
Error:
+# Operation not permitted in 
lldb_private::process_linux::NativeProcessLinux::Attach(int).
+@skipIf(
+oslist=["linux"],
+archs=["aarch64"],
+bugnumber="github.com/llvm/llvm-project/issues/138085",
+)
 @expectedFailureAll(oslist=["windows"])  # expect one more thread stopped
 def test_qThreadInfo_matches_qC_attach(self):
 self.build()

``




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


[Lldb-commits] [lldb] [lldb][test] Disable flaky test_qThreadInfo_matches_qC_attach test on AArch64 Linux (PR #138940)

2025-05-07 Thread Dmitry Vasilyev via lldb-commits

https://github.com/slydiman created 
https://github.com/llvm/llvm-project/pull/138940

See #138085 for details.
https://lab.llvm.org/buildbot/#/builders/59/builds/16937 
https://lab.llvm.org/buildbot/#/builders/59/builds/17224




  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [DRAFT][lldb][RPC] Design doc for upstreaming PR (PR #138612)

2025-05-07 Thread David Spickett via lldb-commits


@@ -0,0 +1,94 @@
+LLDB RPC Upstreaming Design Doc
+===
+
+This document aims to explain the general structure of the upstreaming patches 
for adding LLDB RPC. The 2 primary concepts explained here will be:
+
+* How LLDB RPC is used
+* How the ``lldb-rpc-gen`` works and what it outputs
+
+LLDB RPC
+*
+
+LLDB RPC is a framework by which processes can communicate with LLDB out of 
process while maintaining compatibility with the SB API. More details are 
explained in the 
`RFC`_ for 
upstreaming LLDB RPC, but the main focus in this doc for this section will be 
how exactly the code is structured for the PRs that will upstream this code.
+
+The ``lldb-rpc-gen`` tool
+*
+
+``lldb-rpc-gen`` is the tool that generates the main client and server 
interfaces for LLDB RPC. It is a ``ClangTool`` that reads all SB API header 
files and their functions and outputs the client/server interfaces and certain 
other pieces of code, such as RPC-specfic versions of Python bindings used for 
the test suite. There's 3 main components behind ``lldb-rpc-gen``:
+
+1. The ``lldb-rpc-gen`` tool itself, which contains the main driver that uses 
the ``ClangTool``.
+2. The code that generates all interfaces, which we call "emitters". All 
generated code for the interfaces are in C++, so the server side has one 
emitter for its generated source code and another for its generated header 
code. The client side has the same.
+3. All common code shared between all emitters, such as helper methods and 
information about exceptions to take when emitting.
+
+The `current PR`_ up for 
upstreaming LLDB RPC upstreams a subset of the code used for the tool. It 
upstreams the ``lldb-rpc-gen`` tool and all code needed for the server side 
emitters. Here's an example of what ``lldb-rpc-gen`` will output for the server 
side interface:
+
+Input
+-
+
+We'll use ``SBDebugger::CreateTarget(const char *filename)`` as an example. 
``lldb-rpc-gen`` will read this method from ``SBDebugger.h``. The output is as 
follows.
+
+Source Code Output
+--
+
+::
+
+   bool 
rpc_server::_ZN4lldb10SBDebugger12CreateTargetEPKc::HandleRPCCall(rpc_common::Connection
 &connection, RPCStream &send, RPCStream &response) {
+   // 1) Make local storage for incoming function arguments
+   lldb::SBDebugger *this_ptr = nullptr;
+   rpc_common::ConstCharPointer filename;
+   // 2) Decode all function arguments
+   this_ptr = RPCServerObjectDecoder(send, 
rpc_common::RPCPacket::ValueType::Argument);
+   if (!this_ptr)
+   return false;
+   if (!RPCValueDecoder(send, rpc_common::RPCPacket::ValueType::Argument, 
filename))
+   return false;
+   // 3) Call the method and encode the return value
+   lldb::SBTarget && __result = this_ptr->CreateTarget(filename.c_str());
+   RPCServerObjectEncoder(response, 
rpc_common::RPCPacket::ValueType::ReturnValue, std::move(__result));
+   return true;
+   }
+
+Function signature
+~~
+
+All server-side source code functions have a function signature that take the 
format ``bool 
rpc_serverHandleRPCCall(rpc_common::Connection 
&connection, RPCStream &send, RPCStream &response)``. Here the ``connection`` 
is what's maintained between the client and server. The ``send`` variable is a 
byte stream that carries information sent from the client. ``response`` is also 
a byte stream that will be populated with the return value obtained from the 
call into the SB API function that will be sent back to the client.

DavidSpickett wrote:

Ok so the thing you need to do is differentiate overloads, and mangled names 
are designed to do exactly that. Got it.

Please add that justification to the doc.

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


[Lldb-commits] [lldb] [LLDB] Add array subscription and integer parsing to DIL (PR #138551)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

> Why is that a bad thing? Can we do math operations later without types? Plus 
> it's a unified interface, node evaluation returns a `ValueObject`.
> 
> > ...
> 
> I mean... this works and is a basis for future patches, why remove something 
> that we will have to bring back shortly afterwards? After replacing frame 
> var, DIL will just have a little bit of extra capabilities, like using 
> another variable as an index.

Because I wanted to avoid this getting bogged down in the discussion about the 
types of numbers. I don't really mind the "extra capability" of indexing an 
array with a another variable. The part I have problem with is the precedent it 
sets about the representation of numbers. 

You're right that we can't do math operations without (implicitly or 
explicitly) assigning them some type, but that's exactly the part I think needs 
more discussion. Right now, you're assigning the type based on the first type 
system you find (which is likely going to be C), but I think that's not a good 
choice. If you're debugging some swift code, I think you'd be surprised if `47` 
resolves to a C type.

Using the type system of the currently selected frame might be better, but I'm 
not convinced that the right choice either. Since you support looking up global 
variables you can easily end up with a global variable from a different 
language, and then we have the question of what to do with expressions like 
`global_c_variable+(__swift int)1`. Normally, I would think we can just say we 
don't support arithmetic on values from different type systems, but if 
constants can end up with a foreign type system because of the context, then 
we'd probably want to support working with those.. somehow.

Which brings me to another idea which might work (but again, I'm not saying 
it's the right one), which is to give constants some neutral type -- for 
example, the one (implicitly) defined by the operations on the `Scalar` class, 
and only convert it to a specific type system once it starts interacting with 
one. Or maybe do it the other way around, and convert everything into a Scalar 
once we start doing arithmetic.

My point is: the space of possible options is very big here, but none of this 
is necessary to make array indexing (with a constant) work. I agree with your 
"it works" assertion (but I think that a much simpler implementation would also 
"work"), but not with the "it's a basis for future patches" part. I think that 
part needs more discussion.

I don't think you need to change the evaluation interface for this -- yet. It's 
true that some of the ideas above would require that, but that's very much in 
the air. For now, it should be sufficient to make the array index a raw integer 
(instead of an AST node). Then there's nothing to evaluate, and you can just 
directly take the number and index with it.

> We still need to implement bit extraction that current `frame var` allows, 
> which looks like this: `integer[4-8]`, another node we will have to 
> re-implement later if we redo how numbers are stored now.

Oh wow, I didn't even know that existed. I guess that means we should implement 
that as well, but I don't think it changes the equation fundamentally. Right 
now, the two numbers can be stored as... numbers, and later that could be 
changed to a recursive `Evaluate` call. It should be a local change, if we end 
up going with the approach you have here. And if we end up with something 
completely different then it will be less code to change, as this 
implementation will be simpler.

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


[Lldb-commits] [lldb] [lldb][AArch64] Fix Apple M4 on Linux (PR #135563)

2025-05-07 Thread David Spickett via lldb-commits

DavidSpickett wrote:

>From what I've seen, this is a decent start but there are further issues to be 
>dealt with. Details on https://github.com/llvm/llvm-project/issues/138717.

I have to work on some other SME changes first, so it will be a few weeks until 
I can do anything for this. @laverdet if you want to pursue this yourself in 
the meantime, feel free to do so.

In which case you will find https://lldb.llvm.org/resources/debugging.html# 
useful, and you can try setting up the Foundation Model to test SVE+SME if you 
want, but since I'll want to test the changes myself anyway, easier to leave 
that to me.

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


[Lldb-commits] [lldb] [lldb] Provide lr value in faulting frame on arm64 (PR #138805)

2025-05-07 Thread Jason Molenda via lldb-commits

jasonmolenda wrote:

I am also not thrilled with the GetAsKind method for register numbering 
returning LLDB_INVALID_REGNUM, the code reads so poorly in this method because 
of it.  But returning an optional would make other code more verbose unless I 
carried optionals through a lot further.  I haven't been annoyed enough to try 
doing that yet.

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


[Lldb-commits] [lldb] 47c7e73 - Revert "[lldb-dap] Change the launch sequence (#138219)"

2025-05-07 Thread David Spickett via lldb-commits

Author: David Spickett
Date: 2025-05-07T09:11:09Z
New Revision: 47c7e73e5763f81f218cc4e1eae306d0427aa42d

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

LOG: Revert "[lldb-dap] Change the launch sequence (#138219)"

This reverts commit ba29e60f9abd5e883579bb78db13fc5a7588.

As it broke tests on Windows on Arm: 
https://lab.llvm.org/buildbot/#/builders/141/builds/8500


Unresolved Tests (2):
  lldb-api :: tools/lldb-dap/completions/TestDAP_completions.py
  lldb-api :: tools/lldb-dap/startDebugging/TestDAP_startDebugging.py

Timed Out Tests (1):
  lldb-api :: tools/lldb-dap/send-event/TestDAP_sendEvent.py

Failed Tests (6):
  lldb-api :: tools/lldb-dap/console/TestDAP_console.py
  lldb-api :: tools/lldb-dap/console/TestDAP_redirection_to_console.py
  lldb-api :: tools/lldb-dap/launch/TestDAP_launch.py
  lldb-api :: tools/lldb-dap/stackTrace/TestDAP_stackTrace.py
  lldb-api :: 
tools/lldb-dap/stackTraceDisassemblyDisplay/TestDAP_stackTraceDisassemblyDisplay.py
  lldb-api :: tools/lldb-dap/variables/children/TestDAP_variables_children.py

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py
lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
lldb/test/API/tools/lldb-dap/breakpoint-events/TestDAP_breakpointEvents.py
lldb/test/API/tools/lldb-dap/completions/TestDAP_completions.py
lldb/test/API/tools/lldb-dap/console/TestDAP_console.py
lldb/test/API/tools/lldb-dap/disconnect/TestDAP_disconnect.py
lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py
lldb/test/API/tools/lldb-dap/progress/TestDAP_Progress.py
lldb/test/API/tools/lldb-dap/repl-mode/TestDAP_repl_mode_detection.py
lldb/test/API/tools/lldb-dap/restart/TestDAP_restart.py
lldb/test/API/tools/lldb-dap/restart/TestDAP_restart_runInTerminal.py
lldb/test/API/tools/lldb-dap/stop-hooks/TestDAP_stop_hooks.py
lldb/tools/lldb-dap/DAP.cpp
lldb/tools/lldb-dap/DAP.h
lldb/tools/lldb-dap/EventHelper.cpp
lldb/tools/lldb-dap/Handler/AttachRequestHandler.cpp
lldb/tools/lldb-dap/Handler/ConfigurationDoneRequestHandler.cpp
lldb/tools/lldb-dap/Handler/InitializeRequestHandler.cpp
lldb/tools/lldb-dap/Handler/LaunchRequestHandler.cpp
lldb/tools/lldb-dap/Handler/RequestHandler.cpp
lldb/tools/lldb-dap/Handler/RequestHandler.h

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py 
b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index e10342b72f4f0..6d9ab770684f1 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -132,6 +132,7 @@ def __init__(self, recv, send, init_commands, 
log_file=None):
 self.exit_status = None
 self.initialize_body = None
 self.thread_stop_reasons = {}
+self.breakpoint_events = []
 self.progress_events = []
 self.reverse_requests = []
 self.module_events = []
@@ -243,6 +244,13 @@ def handle_recv_packet(self, packet):
 self._process_stopped()
 tid = body["threadId"]
 self.thread_stop_reasons[tid] = body
+elif event == "breakpoint":
+# Breakpoint events come in when a breakpoint has locations
+# added or removed. Keep track of them so we can look for them
+# in tests.
+self.breakpoint_events.append(packet)
+# no need to add 'breakpoint' event packets to our packets list
+return keepGoing
 elif event.startswith("progress"):
 # Progress events come in as 'progressStart', 'progressUpdate',
 # and 'progressEnd' events. Keep these around in case test
@@ -404,15 +412,6 @@ def wait_for_stopped(self, timeout=None):
 self.threads = []
 return stopped_events
 
-def wait_for_breakpoint_events(self, timeout=None):
-breakpoint_events = []
-while True:
-event = self.wait_for_event("breakpoint", timeout=timeout)
-if not event:
-break
-breakpoint_events.append(event)
-return breakpoint_events
-
 def wait_for_exited(self):
 event_dict = self.wait_for_event("exited")
 if event_dict is None:
@@ -592,7 +591,6 @@ def request_attach(
 attachCommands=None,
 terminateCommands=None,
 coreFile=None,
-stopOnAttach=True,
   

[Lldb-commits] [lldb] [lldb] print a notice when `source list` paging reaches the end of th… (PR #137515)

2025-05-07 Thread via lldb-commits

hapee wrote:

Hi @JDevlieghere , I've corrected the typos. Could you please review my changes 
again?

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


[Lldb-commits] [lldb] [LLDB] Add array subscription and integer parsing to DIL (PR #138551)

2025-05-07 Thread Pavel Labath via lldb-commits


@@ -280,6 +311,52 @@ void DILParser::BailOut(const std::string &error, uint32_t 
loc,
   m_dil_lexer.ResetTokenIdx(m_dil_lexer.NumLexedTokens() - 1);
 }
 
+// Parse a numeric_literal.
+//
+//  numeric_literal:
+//? Token::numeric_constant ?
+//
+ASTNodeUP DILParser::ParseNumericLiteral() {
+  Expect(Token::numeric_constant);
+  ASTNodeUP numeric_constant = ParseNumericConstant();
+  if (numeric_constant->GetKind() == NodeKind::eErrorNode) {
+BailOut(llvm::formatv("Failed to parse token as numeric-constant: {0}",
+  CurToken()),
+CurToken().GetLocation(), CurToken().GetSpelling().length());
+return std::make_unique();
+  }
+  m_dil_lexer.Advance();
+  return numeric_constant;
+}
+
+static constexpr std::pair type_suffixes[] = {
+{"ull", lldb::eBasicTypeUnsignedLongLong},
+{"ul", lldb::eBasicTypeUnsignedLong},
+{"u", lldb::eBasicTypeUnsignedInt},
+{"ll", lldb::eBasicTypeLongLong},
+{"l", lldb::eBasicTypeLong},
+};
+
+ASTNodeUP DILParser::ParseNumericConstant() {
+  Token token = CurToken();
+  auto spelling = token.GetSpelling();
+  llvm::StringRef spelling_ref = spelling;
+  lldb::BasicType type = lldb::eBasicTypeInt;
+  for (auto [suffix, t] : type_suffixes) {
+if (spelling_ref.consume_back_insensitive(suffix)) {
+  type = t;
+  break;
+}
+  }
+  llvm::APInt raw_value;
+  if (!spelling_ref.getAsInteger(0, raw_value)) {

labath wrote:

It was mentioned (along with `'`) in our discussion on the number format a 
couple of months ago, but I don't think it needs to be implemented right now, 
so :+1:

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


[Lldb-commits] [lldb] [lldb][DataFormatters] Change ExtractIndexFromString to return std::optional (PR #138297)

2025-05-07 Thread Michael Buch via lldb-commits

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


[Lldb-commits] [lldb] [lldb][lldb-dap] Added support for "WriteMemory" request. (PR #131820)

2025-05-07 Thread Santhosh Kumar Ellendula via lldb-commits

https://github.com/santhoshe447 updated 
https://github.com/llvm/llvm-project/pull/131820



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] 1ad57b5 - [LLDB] Add IsCoreDumping to ProcessInstanceInfo (#138580)

2025-05-07 Thread via lldb-commits

Author: Jacob Lalonde
Date: 2025-05-07T09:05:53-07:00
New Revision: 1ad57b58d6ba53be99bd6f2fa928a126c9deb91c

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

LOG: [LLDB] Add IsCoreDumping to ProcessInstanceInfo (#138580)

This is the first useful patch in the series related to enabling
`PTRACE_SEIZE` for processes Coredumping. In order to make the decision
if we want to seize or attach, we need to expose that in processinfo.
Which we acquire by reading it from `/proc/pid/status`

Note that in status it is `CoreDumping` not `Coredumping`, so I kept
with that, even if I prefer `Coredumping`

Added: 


Modified: 
lldb/include/lldb/Utility/ProcessInfo.h
lldb/source/Host/linux/Host.cpp
lldb/unittests/Host/posix/HostTest.cpp

Removed: 




diff  --git a/lldb/include/lldb/Utility/ProcessInfo.h 
b/lldb/include/lldb/Utility/ProcessInfo.h
index 78ade4bbb1ee6..24041faad80bf 100644
--- a/lldb/include/lldb/Utility/ProcessInfo.h
+++ b/lldb/include/lldb/Utility/ProcessInfo.h
@@ -247,6 +247,11 @@ class ProcessInstanceInfo : public ProcessInfo {
 
   std::optional IsZombie() const { return m_zombie; }
 
+  // proc/../status specifies CoreDumping as the field
+  // so we match the case here.
+  void SetIsCoreDumping(bool is_coredumping) { m_coredumping = is_coredumping; 
}
+  std::optional IsCoreDumping() const { return m_coredumping; }
+
   void Dump(Stream &s, UserIDResolver &resolver) const;
 
   static void DumpTableHeader(Stream &s, bool show_args, bool verbose);
@@ -266,6 +271,7 @@ class ProcessInstanceInfo : public ProcessInfo {
   struct timespec m_cumulative_system_time;
   std::optional m_priority_value = std::nullopt;
   std::optional m_zombie = std::nullopt;
+  std::optional m_coredumping = std::nullopt;
 };
 
 typedef std::vector ProcessInstanceInfoList;

diff  --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index 8b475a7ab5003..b5f050426d88b 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -213,6 +213,11 @@ static bool GetStatusInfo(::pid_t Pid, ProcessInstanceInfo 
&ProcessInfo,
 } else if (Line.consume_front("Tgid:")) {
   Line = Line.ltrim();
   Line.consumeInteger(10, Tgid);
+} else if (Line.consume_front("CoreDumping:")) {
+  uint32_t coredumping;
+  Line = Line.ltrim();
+  if (!Line.consumeInteger(2, coredumping))
+ProcessInfo.SetIsCoreDumping(coredumping);
 }
   }
   return true;

diff  --git a/lldb/unittests/Host/posix/HostTest.cpp 
b/lldb/unittests/Host/posix/HostTest.cpp
index 5d50de3524d1e..082edccf4e774 100644
--- a/lldb/unittests/Host/posix/HostTest.cpp
+++ b/lldb/unittests/Host/posix/HostTest.cpp
@@ -115,5 +115,8 @@ TEST_F(HostTest, GetProcessInfoSetsPriority) {
   }
   ASSERT_TRUE(Info.IsZombie().has_value());
   ASSERT_FALSE(Info.IsZombie().value());
+
+  ASSERT_TRUE(Info.IsCoreDumping().has_value());
+  ASSERT_FALSE(Info.IsCoreDumping().value());
 }
 #endif



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


[Lldb-commits] [lldb] [LLDB] Add IsCoreDumping to ProcessInstanceInfo (PR #138580)

2025-05-07 Thread Jacob Lalonde via lldb-commits

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


[Lldb-commits] [lldb] [lldb-dap] Ensure we acquire the SB API lock while handling requests. (PR #137026)

2025-05-07 Thread John Harrison via lldb-commits

ashgti wrote:

So, I was checking this and I see `lldb_dap::DAP::ResetDebuggerState() 
(/data/users/jeffreytan/llvm-sand/external/llvm-project/lldb/tools/lldb-dap/DAP.cpp:1411)`
 in the call stack.

That function doesn't exist in the open source version of lldb-dap. I'm not 
sure what its doing but it looks like its trying to join the event thread.

The `DAP::Loop` call is already cleaning up the event handler when it exits 
(here is the handler 
https://github.com/llvm/llvm-project/blob/32752913b12103431dc392242c3c808afb70bd15/lldb/tools/lldb-dap/DAP.cpp#L935-L939).

I'm not sure I have enough information on this deadlock. Is the 
`ResetDebuggerState` function open sourced somewhere that you could share? Or 
have you considered using the server mode flag to have lldb-dap manage multiple 
sessions?

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


[Lldb-commits] [lldb] [LLDB] Add array subscription and integer parsing to DIL (PR #138551)

2025-05-07 Thread Pavel Labath via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread Pavel Labath via lldb-commits

https://github.com/labath updated 
https://github.com/llvm/llvm-project/pull/138698

>From 663db321027e05736344fe763a5473175f0c90f2 Mon Sep 17 00:00:00 2001
From: Pavel Labath 
Date: Tue, 6 May 2025 16:35:01 +0200
Subject: [PATCH 1/2] [lldb] Fix dynamic type resolutions for core files

We're reading from the object's vtable to determine the pointer to the
full object. The vtable is normally in the "rodata" section of the
executable, which is often not included in the core file because it's
not supposed to change and the debugger can extrapolate its contents
from the executable file. We weren't doing that.

This patch changes the read operation to use the target class (which
falls back onto the executable module as expected) and adds the missing
ReadSignedIntegerFromMemory API. The fix is tested by creating a core
(minidump) file which deliberately omits the vtable pointer.
---
 lldb/include/lldb/Target/Target.h |  5 ++
 .../ItaniumABI/ItaniumABILanguageRuntime.cpp  |  2 +-
 lldb/source/Target/Target.cpp | 11 
 .../cpp/dynamic-value/TestDynamicValue.py | 50 +++
 4 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/lldb/include/lldb/Target/Target.h 
b/lldb/include/lldb/Target/Target.h
index 73f27dc934b46..0d4e11b65339e 100644
--- a/lldb/include/lldb/Target/Target.h
+++ b/lldb/include/lldb/Target/Target.h
@@ -1158,6 +1158,11 @@ class Target : public 
std::enable_shared_from_this,
  Status &error,
  bool force_live_memory = false);
 
+  int64_t ReadSignedIntegerFromMemory(const Address &addr,
+  size_t integer_byte_size,
+  int64_t fail_value, Status &error,
+  bool force_live_memory = false);
+
   uint64_t ReadUnsignedIntegerFromMemory(const Address &addr,
  size_t integer_byte_size,
  uint64_t fail_value, Status &error,
diff --git 
a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
 
b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index 8faf7135217ac..0d068ed5950d5 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -350,7 +350,7 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
   if (offset_to_top_location >= vtable_load_addr)
 return false;
   Status error;
-  const int64_t offset_to_top = m_process->ReadSignedIntegerFromMemory(
+  const int64_t offset_to_top = target.ReadSignedIntegerFromMemory(
   offset_to_top_location, addr_byte_size, INT64_MIN, error);
 
   if (offset_to_top == INT64_MIN)
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index e90e748191a7e..7f61f8689fb95 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2270,6 +2270,17 @@ size_t Target::ReadScalarIntegerFromMemory(const Address 
&addr, uint32_t byte_si
   return 0;
 }
 
+int64_t Target::ReadSignedIntegerFromMemory(const Address &addr,
+size_t integer_byte_size,
+int64_t fail_value, Status &error,
+bool force_live_memory) {
+  Scalar scalar;
+  if (ReadScalarIntegerFromMemory(addr, integer_byte_size, false, scalar, 
error,
+  force_live_memory))
+return scalar.SLongLong(fail_value);
+  return fail_value;
+}
+
 uint64_t Target::ReadUnsignedIntegerFromMemory(const Address &addr,
size_t integer_byte_size,
uint64_t fail_value, Status 
&error,
diff --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py 
b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index 634bd13d7c71a..b15b5f1dde377 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -279,3 +279,53 @@ def test_from_forward_decl(self):
 "frame var -d run-target --ptr-depth=1 --show-types a",
 substrs=["(B *) a", "m_b_value = 10"],
 )
+
+@no_debug_info_test
+@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
+def test_from_core_file(self):
+"""Test fetching C++ dynamic values from core files. Specifically, test
+that we can determine the dynamic type of the value if the core file
+does not contain the type vtable."""
+self.build()
+lldbutil.run_to_name_breakpoint(self, "take_A")
+
+# Get the address of our object and its vtable
+a = self.frame().FindVariable("a")
+self.assertSuccess(a.GetE

[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)

2025-05-07 Thread Pavel Labath via lldb-commits


@@ -18,5 +20,18 @@ void HostInfoAIX::Terminate() { HostInfoBase::Terminate(); }
 
 FileSpec HostInfoAIX::GetProgramFileSpec() {
   static FileSpec g_program_filespec;
+  struct psinfo psinfoData;
+  auto BufferOrError = getProcFile(getpid(), "psinfo");
+  if (BufferOrError) {
+std::unique_ptr PsinfoBuffer =
+std::move(*BufferOrError);
+memcpy(&psinfoData, PsinfoBuffer->getBufferStart(), sizeof(psinfoData));
+llvm::StringRef exe_path(
+psinfoData.pr_psargs,
+strnlen(psinfoData.pr_psargs, sizeof(psinfoData.pr_psargs)));
+if (!exe_path.empty()) {
+  g_program_filespec.SetFile(exe_path, FileSpec::Style::native);
+}

labath wrote:

```suggestion
if (!exe_path.empty())
  g_program_filespec.SetFile(exe_path, FileSpec::Style::native);
```

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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread Pavel Labath via lldb-commits

labath wrote:

Oh, it's [this 
one](https://github.com/llvm/llvm-project/blob/3feb8b42e973f935883bc9e779645ecdae1a586d/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp#L547).

That makes more sense now. I'll skip the test on arm. Thanks for catching that.

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


[Lldb-commits] [lldb] [lldb] Fix dynamic type resolutions for core files (PR #138698)

2025-05-07 Thread David Spickett via lldb-commits

DavidSpickett wrote:

Yep, called from AddThreadList:
```
#0 0xedfbe37c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) 
(/home/david.spickett/build-llvm-arm/local/lib/python3.10/dist-packages/lldb/_lldb.cpython-310-arm-linux-gnueabihf.so+0xdbe37c)
#1 0xedfbca00 llvm::sys::RunSignalHandlers() 
(/home/david.spickett/build-llvm-arm/local/lib/python3.10/dist-packages/lldb/_lldb.cpython-310-arm-linux-gnueabihf.so+0xdbca00)
#2 0xedfbcb44 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0xf7c3d6f0 __default_rt_sa_restorer 
./signal/../sysdeps/unix/sysv/linux/arm/sigrestorer.S:80:0
#4 0xedd87604 MinidumpFileBuilder::AddThreadList() 
(/home/david.spickett/build-llvm-arm/local/lib/python3.10/dist-packages/lldb/_lldb.cpython-310-arm-linux-gnueabihf.so+0xb87604)
```

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


[Lldb-commits] [lldb] 461ba2d - [lldb] XFAIL TestDynamicValue.py:test_from_core_file on arm(32)

2025-05-07 Thread Pavel Labath via lldb-commits

Author: Pavel Labath
Date: 2025-05-07T16:57:30+02:00
New Revision: 461ba2db5d15793d18a5c18ce417c30e335602cc

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

LOG: [lldb] XFAIL TestDynamicValue.py:test_from_core_file on arm(32)

Minidump saving is not implemented there.

Added: 


Modified: 
lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py

Removed: 




diff  --git a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py 
b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
index 97d539f7a807c..cd95a9ff3fe8c 100644
--- a/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/lldb/test/API/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -283,6 +283,7 @@ def test_from_forward_decl(self):
 @no_debug_info_test
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24663")
 @expectedFailureDarwin  # dynamic loader unloads modules
+@expectedFailureAll(archs=["arm"]) # Minidump saving not implemented
 def test_from_core_file(self):
 """Test fetching C++ dynamic values from core files. Specifically, test
 that we can determine the dynamic type of the value if the core file



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


[Lldb-commits] [lldb] [lldb] print a notice when `source list` paging reaches the end of th… (PR #137515)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Fixed TestProcessModificationIdOnExpr to work on both x86 and x64 architectures (PR #138941)

2025-05-07 Thread Mikhail Zakharov via lldb-commits

https://github.com/real-mikhail created 
https://github.com/llvm/llvm-project/pull/138941

Original PR where test was introduced and improvements discussed: 
https://github.com/llvm/llvm-project/pull/129092#issuecomment-2855337004



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [lldb] Fixed TestProcessModificationIdOnExpr to work on both x86 and x64 architectures (PR #138941)

2025-05-07 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Mikhail Zakharov (real-mikhail)


Changes

Original PR where test was introduced and improvements discussed: 
https://github.com/llvm/llvm-project/pull/129092#issuecomment-2855337004

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


1 Files Affected:

- (modified) lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp (+30-12) 


``diff
diff --git a/lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp 
b/lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp
index fe6c2fd93303c..4d67200745018 100644
--- a/lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp
+++ b/lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp
@@ -1,7 +1,7 @@
 // Tests that ProcessModID.m_memory_id is not bumped when evaluating 
expressions without side effects.
 
-// REQUIRES: target-windows && target-x86
-// Due to different implementations exact numbers (m_stop_id) are different on 
different OSs. So we lock this test to specific platform (Windows). It is 
limited to x86 because on x86, running get()
+// REQUIRES: target-windows && (target-x86 || target-x86_64)
+// Due to different implementations exact numbers (m_stop_id) are different on 
different OSs. So we lock this test to specific platform (Windows). It is 
limited to x86/x64 because on x86/x64, running get()
 // requires that we write the return address to the stack, this does not 
happen on AArch64.
 
 // RUN: %build %s -o %t
@@ -11,10 +11,13 @@
 // RUN:   -o "process status -d" \
 // RUN:   -o "expr x.i != 42" \
 // RUN:   -o "process status -d" \
+// RUN:   -o "process status -d" \
 // RUN:   -o "expr x.get()" \
 // RUN:   -o "process status -d" \
+// RUN:   -o "process status -d" \
 // RUN:   -o "expr x.i = 10" \
 // RUN:   -o "process status -d" \
+// RUN:   -o "process status -d" \
 // RUN:   -o "continue" \
 // RUN:   -o "process status -d" \
 // RUN:   -o "exit" | FileCheck %s -dump-input=fail
@@ -36,34 +39,49 @@ int main() {
 }
 
 // CHECK-LABEL: process status -d
-// CHECK: m_stop_id: 2
-// CHECK: m_memory_id: 0
+// CHECK: m_stop_id: [[#STOP_ID:]]
+// CHECK: m_memory_id: [[#MEMORY_ID:]]
 
 // CHECK-LABEL: expr x.i != 42
 // IDs are not changed when executing simple expressions
 
 // CHECK-LABEL: process status -d
-// CHECK: m_stop_id: 2
-// CHECK: m_memory_id: 0
+// CHECK: m_stop_id: [[#STOP_ID]]
+// CHECK: m_memory_id: [[#MEMORY_ID]]
+
+// CHECK-LABEL: process status -d
+// Remember new values
+// CHECK: m_stop_id: [[#STOP_ID:]]
+// CHECK: m_memory_id: [[#MEMORY_ID:]]
 
 // CHECK-LABEL: expr x.get()
 // Expression causes ID to be bumped because LLDB has to execute function and 
in doing
 // so must write the return address to the stack.
 
 // CHECK-LABEL: process status -d
-// CHECK: m_stop_id: 3
-// CHECK: m_memory_id: 1
+// CHECK-NOT: m_stop_id: [[#STOP_ID]]
+// CHECK-NOT: m_memory_id: [[#MEMORY_ID]]
+
+// CHECK-LABEL: process status -d
+// Remember new values
+// CHECK: m_stop_id: [[#STOP_ID:]]
+// CHECK: m_memory_id: [[#MEMORY_ID:]]
 
 // CHECK-LABEL: expr x.i = 10
 // Expression causes MemoryID to be bumped because LLDB writes to non-cache 
memory
 
 // CHECK-LABEL: process status -d
-// CHECK: m_stop_id: 3
-// CHECK: m_memory_id: 2
+// CHECK: m_stop_id: [[#STOP_ID]]
+// CHECK-NOT: m_memory_id: [[#MEMORY_ID]]
+
+// CHECK-LABEL: process status -d
+// Remember new values
+// CHECK: m_stop_id: [[#STOP_ID:]]
+// CHECK: m_memory_id: [[#MEMORY_ID:]]
 
 // CHECK-LABEL: continue
 // Continue causes StopID to be bumped because process is resumed
 
 // CHECK-LABEL: process status -d
-// CHECK: m_stop_id: 4
-// CHECK: m_memory_id: 2
+// CHECK-NOT: m_stop_id: [[#STOP_ID]]
+// CHECK: m_memory_id: [[#MEMORY_ID]]

``




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


[Lldb-commits] [lldb] [lldb] Do not bump memory modificator ID when "internal" debugger memory is updated (PR #129092)

2025-05-07 Thread Mikhail Zakharov via lldb-commits

real-mikhail wrote:

Thanks for the example and the link.
I fixed test to work on both Windows-x86 and Windows-x64 and created new PR: 
https://github.com/llvm/llvm-project/pull/138941

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


[Lldb-commits] [lldb] [LLDB][Minidump] Add some buffer directories (PR #138943)

2025-05-07 Thread Jacob Lalonde via lldb-commits

https://github.com/Jlalond created 
https://github.com/llvm/llvm-project/pull/138943

Add a generous amount of buffer directories. I found out some LLDB forks 
(internal and external) had custom ranges that could fail because we didn't 
pre-account for those. To prevent this from being a problem, I've added a large 
number of buffer directories at the cost of 160 bytes.



  



Rate limit · GitHub


  body {
background-color: #f6f8fa;
color: #24292e;
font-family: -apple-system,BlinkMacSystemFont,Segoe 
UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
font-size: 14px;
line-height: 1.5;
margin: 0;
  }

  .container { margin: 50px auto; max-width: 600px; text-align: center; 
padding: 0 24px; }

  a { color: #0366d6; text-decoration: none; }
  a:hover { text-decoration: underline; }

  h1 { line-height: 60px; font-size: 48px; font-weight: 300; margin: 0px; 
text-shadow: 0 1px 0 #fff; }
  p { color: rgba(0, 0, 0, 0.5); margin: 20px 0 40px; }

  ul { list-style: none; margin: 25px 0; padding: 0; }
  li { display: table-cell; font-weight: bold; width: 1%; }

  .logo { display: inline-block; margin-top: 35px; }
  .logo-img-2x { display: none; }
  @media
  only screen and (-webkit-min-device-pixel-ratio: 2),
  only screen and (   min--moz-device-pixel-ratio: 2),
  only screen and ( -o-min-device-pixel-ratio: 2/1),
  only screen and (min-device-pixel-ratio: 2),
  only screen and (min-resolution: 192dpi),
  only screen and (min-resolution: 2dppx) {
.logo-img-1x { display: none; }
.logo-img-2x { display: inline-block; }
  }

  #suggestions {
margin-top: 35px;
color: #ccc;
  }
  #suggestions a {
color: #66;
font-weight: 200;
font-size: 14px;
margin: 0 10px;
  }


  
  



  Whoa there!
  You have exceeded a secondary rate limit.
Please wait a few minutes before you try again;
in some cases this may take up to an hour.
  
  
https://support.github.com/contact";>Contact Support —
https://githubstatus.com";>GitHub Status —
https://twitter.com/githubstatus";>@githubstatus
  

  

  

  

  

  


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


[Lldb-commits] [lldb] [LLDB][Minidump] Add some buffer directories (PR #138943)

2025-05-07 Thread Jacob Lalonde via lldb-commits

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


[Lldb-commits] [lldb] [LLDB][Minidump] Add some buffer directories (PR #138943)

2025-05-07 Thread via lldb-commits

llvmbot wrote:




@llvm/pr-subscribers-lldb

Author: Jacob Lalonde (Jlalond)


Changes

Add a generous amount of buffer directories. I found out some LLDB forks 
(internal and external) had custom ranges that could fail because we didn't 
pre-account for those. To prevent this from being a problem, I've added a large 
number of buffer directories at the cost of 240 bytes.

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


1 Files Affected:

- (modified) lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp 
(+5) 


``diff
diff --git a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp 
b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
index 38806dfc8e5b5..b6c7e66e28793 100644
--- a/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
+++ b/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp
@@ -75,6 +75,11 @@ Status 
MinidumpFileBuilder::AddHeaderAndCalculateDirectories() {
 }
   }
 
+  // Add a generous buffer of directories, these are quite small
+  // and forks may add new directories upstream LLDB hadn't accounted for
+  // when we started pre-calculating directory size, so this should account 
for that
+  m_expected_directories += 100;
+
   m_saved_data_size +=
   m_expected_directories * sizeof(llvm::minidump::Directory);
   Status error;

``




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


[Lldb-commits] [lldb] [lldb-dap] Change the launch sequence (PR #138219)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

The following two tests are both setting breakpoints without stopping at entry, 
which means that we could have run past the breakpoint by the time it's set:

```
  lldb-api :: tools/lldb-dap/completions/TestDAP_completions.py
  lldb-api :: tools/lldb-dap/startDebugging/TestDAP_startDebugging.py
```

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


[Lldb-commits] [lldb] [lldb] Use -Wno-documentation-deprecated-sync if available (PR #138909)

2025-05-07 Thread Alex Langford via lldb-commits


@@ -16,6 +16,15 @@ if (CXX_SUPPORTS_DOCUMENTATION)
 PRIVATE -Wdocumentation)
 endif()
 
+# Apply -Wno-documentation-deprecated-sync while we migrate away from
+# report_fatal_error in llvm/include/llvm/Support/ErrorHandling.h
+# and llvm/include/llvm/Support/Error.h.

bulbazord wrote:

Is there an associated Issue on Github you could add here? If the migration 
completes and we forget to clean this up, how would a future contributor know 
if this migration finished?

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


[Lldb-commits] [lldb] [lldb] Use -Wno-documentation-deprecated-sync if available (PR #138909)

2025-05-07 Thread Kazu Hirata via lldb-commits


@@ -16,6 +16,15 @@ if (CXX_SUPPORTS_DOCUMENTATION)
 PRIVATE -Wdocumentation)
 endif()
 
+# Apply -Wno-documentation-deprecated-sync while we migrate away from
+# report_fatal_error in llvm/include/llvm/Support/ErrorHandling.h
+# and llvm/include/llvm/Support/Error.h.

kazutakahirata wrote:

Good point!  I just filed #138914.  Let me update this PR to mention the issue. 
 Thanks!

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


[Lldb-commits] [lldb] [LLDB] Fix GetIndexOfChildMemberWithName to handle anonymous structs. (PR #138487)

2025-05-07 Thread via lldb-commits

https://github.com/cmtice updated 
https://github.com/llvm/llvm-project/pull/138487

>From 780371cf111c97e2bce5f030625ff557bb2f40b6 Mon Sep 17 00:00:00 2001
From: Caroline Tice 
Date: Sun, 4 May 2025 23:43:28 -0700
Subject: [PATCH 1/3] [LLDB] Fix GetIndexOfChildMemberWithName to handle
 anonymous structs.

When handling anonymous structs, GetIndexOfChildMemberWithName needs
to add the number of non-empty base classes to the child index, to get
the actual correct index. It was not doing so. This fixes that.
---
 .../TypeSystem/Clang/TypeSystemClang.cpp  |  9 -
 .../lang/cpp/type_lookup_anon_struct/Makefile |  3 ++
 .../TestCppTypeLookupAnonStruct.py| 27 +++
 .../lang/cpp/type_lookup_anon_struct/main.cpp | 33 +++
 4 files changed, 71 insertions(+), 1 deletion(-)
 create mode 100644 lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile
 create mode 100644 
lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
 create mode 100644 lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp

diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 1a2b3d4133e51..dd8d144510056 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -6743,7 +6743,14 @@ size_t TypeSystemClang::GetIndexOfChildMemberWithName(
   if (field_name.empty()) {
 CompilerType field_type = GetType(field->getType());
 std::vector save_indices = child_indexes;
-child_indexes.push_back(child_idx);
+if (field_type.IsAnonymousType())
+  // We have to add on the number of non-empty base classes to this
+  // index!
+  child_indexes.push_back(
+  child_idx +
+  TypeSystemClang::GetNumBaseClasses(cxx_record_decl, true));
+else
+  child_indexes.push_back(child_idx);
 if (field_type.GetIndexOfChildMemberWithName(
 name, omit_empty_base_classes, child_indexes))
   return child_indexes.size();
diff --git a/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile
new file mode 100644
index 0..8b20bcb05
--- /dev/null
+++ b/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules
diff --git 
a/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
new file mode 100644
index 0..2295ecfe81ff7
--- /dev/null
+++ 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
@@ -0,0 +1,27 @@
+"""
+Test that we properly print multiple types.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import decorators
+
+
+class TestTypeLookupAnonStruct(TestBase):
+def test_lookup_anon_struct(self):
+self.build()
+lldbutil.run_to_source_breakpoint(
+self, '// Set breakpoint here', lldb.SBFileSpec('main.cpp')
+)
+
+self.expect_var_path('unnamed_derived.y', value='2')
+self.expect_var_path('unnamed_derived.z', value='13')
+self.expect('frame variable "derb.x"', error=True,
+substrs=['"x" is not a member of "(DerivedB) derb"'])
+self.expect('frame variable "derb.y"', error=True,
+substrs=['"y" is not a member of "(DerivedB) derb"'])
+self.expect_var_path('derb.w', value='14')
+self.expect_var_path('derb.k', value='15')
+self.expect_var_path('derb.a.x', value='1')
+self.expect_var_path('derb.a.y', value='2')
diff --git a/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp
new file mode 100644
index 0..18dd997ea9563
--- /dev/null
+++ b/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp
@@ -0,0 +1,33 @@
+int main(int argc, char** argv) {
+  struct A {
+struct {
+  int x = 1;
+};
+int y = 2;
+  } a;
+
+   struct B {
+// Anonymous struct inherits another struct.
+struct : public A {
+  int z = 3;
+};
+int w = 4;
+A a;
+  } b;
+
+   struct : public A {
+ struct {
+   int z = 13;
+ };
+   } unnamed_derived;
+
+   struct DerivedB : public B {
+ struct {
+   // `w` in anonymous struct overrides `w` from `B`.
+   int w = 14;
+   int k = 15;
+ };
+   } derb;
+
+   return 0; // Set breakpoint here
+}

>From 81870ff46edc647695720d5635e700e77c7ca620 Mon Sep 17 00:00:00 2001
From: Caroline Tice 
Date: Mon, 5 May 2025 21:45:50 -0700
Subject: [PATCH 2/3] Update to always add the number of base classes (not just
 for anonymous structs). Remove hard

[Lldb-commits] [lldb] 92d3029 - [LLDB] Fix GetIndexOfChildMemberWithName to handle anonymous structs. (#138487)

2025-05-07 Thread via lldb-commits

Author: cmtice
Date: 2025-05-07T20:39:37-07:00
New Revision: 92d3029fa4a9c6ce21c50590e57ae834ae3db3bc

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

LOG: [LLDB] Fix GetIndexOfChildMemberWithName to handle anonymous structs. 
(#138487)

When handling anonymous structs, GetIndexOfChildMemberWithName needs to
add the number of non-empty base classes to the child index, to get the
actual correct index. It was not doing so. This fixes that.

Added: 
lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile

lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp

Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 45f044733c0ff..3b286885cc37f 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -6743,7 +6743,9 @@ size_t TypeSystemClang::GetIndexOfChildMemberWithName(
   if (field_name.empty()) {
 CompilerType field_type = GetType(field->getType());
 std::vector save_indices = child_indexes;
-child_indexes.push_back(child_idx);
+child_indexes.push_back(
+child_idx + TypeSystemClang::GetNumBaseClasses(
+cxx_record_decl, omit_empty_base_classes));
 if (field_type.GetIndexOfChildMemberWithName(
 name, omit_empty_base_classes, child_indexes))
   return child_indexes.size();

diff  --git a/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile
new file mode 100644
index 0..8b20bcb05
--- /dev/null
+++ b/lldb/test/API/lang/cpp/type_lookup_anon_struct/Makefile
@@ -0,0 +1,3 @@
+CXX_SOURCES := main.cpp
+
+include Makefile.rules

diff  --git 
a/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
new file mode 100644
index 0..265a96f7da152
--- /dev/null
+++ 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/TestCppTypeLookupAnonStruct.py
@@ -0,0 +1,43 @@
+"""
+Test that we properly print multiple types.
+"""
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import decorators
+
+
+class TestTypeLookupAnonStruct(TestBase):
+def test_lookup_anon_struct(self):
+self.build()
+lldbutil.run_to_source_breakpoint(
+self, "// Set breakpoint here", lldb.SBFileSpec("main.cpp")
+)
+
+self.expect_var_path("unnamed_derived.y", value="2")
+self.expect_var_path("unnamed_derived.z", value="13")
+self.expect(
+'frame variable "derb.x"',
+error=True,
+substrs=['"x" is not a member of "(DerivedB) derb"']
+)
+self.expect(
+'frame variable "derb.y"',
+error=True,
+substrs=['"y" is not a member of "(DerivedB) derb"']
+)
+self.expect_var_path("derb.w", value="14")
+self.expect_var_path("derb.k", value="15")
+self.expect_var_path("derb.a.x", value="1")
+self.expect_var_path("derb.a.y", value="2")
+
+self.expect_var_path("multi1.m", value="16")
+self.expect_var_path("multi1.y", value="30")
+
+self.expect_var_path("multi2.i", value="42")
+self.expect_var_path("multi2.w", value="23")
+self.expect_var_path("multi2.a.x", value="1")
+self.expect_var_path("multi2.a.y", value="2")
+self.expect_var_path("multi2.y", value="2")
+self.expect_var_path("multi2.n", value="7")

diff  --git a/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp 
b/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp
new file mode 100644
index 0..a9288e6466e74
--- /dev/null
+++ b/lldb/test/API/lang/cpp/type_lookup_anon_struct/main.cpp
@@ -0,0 +1,52 @@
+int main(int argc, char **argv) {
+  struct A {
+struct {
+  int x = 1;
+};
+int y = 2;
+  } a;
+
+  struct B {
+// Anonymous struct inherits another struct.
+struct : public A {
+  int z = 3;
+};
+int w = 4;
+A a;
+  } b;
+
+
+  struct EmptyBase {
+  };
+
+  struct : public A {
+struct {
+  int z = 13;
+};
+  } unnamed_derived;
+
+  struct DerivedB : public B {
+struct {
+  // `w` in anonymous struct shadows `w` from `B`.
+  int w = 14;
+  int k = 15;
+};
+  } derb;
+
+  struct MultiBase : public EmptyBase, public A {
+struct {

[Lldb-commits] [lldb] [lldb-dap] Re-enable the lldb-dap tests (PR #138791)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I re-landed the launch sequence patch 
(aeeb9a3c09f40f42a1e8e5e3c8dbde3b260744bd) and the Windows bots are happy 
again. Given that was the only objections, I'm going to merge this so we can 
get some insights overnight. 

As I said in the description, I expect the tests to be reliable, but if they're 
not, feel free to revert this again but please include a link to the failures 
or list the affected tests so we can continue investigating. 

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


[Lldb-commits] [lldb] [LLDB] Fix GetIndexOfChildMemberWithName to handle anonymous structs. (PR #138487)

2025-05-07 Thread via lldb-commits

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


[Lldb-commits] [lldb] [lldb-dap] Re-enable the lldb-dap tests (PR #138791)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] efce7a1 - [lldb-dap] Re-enable the lldb-dap tests (#138791)

2025-05-07 Thread via lldb-commits

Author: Jonas Devlieghere
Date: 2025-05-07T20:40:04-07:00
New Revision: efce7a169e58ec8b27d266ec4dfb851f85a7c6c2

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

LOG: [lldb-dap] Re-enable the lldb-dap tests (#138791)

Re-enable the lldb-dap tests. We've spent the last week improving the
reliability of the test suite and the tests now pass reliably on macOS
and Linux at desk. Let's see how things fare on the bots.

Added: 


Modified: 
lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
lldb/test/API/tools/lldb-dap/memory/TestDAP_memory.py
lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py

Removed: 




diff  --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py 
b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
index 741c011a3d692..b5569642f9d34 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py
@@ -24,7 +24,6 @@ def spawn_and_wait(program, delay):
 process.wait()
 
 
-@skip
 class TestDAP_attach(lldbdap_testcase.DAPTestCaseBase):
 def set_and_hit_breakpoint(self, continueToExit=True):
 self.dap_server.wait_for_stopped()

diff  --git a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py 
b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
index 7250e67ebcd8c..7c2b540195d15 100644
--- a/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
+++ b/lldb/test/API/tools/lldb-dap/attach/TestDAP_attachByPortNum.py
@@ -18,6 +18,7 @@
 import socket
 
 
+@skip("https://github.com/llvm/llvm-project/issues/138803";)
 class TestDAP_attachByPortNum(lldbdap_testcase.DAPTestCaseBase):
 default_timeout = 20
 

diff  --git 
a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py 
b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
index 4a99cacc761a3..1058157e2c668 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_breakpointLocations.py
@@ -11,8 +11,7 @@
 import lldbdap_testcase
 import os
 
-# DAP tests are flakey, see https://github.com/llvm/llvm-project/issues/137660.
-@skip
+
 class TestDAP_breakpointLocations(lldbdap_testcase.DAPTestCaseBase):
 def setUp(self):
 lldbdap_testcase.DAPTestCaseBase.setUp(self)

diff  --git a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py 
b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
index 6c6681804f250..26df2573555df 100644
--- a/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/breakpoint/TestDAP_setBreakpoints.py
@@ -11,8 +11,7 @@
 import lldbdap_testcase
 import os
 
-# DAP tests are flakey, see https://github.com/llvm/llvm-project/issues/137660.
-@skip
+
 class TestDAP_setBreakpoints(lldbdap_testcase.DAPTestCaseBase):
 def setUp(self):
 lldbdap_testcase.DAPTestCaseBase.setUp(self)

diff  --git a/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py 
b/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
index 4aecf9a665c06..223258fbdd3dc 100644
--- a/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
+++ b/lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py
@@ -6,8 +6,6 @@
 from lldbsuite.test.decorators import *
 
 
-# DAP tests are flakey, see https://github.com/llvm/llvm-project/issues/137660.
-@skip
 class TestDAP_commands(lldbdap_testcase.DAPTestCaseBase):
 def test_command_directive_quiet_on_success(self):
 program = self.getBuildArtifact("a.out")

diff  --git a/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py 
b/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
index ebecb349ac177..9e8ef5b289f2e 100644
--- a/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
+++ b/lldb/test/API/tools/lldb-dap/disassemble/TestDAP_disassemble.py
@@ -10,8 +10,7 @@
 import lldbdap_testcase
 import os
 
-# DAP tests are flakey, see https://github.com/llvm/llvm-project/issues/137660.
-@skip
+
 class TestDAP_disassemble(lldbdap_testcase.DAPTestCaseBase):
 @skipIfWindows
 def test_disassemble(self):

diff  --git a/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py 
b/lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
index 19b682dfcd22d..372a9bb75e007 100644
--- a/lldb/test/API/tools/

[Lldb-commits] [lldb] [lldb] Change the statusline format to print "no target" (PR #139021)

2025-05-07 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere updated 
https://github.com/llvm/llvm-project/pull/139021

>From fcd590a31f7b490f5fbc5996d9c5f2836ff4e7ee Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 7 May 2025 21:20:47 -0700
Subject: [PATCH 1/2] [lldb] Change the statusline format to print "no target"

Change the default statusline format to print "no target" when lldb is
launched without a target. Currently, the statusline is empty, which
looks rather odd.
---
 lldb/source/Core/CoreProperties.td|  2 +-
 .../statusline/TestStatusline.py  | 62 ++-
 2 files changed, 35 insertions(+), 29 deletions(-)

diff --git a/lldb/source/Core/CoreProperties.td 
b/lldb/source/Core/CoreProperties.td
index 2498841b47d9f..78988ce5b732f 100644
--- a/lldb/source/Core/CoreProperties.td
+++ b/lldb/source/Core/CoreProperties.td
@@ -186,7 +186,7 @@ let Definition = "debugger" in {
   : Property<"statusline-format", "FormatEntity">,
 Global,
 DefaultStringValue<
-"${ansi.negative}{${target.file.basename}}{ "
+"${ansi.negative}{${target.file.basename}|no target}{ "
 "${separator}${line.file.basename}:${line.number}:${line.column}}{ 
"
 "${separator}${thread.stop-reason}}{ "
 "${separator}{${progress.count} }${progress.message}}">,
diff --git a/lldb/test/API/functionalities/statusline/TestStatusline.py 
b/lldb/test/API/functionalities/statusline/TestStatusline.py
index da6b4e7c8f320..f00413e878d26 100644
--- a/lldb/test/API/functionalities/statusline/TestStatusline.py
+++ b/lldb/test/API/functionalities/statusline/TestStatusline.py
@@ -6,7 +6,18 @@
 from lldbsuite.test.lldbpexpect import PExpectTest
 
 
+# PExpect uses many timeouts internally and doesn't play well
+# under ASAN on a loaded machine..
+@skipIfAsan
 class TestStatusline(PExpectTest):
+
+# Change this value to something smaller to make debugging this test less
+# tedious.
+TIMEOUT = 60
+
+TERMINAL_HEIGHT = 10
+TERMINAL_WIDTH = 60
+
 def do_setup(self):
 # Create a target and run to a breakpoint.
 exe = self.getBuildArtifact("a.out")
@@ -15,36 +26,34 @@ def do_setup(self):
 )
 self.expect('breakpoint set -p "Break here"', substrs=["Breakpoint 1"])
 self.expect("run", substrs=["stop reason"])
+self.resize()
+
+def resize(self):
+# Change the terminal dimensions. When we launch the tests, we reset
+# all the settings, leaving the terminal dimensions unset.
+self.child.setwinsize(self.TERMINAL_HEIGHT, self.TERMINAL_WIDTH)
 
-# PExpect uses many timeouts internally and doesn't play well
-# under ASAN on a loaded machine..
-@skipIfAsan
 def test(self):
 """Basic test for the statusline."""
 self.build()
-self.launch()
+self.launch(timeout=self.TIMEOUT)
 self.do_setup()
 
-# Change the terminal dimensions.
-terminal_height = 10
-terminal_width = 60
-self.child.setwinsize(terminal_height, terminal_width)
-
 # Enable the statusline and check for the control character and that we
 # can see the target, the location and the stop reason.
 self.expect('set set separator "| "')
 self.expect(
 "set set show-statusline true",
 [
-"\x1b[0;{}r".format(terminal_height - 1),
+"\x1b[0;{}r".format(self.TERMINAL_HEIGHT - 1),
 "a.out | main.c:2:11 | breakpoint 1.1",
 ],
 )
 
 # Change the terminal dimensions and make sure it's reflected 
immediately.
-self.child.setwinsize(terminal_height, 25)
+self.child.setwinsize(self.TERMINAL_HEIGHT, 25)
 self.child.expect(re.escape("a.out | main.c:2:11 | bre"))
-self.child.setwinsize(terminal_height, terminal_width)
+self.child.setwinsize(self.TERMINAL_HEIGHT, self.TERMINAL_WIDTH)
 
 # Change the separator.
 self.expect('set set separator "S "', ["a.out S main.c:2:11"])
@@ -58,23 +67,15 @@ def test(self):
 
 # Hide the statusline and check or the control character.
 self.expect(
-"set set show-statusline false", 
["\x1b[0;{}r".format(terminal_height)]
+"set set show-statusline false", 
["\x1b[0;{}r".format(self.TERMINAL_HEIGHT)]
 )
 
-# PExpect uses many timeouts internally and doesn't play well
-# under ASAN on a loaded machine..
-@skipIfAsan
 def test_no_color(self):
 """Basic test for the statusline with colors disabled."""
 self.build()
-self.launch(use_colors=False)
+self.launch(use_colors=False, timeout=self.TIMEOUT)
 self.do_setup()
 
-# Change the terminal dimensions.
-terminal_height = 10
-terminal_width = 60
-self.child.setwinsize(terminal_height, terminal_width)
-
 # Enable the statusline and

  1   2   >