diff agent/src/share/native/sadis.c @ 8750:39432a1cefdd

8003348: SA can not read core file on OS Summary: Macosx uses Mach-O file format for binary files, not ELF format. Currently SA works on core files on other platforms, t his change enables SA work on core file generated on Darwin. Reviewed-by: sla, sspitsyn Contributed-by: yumin.qi@oracle.com
author minqi
date Thu, 14 Mar 2013 00:33:08 -0700
parents 79f492f184d0
children
line wrap: on
line diff
--- a/agent/src/share/native/sadis.c	Wed Mar 13 17:34:29 2013 -0400
+++ b/agent/src/share/native/sadis.c	Thu Mar 14 00:33:08 2013 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,10 @@
 
 #include <string.h>
 #include <dlfcn.h>
+
+#ifndef __APPLE__
 #include <link.h>
+#endif
 
 #endif
 
@@ -109,9 +112,7 @@
                                                                            jstring libname_s) {
   uintptr_t func = 0;
   const char* error_message = NULL;
-  const char* java_home;
   jboolean isCopy;
-  uintptr_t *handle = NULL;
 
   const char * jrepath = (*env)->GetStringUTFChars(env, jrepath_s, &isCopy); // like $JAVA_HOME/jre/lib/sparc/
   const char * libname = (*env)->GetStringUTFChars(env, libname_s, &isCopy);
@@ -167,7 +168,8 @@
                              void* event_stream,
                              int (*printf_callback)(void*, const char*, ...),
                              void* printf_stream,
-                             const char* options);
+                             const char* options,
+                             int newline);
 
 /* container for call back state when decoding instructions */
 typedef struct {
@@ -281,7 +283,7 @@
                                                          end - start,
                                                          &event_to_env,  (void*) &denv,
                                                          &printf_to_env, (void*) &denv,
-                                                         options);
+                                                         options, 0 /* newline */);
 
   /* cleanup */
   (*env)->ReleaseByteArrayElements(env, code, start, JNI_ABORT);