[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)

2024-05-30 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

GreenDragon now has `packaging` and based on David's message, the Linaro bots 
do as well. 

@labath Does your ✅ mean the 
[debian](https://lab.llvm.org/buildbot/#/builders/68) bot has this package 
installed? 
@mysterymath Can you install this package on the Fuchia bots? I assume you must 
do something similar for `pexpect`?

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


[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)

2024-05-30 Thread Jonas Devlieghere via lldb-commits

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

>From 4666a6a6470fc91ed17a9e60624a005dc97c4531 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 29 May 2024 10:36:47 -0700
Subject: [PATCH 1/2] [lldb] Use packaging module instead of pkg_resources

Use the packaging [1] module for parsing version numbers, instead of
pkg_resources which is distributed with setuptools. I recently switched
over to using the latter, knowing it was deprecated (in favor of the
packaging module) because it comes with Python out of the box. Newer
versions of setuptools have removed `pkg_resources` so we have to use
packaging.

[1] https://pypi.org/project/packaging/
---
 lldb/packages/Python/lldbsuite/test/decorators.py  | 6 ++
 lldb/packages/Python/lldbsuite/test/lldbplatformutil.py| 7 +++
 .../test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 4 ++--
 lldb/test/Shell/helper/build.py| 4 ++--
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 79cc0a2aeacbeb..4b85219ce7c19c 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1,6 +1,6 @@
 # System modules
 from functools import wraps
-from pkg_resources import packaging
+from packaging.version import parse
 import ctypes
 import locale
 import os
@@ -66,9 +66,7 @@ def fn_neq(x, y):
 "<=": fn_leq,
 }
 
-return op_lookup[comparison](
-packaging.version.parse(actual), packaging.version.parse(expected)
-)
+return op_lookup[comparison](parse(actual), parse(expected))
 
 
 def _match_decorator_property(expected, actual):
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py 
b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index 187d16aa1baa68..ecc814b0160597 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -8,8 +8,7 @@
 import subprocess
 import sys
 import os
-from urllib.parse import urlparse
-from pkg_resources import packaging
+from packaging.version import parse
 
 # LLDB modules
 import lldb
@@ -309,8 +308,8 @@ def expectedCompilerVersion(compiler_version):
 # Assume the compiler version is at or near the top of trunk.
 return operator in [">", ">=", "!", "!=", "not"]
 
-version = packaging.version.parse(version_str)
-test_compiler_version = packaging.version.parse(test_compiler_version_str)
+version = parse(version_str)
+test_compiler_version = parse(test_compiler_version_str)
 
 if operator == ">":
 return test_compiler_version > version
diff --git a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py 
b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
index d770447f0771cd..6dd838dab168bf 100644
--- a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
+++ b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -61,9 +61,9 @@ def check_simulator_ostype(self, sdk, platform_name, 
arch=platform.machine()):
 
 # Older versions of watchOS (<7.0) only support i386
 if platform_name == "watchos":
-from pkg_resources import packaging
+from packaging.version import parse
 
-if packaging.version.parse(vers) < packaging.version.parse("7.0"):
+if parse(vers) < parse("7.0"):
 arch = "i386"
 
 triple = "-".join([arch, "apple", platform_name + vers, "simulator"])
diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index d3c25bd944e983..9db2b133483a8f 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -519,9 +519,9 @@ def _find_windows_sdk_in_registry_view(self, view):
 
 # Windows SDK version numbers consist of 4 dotted components, so we
 # have to use LooseVersion, as StrictVersion supports 3 or fewer.
-from pkg_resources import packaging
+from packaging.version import parse
 
-sdk_versions.sort(key=lambda x: packaging.version.parse(x), 
reverse=True)
+sdk_versions.sort(key=lambda x: parse(x), reverse=True)
 option_value_name = "OptionId.DesktopCPP" + self.msvc_arch_str
 for v in sdk_versions:
 try:

>From e15e578b70311eb9140020e0cb71179d3d5be088 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 30 May 2024 10:01:01 -0700
Subject: [PATCH 2/2] Address review feedback

---
 lldb/packages/Python/lldbsuite/test/decorators.py  |  4 ++--
 .../Python/lldbsuite/test/lldbplatformutil.py  | 14 +++---
 .../tools/lldb-server/TestAppleSimulatorOSType.py  |  4 ++--
 lldb/test/Shell/helper/build.py| 10 --
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git 

[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)

2024-05-30 Thread Jonas Devlieghere via lldb-commits


@@ -519,9 +519,9 @@ def _find_windows_sdk_in_registry_view(self, view):
 
 # Windows SDK version numbers consist of 4 dotted components, so we
 # have to use LooseVersion, as StrictVersion supports 3 or fewer.

JDevlieghere wrote:

No, it doesn't. StrictVersion was still being used elsewhere in the file, which 
I've replaced as well. 

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


[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)

2024-05-29 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> At least at present, this will probably break Fuchsia's build; the Python we 
> ship includes `pkg_resources` but not `packaging`. Is the default `cpython` 
> build from source intended to build and install `packaging`? Is this 
> something that changed recently?

I'm not sure but I don't think so. IIUC the expectation that if folks want to 
use the packaging module, they have to install it themselves (i.e. with pip). 
I'm not sure all the bots have this package which is the reason I went with the 
`pkg_resources` approach previously, but that no longer works (i.e. Python 3.12 
installed via homebrew no longer has it which is why we've seen folks hitting 
this). 

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


[Lldb-commits] [lldb] [lldb] Remove setupterm workaround on macOS (PR #93714)

2024-05-29 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Remove setupterm workaround on macOS (PR #93714)

2024-05-29 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/93714

Remove setupterm workaround on macOS which caused an issues after the removal 
of the terminfo dependency. There's a comment that explains why the workaround 
is present, but neither Jim nor I were able to reproduce the issue by setting 
TERM to vt100.

>From 030ab776933816a713a80852f0a32ff7d51ba8bd Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 29 May 2024 11:06:10 -0700
Subject: [PATCH] [lldb] Remove setupterm workaround on macOS

Remove setupterm workaround on macOS which caused an issues after the
removal of the terminfo dependency. There's a comment that explains why
the workaround is present, but neither Jim nor I were able to reproduce
the issue by setting TERM to vt100.
---
 lldb/source/Host/common/Editline.cpp | 43 
 1 file changed, 43 deletions(-)

diff --git a/lldb/source/Host/common/Editline.cpp 
b/lldb/source/Host/common/Editline.cpp
index ed61aecc23b9b..561ec228cdb23 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -31,20 +31,6 @@
 using namespace lldb_private;
 using namespace lldb_private::line_editor;
 
-// Workaround for what looks like an OS X-specific issue, but other platforms
-// may benefit from something similar if issues arise.  The libedit library
-// doesn't explicitly initialize the curses termcap library, which it gets away
-// with until TERM is set to VT100 where it stumbles over an implementation
-// assumption that may not exist on other platforms.  The setupterm() function
-// would normally require headers that don't work gracefully in this context,
-// so the function declaration has been hoisted here.
-#if defined(__APPLE__)
-extern "C" {
-int setupterm(char *term, int fildes, int *errret);
-}
-#define USE_SETUPTERM_WORKAROUND
-#endif
-
 // Editline uses careful cursor management to achieve the illusion of editing a
 // multi-line block of text with a single line editor.  Preserving this
 // illusion requires fairly careful management of cursor state.  Read and
@@ -1402,35 +1388,6 @@ Editline::Editline(const char *editline_name, FILE 
*input_file,
   // Get a shared history instance
   m_editor_name = (editline_name == nullptr) ? "lldb-tmp" : editline_name;
   m_history_sp = EditlineHistory::GetHistory(m_editor_name);
-
-#ifdef USE_SETUPTERM_WORKAROUND
-  if (m_output_file) {
-const int term_fd = fileno(m_output_file);
-if (term_fd != -1) {
-  static std::recursive_mutex *g_init_terminal_fds_mutex_ptr = nullptr;
-  static std::set *g_init_terminal_fds_ptr = nullptr;
-  static llvm::once_flag g_once_flag;
-  llvm::call_once(g_once_flag, [&]() {
-g_init_terminal_fds_mutex_ptr =
-new std::recursive_mutex(); // NOTE: Leak to avoid C++ destructor
-// chain issues
-g_init_terminal_fds_ptr = new std::set(); // NOTE: Leak to avoid
-   // C++ destructor chain
-   // issues
-  });
-
-  // We must make sure to initialize the terminal a given file descriptor
-  // only once. If we do this multiple times, we start leaking memory.
-  std::lock_guard guard(
-  *g_init_terminal_fds_mutex_ptr);
-  if (g_init_terminal_fds_ptr->find(term_fd) ==
-  g_init_terminal_fds_ptr->end()) {
-g_init_terminal_fds_ptr->insert(term_fd);
-setupterm((char *)0, term_fd, (int *)0);
-  }
-}
-  }
-#endif
 }
 
 Editline::~Editline() {

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


[Lldb-commits] [lldb] [lldb] Use packaging module instead of pkg_resources (PR #93712)

2024-05-29 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/93712

Use the packaging [1] module for parsing version numbers, instead of 
pkg_resources which is distributed with setuptools. I recently switched over to 
using the latter, knowing it was deprecated (in favor of the packaging module) 
because it comes with Python out of the box. Newer versions of setuptools have 
removed `pkg_resources` so we have to use packaging.

[1] https://pypi.org/project/packaging/

>From fad874b04b1db121b8cab1a885882e1977264134 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Wed, 29 May 2024 10:36:47 -0700
Subject: [PATCH] [lldb] Use packaging module instead of pkg_resources

Use the packaging [1] module for parsing version numbers, instead of
pkg_resources which is distributed with setuptools. I recently switched
over to using the latter, knowing it was deprecated (in favor of the
packaging module) because it comes with Python out of the box. Newer
versions of setuptools have removed `pkg_resources` so we have to use
packaging.

[1] https://pypi.org/project/packaging/
---
 lldb/packages/Python/lldbsuite/test/decorators.py  | 6 ++
 lldb/packages/Python/lldbsuite/test/lldbplatformutil.py| 7 +++
 .../test/API/tools/lldb-server/TestAppleSimulatorOSType.py | 4 ++--
 lldb/test/Shell/helper/build.py| 4 ++--
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/lldb/packages/Python/lldbsuite/test/decorators.py 
b/lldb/packages/Python/lldbsuite/test/decorators.py
index 79cc0a2aeacbe..4b85219ce7c19 100644
--- a/lldb/packages/Python/lldbsuite/test/decorators.py
+++ b/lldb/packages/Python/lldbsuite/test/decorators.py
@@ -1,6 +1,6 @@
 # System modules
 from functools import wraps
-from pkg_resources import packaging
+from packaging.version import parse
 import ctypes
 import locale
 import os
@@ -66,9 +66,7 @@ def fn_neq(x, y):
 "<=": fn_leq,
 }
 
-return op_lookup[comparison](
-packaging.version.parse(actual), packaging.version.parse(expected)
-)
+return op_lookup[comparison](parse(actual), parse(expected))
 
 
 def _match_decorator_property(expected, actual):
diff --git a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py 
b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
index 187d16aa1baa6..ecc814b016059 100644
--- a/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/lldb/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -8,8 +8,7 @@
 import subprocess
 import sys
 import os
-from urllib.parse import urlparse
-from pkg_resources import packaging
+from packaging.version import parse
 
 # LLDB modules
 import lldb
@@ -309,8 +308,8 @@ def expectedCompilerVersion(compiler_version):
 # Assume the compiler version is at or near the top of trunk.
 return operator in [">", ">=", "!", "!=", "not"]
 
-version = packaging.version.parse(version_str)
-test_compiler_version = packaging.version.parse(test_compiler_version_str)
+version = parse(version_str)
+test_compiler_version = parse(test_compiler_version_str)
 
 if operator == ">":
 return test_compiler_version > version
diff --git a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py 
b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
index d770447f0771c..6dd838dab168b 100644
--- a/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
+++ b/lldb/test/API/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -61,9 +61,9 @@ def check_simulator_ostype(self, sdk, platform_name, 
arch=platform.machine()):
 
 # Older versions of watchOS (<7.0) only support i386
 if platform_name == "watchos":
-from pkg_resources import packaging
+from packaging.version import parse
 
-if packaging.version.parse(vers) < packaging.version.parse("7.0"):
+if parse(vers) < parse("7.0"):
 arch = "i386"
 
 triple = "-".join([arch, "apple", platform_name + vers, "simulator"])
diff --git a/lldb/test/Shell/helper/build.py b/lldb/test/Shell/helper/build.py
index d3c25bd944e98..9db2b133483a8 100755
--- a/lldb/test/Shell/helper/build.py
+++ b/lldb/test/Shell/helper/build.py
@@ -519,9 +519,9 @@ def _find_windows_sdk_in_registry_view(self, view):
 
 # Windows SDK version numbers consist of 4 dotted components, so we
 # have to use LooseVersion, as StrictVersion supports 3 or fewer.
-from pkg_resources import packaging
+from packaging.version import parse
 
-sdk_versions.sort(key=lambda x: packaging.version.parse(x), 
reverse=True)
+sdk_versions.sort(key=lambda x: parse(x), reverse=True)
 option_value_name = "OptionId.DesktopCPP" + self.msvc_arch_str
 for v in sdk_versions:
 try:

___
lldb-commits mailing list
lldb-commits@lists.llvm.org

[Lldb-commits] [clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-28 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

`LLDB_CURSES_LIBS` is scoped to lldbCore, which the EditLine unit test isn't 
linking. If its also necessary in Host, then we should hoist it up and link 
both libraries against it.

Anyway, that also means my initial assessment was wrong. I looked for the 
header include but the code in our editline wrapper forward declares 
`setupterm` which explains why I missed it. Maybe we should reconsider? Anyway, 
if I cannot figure this out in the next hour or so, I think we should revert 
this to get our bots green again. 

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


[Lldb-commits] [lldb] f69b6d2 - [lldb] Add missing semicolon (NFC)

2024-05-28 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-28T10:36:20-07:00
New Revision: f69b6d2c99a10847a2d73c7fcd656d2ae22937ce

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

LOG: [lldb] Add missing semicolon (NFC)

Added: 


Modified: 

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp

Removed: 




diff  --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
index 4871c59faefcc..ddaa7a8a597b4 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -242,7 +242,7 @@ clang::QualType 
AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
   // case. Assert assert in debug builds so we catch other weird cases.
   assert(false && "forward declaration without definition");
   LLDB_LOG(GetLog(LLDBLog::Types),
-   "forward declaration without definition: {0}", name)
+   "forward declaration without definition: {0}", name);
   return ast_ctx.getObjCIdType();
 }
 



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


[Lldb-commits] [lldb] [lldb] Remove lldbassert in AppleObjCTypeEncodingParser (PR #93332)

2024-05-28 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere closed 
https://github.com/llvm/llvm-project/pull/93332
___
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] Cleanup breakpoint filters. (PR #87550)

2024-05-24 Thread Jonas Devlieghere via lldb-commits


@@ -61,40 +61,37 @@ DAP::DAP()
 DAP::~DAP() = default;
 
 void DAP::PopulateExceptionBreakpoints() {
+  exception_breakpoints = {};
   if (debugger.SupportsLanguage(lldb::eLanguageTypeC_plus_plus)) {
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"cpp_catch", "C++ Catch", lldb::eLanguageTypeC_plus_plus});
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"cpp_throw", "C++ Throw", lldb::eLanguageTypeC_plus_plus});
   }
   if (debugger.SupportsLanguage(lldb::eLanguageTypeObjC)) {
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"objc_catch", "Objective-C Catch", lldb::eLanguageTypeObjC});
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"objc_throw", "Objective-C Throw", lldb::eLanguageTypeObjC});
   }
   if (debugger.SupportsLanguage(lldb::eLanguageTypeSwift)) {
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"swift_catch", "Swift Catch", lldb::eLanguageTypeSwift});
-exception_breakpoints.emplace_back(
+exception_breakpoints->emplace_back(
 {"swift_throw", "Swift Throw", lldb::eLanguageTypeSwift});
   }
-
-  bp_initted = true;
 }
 
 ExceptionBreakpoint *DAP::GetExceptionBreakpoint(const std::string ) {
-  assert(bp_initted);
-  for (auto  : exception_breakpoints) {
+  for (auto  : *exception_breakpoints) {

JDevlieghere wrote:

You could keep the assert:

```
assert(exception_breakpoints.has_value() && "PopulateExceptionBreakpoints must 
be called first") 
```

https://github.com/llvm/llvm-project/pull/87550
___
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] Cleanup breakpoint filters. (PR #87550)

2024-05-24 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere edited 
https://github.com/llvm/llvm-project/pull/87550
___
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] Cleanup breakpoint filters. (PR #87550)

2024-05-24 Thread Jonas Devlieghere via lldb-commits

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

LGTM!

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


[Lldb-commits] [lldb] [lldb] Remove lldbassert in AppleObjCTypeEncodingParser (PR #93332)

2024-05-24 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/93332

AppleObjCTypeEncodingParser::BuildObjCObjectPointerType currently contains an 
lldbassert to detect situations where we have a forward declaration without a 
definition. According to the accompanying comment, its purpose is to catch 
"weird cases" during test suite runs.

However, because this is an lldbassert, we show a scary message to our users 
who think this is a problem and report the issue to us. Unfortunately those 
reports aren't very actionable without a way to know the name of the type.

This patch changes the lldbassert to a regular assert and emits a log message 
to the types log when this happens.

rdar://127439898

>From 55fb6056564f156f83b387d05f23368e06b64b19 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 24 May 2024 11:24:09 -0700
Subject: [PATCH] [lldb] Remove lldbassert in AppleObjCTypeEncodingParser

AppleObjCTypeEncodingParser::BuildObjCObjectPointerType currently
contains an lldbassert to detect situations where we have a forward
declaration without a definition. According to the accompanying comment,
its purpose is to catch "weird cases" during test suite runs.

However, because this is an lldbassert, we show a scary message to our
users who think this is a problem and report the issue to us.
Unfortunately those reports aren't very actionable without a way to know
the name of the type.

This patch changes the lldbassert to a regular assert and emits a log
message to the types log when this happens.

rdar://127439898
---
 .../AppleObjCTypeEncodingParser.cpp   | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
index ca582cb1d5a46..4871c59faefcc 100644
--- 
a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ 
b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -13,6 +13,8 @@
 #include "lldb/Symbol/CompilerType.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
+#include "lldb/Utility/LLDBLog.h"
+#include "lldb/Utility/Log.h"
 #include "lldb/Utility/StringLexer.h"
 
 #include "clang/Basic/TargetInfo.h"
@@ -234,12 +236,15 @@ clang::QualType 
AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
 
 auto types = decl_vendor->FindTypes(ConstString(name), /*max_matches*/ 1);
 
-// The user can forward-declare something that has no definition.  The 
runtime
-// doesn't prohibit this at all. This is a rare and very weird case.  We 
keep
-// this assert in debug builds so we catch other weird cases.
-lldbassert(!types.empty());
-if (types.empty())
+if (types.empty()) {
+  // The user can forward-declare something that has no definition. The
+  // runtime doesn't prohibit this at all. This is a rare and very weird
+  // case. Assert assert in debug builds so we catch other weird cases.
+  assert(false && "forward declaration without definition");
+  LLDB_LOG(GetLog(LLDBLog::Types),
+   "forward declaration without definition: {0}", name)
   return ast_ctx.getObjCIdType();
+}
 
 return ClangUtil::GetQualType(types.front().GetPointerType());
   } else {

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


[Lldb-commits] [flang] [lldb] [llvm] [flang] [lldb] [llvm] Fix 'destory' comment typos [NFC] (PR #93260)

2024-05-24 Thread Jonas Devlieghere via lldb-commits

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

Normally I'd ask splitting upcross-project PRs, but this one is trivial and 
very unlikely to be cause churn :-) LGMT. 

https://github.com/llvm/llvm-project/pull/93260
___
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] Cleanup breakpoint filters. (PR #87550)

2024-05-24 Thread Jonas Devlieghere via lldb-commits


@@ -331,6 +333,7 @@ struct DAP {
   // "Content-Length:" field followed by the length, followed by the raw
   // JSON bytes.
   void SendJSON(const std::string _str);
+  bool bp_initted;

JDevlieghere wrote:

This should be next to `exception_breakpoints`, but I wouldn't bother with the 
boolean and instead make `exception_breakpoints` a `std::optional<...>` and 
initialize it in `PopulateExceptionBreakpoints` so that the two are inherently 
tied together. 

https://github.com/llvm/llvm-project/pull/87550
___
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] Cleanup breakpoint filters. (PR #87550)

2024-05-24 Thread Jonas Devlieghere via lldb-commits


@@ -335,3 +335,14 @@ TypeSystemMap::GetTypeSystemForLanguage(lldb::LanguageType 
language,
   }
   return GetTypeSystemForLanguage(language);
 }
+
+bool TypeSystem::SupportsLanguageStatic(lldb::LanguageType language) {
+  if (language == eLanguageTypeUnknown)
+return false;
+
+  LanguageSet plugins =
+  PluginManager::GetAllTypeSystemSupportedLanguagesForTypes();

JDevlieghere wrote:

`s/plugins/languages/`

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


[Lldb-commits] [lldb] [llvm] Add a createError variant without error code (NFC) (PR #93209)

2024-05-23 Thread Jonas Devlieghere via lldb-commits


@@ -87,8 +87,8 @@ llvm::Error Socket::Initialize() {
   if (err == 0) {
 if (wsaData.wVersion < wVersion) {
   WSACleanup();
-  return llvm::make_error(
-  "WSASock version is not expected.", llvm::inconvertibleErrorCode());
+  return llvm::createStringError("WSASock version is not expected.",
+ llvm::inconvertibleErrorCode());

JDevlieghere wrote:

This doesn't need the `inconvertibleErrorCode` anymore, right?

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


[Lldb-commits] [lldb] [llvm] Add a createError variant without error code (NFC) (PR #93209)

2024-05-23 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere commented:

I'm in favor of this. I rarely have a meaningful error code and it makes the 
code needlessly verbose. 

I was going to ask if we wanted to make an overload of the existing 
`createStringError` but without the error code. But then I noticed that it uses 
the printf-style formatters (and not the llvm one). I think @bulbazord tried to 
add a `formatv` overload but that slowed down compilation of LLVM itself. Long 
story short, I think having this function take an `llvm::Twine` is fine. 

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


[Lldb-commits] [lldb] [llvm] Add a createError variant without error code (NFC) (PR #93209)

2024-05-23 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb-dap] Automatically skip lldb-dap tests for remote platforms (PR #93169)

2024-05-23 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb/DWARF] Make sure bad abbreviation codes do not crash lldb (PR #93006)

2024-05-22 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb/DWARF] Make sure bad abbreviation codes do not crash lldb (PR #93006)

2024-05-22 Thread Jonas Devlieghere via lldb-commits


@@ -44,10 +45,20 @@ bool DWARFDebugInfoEntry::Extract(const DWARFDataExtractor 
,
   const DWARFUnit *cu,
   lldb::offset_t *offset_ptr) {
   m_offset = *offset_ptr;
+  auto report_error = [&](const char *fmt, const auto &...vals) {
+cu->GetSymbolFileDWARF().GetObjectFile()->GetModule()->ReportError(

JDevlieghere wrote:

Can we assume `cu` is always a valid pointer? If so, should the signature take 
it by const reference instead? 

AFAIK only `GetAbbreviationDeclarationPtr` checks that it's not NULL but we 
have a code path that calls the lambda before as well as when `abbrevDecl` is 
NULL which would happen if CU is NULL. 

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


[Lldb-commits] [clang] [lldb] [llvm] Remove some `try_compile` CMake checks for compiler flags (PR #92953)

2024-05-21 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [clang] [compiler-rt] [lldb] [llvm] [Support] Remove terminfo dependency (PR #92865)

2024-05-21 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

No objections in the context of LLDB. We don't use terminfo directly (although 
I think editline does, but that isn't affected by this) and if we want the TUI 
we depend on curses anyway. 


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


[Lldb-commits] [lldb] [lldb] Adds additional fields to ProcessInfo (PR #91544)

2024-05-20 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> Hello all. I am wondering what I can do to advance this patch? I think it is 
> required to support process save-core in linux for lldb. I'd love to move 
> this before adding static methods in ThreadEfCore.h to produce populated 
> prpsinfo and prstatus structs for inclusion in a generated corefile. Is there 
> someone else I should include on review here? @JDevlieghere? I am happy to 
> amend this in whatever way the community thinks works best for lldb.

A message like this that the PR is ready for re-review should be all you need. 
Several folks left comments and they might be waiting for all of them to be 
addressed before they take another look. If you don't hear back within a week, 
you can ping the patch to get reviewer's attention. 

There's some more info here: 
https://llvm.org/docs/CodeReview.html#lgtm-how-a-patch-is-accepted

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


[Lldb-commits] [lldb] 1e9324a - [lldb] Namespace SBSourceLanguageName (NFC)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-17T18:43:09-07:00
New Revision: 1e9324a8c734aaa933d2672522cc22d5022c6200

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

LOG: [lldb] Namespace SBSourceLanguageName (NFC)

Added: 


Modified: 
lldb/include/lldb/API/SBExpressionOptions.h
lldb/source/API/SBExpressionOptions.cpp

Removed: 




diff  --git a/lldb/include/lldb/API/SBExpressionOptions.h 
b/lldb/include/lldb/API/SBExpressionOptions.h
index 19c416d0f3bcb..a9e929a4c0bd9 100644
--- a/lldb/include/lldb/API/SBExpressionOptions.h
+++ b/lldb/include/lldb/API/SBExpressionOptions.h
@@ -71,7 +71,7 @@ class LLDB_API SBExpressionOptions {
   /// Set the language using a pair of language code and version as
   /// defined by the DWARF 6 specification.
   /// WARNING: These codes may change until DWARF 6 is finalized.
-  void SetLanguage(SBSourceLanguageName name, uint32_t version);
+  void SetLanguage(lldb::SBSourceLanguageName name, uint32_t version);
 
 #ifndef SWIG
   void SetCancelCallback(lldb::ExpressionCancelCallback callback, void *baton);

diff  --git a/lldb/source/API/SBExpressionOptions.cpp 
b/lldb/source/API/SBExpressionOptions.cpp
index ce686112ff719..15ed403eaaea1 100644
--- a/lldb/source/API/SBExpressionOptions.cpp
+++ b/lldb/source/API/SBExpressionOptions.cpp
@@ -156,7 +156,7 @@ void SBExpressionOptions::SetLanguage(lldb::LanguageType 
language) {
   m_opaque_up->SetLanguage(language);
 }
 
-void SBExpressionOptions::SetLanguage(SBSourceLanguageName name,
+void SBExpressionOptions::SetLanguage(lldb::SBSourceLanguageName name,
   uint32_t version) {
   LLDB_INSTRUMENT_VA(this, name, version);
 



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


[Lldb-commits] [lldb] [WIP] [lldb][Progress] Report progress when completing types from DWARF (PR #91452)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> @JDevlieghere I know we discussed this in the past and it made sense to me, 
> but I'm right now failing to connect the dots. Why couldn't the same 
> single-line interface be used to print nested events something like this?
> 
> ```
> Evaluating expression > Type Checking > Importing "vector" > Finding 
> "begin" in Foo.o
> ```

Shadowing happens with _unrelated_ events. The problem is that you don't want 
to show something like this:

```
Evaluating expression > Type Checking > Some unrelated background operation > 
Importing "vector"
```

Or let's say you're doing some work in parallel:

```
Doing some work on thread 1 > Doing some work on thread 2 > Some nested work on 
thread 2 > Some nested work on thread 1
```

For a single event, you can update it, as we do for importing the Swift 
modules. For your example, today you can show something like this:

```
Evaluating expression: Type Checking
Evaluating expression: Importing "vector"
Evaluating expression: Finding "begin" in Foo.o 
```

Compared to your approach, you lose out on the additional context that's not 
part of the title/category before the colon. On the other hand, that's how we 
aggregate events in the progress manager.

If we want to support nested _related_ events, I think that wouldn't be too 
hard. An event could have a parent event ID and LLDB could append events that 
belong to the currently displayed event. But we'd still shadow _unrelated_ 
events. 

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


[Lldb-commits] [lldb] bdfb04a - [lldb-dap] Bump the version to 0.2.1

2024-05-17 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-17T14:00:24-07:00
New Revision: bdfb04a63d73c31ee75395064762d0d6ccb45819

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

LOG: [lldb-dap] Bump the version to 0.2.1

Bump the version to 0.2.1 to test the publishing workflow and update the
extension README and URL.

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 45fcb83cf81d8..adffc3f0a2c58 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -1,7 +1,7 @@
 {
   "name": "lldb-dap",
   "displayName": "LLDB DAP",
-  "version": "0.2.0",
+  "version": "0.2.1",
   "publisher": "llvm-vs-code-extensions",
   "homepage": "https://lldb.llvm.org;,
   "description": "LLDB debugging from VSCode",



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


[Lldb-commits] [lldb] a4ad052 - [lldb-dap] Replace `assertEquals` with `assertEqual` (NFC)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-17T10:12:51-07:00
New Revision: a4ad05284e97dd188c44252846486cbfb74a884c

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

LOG: [lldb-dap] Replace `assertEquals` with `assertEqual` (NFC)

Fixes new test that were added or modified after #82073. Also fixes a
formatting issue.

Added: 


Modified: 
lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py

Removed: 




diff  --git 
a/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py 
b/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
index 52c0bbfb33dad..1e0e40d4a0130 100644
--- a/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
+++ b/lldb/test/API/tools/lldb-dap/databreakpoint/TestDAP_setDataBreakpoints.py
@@ -27,10 +27,10 @@ def test_duplicate_start_addresses(self):
 response_x = self.dap_server.request_dataBreakpointInfo(0, "")
 response_arr_2 = self.dap_server.request_dataBreakpointInfo(0, "arr+2")
 # Test response from dataBreakpointInfo request.
-self.assertEquals(response_x["body"]["dataId"].split("/")[1], "4")
-self.assertEquals(response_x["body"]["accessTypes"], self.accessTypes)
-self.assertEquals(response_arr_2["body"]["dataId"].split("/")[1], "4")
-self.assertEquals(response_arr_2["body"]["accessTypes"], 
self.accessTypes)
+self.assertEqual(response_x["body"]["dataId"].split("/")[1], "4")
+self.assertEqual(response_x["body"]["accessTypes"], self.accessTypes)
+self.assertEqual(response_arr_2["body"]["dataId"].split("/")[1], "4")
+self.assertEqual(response_arr_2["body"]["accessTypes"], 
self.accessTypes)
 # The first one should be overwritten by the third one as they start at
 # the same address. This is indicated by returning {verified: False} 
for
 # the first one.
@@ -40,7 +40,7 @@ def test_duplicate_start_addresses(self):
 {"dataId": response_x["body"]["dataId"], "accessType": "write"},
 ]
 set_response = 
self.dap_server.request_setDataBreakpoint(dataBreakpoints)
-self.assertEquals(
+self.assertEqual(
 set_response["body"]["breakpoints"],
 [{"verified": False}, {"verified": True}, {"verified": True}],
 )
@@ -48,14 +48,14 @@ def test_duplicate_start_addresses(self):
 self.continue_to_next_stop()
 x_val = self.dap_server.get_local_variable_value("x")
 i_val = self.dap_server.get_local_variable_value("i")
-self.assertEquals(x_val, "2")
-self.assertEquals(i_val, "1")
+self.assertEqual(x_val, "2")
+self.assertEqual(i_val, "1")
 
 self.continue_to_next_stop()
 arr_2 = self.dap_server.get_local_variable_child("arr", "[2]")
 i_val = self.dap_server.get_local_variable_value("i")
-self.assertEquals(arr_2["value"], "42")
-self.assertEquals(i_val, "2")
+self.assertEqual(arr_2["value"], "42")
+self.assertEqual(i_val, "2")
 
 @skipIfWindows
 @skipIfRemote
@@ -72,16 +72,16 @@ def test_expression(self):
 response_x = self.dap_server.request_dataBreakpointInfo(0, "")
 response_arr_2 = self.dap_server.request_dataBreakpointInfo(0, "arr+2")
 # Test response from dataBreakpointInfo request.
-self.assertEquals(response_x["body"]["dataId"].split("/")[1], "4")
-self.assertEquals(response_x["body"]["accessTypes"], self.accessTypes)
-self.assertEquals(response_arr_2["body"]["dataId"].split("/")[1], "4")
-self.assertEquals(response_arr_2["body"]["accessTypes"], 
self.accessTypes)
+self.assertEqual(response_x["body"]["dataId"].split("/")[1], "4")
+self.assertEqual(response_x["body"]["accessTypes"], self.accessTypes)
+self.assertEqual(response_arr_2["body"]["dataId"].split("/")[1], "4")
+self.assertEqual(response_arr_2["body"]["accessTypes"], 
self.accessTypes)
 dataBreakpoints = [
 {"dataId": response_x["body"]["dataId"], "accessType": "write"},
 {"dataId": response_arr_2["body"]["dataId"], "accessType": 
"write"},
 ]
 set_response = 
self.dap_server.request_setDataBreakpoint(dataBreakpoints)
-self.assertEquals(
+self.assertEqual(
 set_response["body"]["breakpoints"],
 [{"verified": True}, {"verified": True}],
 )
@@ -89,14 +89,14 @@ def test_expression(self):
 self.continue_to_next_stop()
 x_val = self.dap_server.get_local_variable_value("x")
 i_val = self.dap_server.get_local_variable_value("i")
-self.assertEquals(x_val, "2")
-

[Lldb-commits] [lldb] d74bc82 - [lldb] Include SBLanguages in the SWIG bindings (#92470)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-17T09:58:56-07:00
New Revision: d74bc823beabbb7067a4b4ae2d69a36d874f5132

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

LOG: [lldb] Include SBLanguages in the SWIG bindings (#92470)

Added: 


Modified: 
lldb/bindings/CMakeLists.txt
lldb/bindings/headers.swig
lldb/bindings/interfaces.swig
lldb/bindings/lua/CMakeLists.txt
lldb/bindings/python/CMakeLists.txt

Removed: 




diff  --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index 296eae1ae77f8..bec694e43bd7b 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -3,6 +3,7 @@ file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
   ${LLDB_SOURCE_DIR}/include/lldb/*.h
+  ${LLDB_BINARY_DIR}/include/lldb/API/SBLanguages.h
 )
 file(GLOB SWIG_PRIVATE_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h
@@ -30,6 +31,7 @@ set(SWIG_COMMON_FLAGS
   -w361,362,509
   -features autodoc
   -I${LLDB_SOURCE_DIR}/include
+  -I${LLDB_BINARY_DIR}/include
   -I${CMAKE_CURRENT_SOURCE_DIR}
   ${DARWIN_EXTRAS}
 )

diff  --git a/lldb/bindings/headers.swig b/lldb/bindings/headers.swig
index e8d0cda288141..ffdc3c31ec883 100644
--- a/lldb/bindings/headers.swig
+++ b/lldb/bindings/headers.swig
@@ -36,6 +36,7 @@
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBInstruction.h"
 #include "lldb/API/SBInstructionList.h"
+#include "lldb/API/SBLanguages.h"
 #include "lldb/API/SBLanguageRuntime.h"
 #include "lldb/API/SBLaunchInfo.h"
 #include "lldb/API/SBLineEntry.h"

diff  --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig
index a31a0b4af1eb6..2a29a8dd7ef0b 100644
--- a/lldb/bindings/interfaces.swig
+++ b/lldb/bindings/interfaces.swig
@@ -114,6 +114,7 @@
 %include "lldb/API/SBHostOS.h"
 %include "lldb/API/SBInstruction.h"
 %include "lldb/API/SBInstructionList.h"
+%include "lldb/API/SBLanguages.h"
 %include "lldb/API/SBLanguageRuntime.h"
 %include "lldb/API/SBLaunchInfo.h"
 %include "lldb/API/SBLineEntry.h"

diff  --git a/lldb/bindings/lua/CMakeLists.txt 
b/lldb/bindings/lua/CMakeLists.txt
index 2d128cc1864c8..4a110f7829b03 100644
--- a/lldb/bindings/lua/CMakeLists.txt
+++ b/lldb/bindings/lua/CMakeLists.txt
@@ -3,6 +3,7 @@ add_custom_command(
   DEPENDS ${SWIG_SOURCES}
   DEPENDS ${SWIG_INTERFACES}
   DEPENDS ${SWIG_HEADERS}
+  DEPENDS lldb-sbapi-dwarf-enums
   COMMAND ${SWIG_EXECUTABLE}
   ${SWIG_COMMON_FLAGS}
   -I${CMAKE_CURRENT_SOURCE_DIR}

diff  --git a/lldb/bindings/python/CMakeLists.txt 
b/lldb/bindings/python/CMakeLists.txt
index 73b1239495e22..def6941e802bb 100644
--- a/lldb/bindings/python/CMakeLists.txt
+++ b/lldb/bindings/python/CMakeLists.txt
@@ -11,6 +11,7 @@ add_custom_command(
   DEPENDS ${SWIG_SOURCES}
   DEPENDS ${SWIG_INTERFACES}
   DEPENDS ${SWIG_HEADERS}
+  DEPENDS lldb-sbapi-dwarf-enums
   COMMAND ${SWIG_EXECUTABLE}
   ${SWIG_COMMON_FLAGS}
   -I${CMAKE_CURRENT_SOURCE_DIR}



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


[Lldb-commits] [lldb] [WIP] [lldb][Progress] Report progress when completing types from DWARF (PR #91452)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> @JDevlieghere @adrian-prantl are there plans to change the presentation layer 
> to prevent this kind of shadowing in the future? Would be nice if all we 
> needed to do was report progress, and not worry about other progress events 
> in the debugger being in-flight

No, on the terminal it works that way by design. Unless you switch to something 
that takes full control of your screen (like curses) there's no good way to 
display multiple progress events at the same time and not doing the shadowing 
(i.e. letting more recent progress events through) defeats the purpose of 
highlighting long running operations. 

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


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-17 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> It's a `sed s/== None/is None/g` - what is there to review? 10 separate 
> commits/PRs for the same exact `sed` costs more in commit noise (and effort 
> on the part of @e-kwsm) than one solid, patient, review here.

In addition to what @ftynse said above, the `sed` might not be the right thing 
in the first place (e.g. #91858). 

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


[Lldb-commits] [lldb] Revert "[lldb] Include SBLanguages in the SWIG bindings" (PR #92490)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] Revert "[lldb] Include SBLanguages in the SWIG bindings" (PR #92490)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/92490

Reverts llvm/llvm-project#92470

>From ebb9f82e4c6f9b7c6f627da71ffbfb858f655d1e Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 19:58:44 -0700
Subject: [PATCH] Revert "[lldb] Include SBLanguages in the SWIG bindings
 (#92470)"

This reverts commit ebf283162f5a0e7e9392c3a825e060856eee0991.
---
 lldb/bindings/CMakeLists.txt  | 2 --
 lldb/bindings/headers.swig| 1 -
 lldb/bindings/interfaces.swig | 1 -
 3 files changed, 4 deletions(-)

diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index bec694e43bd7b..296eae1ae77f8 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -3,7 +3,6 @@ file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
   ${LLDB_SOURCE_DIR}/include/lldb/*.h
-  ${LLDB_BINARY_DIR}/include/lldb/API/SBLanguages.h
 )
 file(GLOB SWIG_PRIVATE_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h
@@ -31,7 +30,6 @@ set(SWIG_COMMON_FLAGS
   -w361,362,509
   -features autodoc
   -I${LLDB_SOURCE_DIR}/include
-  -I${LLDB_BINARY_DIR}/include
   -I${CMAKE_CURRENT_SOURCE_DIR}
   ${DARWIN_EXTRAS}
 )
diff --git a/lldb/bindings/headers.swig b/lldb/bindings/headers.swig
index ffdc3c31ec883..e8d0cda288141 100644
--- a/lldb/bindings/headers.swig
+++ b/lldb/bindings/headers.swig
@@ -36,7 +36,6 @@
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBInstruction.h"
 #include "lldb/API/SBInstructionList.h"
-#include "lldb/API/SBLanguages.h"
 #include "lldb/API/SBLanguageRuntime.h"
 #include "lldb/API/SBLaunchInfo.h"
 #include "lldb/API/SBLineEntry.h"
diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig
index 2a29a8dd7ef0b..a31a0b4af1eb6 100644
--- a/lldb/bindings/interfaces.swig
+++ b/lldb/bindings/interfaces.swig
@@ -114,7 +114,6 @@
 %include "lldb/API/SBHostOS.h"
 %include "lldb/API/SBInstruction.h"
 %include "lldb/API/SBInstructionList.h"
-%include "lldb/API/SBLanguages.h"
 %include "lldb/API/SBLanguageRuntime.h"
 %include "lldb/API/SBLaunchInfo.h"
 %include "lldb/API/SBLineEntry.h"

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


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [lldb] [llvm] [mlir] [openmp] [polly] fix(python): fix comparison to None (PR #91857)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere commented:

This should really be broken up into separate PRs per subproject. One large PR 
like this makes reviewing harder and causes unnecessary churn in the case that 
this gets reverted.

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


[Lldb-commits] [lldb] [lldb] Include SBLanguages in the SWIG bindings (PR #92470)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Use operator==(StringRef, StringRef) instead of StringRef::equals (NFC) (PR #92476)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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

The change looks fine. Was this done with by hand or with the help of a script? 
If so please put that in the commit message so we can do the same downstream.

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


[Lldb-commits] [lldb] [lldb] Include SBLanguages in the SWIG bindings (PR #92470)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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

>From 3bd3650ad624c1d45b118eb1d5bebc2732371b9d Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 15:46:36 -0700
Subject: [PATCH 1/2] [lldb] Include SBLanguages in the SWIG bindings

---
 lldb/bindings/CMakeLists.txt  | 2 ++
 lldb/bindings/headers.swig| 1 +
 lldb/bindings/interfaces.swig | 1 +
 3 files changed, 4 insertions(+)

diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index 296eae1ae77f8..438643004c3fa 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -2,6 +2,7 @@ file(GLOB SWIG_INTERFACES interface/*.i)
 file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
+  ${LLDB_BINARY_DIR}/include/lldb/API/*.h
   ${LLDB_SOURCE_DIR}/include/lldb/*.h
 )
 file(GLOB SWIG_PRIVATE_HEADERS
@@ -30,6 +31,7 @@ set(SWIG_COMMON_FLAGS
   -w361,362,509
   -features autodoc
   -I${LLDB_SOURCE_DIR}/include
+  -I${LLDB_BINARY_DIR}/include
   -I${CMAKE_CURRENT_SOURCE_DIR}
   ${DARWIN_EXTRAS}
 )
diff --git a/lldb/bindings/headers.swig b/lldb/bindings/headers.swig
index e8d0cda288141..ffdc3c31ec883 100644
--- a/lldb/bindings/headers.swig
+++ b/lldb/bindings/headers.swig
@@ -36,6 +36,7 @@
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBInstruction.h"
 #include "lldb/API/SBInstructionList.h"
+#include "lldb/API/SBLanguages.h"
 #include "lldb/API/SBLanguageRuntime.h"
 #include "lldb/API/SBLaunchInfo.h"
 #include "lldb/API/SBLineEntry.h"
diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig
index a31a0b4af1eb6..2a29a8dd7ef0b 100644
--- a/lldb/bindings/interfaces.swig
+++ b/lldb/bindings/interfaces.swig
@@ -114,6 +114,7 @@
 %include "lldb/API/SBHostOS.h"
 %include "lldb/API/SBInstruction.h"
 %include "lldb/API/SBInstructionList.h"
+%include "lldb/API/SBLanguages.h"
 %include "lldb/API/SBLanguageRuntime.h"
 %include "lldb/API/SBLaunchInfo.h"
 %include "lldb/API/SBLineEntry.h"

>From 3bb203846499f5530266c0fb7cd2779e03c0bb0a Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 16:37:40 -0700
Subject: [PATCH 2/2] Don't glob for SBLanguages.h as it may not exist yet

---
 lldb/bindings/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index 438643004c3fa..bec694e43bd7b 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -2,8 +2,8 @@ file(GLOB SWIG_INTERFACES interface/*.i)
 file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
-  ${LLDB_BINARY_DIR}/include/lldb/API/*.h
   ${LLDB_SOURCE_DIR}/include/lldb/*.h
+  ${LLDB_BINARY_DIR}/include/lldb/API/SBLanguages.h
 )
 file(GLOB SWIG_PRIVATE_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h

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


[Lldb-commits] [lldb] [lldb] Include SBLanguages in the SWIG bindings (PR #92470)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> Actually, this has no dependency tracking. You'll need to add that for this 
> to work every time.

It does actually, that's what the `SWIG_HEADERS` glob is used for. 

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


[Lldb-commits] [lldb] [lldb] Include SBLanguages in the SWIG bindings (PR #92470)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/92470

None

>From 3bd3650ad624c1d45b118eb1d5bebc2732371b9d Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 15:46:36 -0700
Subject: [PATCH] [lldb] Include SBLanguages in the SWIG bindings

---
 lldb/bindings/CMakeLists.txt  | 2 ++
 lldb/bindings/headers.swig| 1 +
 lldb/bindings/interfaces.swig | 1 +
 3 files changed, 4 insertions(+)

diff --git a/lldb/bindings/CMakeLists.txt b/lldb/bindings/CMakeLists.txt
index 296eae1ae77f8..438643004c3fa 100644
--- a/lldb/bindings/CMakeLists.txt
+++ b/lldb/bindings/CMakeLists.txt
@@ -2,6 +2,7 @@ file(GLOB SWIG_INTERFACES interface/*.i)
 file(GLOB_RECURSE SWIG_SOURCES *.swig)
 file(GLOB SWIG_HEADERS
   ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
+  ${LLDB_BINARY_DIR}/include/lldb/API/*.h
   ${LLDB_SOURCE_DIR}/include/lldb/*.h
 )
 file(GLOB SWIG_PRIVATE_HEADERS
@@ -30,6 +31,7 @@ set(SWIG_COMMON_FLAGS
   -w361,362,509
   -features autodoc
   -I${LLDB_SOURCE_DIR}/include
+  -I${LLDB_BINARY_DIR}/include
   -I${CMAKE_CURRENT_SOURCE_DIR}
   ${DARWIN_EXTRAS}
 )
diff --git a/lldb/bindings/headers.swig b/lldb/bindings/headers.swig
index e8d0cda288141..ffdc3c31ec883 100644
--- a/lldb/bindings/headers.swig
+++ b/lldb/bindings/headers.swig
@@ -36,6 +36,7 @@
 #include "lldb/API/SBHostOS.h"
 #include "lldb/API/SBInstruction.h"
 #include "lldb/API/SBInstructionList.h"
+#include "lldb/API/SBLanguages.h"
 #include "lldb/API/SBLanguageRuntime.h"
 #include "lldb/API/SBLaunchInfo.h"
 #include "lldb/API/SBLineEntry.h"
diff --git a/lldb/bindings/interfaces.swig b/lldb/bindings/interfaces.swig
index a31a0b4af1eb6..2a29a8dd7ef0b 100644
--- a/lldb/bindings/interfaces.swig
+++ b/lldb/bindings/interfaces.swig
@@ -114,6 +114,7 @@
 %include "lldb/API/SBHostOS.h"
 %include "lldb/API/SBInstruction.h"
 %include "lldb/API/SBInstructionList.h"
+%include "lldb/API/SBLanguages.h"
 %include "lldb/API/SBLanguageRuntime.h"
 %include "lldb/API/SBLaunchInfo.h"
 %include "lldb/API/SBLineEntry.h"

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


[Lldb-commits] [lldb] [lldb][breakpoint] Grey out disabled breakpoints (PR #91404)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

The stream already knows whether color support is enabled, but it looks like 
we're only storing that in the underlying llvm stream, which is commonly used 
in combination with `WithColor`. I think we could add a member to check if the 
stream has colors enabled. It's already a property of `m_forwarder` so we don't 
need to create a new member. 

```
SBStream::HasColor() {
  return m_forwarded.has_color();
}
```

Alternatively, we could add a helper that does that under the hood. 

```
SBStream::FormatAnsiTerminalCodes(llvm::StringRef format) {
  if (m_forwarded.has_color()) 
print(FormatAnsiTerminalCodes(format));
}
```

So instead of having to write:

```
if(s->HasColor())
 s->Printf("%s", ansi::FormatAnsiTerminalCodes("${ansi.faint}").c_str());
```

You can just write:

```
s-> FormatAnsiTerminalCodes("${ansi.faint}") 
```

and have it do the right thing.
```

I think I understand Jim's concern. Most places that we use colors, we do that 
through `WithColor` which checks the color property of the underlying LLVM 
stream. Chelsea is not going through WithColor, so in her case she would indeed 
need to check 

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


[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

I don't think Alex is arguing in favor of keeping the old (wrong) behavior, but 
the first file looks like this:

```
foundSpec = False
if [...]
  foundSpec = True
[...]
if foundSpec is False:
```

It's pretty obvious this is a boolean and should use `if not foundSpec`. 

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


[Lldb-commits] [lldb] [lldb-dap] Separate user and developer documentation (PR #92428)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb-dap] Separate user and developer documentation (PR #92428)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

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

>From ca9fc570e4b721c36e5a0f9154e3158573bc5483 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 09:44:57 -0700
Subject: [PATCH] [lldb-dap] Separate user and developer documentation

The README.md is what users see when they look for the extension in the
Marketplace [1]. Right now, it's a mix of developer documentation (for us)
and user documentation. This commit moves the developer docs into `docs`
and the lldb website and refocuses the README on using the extension.

[1] 
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap
---
 lldb/docs/index.rst|   1 +
 lldb/docs/resources/lldbdap.md |  97 
 lldb/tools/lldb-dap/README.md  | 156 +
 3 files changed, 119 insertions(+), 135 deletions(-)
 create mode 100644 lldb/docs/resources/lldbdap.md

diff --git a/lldb/docs/index.rst b/lldb/docs/index.rst
index 7a27f6914fa89..1e7d69002dd3e 100644
--- a/lldb/docs/index.rst
+++ b/lldb/docs/index.rst
@@ -161,6 +161,7 @@ interesting areas to contribute to lldb.
resources/lldbplatformpackets
resources/caveats
resources/projects
+   resources/lldbdap
Public C++ API 
Private C++ API 
 
diff --git a/lldb/docs/resources/lldbdap.md b/lldb/docs/resources/lldbdap.md
new file mode 100644
index 0..2d345e26b7e57
--- /dev/null
+++ b/lldb/docs/resources/lldbdap.md
@@ -0,0 +1,97 @@
+# LLDB-DAP
+
+The `lldb-dap` tool (formerly `lldb-vscode`) is a command line tool that
+implements the [Debug Adapter
+Protocol](https://microsoft.github.io/debug-adapter-protocol/). It can be
+installed as an extension for Visual Studio Code and other IDEs supporting DAP.
+The protocol is easy to run remotely and also can allow other tools and IDEs to
+get a full featured debugger with a well defined protocol.
+
+## Local Installation for Visual Studio Code
+
+Installing the plug-in is very straightforward and involves just a few steps.
+
+### Pre-requisites
+
+- Install a modern version of node (e.g. `v20.0.0`).
+- On VS Code, execute the command `Install 'code' command in PATH`. You need to
+  do it only once. This enables the command `code` in the PATH.
+
+### Packaging and installation
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+npm install
+npm run package # This also compiles the extension.
+npm run vscode-install
+```
+
+On VS Code, set the setting `lldb-dap.executable-path` to the path of your 
local
+build of `lldb-dap`.
+
+And then you are ready!
+
+### Updating the extension
+
+*Note: It's not necessary to update the extension if there has been changes
+to  `lldb-dap`. The extension needs to be updated only if the TypesScript code
+has changed.*
+
+Updating the extension is pretty much the same process as installing it from
+scratch. However, VS Code expects the version number of the upgraded extension
+to be greater than the previous one, otherwise the installation step might have
+no effect.
+
+```bash
+# Bump version in package.json
+cd /path/to/lldb/tools/lldb-dap
+npm install
+npm run package
+npm run vscode-install
+```
+
+Another way upgrade without bumping the extension version is to first uninstall
+the extension, then reload VS Code, and then install it again. This is
+an unfortunate limitation of the editor.
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+npm run vscode-uninstall
+# Then reload VS Code: reopen the IDE or execute the `Developer: Reload Window`
+# command.
+npm run package
+npm run vscode-install
+```
+
+### Deploying for Visual Studio Code
+
+The easiest way to deploy the extension for execution on other machines 
requires
+copying `lldb-dap` and its dependencies into a`./bin` subfolder and then 
create a
+standalone VSIX package.
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+mkdir -p ./bin
+cp /path/to/a/built/lldb-dap ./bin/
+cp /path/to/a/built/liblldb.so ./bin/
+npm run package
+```
+
+This will produce the file `./out/lldb-dap.vsix` that can be distributed. In
+this type of installation, users don't need to manually set the path to
+`lldb-dap`. The extension will automatically look for it in the `./bin`
+subfolder.
+
+*Note: It's not possible to use symlinks to `lldb-dap`, as the packaging tool
+forcefully performs a deep copy of all symlinks.*
+
+*Note: It's possible to use this kind flow for local installations, but it's
+not recommended because updating `lldb-dap` requires rebuilding the extension.*
+
+## Formatting the Typescript code
+
+This is also very simple, just run:
+
+```bash
+npm run format
+```
diff --git a/lldb/tools/lldb-dap/README.md b/lldb/tools/lldb-dap/README.md
index 16ce4672be71c..8ecbaf7ce9816 100644
--- a/lldb/tools/lldb-dap/README.md
+++ b/lldb/tools/lldb-dap/README.md
@@ -1,133 +1,19 @@
+# LLDB DAP
 
-# Table of Contents
-
-- [Table of 

[Lldb-commits] [lldb] bd6c358 - [lldb-dap] Update repository in package.json

2024-05-16 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2024-05-16T09:54:47-07:00
New Revision: bd6c358d01f6ebc3851996e2c29c47b08e992525

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

LOG: [lldb-dap] Update repository in package.json

Use https://github.com/llvm/vscode-lldb instead of the monorepo, for
consistency with the other two extensions (mlir, clangd).

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 aeb24445551c1..45fcb83cf81d8 100644
--- a/lldb/tools/lldb-dap/package.json
+++ b/lldb/tools/lldb-dap/package.json
@@ -8,7 +8,7 @@
   "license": "Apache 2.0 License with LLVM exceptions",
   "repository": {
 "type": "git",
-"url": "https://github.com/llvm/llvm-project.git;
+"url": "https://github.com/llvm/vscode-lldb.git;
   },
   "bugs": {
 "url": "https://github.com/llvm/llvm-project/issues;



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


[Lldb-commits] [lldb] [lldb-dap] Separate user and developer documentation (PR #92428)

2024-05-16 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/92428

The README.md is what users see when they look for the extension in the 
Marketplace [1]. Right now, it's a mix of developer documentation (for us) and 
user documentation. This commit moves the developer docs into `docs` and the 
lldb website and refocuses the README on using the extension.

[1] 
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap

>From 729a9699cce518790e4077e41f659eff505cdc6e Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Thu, 16 May 2024 09:44:57 -0700
Subject: [PATCH] [lldb-dap] Separate user and developer documentation

The README.md is what users see when they look for the extension in the
Marketplace [1]. Right now, it's a mix of developer documentation (for us)
and user documentation. This commit moves the developer docs into `docs`
and the lldb website and refocuses the README on using the extension.

[1] 
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap
---
 lldb/docs/index.rst|   1 +
 lldb/docs/resources/lldbdap.md |  97 
 lldb/tools/lldb-dap/README.md  | 156 +
 3 files changed, 119 insertions(+), 135 deletions(-)
 create mode 100644 lldb/docs/resources/lldbdap.md

diff --git a/lldb/docs/index.rst b/lldb/docs/index.rst
index 7a27f6914fa89..1e7d69002dd3e 100644
--- a/lldb/docs/index.rst
+++ b/lldb/docs/index.rst
@@ -161,6 +161,7 @@ interesting areas to contribute to lldb.
resources/lldbplatformpackets
resources/caveats
resources/projects
+   resources/lldbdap
Public C++ API 
Private C++ API 
 
diff --git a/lldb/docs/resources/lldbdap.md b/lldb/docs/resources/lldbdap.md
new file mode 100644
index 0..6c2252d77e55c
--- /dev/null
+++ b/lldb/docs/resources/lldbdap.md
@@ -0,0 +1,97 @@
+# LLDB-DAP
+
+The `lldb-dap` tool (formerly `lldb-vscode`) creates a command line tool that
+implements the [Debug Adapter
+Protocol](https://microsoft.github.io/debug-adapter-protocol/). It can be
+installed as an extension for Visual Studio Code and other IDEs supporting DAP.
+The protocol is easy to run remotely and also can allow other tools and IDEs to
+get a full featured debugger with a well defined protocol.
+
+## Local Installation for Visual Studio Code
+
+Installing the plug-in is very straightforward and involves just a few steps.
+
+### Pre-requisites
+
+- Install a modern version of node (e.g. `v20.0.0`).
+- On VS Code, execute the command `Install 'code' command in PATH`. You need to
+  do it only once. This enables the command `code` in the PATH.
+
+### Packaging and installation
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+npm install
+npm run package # This also compiles the extension.
+npm run vscode-install
+```
+
+On VS Code, set the setting `lldb-dap.executable-path` to the path of your 
local
+build of `lldb-dap`.
+
+And then you are ready!
+
+### Updating the extension
+
+*Note: It's not necessary to update the extension if there has been changes
+to  `lldb-dap`. The extension needs to be updated only if the TypesScript code
+has changed.*
+
+Updating the extension is pretty much the same process as installing it from
+scratch. However, VS Code expects the version number of the upgraded extension
+to be greater than the previous one, otherwise the installation step might have
+no effect.
+
+```bash
+# Bump version in package.json
+cd /path/to/lldb/tools/lldb-dap
+npm install
+npm run package
+npm run vscode-install
+```
+
+Another way upgrade without bumping the extension version is to first uninstall
+the extension, then reload VS Code, and then install it again. This is
+an unfortunate limitation of the editor.
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+npm run vscode-uninstall
+# Then reload VS Code: reopen the IDE or execute the `Developer: Reload Window`
+# command.
+npm run package
+npm run vscode-install
+```
+
+### Deploying for Visual Studio Code
+
+The easiest way to deploy the extension for execution on other machines 
requires
+copying `lldb-dap` and its dependencies into a`./bin` subfolder and then 
create a
+standalone VSIX package.
+
+```bash
+cd /path/to/lldb/tools/lldb-dap
+mkdir -p ./bin
+cp /path/to/a/built/lldb-dap ./bin/
+cp /path/to/a/built/liblldb.so ./bin/
+npm run package
+```
+
+This will produce the file `./out/lldb-dap.vsix` that can be distributed. In
+this type of installation, users don't need to manually set the path to
+`lldb-dap`. The extension will automatically look for it in the `./bin`
+subfolder.
+
+*Note: It's not possible to use symlinks to `lldb-dap`, as the packaging tool
+forcefully performs a deep copy of all symlinks.*
+
+*Note: It's possible to use this kind flow for local installations, but it's
+not recommended because updating `lldb-dap` requires rebuilding the 

[Lldb-commits] [lldb] [lldb-dap] Support publishing to the VSCode market place (PR #92320)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Fixed the TestFdLeak test (PR #92273)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Fixed the TestNetBSDCore test (PR #92285)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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

LGTM

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


[Lldb-commits] [lldb] [lldb][Windows] Fixed the TestIOHandlerResizeNoEditline test (PR #92286)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Fixed the TestCompletion test running on a remote target (PR #92281)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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

Thanks. LGTM!

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


[Lldb-commits] [lldb] [lldb] Fixed the TestNetBSDCore test (PR #92285)

2024-05-15 Thread Jonas Devlieghere via lldb-commits


@@ -177,12 +177,12 @@ def check_stack(self, process, pid, filename):
 self.assertEqual(thread.GetStopReasonDataAtIndex(0), 0)
 
 @skipIfLLVMTargetMissing("AArch64")
-def test_aarch64(self):
+def test_aarch64_B(self):

JDevlieghere wrote:

`test_aarch64_thread_signaled`?

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


[Lldb-commits] [lldb] [lldb] Fixed the TestNetBSDCore test (PR #92285)

2024-05-15 Thread Jonas Devlieghere via lldb-commits


@@ -207,11 +207,11 @@ def check_stack(self, process, pid, filename):
 self.assertEqual(thread.GetStopReasonDataAtIndex(0), signal.SIGSEGV)
 
 @skipIfLLVMTargetMissing("AArch64")
-def test_aarch64(self):
+def test_aarch64_C(self):

JDevlieghere wrote:

`test_aarch64_process_signaled`? 

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


[Lldb-commits] [lldb] [lldb] Fixed the TestNetBSDCore test (PR #92285)

2024-05-15 Thread Jonas Devlieghere via lldb-commits


@@ -147,12 +147,12 @@ def check_stack(self, process, pid, filename):
 self.check_backtrace(thread, filename, backtrace)
 
 @skipIfLLVMTargetMissing("AArch64")
-def test_aarch64(self):
+def test_aarch64_A(self):

JDevlieghere wrote:

Can we give this a more meaningful name, like `test_aarch64_single` or 
`test_aarch64_single_threaded`? Or maybe keep these and only rename the ones 
below. 

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


[Lldb-commits] [lldb] [lldb] Fixed the TestGdbRemoteCompletion test (PR #92268)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Fixed the TestFdLeak test (PR #92273)

2024-05-15 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere commented:

Could this use `os.devnull` to pick the right one based on the platform this is 
running on?
```
self.do_test(["log enable -f '{}}' lldb commands".format(os.devnull)])
```

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


[Lldb-commits] [lldb] [lldb] Fixed the TestCompletion test running on a remote target (PR #92281)

2024-05-15 Thread Jonas Devlieghere via lldb-commits


@@ -107,9 +107,20 @@ def test_process_unload(self):
 self, "// Break here", lldb.SBFileSpec("main.cpp")
 )
 err = lldb.SBError()
-self.process().LoadImage(
-lldb.SBFileSpec(self.getBuildArtifact("libshared.so")), err
-)
+if lldb.remote_platform:
+self.process().LoadImage(
+lldb.SBFileSpec(self.getBuildArtifact("libshared.so")),
+lldb.SBFileSpec(
+lldbutil.append_to_process_working_directory(self, 
"libshared.so"),
+False,
+),
+err,
+)
+else:
+self.process().LoadImage(
+lldb.SBFileSpec(self.getBuildArtifact("libshared.so")),
+err,
+)

JDevlieghere wrote:

I think this can be simplified to:

```
err = lldb.SBError()
local_spec = lldb.SBFileSpec(self.getBuildArtifact("libshared.so"))
remote_spec = 
lldb.SBFileSpec(lldbutil.append_to_process_working_directory(self, 
"libshared.so"), false) if lldb.remote_platform else lldb.SBFileSpec()
self.process().LoadImage(local_spec, remote_spec)
```

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


[Lldb-commits] [clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] [polly] fix(python): fix invalid escape sequences (PR #91856)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

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

As per Aiden's suggestion, please split this up into smaller PRs, grouped by 
subproject. 

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


[Lldb-commits] [lldb] [lldb] Allow env override for LLDB_ARGDUMPER_PATH (PR #91688)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere commented:

Thanks!

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


[Lldb-commits] [lldb] [lldb] Fixed the test TestThreadStates when run with a remote target (PR #92086)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> I'm pretty sure lldb was sending these events at some point, but that could 
> have change since then. I slightly surprised that this wasn't caught before 
> as that would mean noone is running these tests remotely.
> 
> Jonas, are you running lldb tests in remote configurations?

Yup, I am. Looks like all these tests are marked as `@skipIfDarwin` so that 
would explain why it wasn't caught before. 

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


[Lldb-commits] [clang] [lldb] [llvm] [openmp] [polly] fix(python): fix comparison to True/False (PR #91858)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> If this is split out from the other larger PR, should there be `clang/` 
> changes in here?

+1, please unstage the `clang` and `openmp` changes. 

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


[Lldb-commits] [lldb] [lldb] Document some more packets (PR #92124)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Document some more packets (PR #92124)

2024-05-14 Thread Jonas Devlieghere via lldb-commits

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

LGTM. TILL about `qSpeedTest`. 

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


[Lldb-commits] [lldb] [lldb] Put SBSourceLanguageName in lldb namespace (PR #91685)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #91029)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb/crashlog] Fix test failure when creating a target using command options (PR #91653)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb/crashlog] Fix module binary resolution (PR #91631)

2024-05-09 Thread Jonas Devlieghere via lldb-commits


@@ -418,9 +418,20 @@ def locate_module_and_debug_symbols(self):
 with print_lock:
 print('falling back to binary inside "%s"' % dsym)
 self.symfile = dsym
-for filename in os.listdir(dwarf_dir):
-self.path = os.path.join(dwarf_dir, filename)
-if self.find_matching_slice():
+# Look for the executable next to the dSYM bundle.
+parent_dir = os.path.dirname(dsym)
+executables = []
+for root, dirs, files in os.walk(parent_dir):

JDevlieghere wrote:

Let's use `_` instead of `dirs` as it's unused. 

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


[Lldb-commits] [lldb] [lldb/crashlog] Fix module binary resolution (PR #91631)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb/crashlog] Fix module binary resolution (PR #91631)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb][breakpoint] Grey out disabled breakpoints (PR #91404)

2024-05-09 Thread Jonas Devlieghere via lldb-commits


@@ -848,6 +850,13 @@ void Breakpoint::GetDescription(Stream *s, 
lldb::DescriptionLevel level,
   const size_t num_locations = GetNumLocations();
   const size_t num_resolved_locations = GetNumResolvedLocations();
 
+  // Grey out any disabled breakpoints in the list of breakpoints.
+  if (GetTarget().GetDebugger().GetUseColor())
+s->Printf("%s",
+  IsEnabled()
+  ? ansi::FormatAnsiTerminalCodes("${ansi.normal}").c_str()
+  : ansi::FormatAnsiTerminalCodes("${ansi.faint}").c_str());

JDevlieghere wrote:

You need to reset the color after printing, otherwise everything in the 
terminal printed after will be faint.  Also seems like you can simplify this by 
moving the check for `IsEnabled()` into the first `if`:

```
const bool print_faint = !IsEnabled() && 
GetTarget().GetDebugger().GetUseColor();
if (print_faint)
 s->Print(ansi::FormatAnsiTerminalCodes("${ansi.faint}"));

[...]

if (print_faint)
 s->Print(ansi::FormatAnsiTerminalCodes("${ansi.reset}"));
```


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


[Lldb-commits] [lldb] [lldb/crashlog] Fix module binary resolution (PR #91631)

2024-05-09 Thread Jonas Devlieghere via lldb-commits


@@ -418,9 +418,22 @@ def locate_module_and_debug_symbols(self):
 with print_lock:
 print('falling back to binary inside "%s"' % dsym)
 self.symfile = dsym
-for filename in os.listdir(dwarf_dir):
-self.path = os.path.join(dwarf_dir, filename)
-if self.find_matching_slice():
+# Look for the executable next to the dSYM bundle.
+parent_dir = os.path.dirname(dsym)
+find_results = (
+subprocess.check_output(
+'/usr/bin/find "%s" -type f \( -perm -u=x -o 
-perm -g=x -o -perm -o=x \)'

JDevlieghere wrote:

Rather than shelling out to find, can you use `os.walk`? 

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


[Lldb-commits] [lldb] [WIP] [lldb][Progress] Report progress when completing types from DWARF (PR #91452)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> If this turns out to be necessary, one way to rate-limit them would be to 
> have a nesting depth counter. Assuming that these imports happen recursively 
> we could create only Progress objects for the top n layers.

Is the code that emits the progress event recursive too? The reason I ask is 
because on the command line, nested progress events will get shadowed. The same 
is true for coalesced progress events. I'm not sure how VSCode/DAP clients deal 
with this, so maybe they're shown there?

Anyway, if the code is recursive, we might need to do something like we did for 
Swift, with one top-level event and callback that updates the details. 

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


[Lldb-commits] [lldb] [lldb][enums] Remove broadcast bits from debugger (PR #91618)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb][enums] Remove broadcast bits from debugger (PR #91618)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

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

LGTM but let's give Alex and Ismail a chance to take a look too.

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


[Lldb-commits] [lldb] [WIP] [lldb][Progress] Report progress when completing types from DWARF (PR #91452)

2024-05-09 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> My understanding was that the progress increment is designed to be really 
> cheap (writing two pointers) and that it's up to presentation layer to decide 
> a t what frequency to update the UI.
> 
> @JDevlieghere — is that perception correct?

You're correct about the presentation layer, but creating the progress reports 
isn't free and more recently we've added some bookkeeping to coalesce them. In 
the grand scheme of things they should be relatively cheap, but like timers I 
wouldn't put them in hot loops. 

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


[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #91029)

2024-05-08 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #91029)

2024-05-08 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

> @JDevlieghere , do you know if there's a way to run buildbot on a merge of 
> this PR and main branch - just to validate the build/tests work before this 
> merge?

Not that I know. When failures are macOS specific I'm happy to apply a PR 
locally and run the test suite and other folks with specific configurations 
might do the same, but that's about all I can think of.

> The [llvm contributing 
> guide](https://llvm.org/docs/MyFirstTypoFix.html#myfirsttypofix-issues-after-landing-your-pr)
>  says this is normal workflow - but I worry since I am using a lot of the 
> maintainers' time to merge / revert the changes for me since I don't have 
> write access.

No worries, it's totally normal and we're happy to help with that!



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


[Lldb-commits] [lldb] [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (PR #91146)

2024-05-08 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb/crashlog] Enforce image loading policy (PR #91109)

2024-05-08 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] Add a dependency from lldb-sbapi-dwarf-enums as a dependency of libll… (PR #91511)

2024-05-08 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb][DWARF] Sort ranges list in dwarf 5. (PR #91343)

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

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


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


[Lldb-commits] [lldb] [lldb][breakpointoptions] Make disabled keyword red (PR #91404)

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


@@ -534,7 +534,8 @@ void BreakpointOptions::GetDescription(Stream *s,
 
 if (m_ignore_count > 0)
   s->Printf("ignore: %d ", m_ignore_count);
-s->Printf("%sabled ", m_enabled ? "en" : "dis");
+s->PutCStringColorHighlighted(m_enabled ? "enabled " : "disabled ",
+  m_disbaled_breakpoint_highlight_settings);

JDevlieghere wrote:

This is going to regex search for disabled and then replace it with its colored 
variant. That seems unnecessarily inefficient. You know whether you're going to 
put enabled or disabled, so you could print it colored right away. 

You might also have to check the debugger setting for whether colors are 
enabled (`Debugger::GetUseColor()`). Sometimes it's set at the stream level: 
the stream might have colors disabled if it was created somewhere were the 
setting was checked). I don't know if that's always going to be the case here. 
If it's not, we should check the setting here. To find out I would run lldb 
with `--no-use-colors` and see if the colors still get printed. 

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


[Lldb-commits] [lldb] [lldb] Reinstate lldb-sbapi-dwarf-enums target (NFC) (PR #91390)

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

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


[Lldb-commits] [lldb] [lldb] Reinstate lldb-sbapi-dwarf-enums target (NFC) (PR #91390)

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

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/91390

Alex pointed out in #91254 that we only need the custom target if we had more 
than one target depending on it. This isn't the case upstream, but on our 
downstream fork, we have a second dependency. Reintroduce the target so that 
everything can depend on that, without the single-dependency foot-gun.

>From 3315ede7d03b8a0e5abf5db948e20a93f5530fb2 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Tue, 7 May 2024 13:05:34 -0700
Subject: [PATCH] [lldb] Reinstate lldb-sbapi-dwarf-enums target (NFC)

Alex pointed out in #91254 that we only need the custom target if we had
more than one target depending on it. This isn't the case upstream, but
on our downstream fork, we have a second dependency. Reintroduce the
target so that everything can depend on that, without the
single-dependency foot-gun.
---
 lldb/source/API/CMakeLists.txt | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index 798a92874f13d..aa31caddfde3a 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -20,7 +20,7 @@ if(LLDB_ENABLE_LUA)
   set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
 endif()
 
-# Target to generate SBLanguages.h from Dwarf.def.
+# Generate SBLanguages.h from Dwarf.def.
 set(sb_languages_file
   ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
 add_custom_command(
@@ -33,6 +33,8 @@ add_custom_command(
   DEPENDS ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
   WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR}
 )
+add_custom_target(lldb-sbapi-dwarf-enums
+  DEPENDS ${sb_languages_file})
 
 add_lldb_library(liblldb SHARED ${option_framework}
   SBAddress.cpp
@@ -113,7 +115,9 @@ add_lldb_library(liblldb SHARED ${option_framework}
   SystemInitializerFull.cpp
   ${lldb_python_wrapper}
   ${lldb_lua_wrapper}
-  ${sb_languages_file}
+
+  DEPENDS
+lldb-sbapi-dwarf-enums
 
   LINK_LIBS
 lldbBreakpoint

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


[Lldb-commits] [lldb] [lldb] Request crash report when prompting for a bug report on Darwin (PR #91371)

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

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


[Lldb-commits] [lldb] [lldb] Request crash report when prompting for a bug report on Darwin (PR #91371)

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

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/91371

On Darwin platforms, the system will generate a crash report in 
~/Library/Logs/DiagnosticReports/ when a process crashes.

These reports are much more useful than the "pretty backtraces" printed by LLVM 
and are preferred when filing bug reports on Darwin.

>From 5821138c31b91b4e1df5757db23f571292f925a0 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Tue, 7 May 2024 11:15:22 -0700
Subject: [PATCH] [lldb] Request crash report when prompting for a bug report
 on Darwin

On Darwin platforms, the system will generate a crash report in
~/Library/Logs/DiagnosticReports/ when a process crashes.

These reports are much more useful than the "pretty backtraces" printed
by LLVM and are preferred when filing bug reports on Darwin.
---
 lldb/tools/driver/Driver.cpp | 6 ++
 lldb/tools/lldb-dap/lldb-dap.cpp | 6 ++
 2 files changed, 12 insertions(+)

diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index a821699c5e2ec2..14371da64f2f2f 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -733,8 +733,14 @@ int main(int argc, char const *argv[]) {
   // Setup LLVM signal handlers and make sure we call llvm_shutdown() on
   // destruction.
   llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
+#if !defined(__APPLE__)
   llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
 " and include the crash backtrace.\n");
+#else
+  llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
+" and include the crash report from "
+"~/Library/Logs/DiagnosticReports/.\n");
+#endif
 
   // Parse arguments.
   LLDBOptTable T;
diff --git a/lldb/tools/lldb-dap/lldb-dap.cpp b/lldb/tools/lldb-dap/lldb-dap.cpp
index cf52a22b18cc14..f35abd665e8449 100644
--- a/lldb/tools/lldb-dap/lldb-dap.cpp
+++ b/lldb/tools/lldb-dap/lldb-dap.cpp
@@ -4192,8 +4192,14 @@ int SetupStdoutStderrRedirection() {
 
 int main(int argc, char *argv[]) {
   llvm::InitLLVM IL(argc, argv, /*InstallPipeSignalExitHandler=*/false);
+#if !defined(__APPLE__)
   llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
 " and include the crash backtrace.\n");
+#else
+  llvm::setBugReportMsg("PLEASE submit a bug report to " LLDB_BUG_REPORT_URL
+" and include the crash report from "
+"~/Library/Logs/DiagnosticReports/.\n");
+#endif
 
   llvm::SmallString<256> program_path(argv[0]);
   llvm::sys::fs::make_absolute(program_path);

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


[Lldb-commits] [lldb] SBDebugger: Add new APIs `AddDestroyCallback` and `RemoveDestroyCallback` (PR #89868)

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


@@ -731,8 +747,11 @@ class Debugger : public 
std::enable_shared_from_this,
   lldb::TargetSP m_dummy_target_sp;
   Diagnostics::CallbackID m_diagnostics_callback_id;
 
-  lldb_private::DebuggerDestroyCallback m_destroy_callback = nullptr;
-  void *m_destroy_callback_baton = nullptr;
+  std::recursive_mutex m_destroy_callback_mutex;

JDevlieghere wrote:

@bulbazord But that's only if you call `Debugger::Destroy` (and therefore run 
the callbacks) on another thread, right? Given nothing else in `(SB)Debugger` 
provides such safety guarantees (besides the global debugger list) I'd say 
let's not overthink this and if we want to change that, let's do it 
holistically for the whole class instead of piecemeal. 

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


[Lldb-commits] [lldb] [lldb] Use add_custom_command for SBLanguages.h (PR #91254)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] [lldb] Use add_custom_command for SBLanguages.h (PR #91254)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

Good point. I can't imagine anything needing the SB header that doesn't need 
the rest of the framework, but if that's the case we go through a custom 
target. 

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


[Lldb-commits] [lldb] [lldb] Fixed SyntaxWarning: invalid escape sequence \[ \d \s (PR #91146)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

JDevlieghere wrote:

The change itself looks fine, but can you please add a bit more info to the 
commit message, such as the Python version you're seeing this with. 

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


[Lldb-commits] [lldb] [lldb/crashlog] Update incorrect help message for `--no-crashed-only` option (PR #91162)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb] Use Python script to generate SBLanguages.h (PR #90753)

2024-05-06 Thread Jonas Devlieghere via lldb-commits


@@ -20,9 +20,19 @@ if(LLDB_ENABLE_LUA)
   set(lldb_lua_wrapper ${lua_bindings_dir}/LLDBWrapLua.cpp)
 endif()
 
-lldb_tablegen(../../include/lldb/API/SBLanguages.h -gen-lldb-sbapi-dwarf-enum
-  SOURCE ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
-  TARGET lldb-sbapi-dwarf-enums)
+# Target to generate SBLanguages.h from Dwarf.def.
+set(sb_languages_file
+  ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
+add_custom_target(

JDevlieghere wrote:

https://github.com/llvm/llvm-project/pull/91254

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


[Lldb-commits] [lldb] [lldb] Use add_custom_command for SBLanguages.h (PR #91254)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/91254

Use add_custom_command instead of add_custom_target to generate SBLanguages.h.

>From 7fa130d2bb2e45f350ca8c3851d32bbec3332f8c Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Mon, 6 May 2024 11:48:24 -0700
Subject: [PATCH] [lldb] Use add_custom_command for SBLanguages.h

Use add_custom_command instead of add_custom_target to generate
SBLanguages.h.
---
 lldb/source/API/CMakeLists.txt | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index a64c0d4a333425..798a92874f13d1 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -23,13 +23,13 @@ endif()
 # Target to generate SBLanguages.h from Dwarf.def.
 set(sb_languages_file
   ${CMAKE_CURRENT_BINARY_DIR}/../../include/lldb/API/SBLanguages.h)
-add_custom_target(
-  lldb-sbapi-dwarf-enums
-  "${Python3_EXECUTABLE}"
+add_custom_command(
+  COMMENT "Generating SBLanguages.h from Dwarf.def"
+  COMMAND "${Python3_EXECUTABLE}"
   ${LLDB_SOURCE_DIR}/scripts/generate-sbapi-dwarf-enum.py
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
   -o ${sb_languages_file}
-  BYPRODUCTS ${sb_languages_file}
+  OUTPUT ${sb_languages_file}
   DEPENDS ${LLVM_MAIN_INCLUDE_DIR}/llvm/BinaryFormat/Dwarf.def
   WORKING_DIRECTORY ${LLVM_LIBRARY_OUTPUT_INTDIR}
 )
@@ -113,9 +113,7 @@ add_lldb_library(liblldb SHARED ${option_framework}
   SystemInitializerFull.cpp
   ${lldb_python_wrapper}
   ${lldb_lua_wrapper}
-
-  DEPENDS
-lldb-sbapi-dwarf-enums
+  ${sb_languages_file}
 
   LINK_LIBS
 lldbBreakpoint

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


[Lldb-commits] [lldb] lldb create API folder if it does not exist, before creating SBLangua… (PR #91128)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

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


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


[Lldb-commits] [lldb] [lldb/crashlog] Update incorrect help message for `--no-crashed-only` option (PR #91162)

2024-05-06 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere commented:

Since we're already using `argparse`, can we use the `BooleanOptionalAction` to 
make this work automatically with the affirmative option? 
https://docs.python.org/3.9/library/argparse.html#action

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


[Lldb-commits] [lldb] [lldb] Verify target stop-hooks support with scripted process (PR #91107)

2024-05-06 Thread Jonas Devlieghere via lldb-commits


@@ -100,6 +111,10 @@ def get_register_context(self) -> str:
 
 def __lldb_init_module(debugger, dict):
 if not "SKIP_SCRIPTED_PROCESS_LAUNCH" in os.environ:
+debugger.HandleCommand(

JDevlieghere wrote:

This seems like it would be worth documenting in a comment?

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


[Lldb-commits] [lldb] Revert "[lldb] Unify CalculateMD5 return types" (PR #90998)

2024-05-03 Thread Jonas Devlieghere via lldb-commits

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


[Lldb-commits] [lldb] Revert "[lldb] Unify CalculateMD5 return types" (PR #90998)

2024-05-03 Thread Jonas Devlieghere via lldb-commits

https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/90998

Reverts llvm/llvm-project#90921

>From 2beb507e10a6dbe6387bc67143601a66b0168293 Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere 
Date: Fri, 3 May 2024 12:14:36 -0700
Subject: [PATCH] Revert "[lldb] Unify CalculateMD5 return types (#90921)"

This reverts commit 2f58b9aae2d6f1aeaecd98766ef31cebc0dcbb5b.
---
 lldb/include/lldb/Target/Platform.h   |  4 +--
 .../include/lldb/Target/RemoteAwarePlatform.h |  4 +--
 .../Platform/MacOSX/PlatformDarwinDevice.cpp  | 16 -
 .../gdb-server/PlatformRemoteGDBServer.cpp|  8 ++---
 .../gdb-server/PlatformRemoteGDBServer.h  |  4 +--
 .../GDBRemoteCommunicationClient.cpp  | 30 ++--
 .../gdb-remote/GDBRemoteCommunicationClient.h |  2 +-
 lldb/source/Target/Platform.cpp   | 36 ++-
 lldb/source/Target/RemoteAwarePlatform.cpp|  8 ++---
 9 files changed, 52 insertions(+), 60 deletions(-)

diff --git a/lldb/include/lldb/Target/Platform.h 
b/lldb/include/lldb/Target/Platform.h
index e05c79cb501bf0..ad9c9dcbe684ba 100644
--- a/lldb/include/lldb/Target/Platform.h
+++ b/lldb/include/lldb/Target/Platform.h
@@ -649,8 +649,8 @@ class Platform : public PluginInterface {
 
   virtual std::string GetPlatformSpecificConnectionInformation() { return ""; }
 
-  virtual llvm::ErrorOr
-  CalculateMD5(const FileSpec _spec);
+  virtual bool CalculateMD5(const FileSpec _spec, uint64_t ,
+uint64_t );
 
   virtual uint32_t GetResumeCountForLaunchInfo(ProcessLaunchInfo _info) 
{
 return 1;
diff --git a/lldb/include/lldb/Target/RemoteAwarePlatform.h 
b/lldb/include/lldb/Target/RemoteAwarePlatform.h
index 0b9d79f9ff0380..d183815e1c8b07 100644
--- a/lldb/include/lldb/Target/RemoteAwarePlatform.h
+++ b/lldb/include/lldb/Target/RemoteAwarePlatform.h
@@ -58,8 +58,8 @@ class RemoteAwarePlatform : public Platform {
   Status SetFilePermissions(const FileSpec _spec,
 uint32_t file_permissions) override;
 
-  llvm::ErrorOr
-  CalculateMD5(const FileSpec _spec) override;
+  bool CalculateMD5(const FileSpec _spec, uint64_t ,
+uint64_t ) override;
 
   Status GetFileWithUUID(const FileSpec _file, const UUID *uuid,
  FileSpec _file) override;
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp 
b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
index 82156aca8cf159..52777909a1f825 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinDevice.cpp
@@ -405,21 +405,17 @@ lldb_private::Status 
PlatformDarwinDevice::GetSharedModuleWithLocalCache(
   // when going over the *slow* GDB remote transfer mechanism we first
   // check the hashes of the files - and only do the actual transfer if
   // they differ
+  uint64_t high_local, high_remote, low_local, low_remote;
   auto MD5 = llvm::sys::fs::md5_contents(module_cache_spec.GetPath());
   if (!MD5)
 return Status(MD5.getError());
+  std::tie(high_local, low_local) = MD5->words();
 
-  Log *log = GetLog(LLDBLog::Platform);
-  bool requires_transfer = true;
-  llvm::ErrorOr remote_md5 =
-  m_remote_platform_sp->CalculateMD5(module_spec.GetFileSpec());
-  if (std::error_code ec = remote_md5.getError())
-LLDB_LOG(log, "couldn't get md5 sum from remote: {0}",
- ec.message());
-  else
-requires_transfer = *MD5 != *remote_md5;
-  if (requires_transfer) {
+  m_remote_platform_sp->CalculateMD5(module_spec.GetFileSpec(),
+ low_remote, high_remote);
+  if (low_local != low_remote || high_local != high_remote) {
 // bring in the remote file
+Log *log = GetLog(LLDBLog::Platform);
 LLDB_LOGF(log,
   "[%s] module %s/%s needs to be replaced from remote 
copy",
   (IsHost() ? "host" : "remote"),
diff --git 
a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp 
b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index 4684947ede209f..0dce5add2e3759 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -684,12 +684,12 @@ Status PlatformRemoteGDBServer::RunShellCommand(
   signo_ptr, command_output, timeout);
 }
 
-llvm::ErrorOr
-PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec) {
+bool PlatformRemoteGDBServer::CalculateMD5(const FileSpec _spec,
+   uint64_t , uint64_t ) {
   if (!IsConnected())
-return std::make_error_code(std::errc::not_connected);
+return false;
 
-  return 

[Lldb-commits] [lldb] [lldb] Unify CalculateMD5 return types (PR #90921)

2024-05-03 Thread Jonas Devlieghere via lldb-commits

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


  1   2   3   4   5   6   7   8   9   10   >