2 +----------------------------------------------------------------------+
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2015 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
16 #ifndef incl_HPHP_UTIL_DISASM_H_
17 #define incl_HPHP_UTIL_DISASM_H_
21 #include <xed-interface.h>
27 #include <boost/noncopyable.hpp>
31 class Disasm
: private boost::noncopyable
{
36 , m_printEncoding(false)
37 , m_relativeOffset(false)
39 , m_forceAttSyntax(false)
42 Options
& indent(int i
) {
47 Options
& printEncoding(bool pe
) {
52 Options
& relativeOffset(bool re
) {
53 m_relativeOffset
= re
;
57 Options
& color(std::string c
) {
58 m_color
= std::move(c
);
62 Options
& addresses(bool b
) {
67 Options
& forceAttSyntax(bool b
) {
74 bool m_relativeOffset
;
76 bool m_forceAttSyntax
;
80 /* Create a Disasm object. indentLevel spaces will be put at the beginning of
81 * each line of disassembly. If printEncoding is true, the raw hex bytes of
82 * the instructions will also be in the output. */
83 explicit Disasm(const Options
& opts
= Options());
85 /* Disassemble instructions. start should be the first byte of the region to
86 * disassemble and end should be the first byte past the region to
88 void disasm(std::ostream
& out
, uint8_t* start
, uint8_t* end
);
92 xed_state_t m_xedState
;