зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1662601 - Remove fileid. r=gsvelto
The last thing that was using fileid was fix-stacks, which, as of bug 1662037, doesn't anymore. Differential Revision: https://phabricator.services.mozilla.com/D89076
This commit is contained in:
Родитель
5507ddc4c5
Коммит
aa86bba7ac
|
@ -79,7 +79,6 @@ path:toolkit/mozapps/update/updater
|
|||
# for the minidump_stackwalk toolchain task
|
||||
path:toolkit/crashreporter
|
||||
path:tools/crashreporter/
|
||||
path:testing/tools/fileid
|
||||
path:mfbt
|
||||
path:config/external/zlib
|
||||
path:build/moz.configure
|
||||
|
|
|
@ -17,7 +17,6 @@ job-defaults:
|
|||
- 'config/external/zlib'
|
||||
- 'mfbt'
|
||||
- 'moz.configure'
|
||||
- 'testing/tools/fileid'
|
||||
- 'toolkit/crashreporter'
|
||||
- 'toolkit/crashreporter/google-breakpad/src/common'
|
||||
- 'toolkit/crashreporter/google-breakpad/src/processor'
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
#include "common/linux/file_id.h"
|
||||
#include "common/memory_allocator.h"
|
||||
|
||||
using std::string;
|
||||
|
||||
using google_breakpad::auto_wasteful_vector;
|
||||
using google_breakpad::FileID;
|
||||
using google_breakpad::PageAllocator;
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: fileid <elf file>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
PageAllocator allocator;
|
||||
auto_wasteful_vector<uint8_t, sizeof(MDGUID)> identifier(&allocator);
|
||||
FileID file_id(argv[1]);
|
||||
if (!file_id.ElfFileIdentifier(identifier)) {
|
||||
fprintf(stderr, "%s: unable to generate file identifier\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
string result_guid = FileID::ConvertIdentifierToUUIDString(identifier);
|
||||
|
||||
// Add an extra "0" at the end. PDB files on Windows have an 'age'
|
||||
// number appended to the end of the file identifier; this isn't
|
||||
// really used or necessary on other platforms, but be consistent.
|
||||
printf("%s0\n", result_guid.c_str());
|
||||
return 0;
|
||||
}
|
|
@ -1,48 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
#include "common/mac/arch_utilities.h"
|
||||
#include "common/mac/file_id.h"
|
||||
|
||||
// TODO: move this somewhere common, this is copied from dump_symbols.cc
|
||||
// Format the Mach-O identifier in IDENTIFIER as a UUID with the
|
||||
// dashes removed.
|
||||
std::string FormatIdentifier(unsigned char identifier[16]) {
|
||||
char identifier_string[40];
|
||||
google_breakpad::FileID::ConvertIdentifierToString(
|
||||
identifier, identifier_string, sizeof(identifier_string));
|
||||
std::string compacted(identifier_string);
|
||||
for (size_t i = compacted.find('-'); i != std::string::npos;
|
||||
i = compacted.find('-', i))
|
||||
compacted.erase(i, 1);
|
||||
compacted += '0';
|
||||
return compacted;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: fileid <object file>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned char identifier[16];
|
||||
google_breakpad::FileID file_id(argv[1]);
|
||||
|
||||
// We should be able to use NXGetLocalArchInfo for this, but it returns
|
||||
// CPU_TYPE_X86 (which is the same as CPU_TYPE_I386) on x86_64 machines,
|
||||
// when our binary will typically have CPU_TYPE_X86_64 to match against.
|
||||
// So we hard code x86_64. In practice that's where we're running tests,
|
||||
// and that's what our debug binaries will contain.
|
||||
if (!file_id.MachoIdentifier(CPU_TYPE_X86_64, CPU_SUBTYPE_MULTIPLE,
|
||||
identifier)) {
|
||||
fprintf(stderr, "%s: unable to generate file identifier\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("%s\n", FormatIdentifier(identifier).c_str());
|
||||
return 0;
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'WINNT':
|
||||
Program('fileid')
|
||||
USE_STATIC_LIBS = True
|
||||
SOURCES += ['win_fileid.cpp']
|
||||
OS_LIBS += ['dbghelp']
|
||||
NO_PGO = True
|
||||
elif CONFIG['MOZ_BUILD_APP'] == 'tools/crashreporter':
|
||||
Program('fileid')
|
||||
else:
|
||||
# Technically, it's not a GeckoProgram (thus linkage=None), but it needs
|
||||
# mozglue because of the breakpad code it uses being compiled for gecko
|
||||
# and requiring infallible malloc.
|
||||
GeckoProgram('fileid', linkage=None)
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'Linux':
|
||||
USE_LIBS += [
|
||||
'breakpad_linux_common_s',
|
||||
]
|
||||
SOURCES += ['linux_fileid.cpp']
|
||||
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'Darwin':
|
||||
USE_LIBS += [
|
||||
'breakpad_mac_common_s',
|
||||
]
|
||||
SOURCES += ['mac_fileid.cpp']
|
||||
OS_LIBS += [
|
||||
'-framework Foundation'
|
||||
]
|
||||
|
||||
|
||||
if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin':
|
||||
USE_LIBS += [
|
||||
'breakpad_common_s',
|
||||
]
|
||||
LOCAL_INCLUDES += [
|
||||
'/toolkit/crashreporter/google-breakpad/src',
|
||||
]
|
|
@ -1,75 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <windows.h>
|
||||
#include <dbghelp.h>
|
||||
|
||||
const DWORD CV_SIGNATURE_RSDS = 0x53445352; // 'SDSR'
|
||||
|
||||
struct CV_INFO_PDB70 {
|
||||
DWORD CvSignature;
|
||||
GUID Signature;
|
||||
DWORD Age;
|
||||
BYTE PdbFileName[1];
|
||||
};
|
||||
|
||||
void print_guid(const GUID& guid, DWORD age) {
|
||||
printf("%08lX%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%lX", guid.Data1,
|
||||
guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2],
|
||||
guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6],
|
||||
guid.Data4[7], age);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: fileid <file>\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
HANDLE file = CreateFileA(argv[1], GENERIC_READ, FILE_SHARE_READ, nullptr,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (file == INVALID_HANDLE_VALUE) {
|
||||
fprintf(stderr, "Couldn't open file: %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
HANDLE mapFile = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, 0);
|
||||
if (mapFile == nullptr) {
|
||||
fprintf(stderr, "Couldn't create file mapping\n");
|
||||
CloseHandle(file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t* base = reinterpret_cast<uint8_t*>(
|
||||
MapViewOfFile(mapFile, FILE_MAP_READ, 0, 0, 0));
|
||||
if (base == nullptr) {
|
||||
fprintf(stderr, "Couldn't map file\n");
|
||||
CloseHandle(mapFile);
|
||||
CloseHandle(file);
|
||||
return 1;
|
||||
}
|
||||
|
||||
DWORD size;
|
||||
PIMAGE_DEBUG_DIRECTORY debug_dir =
|
||||
reinterpret_cast<PIMAGE_DEBUG_DIRECTORY>(ImageDirectoryEntryToDataEx(
|
||||
base, FALSE, IMAGE_DIRECTORY_ENTRY_DEBUG, &size, nullptr));
|
||||
|
||||
bool found = false;
|
||||
if (debug_dir->Type == IMAGE_DEBUG_TYPE_CODEVIEW) {
|
||||
CV_INFO_PDB70* cv =
|
||||
reinterpret_cast<CV_INFO_PDB70*>(base + debug_dir->PointerToRawData);
|
||||
if (cv->CvSignature == CV_SIGNATURE_RSDS) {
|
||||
found = true;
|
||||
print_guid(cv->Signature, cv->Age);
|
||||
}
|
||||
}
|
||||
|
||||
UnmapViewOfFile(base);
|
||||
CloseHandle(mapFile);
|
||||
CloseHandle(file);
|
||||
|
||||
return found ? 0 : 1;
|
||||
}
|
|
@ -7,9 +7,6 @@
|
|||
with Files("**"):
|
||||
BUG_COMPONENT = ("Testing", "General")
|
||||
|
||||
with Files("fileid/**"):
|
||||
BUG_COMPONENT = ("Toolkit", "Crash Reporting")
|
||||
|
||||
with Files("iceserver/**"):
|
||||
BUG_COMPONENT = ("Core", "WebRTC: Networking")
|
||||
|
||||
|
|
|
@ -191,10 +191,6 @@ if CONFIG['ENABLE_TESTS']:
|
|||
'/testing/extensions',
|
||||
]
|
||||
|
||||
# The file id utility requires breakpad libraries.
|
||||
if CONFIG['MOZ_CRASHREPORTER']:
|
||||
DIRS += ['/testing/tools/fileid']
|
||||
|
||||
if CONFIG['MOZ_MEMORY']:
|
||||
DIRS += ['/memory/gtest']
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
DIRS += [
|
||||
'/config/external/zlib',
|
||||
'/testing/tools/fileid',
|
||||
'/toolkit/crashreporter/google-breakpad/src/common',
|
||||
'/toolkit/crashreporter/google-breakpad/src/processor',
|
||||
'/toolkit/crashreporter/rust',
|
||||
|
|
Загрузка…
Ссылка в новой задаче