Skip to content

Commit 8b94997

Browse files
[lldb][windows] fix invalid corefile error message (#170471)
1 parent 2fc1275 commit 8b94997

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ namespace lldb_private {
7979

8080
ProcessSP ProcessWindows::CreateInstance(lldb::TargetSP target_sp,
8181
lldb::ListenerSP listener_sp,
82-
const FileSpec *,
82+
const FileSpec *crash_file_path,
8383
bool can_connect) {
84+
if (crash_file_path)
85+
return nullptr; // Cannot create a Windows process from a crash_file
8486
return ProcessSP(new ProcessWindows(target_sp, listener_sp));
8587
}
8688

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,9 @@ void ProcessGDBRemote::Terminate() {
210210
lldb::ProcessSP ProcessGDBRemote::CreateInstance(
211211
lldb::TargetSP target_sp, ListenerSP listener_sp,
212212
const FileSpec *crash_file_path, bool can_connect) {
213-
lldb::ProcessSP process_sp;
214-
if (crash_file_path == nullptr)
215-
process_sp = std::shared_ptr<ProcessGDBRemote>(
216-
new ProcessGDBRemote(target_sp, listener_sp));
217-
return process_sp;
213+
if (crash_file_path)
214+
return nullptr; // Cannot create a GDBRemote process from a crash_file
215+
return lldb::ProcessSP(new ProcessGDBRemote(target_sp, listener_sp));
218216
}
219217

220218
void ProcessGDBRemote::DumpPluginHistory(Stream &s) {

0 commit comments

Comments
 (0)