mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-28 18:25:20 +01:00
Remove disassembler_objdump from the build on non-linux platforms.
Change-Id: I29d628ac7cf79bfca1794ba325c945a0f122b360 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3964364 Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
parent
95857a18bb
commit
f617814017
5 changed files with 273 additions and 184 deletions
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
#include "processor/disassembler_objdump.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
|
@ -498,23 +497,5 @@ bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context,
|
|||
uint64_t& address) {
|
||||
return CalculateAddress(context, dest_, address);
|
||||
}
|
||||
} // namespace google_breakpad
|
||||
|
||||
#else // __linux__
|
||||
namespace google_breakpad {
|
||||
DisassemblerObjdump::DisassemblerObjdump(const uint32_t cpu,
|
||||
const MemoryRegion* memory_region,
|
||||
uint64_t address) {}
|
||||
|
||||
bool DisassemblerObjdump::CalculateSrcAddress(const DumpContext& context,
|
||||
uint64_t& address) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DisassemblerObjdump::CalculateDestAddress(const DumpContext& context,
|
||||
uint64_t& address) {
|
||||
return false;
|
||||
}
|
||||
} // namespace google_breakpad
|
||||
|
||||
#endif // __linux__
|
||||
} // namespace google_breakpad
|
||||
|
|
@ -41,7 +41,9 @@
|
|||
#include "google_breakpad/processor/call_stack.h"
|
||||
#include "google_breakpad/processor/process_state.h"
|
||||
#include "google_breakpad/processor/stack_frame.h"
|
||||
#ifdef __linux__
|
||||
#include "processor/disassembler_objdump.h"
|
||||
#endif
|
||||
#include "processor/logging.h"
|
||||
|
||||
namespace {
|
||||
|
|
@ -156,7 +158,7 @@ ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
|
|||
}
|
||||
|
||||
bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
|
||||
#ifdef _WIN32
|
||||
#ifndef __linux__
|
||||
BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method.";
|
||||
return false;
|
||||
#else
|
||||
|
|
@ -220,7 +222,7 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
|
|||
} else {
|
||||
return false;
|
||||
}
|
||||
#endif // _WIN32
|
||||
#endif // __linux__
|
||||
}
|
||||
|
||||
bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) {
|
||||
|
|
|
|||
|
|
@ -44,11 +44,14 @@
|
|||
#include "google_breakpad/processor/process_state.h"
|
||||
#include "google_breakpad/processor/exploitability.h"
|
||||
#include "google_breakpad/processor/stack_frame_symbolizer.h"
|
||||
#include "processor/disassembler_objdump.h"
|
||||
#include "processor/logging.h"
|
||||
#include "processor/stackwalker_x86.h"
|
||||
#include "processor/symbolic_constants_win.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include "processor/disassembler_objdump.h"
|
||||
#endif
|
||||
|
||||
namespace google_breakpad {
|
||||
|
||||
MinidumpProcessor::MinidumpProcessor(SymbolSupplier* supplier,
|
||||
|
|
@ -770,6 +773,7 @@ static bool IsCanonicalAddress(uint64_t address) {
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
static void CalculateFaultAddressFromInstruction(Minidump* dump,
|
||||
uint64_t* address) {
|
||||
MinidumpException* exception = dump->GetException();
|
||||
|
|
@ -832,6 +836,7 @@ static void CalculateFaultAddressFromInstruction(Minidump* dump,
|
|||
*address = write_address;
|
||||
}
|
||||
}
|
||||
#endif // __linux__
|
||||
|
||||
// static
|
||||
string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address,
|
||||
|
|
@ -2070,6 +2075,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address,
|
|||
static_cast<MDCPUArchitecture>(raw_system_info->processor_architecture),
|
||||
*address);
|
||||
|
||||
#ifdef __linux__
|
||||
// For invalid accesses to non-canonical addresses, amd64 cpus don't provide
|
||||
// the fault address, so recover it from the disassembly and register state
|
||||
// if possible.
|
||||
|
|
@ -2078,6 +2084,7 @@ string MinidumpProcessor::GetCrashReason(Minidump* dump, uint64_t* address,
|
|||
&& std::numeric_limits<uint64_t>::max() == *address) {
|
||||
CalculateFaultAddressFromInstruction(dump, address);
|
||||
}
|
||||
#endif // __linux__
|
||||
}
|
||||
|
||||
return reason;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue