Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 1 addition & 56 deletions lldb/source/Expression/IRExecutionUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,62 +582,7 @@ lldb::SectionType IRExecutionUnit::GetSectionTypeFromSectionName(
else if (name.starts_with("__debug_") || name.starts_with(".debug_")) {
const uint32_t name_idx = name[0] == '_' ? 8 : 7;
llvm::StringRef dwarf_name(name.substr(name_idx));
switch (dwarf_name[0]) {
case 'a':
if (dwarf_name == "abbrev")
sect_type = lldb::eSectionTypeDWARFDebugAbbrev;
else if (dwarf_name == "aranges")
sect_type = lldb::eSectionTypeDWARFDebugAranges;
else if (dwarf_name == "addr")
sect_type = lldb::eSectionTypeDWARFDebugAddr;
break;

case 'f':
if (dwarf_name == "frame")
sect_type = lldb::eSectionTypeDWARFDebugFrame;
break;

case 'i':
if (dwarf_name == "info")
sect_type = lldb::eSectionTypeDWARFDebugInfo;
break;

case 'l':
if (dwarf_name == "line")
sect_type = lldb::eSectionTypeDWARFDebugLine;
else if (dwarf_name == "loc")
sect_type = lldb::eSectionTypeDWARFDebugLoc;
else if (dwarf_name == "loclists")
sect_type = lldb::eSectionTypeDWARFDebugLocLists;
break;

case 'm':
if (dwarf_name == "macinfo")
sect_type = lldb::eSectionTypeDWARFDebugMacInfo;
break;

case 'p':
if (dwarf_name == "pubnames")
sect_type = lldb::eSectionTypeDWARFDebugPubNames;
else if (dwarf_name == "pubtypes")
sect_type = lldb::eSectionTypeDWARFDebugPubTypes;
break;

case 's':
if (dwarf_name == "str")
sect_type = lldb::eSectionTypeDWARFDebugStr;
else if (dwarf_name == "str_offsets")
sect_type = lldb::eSectionTypeDWARFDebugStrOffsets;
break;

case 'r':
if (dwarf_name == "ranges")
sect_type = lldb::eSectionTypeDWARFDebugRanges;
break;

default:
break;
}
sect_type = ObjectFile::GetDWARFSectionTypeFromName(dwarf_name);
} else if (name.starts_with("__apple_") || name.starts_with(".apple_"))
sect_type = lldb::eSectionTypeInvalid;
else if (name == "__objc_imageinfo")
Expand Down
9 changes: 7 additions & 2 deletions lldb/source/Plugins/TypeSystem/Swift/SwiftASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,9 @@ void SwiftASTContext::SetCompilerInvocationLLDBOverrides() {
m_compiler_invocation_ap->getIRGenOptions();
ir_gen_opts.OutputKind = swift::IRGenOutputKind::Module;
ir_gen_opts.UseJIT = true;
// In the JIT we don't benefit from the indexed indirections in DWARF 5.
ir_gen_opts.DWARFVersion = 4;
ir_gen_opts.DebugInfoFormat = swift::IRGenDebugInfoFormat::DWARF;
// Allow deserializing @_implementationOnly dependencies
// to avoid crashing due to module recovery issues.
swift::LangOptions &lang_opts = m_compiler_invocation_ap->getLangOptions();
Expand Down Expand Up @@ -3037,6 +3040,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
// perform implicit Clang module imports. They will always use the SDK
// version as deployment target, even if that is in the future. To
// avoid building modules twice, match this behavior.
auto &ci_args = swift_ast_sp->GetClangImporterOptions().ExtraArgs;
auto darwin_sdk_info = clang::parseDarwinSDKInfo(
*llvm::vfs::getRealFileSystem(), swift_ast_sp->GetPlatformSDKPath());
if (!darwin_sdk_info)
Expand All @@ -3045,10 +3049,11 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
auto sdk_triple = triple;
sdk_triple.setOSName(std::string(triple.getOSTypeName(triple.getOS())) +
(*darwin_sdk_info)->getVersion().getAsString());
auto &ci_args = swift_ast_sp->GetClangImporterOptions().ExtraArgs;
ci_args.push_back("-target");
ci_args.push_back(sdk_triple.str());
}
ci_args.push_back("-gmodules");
ci_args.push_back("-g");
}

std::vector<swift::PluginSearchOption> plugin_search_options;
Expand Down Expand Up @@ -3190,7 +3195,7 @@ lldb::TypeSystemSP SwiftASTContext::CreateInstance(
{
auto ast_context = swift_ast_sp->GetASTContext();
if (!ast_context) {
logError("couldn't initialize Swift cxompiler");
logError("couldn't initialize Swift compiler");
return {};
}

Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Symbol/ObjectFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ ObjectFile::GetDWARFSectionTypeFromName(llvm::StringRef name) {
.Case("rnglists.dwo", eSectionTypeDWARFDebugRngListsDwo)
.Case("str", eSectionTypeDWARFDebugStr)
.Case("str.dwo", eSectionTypeDWARFDebugStrDwo)
.Case("str_offsets", eSectionTypeDWARFDebugStrOffsets)
.Cases("str_offsets", "str_offs", eSectionTypeDWARFDebugStrOffsets)
.Case("str_offsets.dwo", eSectionTypeDWARFDebugStrOffsetsDwo)
.Case("tu_index", eSectionTypeDWARFDebugTuIndex)
.Case("types", eSectionTypeDWARFDebugTypes)
Expand Down
1 change: 0 additions & 1 deletion lldb/test/Shell/SwiftREPL/FrameworkPath.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
REQUIRES: rdar159531316
// Test target.swift-framework-search-paths works in the REPL.
// REQUIRES: system-darwin
// REQUIRES: swift
Expand Down
1 change: 0 additions & 1 deletion lldb/test/Shell/SwiftREPL/ImportCocoa.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// REQUIRES: rdar159531346
// Test that importing Cocoa works.
// REQUIRES: system-darwin
// REQUIRES: swift
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
REQUIRES: rdar159531365
// This test checks that the value of the symbols.swift-module-loading-mode
// setting is respected when loading Swift modules.
// Note: It intentionally does not check the only-interface or prefer-interface
Expand Down