diff src/os/bsd/vm/decoder_machO.hpp @ 6258:3b01d0321dfa

7186778: MachO decoder implementation for MacOSX Summary: Implementation of decoder for Apple's MacOSX. The implementation is based on the patch provided by Kevin Walls. Reviewed-by: coleenp, kamg, kevinw
author zgu
date Mon, 30 Jul 2012 10:25:52 -0400
parents db006a85bf91
children
line wrap: on
line diff
--- a/src/os/bsd/vm/decoder_machO.hpp	Thu Jul 19 06:24:46 2012 -0700
+++ b/src/os/bsd/vm/decoder_machO.hpp	Mon Jul 30 10:25:52 2012 -0400
@@ -31,10 +31,25 @@
 
 // Just a placehold for now, a real implementation should derive
 // from AbstractDecoder
-class MachODecoder : public NullDecoder {
-public:
+class MachODecoder : public AbstractDecoder {
+ public:
   MachODecoder() { }
   ~MachODecoder() { }
+  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);
 };
 
 #endif