[Lldb-commits] [lldb] Control the "step out through thunk" logic explicitly when pushing thread plans (PR #129301)

2025-03-02 Thread Med Ismail Bennani via lldb-commits

medismailben wrote:

Sorry for the delay, LGTM

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


[Lldb-commits] [lldb] Push down the swig module to avoid an import cycle (PR #129135)

2025-03-02 Thread via lldb-commits

dingxiangfei2009 wrote:

Thank you so much, @JDevlieghere!

Yes, you may hit the merge button. 🙏

Jonas Devlieghere ***@***.***> schrieb am Fr. 28. Feb. 2025
um 16:35:

> ***@***. approved this pull request.
>
> LGTM. Thanks for adding the comment with the motivation!
>
> @dingxiangfei2009  please let me
> know if you need me to press the merge button for you.
>
> —
> Reply to this email directly, view it on GitHub
> ,
> or unsubscribe
> 
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>


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


[Lldb-commits] [lldb] Fix a bug copying the stop hooks from the dummy target. (PR #129340)

2025-03-02 Thread Julian Lettner via lldb-commits

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

Thanks!

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


[Lldb-commits] [lldb] [lldb-dap] Implement a MemoryMonitor for macOS & Linux (PR #129332)

2025-03-02 Thread John Harrison via lldb-commits


@@ -0,0 +1,114 @@
+//===-- MemoryMonitor.cpp 
-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "MemoryMonitor.h"
+#include "llvm/ADT/ScopeExit.h"
+#include 
+#include 
+#include 
+#include 
+
+#if defined(__APPLE__)
+#include 
+#endif
+
+#if defined(__linux__)
+#include 
+#include 
+#include 
+#endif
+
+using namespace lldb_dap;
+
+#if defined(__APPLE__)
+class MemoryMonitorDarwin : public MemoryMonitor {
+  using MemoryMonitor::MemoryMonitor;
+  void Start() override {
+m_memory_pressure_source = dispatch_source_create(
+DISPATCH_SOURCE_TYPE_MEMORYPRESSURE,
+0, // system-wide monitoring
+DISPATCH_MEMORYPRESSURE_WARN | DISPATCH_MEMORYPRESSURE_CRITICAL,
+dispatch_get_main_queue());

ashgti wrote:

Do we call `dispatch_main` anywhere?

I don't know which thread would be considered the 'main' thread. I can't find 
if thats called in lldb.

I think we need that to be called for this queue to exist, right?

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


[Lldb-commits] [lldb] [lldb-dap] Adding server mode support to lldb-dap VSCode extension. (PR #128957)

2025-03-02 Thread Adrian Vogelsgesang via lldb-commits


@@ -115,41 +123,71 @@ export class LLDBDapDescriptorFactory
 }
 const configEnvironment =
   config.get<{ [key: string]: string }>("environment") || {};
-const dapPath = await getDAPExecutable(session);
+const dapPath = (await getDAPExecutable(session)) ?? executable?.command;
+
+if (!dapPath) {
+  LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage();
+  return undefined;
+}
+
+if (!(await isExecutable(dapPath))) {
+  LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(dapPath);
+  return;
+}
+
 const dbgOptions = {
   env: {
 ...executable?.options?.env,
 ...configEnvironment,
 ...env,
   },
 };
-if (dapPath) {
-  if (!(await isExecutable(dapPath))) {
-LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(dapPath);
-return undefined;
-  }
-  return new vscode.DebugAdapterExecutable(dapPath, [], dbgOptions);
-} else if (executable) {
-  if (!(await isExecutable(executable.command))) {
-
LLDBDapDescriptorFactory.showLLDBDapNotFoundMessage(executable.command);
-return undefined;
-  }
-  return new vscode.DebugAdapterExecutable(
-executable.command,
-executable.args,
-dbgOptions,
-  );
+const dbgArgs = executable?.args ?? [];
+
+const serverMode = config.get('serverMode', false);
+if (serverMode) {
+  const { host, port } = await this.startServer(dapPath, dbgArgs, 
dbgOptions);
+  return new vscode.DebugAdapterServer(port, host);
 }
-return undefined;
+
+return new vscode.DebugAdapterExecutable(dapPath, dbgArgs, dbgOptions);
+  }
+
+  startServer(dapPath: string, args: string[], options: 
child_process.CommonSpawnOptions): Promise<{ host: string, port: number }> {
+if (this.server) return this.server;

vogelsgesang wrote:

discussion continued in 
https://github.com/llvm/llvm-project/pull/129262#discussion_r1976240208

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