Skip to content

Commit 738ead2

Browse files
authored
[lldb] Fix FreeBSD/NetBSD plugin build after AsCString API change (llvm#192110)
The argument to `AsCString` was made explicit in 116b045. ``` /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
1 parent 7145f89 commit 738ead2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lldb/source/Plugins/Process/FreeBSD/NativeProcessFreeBSD.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -749,9 +749,9 @@ Status NativeProcessFreeBSD::GetLoadedModuleFileSpec(const char *module_path,
749749
return Status();
750750
}
751751
}
752-
return Status::FromErrorStringWithFormat(
753-
"Module file (%s) not found in process' memory map!",
754-
module_file_spec.GetFilename().AsCString());
752+
return Status::FromErrorStringWithFormatv(
753+
"Module file ({0}) not found in process' memory map!",
754+
module_file_spec.GetFilename());
755755
}
756756

757757
Status

lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,9 @@ Status NativeProcessNetBSD::GetLoadedModuleFileSpec(const char *module_path,
770770
return Status();
771771
}
772772
}
773-
return Status::FromErrorStringWithFormat(
774-
"Module file (%s) not found in process' memory map!",
775-
module_file_spec.GetFilename().AsCString());
773+
return Status::FromErrorStringWithFormatv(
774+
"Module file ({0}) not found in process' memory map!",
775+
module_file_spec.GetFilename());
776776
}
777777

778778
Status NativeProcessNetBSD::GetFileLoadAddress(const llvm::StringRef &file_name,

0 commit comments

Comments
 (0)