https://github.com/charles-zablit created 
https://github.com/llvm/llvm-project/pull/206060

`MAX_PATH` is defined as `260`. `PosixApi.h` already defines `PATH_MAX` as 
`32,768` characters which is the max path limit for Unicode paths on Windows.

Use this in lldb on Windows to avoid path truncation.

>From d1ba499d7f90814431efbc9bfbcf6db7d8be105e Mon Sep 17 00:00:00 2001
From: Charles Zablit <[email protected]>
Date: Fri, 26 Jun 2026 14:27:43 +0100
Subject: [PATCH] [lldb][Windows] Support debugging executables in paths longer
 than MAX_PATH

---
 lldb/tools/driver/Platform.h | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lldb/tools/driver/Platform.h b/lldb/tools/driver/Platform.h
index ff017c4422b12..f2491dcf399bb 100644
--- a/lldb/tools/driver/Platform.h
+++ b/lldb/tools/driver/Platform.h
@@ -28,9 +28,6 @@ typedef unsigned char cc_t;
 typedef unsigned int speed_t;
 typedef unsigned int tcflag_t;
 
-// fcntl.h
-#define O_NOCTTY 0400
-
 // ioctls.h
 #define TIOCGWINSZ 0x5413
 
@@ -60,8 +57,7 @@ struct timeval {
   long tv_sec;
   long tv_usec;
 };
-typedef long pid_t;
-#define PATH_MAX MAX_PATH
+#include "lldb/Host/PosixApi.h"
 #endif
 
 #define STDIN_FILENO 0

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to