mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-01 12:14:56 +01:00
Add custom implementation of NXGetArchInfoXXX to allow adding new arch.
NXGetArchInfoXXX depends on the OS knowledge of architecture. This CL adds a custom implementation of those methods to be able to handle newer CPU before they are handled by the OS. It also add handling for armv7s architecture. Review URL: https://breakpad.appspot.com/475002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1057 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
9f8f461279
commit
9b6b41b8ca
8 changed files with 170 additions and 11 deletions
|
|
@ -7,6 +7,7 @@
|
|||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */; };
|
||||
4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */; };
|
||||
4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721E126F9ADE00B43EAF /* exploitability.cc */; };
|
||||
4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */; };
|
||||
|
|
@ -66,6 +67,8 @@
|
|||
/* Begin PBXFileReference section */
|
||||
08FB7796FE84155DC02AAC07 /* crash_report.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = crash_report.mm; sourceTree = "<group>"; };
|
||||
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
|
||||
162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
|
||||
4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = source_line_resolver_base.cc; path = ../../../processor/source_line_resolver_base.cc; sourceTree = SOURCE_ROOT; };
|
||||
4D2C721E126F9ADE00B43EAF /* exploitability.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability.cc; path = ../../../processor/exploitability.cc; sourceTree = SOURCE_ROOT; };
|
||||
4D2C7222126F9AF900B43EAF /* exploitability_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_win.cc; path = ../../../processor/exploitability_win.cc; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -183,6 +186,8 @@
|
|||
8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */,
|
||||
8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */,
|
||||
F9C7ECE10E8ABC7F00E953AD /* DWARF */,
|
||||
162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */,
|
||||
162F64FD161C5ECB00CD68D5 /* arch_utilities.h */,
|
||||
5578003E0BE1F28500EC23E0 /* macho_utilities.cc */,
|
||||
5578003F0BE1F28500EC23E0 /* macho_utilities.h */,
|
||||
8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */,
|
||||
|
|
@ -410,6 +415,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */,
|
||||
8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */,
|
||||
9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */,
|
||||
9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@
|
|||
/* End PBXAggregateTarget section */
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
|
||||
162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
|
||||
4D72CAF513DFBAC2006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CAF413DFBAC2006CABE3 /* md5.cc */; };
|
||||
B84A91F8116CF78F006C210E /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
|
||||
B84A91FB116CF7AF006C210E /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
|
||||
|
|
@ -270,6 +272,8 @@
|
|||
/* Begin PBXFileReference section */
|
||||
08FB7796FE84155DC02AAC07 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = "<group>"; };
|
||||
08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
162F64F8161C591500CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
|
||||
162F64F9161C591500CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
|
||||
4D72CAF413DFBAC2006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; };
|
||||
557800890BE1F3AB00EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
|
||||
5578008A0BE1F3AB00EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
|
||||
|
|
@ -481,6 +485,8 @@
|
|||
B89E0E6C1166569700DD08C9 /* MACHO */,
|
||||
B88FAE3811666A1700407530 /* STABS */,
|
||||
B88FAE1C11665FFD00407530 /* MODULE */,
|
||||
162F64F8161C591500CD68D5 /* arch_utilities.cc */,
|
||||
162F64F9161C591500CD68D5 /* arch_utilities.h */,
|
||||
B88FAE1D1166603300407530 /* byte_cursor.h */,
|
||||
B88FB0D4116CEC0600407530 /* byte_cursor_unittest.cc */,
|
||||
B8E8CA0C1156C854009E61B2 /* byteswap.h */,
|
||||
|
|
@ -1044,6 +1050,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */,
|
||||
B89E0E781166576C00DD08C9 /* macho_reader.cc in Sources */,
|
||||
B89E0E7A1166576C00DD08C9 /* macho_dump.cc in Sources */,
|
||||
);
|
||||
|
|
@ -1062,6 +1069,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */,
|
||||
B88FAE2C1166606200407530 /* macho_reader.cc in Sources */,
|
||||
B8C5B5171166534700D34F4E /* dwarf2reader.cc in Sources */,
|
||||
B8C5B5181166534700D34F4E /* bytereader.cc in Sources */,
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "common/mac/dump_syms.h"
|
||||
#include "common/mac/arch_utilities.h"
|
||||
#include "common/mac/macho_utilities.h"
|
||||
|
||||
using google_breakpad::DumpSymbols;
|
||||
|
|
@ -73,7 +74,8 @@ static bool Start(const Options &options) {
|
|||
for (size_t i = 0; i < available_size; i++) {
|
||||
const struct fat_arch *arch = &available[i];
|
||||
const NXArchInfo *arch_info =
|
||||
NXGetArchInfoFromCpuType(arch->cputype, arch->cpusubtype);
|
||||
google_breakpad::BreakpadGetArchInfoFromCpuType(
|
||||
arch->cputype, arch->cpusubtype);
|
||||
if (arch_info)
|
||||
fprintf(stderr, "%s (%s)\n", arch_info->name, arch_info->description);
|
||||
else
|
||||
|
|
@ -107,7 +109,8 @@ static void SetupOptions(int argc, const char *argv[], Options *options) {
|
|||
while ((ch = getopt(argc, (char * const *)argv, "a:ch?")) != -1) {
|
||||
switch (ch) {
|
||||
case 'a': {
|
||||
const NXArchInfo *arch_info = NXGetArchInfoFromName(optarg);
|
||||
const NXArchInfo *arch_info =
|
||||
google_breakpad::BreakpadGetArchInfoFromName(optarg);
|
||||
if (!arch_info) {
|
||||
fprintf(stderr, "%s: Invalid architecture: %s\n", argv[0], optarg);
|
||||
Usage(argc, argv);
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "common/byte_cursor.h"
|
||||
#include "common/mac/arch_utilities.h"
|
||||
#include "common/mac/macho_reader.h"
|
||||
|
||||
using google_breakpad::ByteBuffer;
|
||||
|
|
@ -142,8 +143,9 @@ void DumpFile(const char *filename) {
|
|||
printf(" object file count: %ld\n", object_files_size);
|
||||
for (size_t i = 0; i < object_files_size; i++) {
|
||||
const struct fat_arch &file = object_files[i];
|
||||
const NXArchInfo *fat_arch_info
|
||||
= NXGetArchInfoFromCpuType(file.cputype, file.cpusubtype);
|
||||
const NXArchInfo *fat_arch_info =
|
||||
google_breakpad::BreakpadGetArchInfoFromCpuType(
|
||||
file.cputype, file.cpusubtype);
|
||||
printf("\n object file %ld:\n"
|
||||
" fat header:\n:"
|
||||
" CPU type: %s (%s)\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue