You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some dynamic linker support to load module with the same name under different directories, like bionic.
When debugging a program which will link /PathA/liba.so by default, and it will dlopen /PathB/liba.so during runtime, the /PathB/liba.so can not be loaded correctly. LLDB will use /PathA/liba.so as the module of /PathB/liba.so. But /PathA/liba.so and /PathB/liba.so are different.
I find that, in Status NativeProcessLinux::GetLoadedModuleFileSpec , lldb will look for the module_path in the m_mem_region_cache, and just check the Filename without checking directory. This logic let lldb think two different so with same name the same.
Shall we change the NativeProcessLinux::GetLoadedModuleFileSpe to:
`Status NativeProcessLinux::GetLoadedModuleFileSpec(const char *module_path,
FileSpec &file_spec) {
Status error = PopulateMemoryRegionCache();
if (error.Fail())
return error;
Some dynamic linker support to load module with the same name under different directories, like bionic.
When debugging a program which will link /PathA/liba.so by default, and it will dlopen /PathB/liba.so during runtime, the /PathB/liba.so can not be loaded correctly. LLDB will use /PathA/liba.so as the module of /PathB/liba.so. But /PathA/liba.so and /PathB/liba.so are different.
I find that, in Status NativeProcessLinux::GetLoadedModuleFileSpec , lldb will look for the module_path in the m_mem_region_cache, and just check the Filename without checking directory. This logic let lldb think two different so with same name the same.
Shall we change the NativeProcessLinux::GetLoadedModuleFileSpe to:
`Status NativeProcessLinux::GetLoadedModuleFileSpec(const char *module_path,
FileSpec &file_spec) {
Status error = PopulateMemoryRegionCache();
if (error.Fail())
return error;
Some dynamic linker support to load module with the same name under different directories, like bionic.
When debugging a program which will link /PathA/liba.so by default, and it will dlopen /PathB/liba.so during runtime, the /PathB/liba.so can not be loaded correctly. LLDB will use /PathA/liba.so as the module of /PathB/liba.so. But /PathA/liba.so and /PathB/liba.so are different.
I find that, in Status NativeProcessLinux::GetLoadedModuleFileSpec , lldb will look for the module_path in the m_mem_region_cache, and just check the Filename without checking directory. This logic let lldb think two different so with same name the same.
Shall we change the NativeProcessLinux::GetLoadedModuleFileSpe to:
`Status NativeProcessLinux::GetLoadedModuleFileSpec(const char *module_path,
FileSpec &file_spec) {
Status error = PopulateMemoryRegionCache();
if (error.Fail())
return error;
FileSpec module_file_spec(module_path);
FileSystem::Instance().Resolve(module_file_spec);
file_spec.Clear();
for (const auto &it : m_mem_region_cache) {
if (it.second.GetFilename() == module_file_spec.GetFilename() &&
it.second.GetDirectory() == module_file_spec.GetDirectory()) {
file_spec = it.second;
return Status();
}
}
return Status("Module file (%s) not found in /proc/%" PRIu64 "/maps file!",
module_file_spec.GetFilename().AsCString(), GetID());
}`
I am not sure whether this change will make some other bug. Please take a look.
The text was updated successfully, but these errors were encountered: