Skip to content

Commit 2721d50

Browse files
committed
Revert "[dsymutil] Avoid copying binary swiftmodules built from textual"
This reverts commit 39ace8a. while investigating Linux bot failures.
1 parent f869d6e commit 2721d50

File tree

11 files changed

+8
-272
lines changed

11 files changed

+8
-272
lines changed

lldb/source/Core/Statusline.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "lldb/Host/StreamFile.h"
1313
#include "lldb/Interpreter/CommandInterpreter.h"
1414
#include "lldb/Symbol/SymbolContext.h"
15-
#include "lldb/Target/Process.h"
1615
#include "lldb/Target/StackFrame.h"
1716
#include "lldb/Utility/AnsiTerminal.h"
1817
#include "lldb/Utility/StreamString.h"
@@ -127,23 +126,19 @@ void Statusline::Redraw(bool update) {
127126
return;
128127
}
129128

130-
ExecutionContext exe_ctx = m_debugger.GetSelectedExecutionContext();
129+
StreamString stream;
130+
ExecutionContext exe_ctx =
131+
m_debugger.GetCommandInterpreter().GetExecutionContext();
131132

132133
// For colors and progress events, the format entity needs access to the
133134
// debugger, which requires a target in the execution context.
134135
if (!exe_ctx.HasTargetScope())
135136
exe_ctx.SetTargetPtr(&m_debugger.GetSelectedOrDummyTarget());
136137

137138
SymbolContext symbol_ctx;
138-
if (ProcessSP process_sp = exe_ctx.GetProcessSP()) {
139-
Process::StopLocker stop_locker;
140-
if (stop_locker.TryLock(&process_sp->GetRunLock())) {
141-
if (auto frame_sp = exe_ctx.GetFrameSP())
142-
symbol_ctx = frame_sp->GetSymbolContext(eSymbolContextEverything);
143-
}
144-
}
139+
if (auto frame_sp = exe_ctx.GetFrameSP())
140+
symbol_ctx = frame_sp->GetSymbolContext(eSymbolContextEverything);
145141

146-
StreamString stream;
147142
if (auto *format = m_debugger.GetStatuslineFormat())
148143
FormatEntity::Format(*format, stream, &symbol_ctx, &exe_ctx, nullptr,
149144
nullptr, false, false);
Binary file not shown.
Binary file not shown.

llvm/test/tools/dsymutil/swiftmodule.test

Lines changed: 0 additions & 29 deletions
This file was deleted.

llvm/test/tools/dsymutil/yaml-object-address-rewrite.test

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@
1212
# CHECK-NEXT: objects:
1313
# CHECK-NEXT: filename:{{.*}}/Inputs/basic1.macho.x86_64.o
1414
# CHECK-NEXT: timestamp: 0
15-
# CHECK-NEXT: type: 102
1615
# CHECK-NEXT: symbols:
1716
# CHECK-NEXT: sym: _main, objAddr: 0x0, binAddr: 0x100000EA0, size: 0x24
1817
# CHECK-NEXT: filename:{{.*}}/Inputs/./libbasic.a(basic2.macho.x86_64.o)'
1918
# CHECK-NEXT: timestamp: 0
20-
# CHECK-NEXT: type: 102
2119
# CHECK-NEXT: symbols:
2220
# CHECK-DAG: sym: _foo, objAddr: 0x20, binAddr: 0x100000ED0, size: 0x50
2321
# CHECK-DAG: sym: _private_int, objAddr: 0x560, binAddr: 0x100001004, size: 0x0
@@ -26,7 +24,6 @@
2624
# CHECK-NOT: { sym:
2725
# CHECK-NEXT: filename:{{.*}}/Inputs/./libbasic.a(basic3.macho.x86_64.o)'
2826
# CHECK-NEXT: timestamp: 0
29-
# CHECK-NEXT: type: 102
3027
# CHECK-NEXT: symbols:
3128
# CHECK-DAG: sym: _val, binAddr: 0x100001008, size: 0x0
3229
# CHECK-DAG: sym: _bar, objAddr: 0x20, binAddr: 0x100000F40, size: 0x50

llvm/tools/dsymutil/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ add_llvm_tool(dsymutil
3232
MachOUtils.cpp
3333
Reproducer.cpp
3434
RelocationMap.cpp
35-
SwiftModule.cpp
3635

3736
DEPENDS
3837
intrinsics_gen

llvm/tools/dsymutil/DebugMap.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,12 @@ namespace yaml {
161161

162162
// Normalize/Denormalize between YAML and a DebugMapObject.
163163
struct MappingTraits<dsymutil::DebugMapObject>::YamlDMO {
164-
YamlDMO(IO &io) {}
164+
YamlDMO(IO &io) { Timestamp = 0; }
165165
YamlDMO(IO &io, dsymutil::DebugMapObject &Obj);
166166
dsymutil::DebugMapObject denormalize(IO &IO);
167167

168168
std::string Filename;
169-
int64_t Timestamp = 0;
170-
uint8_t Type = MachO::N_OSO;
169+
int64_t Timestamp;
171170
std::vector<dsymutil::DebugMapObject::YAMLSymbolMapping> Entries;
172171
};
173172

@@ -184,7 +183,6 @@ void MappingTraits<dsymutil::DebugMapObject>::mapping(
184183
MappingNormalization<YamlDMO, dsymutil::DebugMapObject> Norm(io, DMO);
185184
io.mapRequired("filename", Norm->Filename);
186185
io.mapOptional("timestamp", Norm->Timestamp);
187-
io.mapOptional("type", Norm->Type);
188186
io.mapRequired("symbols", Norm->Entries);
189187
}
190188

@@ -238,7 +236,6 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::YamlDMO(
238236
IO &io, dsymutil::DebugMapObject &Obj) {
239237
Filename = Obj.Filename;
240238
Timestamp = sys::toTimeT(Obj.getTimestamp());
241-
Type = Obj.getType();
242239
Entries.reserve(Obj.Symbols.size());
243240
for (auto &Entry : Obj.Symbols)
244241
Entries.push_back(
@@ -289,6 +286,7 @@ MappingTraits<dsymutil::DebugMapObject>::YamlDMO::denormalize(IO &IO) {
289286
}
290287
}
291288

289+
uint8_t Type = MachO::N_OSO;
292290
if (Path.ends_with(".dylib")) {
293291
// FIXME: find a more resilient way
294292
Type = MachO::N_LIB;

llvm/tools/dsymutil/DwarfLinkerForBinary.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include "BinaryHolder.h"
1111
#include "DebugMap.h"
1212
#include "MachOUtils.h"
13-
#include "SwiftModule.h"
1413
#include "dsymutil.h"
1514
#include "llvm/ADT/ArrayRef.h"
1615
#include "llvm/ADT/DenseMap.h"
@@ -784,21 +783,6 @@ bool DwarfLinkerForBinary::linkImpl(
784783
reportWarning("Could not open '" + File + "'");
785784
continue;
786785
}
787-
auto FromInterfaceOrErr =
788-
IsBuiltFromSwiftInterface((*ErrorOrMem)->getBuffer());
789-
if (!FromInterfaceOrErr) {
790-
reportWarning("Could not parse binary Swift module: " +
791-
toString(FromInterfaceOrErr.takeError()),
792-
Obj->getObjectFilename());
793-
// Only skip swiftmodules that could be parsed and are
794-
// positively identified as textual.
795-
} else if (*FromInterfaceOrErr) {
796-
if (Options.Verbose)
797-
outs() << "Skipping compiled textual Swift interface: "
798-
<< Obj->getObjectFilename() << "\n";
799-
continue;
800-
}
801-
802786
sys::fs::file_status Stat;
803787
if (auto Err = sys::fs::status(File, Stat)) {
804788
reportWarning(Err.message());

llvm/tools/dsymutil/RelocationMap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ struct SymbolMapping {
3737
std::optional<yaml::Hex64> ObjectAddress;
3838
yaml::Hex64 BinaryAddress;
3939
yaml::Hex32 Size;
40-
yaml::Hex8 Type;
4140

4241
SymbolMapping(std::optional<uint64_t> ObjectAddr, uint64_t BinaryAddress,
4342
uint32_t Size)

llvm/tools/dsymutil/SwiftModule.cpp

Lines changed: 0 additions & 192 deletions
This file was deleted.

llvm/tools/dsymutil/SwiftModule.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)