decoder_machO.hpp 2.0 KB
Newer Older
N
never 已提交
1
/*
Z
zgu 已提交
2
 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
N
never 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
 *
 */

Z
zgu 已提交
25 26
#ifndef OS_BSD_VM_DECODER_MACHO_HPP
#define OS_BSD_VM_DECODER_MACHO_HPP
N
never 已提交
27 28 29

#ifdef __APPLE__

Z
zgu 已提交
30
#include "utilities/decoder.hpp"
N
never 已提交
31

Z
zgu 已提交
32 33
// Just a placehold for now, a real implementation should derive
// from AbstractDecoder
34 35
class MachODecoder : public AbstractDecoder {
 public:
Z
zgu 已提交
36 37
  MachODecoder() { }
  ~MachODecoder() { }
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
  virtual bool can_decode_C_frame_in_vm() const {
    return true;
  }
  virtual bool demangle(const char* symbol, char* buf, int buflen);
  virtual bool decode(address pc, char* buf, int buflen, int* offset,
                      const void* base);
  virtual bool decode(address pc, char* buf, int buflen, int* offset,
                      const char* module_path = NULL) {
    ShouldNotReachHere();
    return false;
  }

 private:
  void * mach_find_command(struct mach_header_64 * mach_base, uint32_t command_wanted);
  char * mach_find_in_stringtable(char *strtab, uint32_t tablesize, int strx_wanted);
Z
zgu 已提交
53
};
N
never 已提交
54 55 56

#endif

Z
zgu 已提交
57
#endif // OS_BSD_VM_DECODER_MACHO_HPP
N
never 已提交
58