================
@@ -24,7 +26,20 @@ class PostMortemProcess : public Process {
using Process::Process;
public:
+ PostMortemProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
+ lldb::FileSP file_sp)
+ : Process(target_sp, listener_sp), m_core_file(file_sp) {}
+
bool IsLiveDebugSession() const override { return false; }
+
+ FileSpec GetCoreFile() const override {
+ const FileSpec file_spec;
+ m_core_file->GetFileSpec(const_cast<FileSpec &>(file_spec));
+ return file_spec;
----------------
JDevlieghere wrote:
I'm not sure I understand what's going on here. You're marking the local
variable as `const` only to immediately `const_cast` it away in the line below?
Can't you avoid all this like so:
```
FileSpec file_spec;
m_core_file->GetFileSpec(file_spec);
```
or even better, why doesn't `GetFileSpec` return a `FileSpec` instead of an out
parameter?
```
https://github.com/llvm/llvm-project/pull/71769
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits