Bug 1350500 - Compute the breakpadId for Firefox libraries on Android by mapping them into memory. r=glandium

--HG--
extra : rebase_source : 446a93c262641a55dfe35afefa7a28ef87b15092
This commit is contained in:
Markus Stange 2018-04-27 19:51:20 +09:00
Родитель 28b9b16ea6
Коммит 5a266f1cbf
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -30,6 +30,7 @@
#if defined(GP_OS_linux)
# include <link.h> // dl_phdr_info
#elif defined(GP_OS_android)
# include "AutoObjectMapper.h"
# include "ElfLoader.h" // dl_phdr_info
extern "C" MOZ_EXPORT __attribute__((weak))
int dl_iterate_phdr(
@ -48,6 +49,19 @@ static std::string getId(const char *bin_name)
PageAllocator allocator;
auto_wasteful_vector<uint8_t, sizeof(MDGUID)> identifier(&allocator);
#if defined(GP_OS_android)
if (nsCString(bin_name).Find("!/") != kNotFound) {
AutoObjectMapperFaultyLib mapper(nullptr);
void* image = nullptr;
size_t size = 0;
if (mapper.Map(&image, &size, bin_name) && image && size) {
if (FileID::ElfFileIdentifierFromMappedFile(image, identifier)) {
return FileID::ConvertIdentifierToUUIDString(identifier) + "0";
}
}
}
#endif
FileID file_id(bin_name);
if (file_id.ElfFileIdentifier(identifier)) {
return FileID::ConvertIdentifierToUUIDString(identifier) + "0";

Просмотреть файл

@ -99,6 +99,7 @@ if CONFIG['MOZ_GECKO_PROFILER']:
LOCAL_INCLUDES += [
# We need access to Breakpad's getcontext(3) which is suitable for Android
'/toolkit/crashreporter/google-breakpad/src/common/android/include',
'lul',
]
if not CONFIG['MOZ_CRASHREPORTER'] and CONFIG['OS_TARGET'] == 'Android':