[Lldb-commits] [lldb] 738ead2 - [lldb] Fix FreeBSD/NetBSD plugin build after AsCString API change (#192110)

via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 15 01:34:19 PDT 2026


Author: Evan Wilde
Date: 2026-04-15T09:34:13+01:00
New Revision: 738ead2c739a6b1999db63a187185d00e534c747

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

LOG: [lldb] Fix FreeBSD/NetBSD plugin build after AsCString API change (#192110)

The argument to `AsCString` was made explicit in
116b045b1e2bff462afff0dc0b06218e6074f427.

```
/home/ewilde/llvm-project/freebsd-lldb-build/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp:754:48: error: too few arguments to function call, single argument 'value_if_empty' was not specified
  754 |       module_file_spec.GetFilename().AsCString());
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/home/ewilde/llvm-project/freebsd-lldb-build/lldb/include/lldb/Utility/ConstString.h:183:15: note: 'AsCString' declared here
  183 |   const char *AsCString(const char *value_if_empty) const {
      |               ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

Not all use-sites were updated to pass an argument resulting in build
failures. I'm updating the errors in the FreeBSD and NetBSD plugins to
use formatv instead of expanding the C String, like what is done on
Linux, avoiding the issue entirely.

rdar://174675042

Added: 
    

Modified: 
    lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
    lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
index 38866ed971ffe..46e9ac1cfd6fa 100644
--- a/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
+++ b/lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp
@@ -749,9 +749,9 @@ Status NativeProcessFreeBSD::GetLoadedModuleFileSpec(const char *module_path,
       return Status();
     }
   }
-  return Status::FromErrorStringWithFormat(
-      "Module file (%s) not found in process' memory map!",
-      module_file_spec.GetFilename().AsCString());
+  return Status::FromErrorStringWithFormatv(
+      "Module file ({0}) not found in process' memory map!",
+      module_file_spec.GetFilename());
 }
 
 Status

diff  --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
index 745fcedfe8ad7..3fd14c4c43071 100644
--- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -770,9 +770,9 @@ Status NativeProcessNetBSD::GetLoadedModuleFileSpec(const char *module_path,
       return Status();
     }
   }
-  return Status::FromErrorStringWithFormat(
-      "Module file (%s) not found in process' memory map!",
-      module_file_spec.GetFilename().AsCString());
+  return Status::FromErrorStringWithFormatv(
+      "Module file ({0}) not found in process' memory map!",
+      module_file_spec.GetFilename());
 }
 
 Status NativeProcessNetBSD::GetFileLoadAddress(const llvm::StringRef &file_name,


        


More information about the lldb-commits mailing list