[lldb][DYLD][NFC] Dedupe calls to CreateBreakpoint

These only differ in the modules passed to them. Also I've
swapped the if order so we have the "positive" check first.
This commit is contained in:
David Spickett 2023-10-16 10:13:47 +00:00
parent 1d43096e16
commit 17fce28683

View File

@ -337,29 +337,20 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
};
ModuleSP interpreter = LoadInterpreterModule();
if (!interpreter) {
FileSpecList containingModules;
FileSpecList containingModules;
if (interpreter)
containingModules.Append(interpreter->GetFileSpec());
else
containingModules.Append(
m_process->GetTarget().GetExecutableModulePointer()->GetFileSpec());
dyld_break = target.CreateBreakpoint(
&containingModules, /*containingSourceFiles=*/nullptr,
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
/*m_offset=*/0,
/*skip_prologue=*/eLazyBoolNo,
/*internal=*/true,
/*request_hardware=*/false);
} else {
FileSpecList containingModules;
containingModules.Append(interpreter->GetFileSpec());
dyld_break = target.CreateBreakpoint(
&containingModules, /*containingSourceFiles=*/nullptr,
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
/*m_offset=*/0,
/*skip_prologue=*/eLazyBoolNo,
/*internal=*/true,
/*request_hardware=*/false);
}
dyld_break = target.CreateBreakpoint(
&containingModules, /*containingSourceFiles=*/nullptr,
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
/*m_offset=*/0,
/*skip_prologue=*/eLazyBoolNo,
/*internal=*/true,
/*request_hardware=*/false);
}
if (dyld_break->GetNumResolvedLocations() != 1) {