Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Issue 1821293002: Replace libdisasm with capstone

Created:
4 years, 9 months ago by Ted Mielczarek
Modified:
4 years, 6 months ago
Reviewers:
Mark Mentovai, vapier
CC:
google-breakpad-dev_googlegroups.com
Base URL:
https://chromium.googlesource.com/breakpad/breakpad.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Replace libdisasm with capstone Breakpad has a locally-committed version of libdisasm, which is no longer developed. Capstone (http://www.capstone-engine.org/) is a multi-architecture project which is under active development. Using capstone should provide better support for modern CPU instructions that may show up in minidumps, as well as bring x86-64 support and even ARM/AAarch64 support if desired. This change removes src/third_party/libdisasm, adds capstone's GitHub repository to DEPS under src/third_party/capstone, fixes the automake and gyp build systems to build capstone instead of libdisasm, and fixes the disassembler_x86 and exploitability_win code to use capstone APIs instead of libdisasm APIs. The only place where using capstone seems to be less satisfying than using libdisasm is that capstone lacks the large set of instruction groups that libdisasm had, such as `libdis::insn_string`. Currently I have settled for listing out instructions in a switch statement, which is not terribly satisfying. Future work could be to support x86-64 in DisassemblerX86 to enable better exploitability analysis on Windows dumps (easy), replace the exploitability_linux code that shells out to objdump with DisassemblerX86 (moderately involved), and build capstone's ARM/AArch64 backends (easy) and extend the existing exploitability_linux code to do more thorough analysis of dumps from those architectures (hard). R=mark@chromium.org BUG=

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+660 lines, -11616 lines) Patch
M .gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M DEPS View 1 chunk +5 lines, -0 lines 0 comments Download
M Makefile.am View 9 chunks +33 lines, -35 lines 0 comments Download
M Makefile.in View 25 chunks +313 lines, -160 lines 0 comments Download
M src/build/common.gypi View 2 chunks +2 lines, -1 line 2 comments Download
M src/config.h.in View 1 chunk +3 lines, -0 lines 0 comments Download
M src/processor/disassembler_x86.h View 4 chunks +33 lines, -19 lines 0 comments Download
M src/processor/disassembler_x86.cc View 3 chunks +216 lines, -115 lines 0 comments Download
M src/processor/disassembler_x86_unittest.cc View 9 chunks +21 lines, -24 lines 0 comments Download
M src/processor/exploitability_win.cc View 2 chunks +6 lines, -10 lines 0 comments Download
M src/processor/processor.gyp View 1 chunk +1 line, -1 line 0 comments Download
A + src/third_party/capstone.gyp View 2 chunks +26 lines, -23 lines 2 comments Download
D src/third_party/libdisasm/Makefile.am View 1 chunk +0 lines, -43 lines 0 comments Download
D src/third_party/libdisasm/TODO View 1 chunk +0 lines, -43 lines 0 comments Download
D src/third_party/libdisasm/ia32_implicit.h View 1 chunk +0 lines, -13 lines 0 comments Download
D src/third_party/libdisasm/ia32_implicit.c View 1 chunk +0 lines, -422 lines 0 comments Download
D src/third_party/libdisasm/ia32_insn.h View 1 chunk +0 lines, -506 lines 0 comments Download
D src/third_party/libdisasm/ia32_insn.c View 1 chunk +0 lines, -623 lines 0 comments Download
D src/third_party/libdisasm/ia32_invariant.h View 1 chunk +0 lines, -11 lines 0 comments Download
D src/third_party/libdisasm/ia32_invariant.c View 1 chunk +0 lines, -313 lines 0 comments Download
D src/third_party/libdisasm/ia32_modrm.h View 1 chunk +0 lines, -13 lines 0 comments Download
D src/third_party/libdisasm/ia32_modrm.c View 1 chunk +0 lines, -310 lines 0 comments Download
D src/third_party/libdisasm/ia32_opcode_tables.h View 1 chunk +0 lines, -57 lines 0 comments Download
D src/third_party/libdisasm/ia32_opcode_tables.c View 1 chunk +0 lines, -2939 lines 0 comments Download
D src/third_party/libdisasm/ia32_operand.h View 1 chunk +0 lines, -11 lines 0 comments Download
D src/third_party/libdisasm/ia32_operand.c View 1 chunk +0 lines, -425 lines 0 comments Download
D src/third_party/libdisasm/ia32_reg.h View 1 chunk +0 lines, -41 lines 0 comments Download
D src/third_party/libdisasm/ia32_reg.c View 1 chunk +0 lines, -234 lines 0 comments Download
D src/third_party/libdisasm/ia32_settings.h View 1 chunk +0 lines, -27 lines 0 comments Download
D src/third_party/libdisasm/ia32_settings.c View 1 chunk +0 lines, -13 lines 0 comments Download
D src/third_party/libdisasm/libdis.h View 1 chunk +0 lines, -832 lines 0 comments Download
D src/third_party/libdisasm/libdisasm.gyp View 1 chunk +0 lines, -67 lines 0 comments Download
D src/third_party/libdisasm/qword.h View 1 chunk +0 lines, -14 lines 0 comments Download
D src/third_party/libdisasm/swig/Makefile View 1 chunk +0 lines, -70 lines 0 comments Download
D src/third_party/libdisasm/swig/README View 1 chunk +0 lines, -128 lines 0 comments Download
D src/third_party/libdisasm/swig/libdisasm.i View 1 chunk +0 lines, -508 lines 0 comments Download
D src/third_party/libdisasm/swig/libdisasm_oop.i View 1 chunk +0 lines, -1114 lines 0 comments Download
D src/third_party/libdisasm/swig/perl/Makefile.PL View 1 chunk +0 lines, -7 lines 0 comments Download
D src/third_party/libdisasm/swig/perl/Makefile-swig View 1 chunk +0 lines, -65 lines 0 comments Download
D src/third_party/libdisasm/swig/python/Makefile-swig View 1 chunk +0 lines, -64 lines 0 comments Download
D src/third_party/libdisasm/swig/ruby/Makefile-swig View 1 chunk +0 lines, -68 lines 0 comments Download
D src/third_party/libdisasm/swig/ruby/extconf.rb View 1 chunk +0 lines, -4 lines 0 comments Download
D src/third_party/libdisasm/swig/tcl/Makefile-swig View 1 chunk +0 lines, -63 lines 0 comments Download
D src/third_party/libdisasm/x86_disasm.c View 1 chunk +0 lines, -210 lines 0 comments Download
D src/third_party/libdisasm/x86_format.c View 1 chunk +0 lines, -1430 lines 0 comments Download
D src/third_party/libdisasm/x86_imm.h View 1 chunk +0 lines, -18 lines 0 comments Download
D src/third_party/libdisasm/x86_imm.c View 1 chunk +0 lines, -70 lines 0 comments Download
D src/third_party/libdisasm/x86_insn.c View 1 chunk +0 lines, -182 lines 0 comments Download
D src/third_party/libdisasm/x86_misc.c View 1 chunk +0 lines, -71 lines 0 comments Download
D src/third_party/libdisasm/x86_operand_list.h View 1 chunk +0 lines, -8 lines 0 comments Download
D src/third_party/libdisasm/x86_operand_list.c View 1 chunk +0 lines, -191 lines 0 comments Download

Messages

Total messages: 11 (1 generated)
Ted Mielczarek
4 years, 9 months ago (2016-03-22 18:12:22 UTC) #1
Ted Mielczarek
Sorry to spring a large patch on you unexpectedly (granted most of it is code ...
4 years, 9 months ago (2016-03-22 18:18:50 UTC) #2
Ted Mielczarek
FYI, this is the patch I *wanted* to write, per my previous comment, but I ...
4 years, 9 months ago (2016-03-24 20:25:09 UTC) #3
vapier
rietveld has no concept of dependent changes or different commits and will happily squash all ...
4 years, 9 months ago (2016-03-24 20:30:25 UTC) #5
vapier
4 years, 9 months ago (2016-03-24 20:30:37 UTC) #6
Ted Mielczarek
I filed an issue upstream about instruction groups being less useful than libdisasm, and the ...
4 years, 8 months ago (2016-04-01 17:21:11 UTC) #7
Mark Mentovai
OK, sounds like they’re receptive, so I’ll (keep) hold(ing) off.
4 years, 8 months ago (2016-04-05 00:14:51 UTC) #8
Mark Mentovai
P.S. I’m receptive to this too.
4 years, 8 months ago (2016-04-05 00:15:02 UTC) #9
Ted Mielczarek
On 2016/04/05 00:15:02, Mark Mentovai wrote: > P.S. I’m receptive to this too. Great, thanks, ...
4 years, 8 months ago (2016-04-05 01:36:08 UTC) #10
vapier
4 years, 6 months ago (2016-06-24 20:09:08 UTC) #11
in general seems pretty good

https://codereview.chromium.org/1821293002/diff/1/src/build/common.gypi
File src/build/common.gypi (right):

https://codereview.chromium.org/1821293002/diff/1/src/build/common.gypi#newco...
src/build/common.gypi:557: '<(werror)',  # See note above about the werror
variable
unrelated/undesirable change ?

https://codereview.chromium.org/1821293002/diff/1/src/build/common.gypi#newco...
src/build/common.gypi:573: '-std=c++11',
this should prob be deployed in a dedicated CL, assuming libdisasm works w/it

https://codereview.chromium.org/1821293002/diff/1/src/third_party/capstone.gyp
File src/third_party/capstone.gyp (right):

https://codereview.chromium.org/1821293002/diff/1/src/third_party/capstone.gy...
src/third_party/capstone.gyp:1: # Copyright 2016 Google Inc. All rights
reserved.
we don't update copyright years

https://codereview.chromium.org/1821293002/diff/1/src/third_party/capstone.gy...
src/third_party/capstone.gyp:48: 'CAPSTONE_HAS_X86',
indentation broken ?

Powered by Google App Engine
This is Rietveld 408576698