summaryrefslogtreecommitdiffstats
path: root/testing/tools/fileid/linux_fileid.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/tools/fileid/linux_fileid.cpp
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/tools/fileid/linux_fileid.cpp')
-rw-r--r--testing/tools/fileid/linux_fileid.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/tools/fileid/linux_fileid.cpp b/testing/tools/fileid/linux_fileid.cpp
new file mode 100644
index 000000000..de1ecbd1c
--- /dev/null
+++ b/testing/tools/fileid/linux_fileid.cpp
@@ -0,0 +1,41 @@
+/* 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.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;
+}