Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/processor/disassembler_objdump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
#include "common/linux/scoped_tmpfile.h"
#include "processor/logging.h"

#if defined(__linux__) && !defined(__i386__) && !defined(__x86_64__)
#define OBJDUMP_PATH "x86_64-linux-gnu-objdump"
#else
#define OBJDUMP_PATH "objdump"
#endif

namespace google_breakpad {
namespace {

Expand Down Expand Up @@ -269,14 +275,15 @@ bool DisassemblerObjdump::DisassembleInstruction(uint32_t cpu,
// since objdump does not have a mode to read from stdin. This cannot be
// used with a pipe, since objdump requires that the input is a standard
// file.
execlp("objdump", "objdump", "-D", "--no-show-raw-insn", "-b", "binary",
execlp(OBJDUMP_PATH, OBJDUMP_PATH, "-D", "--no-show-raw-insn", "-b", "binary",
"-M", "intel", "-m", architecture.c_str(), "/proc/self/fd/0",
nullptr);

BPLOG(ERROR) << "Failed to exec objdump.";
exit(-1);
} else {
// In the parent process, parse the objdump output.
disassembly_pipe.CloseWriteFd();

// Match the instruction line, from:
// 0: lock cmpxchg DWORD PTR [esi+0x10],eax
Expand Down