[Lldb-commits] [lldb] Add new API in SBTarget for loading core from SBFile (PR #71769)

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 9 09:37:36 PST 2023


================
@@ -67,30 +67,33 @@ class ProcessFreeBSDKernelKVM : public ProcessFreeBSDKernel {
 } // namespace
 
 ProcessFreeBSDKernel::ProcessFreeBSDKernel(lldb::TargetSP target_sp,
-                                           ListenerSP listener_sp)
-    : PostMortemProcess(target_sp, listener_sp) {}
+                                           ListenerSP listener_sp,
+                                           lldb::FileSP crash_file_sp)
+    : PostMortemProcess(target_sp, listener_sp, crash_file_sp) {}
 
 lldb::ProcessSP ProcessFreeBSDKernel::CreateInstance(lldb::TargetSP target_sp,
                                                      ListenerSP listener_sp,
-                                                     const FileSpec *crash_file,
+                                                     lldb::FileSP crash_file_sp,
                                                      bool can_connect) {
   ModuleSP executable = target_sp->GetExecutableModule();
   if (crash_file && !can_connect && executable) {
+    const FileSpec file_spec;
+    crash_file_sp->GetFileSpec(const_cast<FileSpec &>(file_spec));
----------------
bulbazord wrote:

Same here as before, why are you making a const file spec and then const casting to fill it in?

https://github.com/llvm/llvm-project/pull/71769


More information about the lldb-commits mailing list