Skip to content

Commit 120d97b

Browse files
committed
Revert "[lldb] Add support for debugging via the dynamic linker."
This reverts commit 1cbdc07. Buildbot failure started after this patch with failure in api/multithreaded/TestMultithreaded.py: https://lab.llvm.org/buildbot/#/builders/68/builds/17556
1 parent 88125e8 commit 120d97b

File tree

7 files changed

+17
-142
lines changed

7 files changed

+17
-142
lines changed

lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,6 @@ static addr_t ResolveRendezvousAddress(Process *process) {
5656
"%s resolved via direct object file approach to 0x%" PRIx64,
5757
__FUNCTION__, info_location);
5858
} else {
59-
const Symbol *_r_debug =
60-
target->GetExecutableModule()->FindFirstSymbolWithNameAndType(
61-
ConstString("_r_debug"));
62-
if (_r_debug) {
63-
info_addr = _r_debug->GetAddress().GetLoadAddress(target);
64-
if (info_addr != LLDB_INVALID_ADDRESS) {
65-
LLDB_LOGF(log,
66-
"%s resolved by finding symbol '_r_debug' whose value is "
67-
"0x%" PRIx64,
68-
__FUNCTION__, info_addr);
69-
return info_addr;
70-
}
71-
}
7259
LLDB_LOGF(log,
7360
"%s FAILED - direct object file approach did not yield a "
7461
"valid address",
@@ -289,14 +276,6 @@ bool DYLDRendezvous::FillSOEntryFromModuleInfo(
289276
entry.base_addr = base_addr;
290277
entry.dyn_addr = dyn_addr;
291278

292-
// ld.so saves empty file name for the executable file in the link map.
293-
// When executable is run using ld.so, we need to be update executable path.
294-
if (name.empty()) {
295-
MemoryRegionInfo region;
296-
Status region_status =
297-
m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
298-
name = region.GetName().AsCString();
299-
}
300279
entry.file_spec.SetFile(name, FileSpec::Style::native);
301280

302281
UpdateBaseAddrIfNecessary(entry, name);
@@ -568,15 +547,6 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry) {
568547
return false;
569548

570549
std::string file_path = ReadStringFromMemory(entry.path_addr);
571-
572-
// ld.so saves empty file name for the executable file in the link map.
573-
// When executable is run using ld.so, we need to be update executable path.
574-
if (file_path.empty()) {
575-
MemoryRegionInfo region;
576-
Status region_status =
577-
m_process->GetMemoryRegionInfo(entry.dyn_addr, region);
578-
file_path = region.GetName().AsCString();
579-
}
580550
entry.file_spec.SetFile(file_path, FileSpec::Style::native);
581551

582552
UpdateBaseAddrIfNecessary(entry, file_path);

lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -333,48 +333,28 @@ bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
333333
LLDB_LOG(log, "Rendezvous structure is not set up yet. "
334334
"Trying to locate rendezvous breakpoint in the interpreter "
335335
"by symbol name.");
336-
// Function names from different dynamic loaders that are known to be
337-
// used as rendezvous between the loader and debuggers.
336+
ModuleSP interpreter = LoadInterpreterModule();
337+
if (!interpreter) {
338+
LLDB_LOG(log, "Can't find interpreter, rendezvous breakpoint isn't set.");
339+
return false;
340+
}
341+
342+
// Function names from different dynamic loaders that are known to be used
343+
// as rendezvous between the loader and debuggers.
338344
static std::vector<std::string> DebugStateCandidates{
339345
"_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity",
340346
"r_debug_state", "_r_debug_state", "_rtld_debug_state",
341347
};
342348

343-
ModuleSP interpreter = LoadInterpreterModule();
344-
if (!interpreter) {
345-
if (NameMatches(m_process->GetTarget()
346-
.GetExecutableModulePointer()
347-
->GetFileSpec()
348-
.GetFilename()
349-
.GetCString(),
350-
NameMatch::StartsWith, "ld-")) {
351-
FileSpecList containingModules;
352-
containingModules.Append(
353-
m_process->GetTarget().GetExecutableModulePointer()->GetFileSpec());
354-
355-
dyld_break = target.CreateBreakpoint(
356-
&containingModules, /*containingSourceFiles=*/nullptr,
357-
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
358-
/*offset=*/0,
359-
/*skip_prologue=*/eLazyBoolNo,
360-
/*internal=*/true,
361-
/*request_hardware=*/false);
362-
} else {
363-
LLDB_LOG(log,
364-
"Can't find interpreter, rendezvous breakpoint isn't set.");
365-
return false;
366-
}
367-
} else {
368-
FileSpecList containingModules;
369-
containingModules.Append(interpreter->GetFileSpec());
370-
dyld_break = target.CreateBreakpoint(
371-
&containingModules, /*containingSourceFiles=*/nullptr,
372-
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
373-
/*offset=*/0,
374-
/*skip_prologue=*/eLazyBoolNo,
375-
/*internal=*/true,
376-
/*request_hardware=*/false);
377-
}
349+
FileSpecList containingModules;
350+
containingModules.Append(interpreter->GetFileSpec());
351+
dyld_break = target.CreateBreakpoint(
352+
&containingModules, nullptr /* containingSourceFiles */,
353+
DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
354+
0, /* offset */
355+
eLazyBoolNo, /* skip_prologue */
356+
true, /* internal */
357+
false /* request_hardware */);
378358
}
379359

380360
if (dyld_break->GetNumResolvedLocations() != 1) {

lldb/test/API/functionalities/dyld-launch-linux/Makefile

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

lldb/test/API/functionalities/dyld-launch-linux/TestDyldLaunchLinux.py

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

lldb/test/API/functionalities/dyld-launch-linux/main.cpp

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

lldb/test/API/functionalities/dyld-launch-linux/signal_file.cpp

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

lldb/test/API/functionalities/dyld-launch-linux/signal_file.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)