[Lldb-commits] [lldb] [vscode-lldb] Restart server when the lldb-dap binary's modification time has changed (PR #159481)
Walter Erquinigo via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 19 09:06:39 PDT 2025
================
@@ -149,27 +149,40 @@ Restarting the server will interrupt any existing debug sessions and start a new
this.cleanUp(this.serverProcess);
}
- cleanUp(process: child_process.ChildProcessWithoutNullStreams) {
+ private cleanUp(process: child_process.ChildProcessWithoutNullStreams) {
// If the following don't equal, then the fields have already been updated
// (either a new process has started, or the fields were already cleaned
// up), and so the cleanup should be skipped.
if (this.serverProcess === process) {
this.serverProcess = undefined;
this.serverInfo = undefined;
+ this.serverSpawnInfo = undefined;
}
}
- getSpawnInfo(
+ private async getSpawnInfo(
path: string,
args: string[],
env: NodeJS.ProcessEnv | { [key: string]: string } | undefined,
- ): string[] {
+ ): Promise<string[]> {
return [
path,
...args,
...Object.entries(env ?? {}).map(
(entry) => String(entry[0]) + "=" + String(entry[1]),
),
+ `(${await this.getFileModifiedTimestamp(path)})`,
];
}
+
+ private async getFileModifiedTimestamp(file: string): Promise<string | null> {
+ try {
+ if (!(await fs.pathExists(file))) {
+ return null;
+ }
+ return (await fs.promises.stat(file)).mtime.toLocaleString();
+ } catch (error) {
+ return null;
+ }
+ }
----------------
walter-erquinigo wrote:
I was wrong. What my extensions were using is https://www.npmjs.com/package/chokidar
Try using that one
https://github.com/llvm/llvm-project/pull/159481
More information about the lldb-commits
mailing list