Browse Source

Emulator: Restrict library name check when querying symbols

Libraries in /usr/lib currently only end in .so, so no contains() is
needed for now.
Tim Schumacher 3 years ago
parent
commit
d350d2dfce
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Userland/DevTools/UserspaceEmulator/Emulator.cpp

+ 1 - 1
Userland/DevTools/UserspaceEmulator/Emulator.cpp

@@ -432,7 +432,7 @@ Optional<Emulator::SymbolInfo> Emulator::symbol_at(FlatPtr address)
     auto lib_name = address_region->lib_name();
     auto lib_name = address_region->lib_name();
     auto const* first_region = (lib_name.is_null() || lib_name.is_empty()) ? address_region : first_region_for_object(lib_name);
     auto const* first_region = (lib_name.is_null() || lib_name.is_empty()) ? address_region : first_region_for_object(lib_name);
     VERIFY(first_region);
     VERIFY(first_region);
-    auto lib_path = lib_name.contains(".so"sv) ? String::formatted("/usr/lib/{}", lib_name) : lib_name;
+    auto lib_path = lib_name.ends_with(".so"sv) ? String::formatted("/usr/lib/{}", lib_name) : lib_name;
 
 
     auto it = m_dynamic_library_cache.find(lib_path);
     auto it = m_dynamic_library_cache.find(lib_path);
     auto const& elf = it->value.debug_info->elf();
     auto const& elf = it->value.debug_info->elf();