Skip to content
Browse files

Removing wrongly licensed and useless files as well as tweaking the l…

…icense file for legalization
  • Loading branch information...
1 parent e684f9e commit de3f167153723b1e59caebc9653af5b6fdbe31fa @trishume trishume committed
View
4 LICENSE.txt
@@ -1,3 +1,7 @@
+The Open Turing Project License
+
+Open Turing is released under the MIT license unless otherwise specified by a license file, readme file or code comments. Some (not all) of the things not covered by this license: libungif, the JPEG library, java-related code in the ready/src directory and Microsoft code in the support/Microsoft directory of the package.
+
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
View
6 Readme.md
@@ -81,4 +81,8 @@ To get a fully working release with your changes you must compile both of these.
###How Can I Help?
-Look in the issues tab. Either fix things or add new features listed there.
+Look in the issues tab. Either fix things or add new features listed there.
+
+###Legal
+
+Open Turing uses the IGL JPEG Library and the libungif library.
View
1 local/README.txt
@@ -1 +0,0 @@
-WinDiff - Windiff.exe, gutils.dll, windiff.hlp (Downloaded from http://keithdevens.com/files/windiff)
View
1 local/cvstat.bat
@@ -1 +0,0 @@
-cvs status | egrep '(\?|File:)' | grep -v Up-to-date
View
45 local/evim.bat
@@ -1,45 +0,0 @@
-@echo off
-rem -- Run Vim --
-
-set VIM=C:\Program Files\Vim
-
-if exist "%VIM%\vim63\gvim.exe" goto havevim
-echo "%VIM%\vim63\gvim.exe" not found
-goto eof
-
-:havevim
-rem collect the arguments in VIMARGS for Win95
-set VIMARGS=
-set VIMNOFORK=
-:loopstart
-if .%1==. goto loopend
-if NOT .%1==.-f goto noforkarg
-set VIMNOFORK=1
-:noforkarg
-set VIMARGS=%VIMARGS% %1
-shift
-goto loopstart
-
-:loopend
-if .%OS%==.Windows_NT goto ntaction
-
-if .%VIMNOFORK%==.1 goto nofork
-start "%VIM%\vim63\gvim.exe" -y %VIMARGS%
-goto eof
-
-:nofork
-start /w "%VIM%\vim63\gvim.exe" -y %VIMARGS%
-goto eof
-
-:ntaction
-rem for WinNT we can use %*
-if .%VIMNOFORK%==.1 goto noforknt
-start "dummy" /b "%VIM%\vim63\gvim.exe" -y %*
-goto eof
-
-:noforknt
-start "dummy" /b /wait "%VIM%\vim63\gvim.exe" -y %*
-
-:eof
-set VIMARGS=
-set VIMNOFORK=
View
BIN local/gutils.dll
Binary file not shown.
View
45 local/gvim.bat
@@ -1,45 +0,0 @@
-@echo off
-rem -- Run Vim --
-
-set VIM=C:\Program Files\Vim
-
-if exist "%VIM%\vim63\gvim.exe" goto havevim
-echo "%VIM%\vim63\gvim.exe" not found
-goto eof
-
-:havevim
-rem collect the arguments in VIMARGS for Win95
-set VIMARGS=
-set VIMNOFORK=
-:loopstart
-if .%1==. goto loopend
-if NOT .%1==.-f goto noforkarg
-set VIMNOFORK=1
-:noforkarg
-set VIMARGS=%VIMARGS% %1
-shift
-goto loopstart
-
-:loopend
-if .%OS%==.Windows_NT goto ntaction
-
-if .%VIMNOFORK%==.1 goto nofork
-start "%VIM%\vim63\gvim.exe" %VIMARGS%
-goto eof
-
-:nofork
-start /w "%VIM%\vim63\gvim.exe" %VIMARGS%
-goto eof
-
-:ntaction
-rem for WinNT we can use %*
-if .%VIMNOFORK%==.1 goto noforknt
-start "dummy" /b "%VIM%\vim63\gvim.exe" %*
-goto eof
-
-:noforknt
-start "dummy" /b /wait "%VIM%\vim63\gvim.exe" %*
-
-:eof
-set VIMARGS=
-set VIMNOFORK=
View
3 local/mydoc.bat
@@ -1,3 +0,0 @@
-@echo off
-c:
-cd "\documents and settings\Tom\My Documents"
View
2 local/ued.bat
@@ -1,2 +0,0 @@
-@echo off
-start "dummy" /b "C:\Program Files\UltraEdit\uedit32.exe" %*
View
2 local/ufind.bat
@@ -1,2 +0,0 @@
-@echo off
-c:\cygwin\bin\find %*
View
2 local/vi.bat
@@ -1,2 +0,0 @@
-@echo off
-"C:\Program Files\Vim\vim63\vim.exe" %*
View
2 local/vim.bat
@@ -1,2 +0,0 @@
-@echo off
-"C:\Program Files\Vim\vim63\vim.exe" %*
View
BIN local/windiff.GID
Binary file not shown.
View
BIN local/windiff.exe
Binary file not shown.
View
BIN local/windiff.hlp
Binary file not shown.
View
505 ready/src/config.h
@@ -1,505 +0,0 @@
-/*
-From: "Chris Dennis" <Chris.Dennis@invidi.com>
-To: <jikes-dev@www-126.southbury.usf.ibm.com>
-Subject: RE: [Jikes-dev] MS VC++ Problem
-Date: Mon, 18 Nov 2002 13:32:35 -0700
-*/
-
-/*
-Here is my automatically generated config.h file for MS VC++ 6.0. It was
-generated by
-configure ac_cv_prog_cxx_g=no ac_cv_cxx_rtti=yes HAVE_JIKES_NAMESPACE=yes
-CXX=cl CPPFLAGS="-nologo -TP -G6 -GX -GR -Ox -O2" --host=mingw32
-*/
-
-/* ------- Everything below this line was automatically generated -------- */
-
-/* src/config.h. Generated by configure. */
-/* src/config.h.in. Generated from configure.in by autoheader. */
-
-
-/* This software is subject to the terms of the IBM Jikes
-Compiler License Agreement available at the following URL:
-http://ibm.com/developerworks/opensource/jikes.
-Copyright (C) 1996, 2002 International Business Machines Corporation
-and others. All Rights Reserved.
-You must accept the terms of that agreement to use this software. */
-
-
-/* Defined when the compiler supports 64 bit integer math */
-#define HAVE_64BIT_TYPES
-
-
-/* Define to 1 if you have the <assert.h> header file. */
-#define HAVE_ASSERT_H 1
-
-
-/* defined if bool is a built-in C++ type */
-#define HAVE_BOOL
-
-
-/* known to be broken on mingwin beta 20 */
-/* #undef HAVE_BROKEN_USHRT_MAX */
-
-
-/* define if the compiler supports const_cast<> */
-#define HAVE_CONST_CAST
-
-
-/* Define to 1 if you have the <ctype.h> header file. */
-#define HAVE_CTYPE_H 1
-
-
-/* Define to 1 if you have the `cygwin_win32_to_posix_path_list' function.
-*/
-/* #undef HAVE_CYGWIN_WIN32_TO_POSIX_PATH_LIST */
-
-
-/* Define to 1 if you have the <direct.h> header file. */
-#define HAVE_DIRECT_H 1
-
-
-/* Define to 1 if you have the <dirent.h> header file. */
-/* #undef HAVE_DIRENT_H */
-
-
-/* define if the compiler supports dynamic_cast<> */
-#define HAVE_DYNAMIC_CAST
-
-
-/* Defined if Jikes supports -encoding for input files. */
-/* #undef HAVE_ENCODING */
-
-
-/* Defined when the compiler would generate an error on a call to iconv with
-a
- non const 2nd argument. This is a known problem on IRIX systems, as well
-as
- newer GNU LIBCs. */
-/* #undef HAVE_ERROR_CALL_ICONV_CONST */
-
-
-/* Defined when the compiler would generate an error on a call to wcslen
-with
- a non const argument. This is only known to happen on cygwin and mingwin
-*/
-/* #undef HAVE_ERROR_CALL_WCSLEN_CONST */
-
-
-/* compiler will generate an error when discarding a const qualifier */
-#define HAVE_ERROR_DISCARD_CONST
-
-
-/* define if the compiler supports the explicit keyword */
-#define HAVE_EXPLICIT
-
-
-/* Define to 1 if you have the <float.h> header file. */
-#define HAVE_FLOAT_H 1
-
-
-/* use unix style mkdir(str, S_IRWXU | S_IRWXG | S_IRWXO) */
-/* #undef HAVE_GLIBC_MKDIR */
-
-
-/* known to be broken on Win and OS2 when compiled with ICC */
-/* #undef HAVE_ICC_FP_BUGS */
-
-
-/* Define to 1 if you have the <iconv.h> header file. */
-/* #undef HAVE_ICONV_H */
-
-
-/* Defined when Jikes is built with native floating support */
-/* #undef HAVE_IEEE754 */
-
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-/* #undef HAVE_INTTYPES_H */
-
-
-/* Define Jikes classes in a C++ namespace */
-/* #undef HAVE_JIKES_NAMESPACE */
-
-
-/* use unix style mkdir(str, S_IRWXU) */
-/* #undef HAVE_LIBC5_MKDIR */
-
-
-/* Define to 1 if you have the `iconv' library (-liconv). */
-/* #undef HAVE_LIBICONV */
-
-
-/* Define to 1 if you have the `icu-uc' library (-licu-uc). */
-/* #undef HAVE_LIBICU_UC */
-
-
-/* Define to 1 if you have the `m' library (-lm). */
-/* #undef HAVE_LIBM */
-
-
-/* Define to 1 if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
-
-
-/* Define to 1 if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
-
-
-/* use mac style mkdir(str,0) from <stat.mac.h> */
-/* #undef HAVE_MAC_MKDIR */
-
-
-/* Define to 1 if you have the <math.h> header file. */
-#define HAVE_MATH_H 1
-
-
-/* define if the compiler supports member constants */
-/* #undef HAVE_MEMBER_CONSTANTS */
-
-
-/* Define to 1 if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
-
-
-/* Define to 1 if you have the `mkdir' function. */
-#define HAVE_MKDIR 1
-
-
-/* define if the compiler implements namespaces */
-#define HAVE_NAMESPACES 1
-
-
-/* compiler has ostream << const unsigned char * */
-#define HAVE_OSTREAM_CONST_UNSIGNED_CHAR_PTR
-
-
-/* defined if running on a system with dos style paths */
-#define HAVE_PATHNAME_STYLE_DOS
-
-
-/* define if the compiler supports reinterpret_cast<> */
-#define HAVE_REINTERPRET_CAST
-
-
-/* define if the compiler supports Run-Time Type Identification */
-#define HAVE_RTTI
-
-
-/* define if the compiler supports static_cast<> */
-#define HAVE_STATIC_CAST
-
-
-/* define if the compiler supports ISO C++ standard library */
-#define HAVE_STD
-
-
-/* Define to 1 if you have the <stdint.h> header file. */
-/* #undef HAVE_STDINT_H */
-
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#define HAVE_STDIO_H 1
-
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
-
-
-/* Define to 1 if you have the <strings.h> header file. */
-/* #undef HAVE_STRINGS_H */
-
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-
-/* Define to 1 if you have the <sys/cygwin.h> header file. */
-/* #undef HAVE_SYS_CYGWIN_H */
-
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
-
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-
-/* Define to 1 if you have the <time.h> header file. */
-#define HAVE_TIME_H 1
-
-
-/* Define to 1 if you have the <unistd.h> header file. */
-/* #undef HAVE_UNISTD_H */
-
-
-/* Use visual C++ version of set_new_handler */
-#define HAVE_VCPP_SET_NEW_HANDLER
-
-
-/* Define to 1 if you have the <wchar.h> header file. */
-#define HAVE_WCHAR_H 1
-
-
-/* Define to 1 if you have the `wcscat' function. */
-#define HAVE_WCSCAT 1
-
-
-/* Define to 1 if you have the `wcscmp' function. */
-#define HAVE_WCSCMP 1
-
-
-/* Define to 1 if you have the `wcscpy' function. */
-#define HAVE_WCSCPY 1
-
-
-/* Define to 1 if you have the `wcslen' function. */
-#define HAVE_WCSLEN 1
-
-
-/* Define to 1 if you have the `wcsncmp' function. */
-#define HAVE_WCSNCMP 1
-
-
-/* Define to 1 if you have the `wcsncpy' function. */
-#define HAVE_WCSNCPY 1
-
-
-/* use win32 style mkdir(str) from <direct.h> */
-#define HAVE_WIN32_MKDIR
-
-
-/* Define to 1 if you have the <windows.h> header file. */
-#define HAVE_WINDOWS_H 1
-
-
-/* Defined when the wint_t type is supported */
-#define HAVE_WINT_T
-
-
-/* Enable internal compiler debugging */
-/* #undef JIKES_DEBUG */
-
-
-/* Define this to the name of the unicode encoding that is the same size as
- your wchar_t. See also the following entry for byte swapping. */
-/* #undef JIKES_ICONV_ENCODING */
-
-
-/* Define this if the encoding specified above does not match your
-platform's
- native endianness. */
-/* #undef JIKES_ICONV_NEEDS_BYTE_SWAP */
-
-
-/* Used to test results of stat call to see if it is a directory */
-#define JIKES_STAT_S_IFDIR _S_IFDIR
-
-
-/* A string to indicate the release of jikes: Version 1.17 - 27 Sept 2002 */
-#define JIKES_VERSION_STRING "Version post1.17-CVS - 12 November 2002"
-
-
-/* Name of package */
-#define PACKAGE "jikes"
-
-
-/* Define to the address where bug reports for this package should be sent.
-*/
-#define PACKAGE_BUGREPORT ""
-
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "jikes"
-
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "jikes 1.17a"
-
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "jikes"
-
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.17a"
-
-
-/* used to seperate elements on the PATH */
-#define PATH_SEPARATOR ';'
-
-
-/* The size of a `char', as computed by sizeof. */
-/* #undef SIZEOF_CHAR */
-
-
-/* The size of a `int', as computed by sizeof. */
-/* #undef SIZEOF_INT */
-
-
-/* The size of a `long', as computed by sizeof. */
-/* #undef SIZEOF_LONG */
-
-
-/* The size of a `long long', as computed by sizeof. */
-/* #undef SIZEOF_LONG_LONG */
-
-
-/* The size of a `short', as computed by sizeof. */
-/* #undef SIZEOF_SHORT */
-
-
-/* The size of a `signed', as computed by sizeof. */
-#define SIZEOF_SIGNED 4
-
-
-/* The size of a `signed char', as computed by sizeof. */
-#define SIZEOF_SIGNED_CHAR 1
-
-
-/* The size of a `signed int', as computed by sizeof. */
-/* #undef SIZEOF_SIGNED_INT */
-
-
-/* The size of a `signed long', as computed by sizeof. */
-#define SIZEOF_SIGNED_LONG 4
-
-
-/* The size of a `signed long long', as computed by sizeof. */
-#define SIZEOF_SIGNED_LONG_LONG 0
-
-
-/* The size of a `signed short', as computed by sizeof. */
-#define SIZEOF_SIGNED_SHORT 2
-
-
-/* The size of a `unsigned', as computed by sizeof. */
-#define SIZEOF_UNSIGNED 4
-
-
-/* The size of a `unsigned char', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_CHAR 1
-
-
-/* The size of a `unsigned int16_t', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT16_T 0
-
-
-/* The size of a `unsigned int32_t', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT32_T 0
-
-
-/* The size of a `unsigned int64_t', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT64_T 8
-
-
-/* The size of a `unsigned int8_t', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT8_T 0
-
-
-/* The size of a `unsigned long', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED_LONG */
-
-
-/* The size of a `unsigned long long', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED_LONG_LONG */
-
-
-/* The size of a `unsigned short', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_SHORT 2
-
-
-/* The size of a `unsigned __int16', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED___INT16 */
-
-
-/* The size of a `unsigned __int32', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED___INT32 */
-
-
-/* The size of a `unsigned __int64', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED___INT64 */
-
-
-/* The size of a `unsigned __int8', as computed by sizeof. */
-/* #undef SIZEOF_UNSIGNED___INT8 */
-
-
-/* The size of a `wchar_t', as computed by sizeof. */
-/* #undef SIZEOF_WCHAR_T */
-
-
-/* The size of a `__int16', as computed by sizeof. */
-/* #undef SIZEOF___INT16 */
-
-
-/* The size of a `__int32', as computed by sizeof. */
-/* #undef SIZEOF___INT32 */
-
-
-/* The size of a `__int64', as computed by sizeof. */
-#define SIZEOF___INT64 8
-
-
-/* The size of a `__int8', as computed by sizeof. */
-/* #undef SIZEOF___INT8 */
-
-
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
-
-
-/* quick hack to use UNIX file system, fixme */
-/* #undef UNIX_FILE_SYSTEM */
-
-
-/* Version number of package */
-#define VERSION "1.17a"
-
-
-/* quick hack to use Win32 file system, fixme */
-#define WIN32_FILE_SYSTEM
-
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-
-/* If not already defined, then define as a datatype of *exactly* 16 bits.
-*/
-#define int16_t signed short
-
-
-/* If not already defined, then define as a datatype of *exactly* 32 bits.
-*/
-#define int32_t signed
-
-
-/* If not already defined, then define as a datatype of *exactly* 64 bits.
-*/
-#define int64_t __int64
-
-
-/* If not already defined, then define as a datatype of *exactly* 8 bits. */
-#define int8_t signed char
-
-
-/* If not already defined, then define as a datatype of *exactly* 16 bits.
-*/
-#define uint16_t unsigned short
-
-
-/* If not already defined, then define as a datatype of *exactly* 32 bits.
-*/
-#define uint32_t unsigned
-
-
-/* If not already defined, then define as a datatype of *exactly* 64 bits.
-*/
-#define uint64_t unsigned int64_t
-
-
-/* If not already defined, then define as a datatype of *exactly* 8 bits. */
-#define uint8_t unsigned char
View
3 ready/src/ed.c
@@ -340,7 +340,6 @@ int WINAPI WinMain (HINSTANCE pmApplicationInstance,
EdFile_CombinePath (myCurrentDirectory, "testsuite",
myOutdir);
- //printf("starting...\n");
EdRun_RunProgramNoEditor (myCurrentDirectory,myOutdir,stAutoRunFile);
return 0;
}
@@ -469,7 +468,7 @@ int WINAPI WinMain (HINSTANCE pmApplicationInstance,
return 0;
}
- if (!gProperties.skipSplashScreen && !stAutoRunPrograms)
+ if (!gProperties.skipSplashScreen)
{
// Start the splash screen
EdSplash_Create (FALSE);
View
278 ready/src/jni/jawt.h
@@ -1,278 +0,0 @@
-/*
- * @(#)jawt.h 1.8 01/12/03
- *
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
-#ifndef _JAVASOFT_JAWT_H_
-#define _JAVASOFT_JAWT_H_
-
-#include "jni.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * AWT native interface (new in JDK 1.3)
- *
- * The AWT native interface allows a native C or C++ application a means
- * by which to access native structures in AWT. This is to facilitate moving
- * legacy C and C++ applications to Java and to target the needs of the
- * community who, at present, wish to do their own native rendering to canvases
- * for performance reasons. Standard extensions such as Java3D also require a
- * means to access the underlying native data structures of AWT.
- *
- * There may be future extensions to this API depending on demand.
- *
- * A VM does not have to implement this API in order to pass the JCK.
- * It is recommended, however, that this API is implemented on VMs that support
- * standard extensions, such as Java3D.
- *
- * Since this is a native API, any program which uses it cannot be considered
- * 100% pure java.
- */
-
-/*
- * AWT Native Drawing Surface (JAWT_DrawingSurface).
- *
- * For each platform, there is a native drawing surface structure. This
- * platform-specific structure can be found in jawt_md.h. It is recommended
- * that additional platforms follow the same model. It is also recommended
- * that VMs on Win32 and Solaris support the existing structures in jawt_md.h.
- *
- *******************
- * EXAMPLE OF USAGE:
- *******************
- *
- * In Win32, a programmer wishes to access the HWND of a canvas to perform
- * native rendering into it. The programmer has declared the paint() method
- * for their canvas subclass to be native:
- *
- *
- * MyCanvas.java:
- *
- * import java.awt.*;
- *
- * public class MyCanvas extends Canvas {
- *
- * static {
- * System.loadLibrary("mylib");
- * }
- *
- * public native void paint(Graphics g);
- * }
- *
- *
- * myfile.c:
- *
- * #include "jawt_md.h"
- * #include <assert.h>
- *
- * JNIEXPORT void JNICALL
- * Java_MyCanvas_paint(JNIEnv* env, jobject canvas, jobject graphics)
- * {
- * JAWT awt;
- * JAWT_DrawingSurface* ds;
- * JAWT_DrawingSurfaceInfo* dsi;
- * JAWT_Win32DrawingSurfaceInfo* dsi_win;
- * jboolean result;
- * jint lock;
- *
- * // Get the AWT
- * awt.version = JAWT_VERSION_1_3;
- * result = JAWT_GetAWT(env, &awt);
- * assert(result != JNI_FALSE);
- *
- * // Get the drawing surface
- * ds = awt.GetDrawingSurface(env, canvas);
- * assert(ds != NULL);
- *
- * // Lock the drawing surface
- * lock = ds->Lock(ds);
- * assert((lock & JAWT_LOCK_ERROR) == 0);
- *
- * // Get the drawing surface info
- * dsi = ds->GetDrawingSurfaceInfo(ds);
- *
- * // Get the platform-specific drawing info
- * dsi_win = (JAWT_Win32DrawingSurfaceInfo*)dsi->platformInfo;
- *
- * //////////////////////////////
- * // !!! DO PAINTING HERE !!! //
- * //////////////////////////////
- *
- * // Free the drawing surface info
- * ds->FreeDrawingSurfaceInfo(dsi);
- *
- * // Unlock the drawing surface
- * ds->Unlock(ds);
- *
- * // Free the drawing surface
- * awt.FreeDrawingSurface(ds);
- * }
- *
- */
-
-/*
- * JAWT_Rectangle
- * Structure for a native rectangle.
- */
-typedef struct jawt_Rectangle {
- jint x;
- jint y;
- jint width;
- jint height;
-} JAWT_Rectangle;
-
-struct jawt_DrawingSurface;
-
-/*
- * JAWT_DrawingSurfaceInfo
- * Structure for containing the underlying drawing information of a component.
- */
-typedef struct jawt_DrawingSurfaceInfo {
- /*
- * Pointer to the platform-specific information. This can be safely
- * cast to a JAWT_Win32DrawingSurfaceInfo on Windows or a
- * JAWT_X11DrawingSurfaceInfo on Solaris. See jawt_md.h for details.
- */
- void* platformInfo;
- /* Cached pointer to the underlying drawing surface */
- struct jawt_DrawingSurface* ds;
- /* Bounding rectangle of the drawing surface */
- JAWT_Rectangle bounds;
- /* Number of rectangles in the clip */
- jint clipSize;
- /* Clip rectangle array */
- JAWT_Rectangle* clip;
-} JAWT_DrawingSurfaceInfo;
-
-#define JAWT_LOCK_ERROR 0x00000001
-#define JAWT_LOCK_CLIP_CHANGED 0x00000002
-#define JAWT_LOCK_BOUNDS_CHANGED 0x00000004
-#define JAWT_LOCK_SURFACE_CHANGED 0x00000008
-
-/*
- * JAWT_DrawingSurface
- * Structure for containing the underlying drawing information of a component.
- * All operations on a JAWT_DrawingSurface MUST be performed from the same
- * thread as the call to GetDrawingSurface.
- */
-typedef struct jawt_DrawingSurface {
- /*
- * Cached reference to the Java environment of the calling thread.
- * If Lock(), Unlock(), GetDrawingSurfaceInfo() or
- * FreeDrawingSurfaceInfo() are called from a different thread,
- * this data member should be set before calling those functions.
- */
- JNIEnv* env;
- /* Cached reference to the target object */
- jobject target;
- /*
- * Lock the surface of the target component for native rendering.
- * When finished drawing, the surface must be unlocked with
- * Unlock(). This function returns a bitmask with one or more of the
- * following values:
- *
- * JAWT_LOCK_ERROR - When an error has occurred and the surface could not
- * be locked.
- *
- * JAWT_LOCK_CLIP_CHANGED - When the clip region has changed.
- *
- * JAWT_LOCK_BOUNDS_CHANGED - When the bounds of the surface have changed.
- *
- * JAWT_LOCK_SURFACE_CHANGED - When the surface itself has changed
- */
- jint (JNICALL *Lock)
- (struct jawt_DrawingSurface* ds);
- /*
- * Get the drawing surface info.
- * The value returned may be cached, but the values may change if
- * additional calls to Lock() or Unlock() are made.
- * Lock() must be called before this can return a valid value.
- * Returns NULL if an error has occurred.
- * When finished with the returned value, FreeDrawingSurfaceInfo must be
- * called.
- */
- JAWT_DrawingSurfaceInfo* (JNICALL *GetDrawingSurfaceInfo)
- (struct jawt_DrawingSurface* ds);
- /*
- * Free the drawing surface info.
- */
- void (JNICALL *FreeDrawingSurfaceInfo)
- (JAWT_DrawingSurfaceInfo* dsi);
- /*
- * Unlock the drawing surface of the target component for native rendering.
- */
- void (JNICALL *Unlock)
- (struct jawt_DrawingSurface* ds);
-} JAWT_DrawingSurface;
-
-/*
- * JAWT
- * Structure for containing native AWT functions.
- */
-typedef struct jawt {
- /*
- * Version of this structure. This must always be set before
- * calling JAWT_GetAWT()
- */
- jint version;
- /*
- * Return a drawing surface from a target jobject. This value
- * may be cached.
- * Returns NULL if an error has occurred.
- * Target must be a java.awt.Component (should be a Canvas
- * or Window for native rendering).
- * FreeDrawingSurface() must be called when finished with the
- * returned JAWT_DrawingSurface.
- */
- JAWT_DrawingSurface* (JNICALL *GetDrawingSurface)
- (JNIEnv* env, jobject target);
- /*
- * Free the drawing surface allocated in GetDrawingSurface.
- */
- void (JNICALL *FreeDrawingSurface)
- (JAWT_DrawingSurface* ds);
- /*
- * Since 1.4
- * Locks the entire AWT for synchronization purposes
- */
- void (JNICALL *Lock)(JNIEnv* env);
- /*
- * Since 1.4
- * Unlocks the entire AWT for synchronization purposes
- */
- void (JNICALL *Unlock)(JNIEnv* env);
- /*
- * Since 1.4
- * Returns a reference to a java.awt.Component from a native
- * platform handle. On Windows, this corresponds to an HWND;
- * on Solaris and Linux, this is a Drawable. For other platforms,
- * see the appropriate machine-dependent header file for a description.
- * The reference returned by this function is a local
- * reference that is only valid in this environment.
- * This function returns a NULL reference if no component could be
- * found with matching platform information.
- */
- jobject (JNICALL *GetComponent)(JNIEnv* env, void* platformInfo);
-
-} JAWT;
-
-/*
- * Get the AWT native structure. This function returns JNI_FALSE if
- * an error occurs.
- */
-_JNI_IMPORT_OR_EXPORT_
-jboolean JNICALL JAWT_GetAWT(JNIEnv* env, JAWT* awt);
-
-#define JAWT_VERSION_1_3 0x00010003
-#define JAWT_VERSION_1_4 0x00010004
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif /* !_JAVASOFT_JAWT_H_ */
View
1,951 ready/src/jni/jni.h
0 additions, 1,951 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
1,006 ready/src/jni/jvmdi.h
@@ -1,1006 +0,0 @@
-/*
- * @(#)jvmdi.h 1.44 01/12/03
- *
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
-/*
- * Java Virtual Machine Debug Interface
- *
- * Defines debugging functionality that a VM should provide.
- *
- * Should not overlap functionality in jni.h
- */
-
-#ifndef _JAVASOFT_JVMDI_H_
-#define _JAVASOFT_JVMDI_H_
-
-#include "jni.h"
-
-#define JVMDI_VERSION_1 0x20010000
-#define JVMDI_VERSION_1_1 0x20010001
-#define JVMDI_VERSION_1_2 0x20010002
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef jobject jthread;
-
-typedef jobject jthreadGroup;
-
-struct _jframeID;
-typedef struct _jframeID *jframeID;
-
- /* specifies program location "pc" - often byte code index */
-typedef jlong jlocation;
-
- /* The jmethodID for methods that have been replaced */
- /* via RedefineClasses - used when the implementation */
- /* does not wish to retain replaced jmethodIDs */
-#define OBSOLETE_METHOD_ID ((jmethodID)(NULL))
-
- /*
- * Errors
- */
-
-typedef jint jvmdiError;
-
- /* no error */
-#define JVMDI_ERROR_NONE ((jvmdiError)0)
-
- /*
- * Errors on thread operations
- */
-
- /* invalid thread */
-#define JVMDI_ERROR_INVALID_THREAD ((jvmdiError)10)
- /* invalid thread group */
-#define JVMDI_ERROR_INVALID_THREAD_GROUP ((jvmdiError)11)
- /* invalid thread priority */
-#define JVMDI_ERROR_INVALID_PRIORITY ((jvmdiError)12)
- /* thread not suspended */
-#define JVMDI_ERROR_THREAD_NOT_SUSPENDED ((jvmdiError)13)
- /* thread already suspended */
-#define JVMDI_ERROR_THREAD_SUSPENDED ((jvmdiError)14)
-
- /*
- * Errors on object and class operations
- */
-
- /* invalid object (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_INVALID_OBJECT ((jvmdiError)20)
- /* invalid class (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_INVALID_CLASS ((jvmdiError)21)
- /* class not prepared */
-#define JVMDI_ERROR_CLASS_NOT_PREPARED ((jvmdiError)22)
- /* invalid methodID (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_INVALID_METHODID ((jvmdiError)23)
- /* invalid location */
-#define JVMDI_ERROR_INVALID_LOCATION ((jvmdiError)24)
- /* invalid fieldID (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_INVALID_FIELDID ((jvmdiError)25)
-
- /*
- * Errors on frame operations
- */
-
- /* invalid frameID (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_INVALID_FRAMEID ((jvmdiError)30)
- /* there are no more frames on the stack */
-#define JVMDI_ERROR_NO_MORE_FRAMES ((jvmdiError)31)
- /* operation cannot be performed on this frame */
-#define JVMDI_ERROR_OPAQUE_FRAME ((jvmdiError)32)
- /* operation can only be performed on current frame */
-#define JVMDI_ERROR_NOT_CURRENT_FRAME ((jvmdiError)33)
- /* type mismatch (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_TYPE_MISMATCH ((jvmdiError)34)
- /* invalid slot */
-#define JVMDI_ERROR_INVALID_SLOT ((jvmdiError)35)
-
- /*
- * Errors on set/clear/find operations
- */
-
- /* item already present */
-#define JVMDI_ERROR_DUPLICATE ((jvmdiError)40)
- /* item not found */
-#define JVMDI_ERROR_NOT_FOUND ((jvmdiError)41)
-
- /*
- * Errors on monitor operations
- */
-
- /* invalid monitor */
-#define JVMDI_ERROR_INVALID_MONITOR ((jvmdiError)50)
- /* wait, notify, notify all tried without entering monitor */
-#define JVMDI_ERROR_NOT_MONITOR_OWNER ((jvmdiError)51)
- /* waiting thread interrupted */
-#define JVMDI_ERROR_INTERRUPT ((jvmdiError)52)
-
- /*
- * Class redefinition / operand stack errors
- */
-
- /* The equivalent of ClassFormatError */
-#define JVMDI_ERROR_INVALID_CLASS_FORMAT ((jvmdiError)60)
- /* The equivalent of ClassCircularityError */
-#define JVMDI_ERROR_CIRCULAR_CLASS_DEFINITION ((jvmdiError)61)
- /* The class bytes fail verification */
-#define JVMDI_ERROR_FAILS_VERIFICATION ((jvmdiError)62)
- /* The new class version adds new methods */
- /* and can_add_method is false */
-#define JVMDI_ERROR_ADD_METHOD_NOT_IMPLEMENTED ((jvmdiError)63)
- /* The new class version changes fields */
- /* and can_unrestrictedly_redefine_classes is false */
-#define JVMDI_ERROR_SCHEMA_CHANGE_NOT_IMPLEMENTED ((jvmdiError)64)
- /* bci/operand stack/local var combination is not verifiably */
- /* type safe */
-#define JVMDI_ERROR_INVALID_TYPESTATE ((jvmdiError)65)
- /* A direct superclass is different for the new class */
- /* version, or the set of directly implemented */
- /* interfaces is different */
- /* and can_unrestrictedly_redefine_classes is false */
-#define JVMDI_ERROR_HIERARCHY_CHANGE_NOT_IMPLEMENTED ((jvmdiError)66)
- /* The new class version does not declare a method */
- /* declared in the old class version */
- /* and can_unrestrictedly_redefine_classes is false */
-#define JVMDI_ERROR_DELETE_METHOD_NOT_IMPLEMENTED ((jvmdiError)67)
- /* A class file has a version number not supported */
- /* by this VM. */
-#define JVMDI_ERROR_UNSUPPORTED_VERSION ((jvmdiError)68)
- /* The class name defined in the new class file is */
- /* different from the name in the old class object */
-#define JVMDI_ERROR_NAMES_DONT_MATCH ((jvmdiError)69)
- /* The new class version has different modifiers and */
- /* can_unrestrictedly_redefine_classes is false */
-#define JVMDI_ERROR_CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)70)
- /* A method in the new class version has different modifiers */
- /* than its counterpart in the old class version */
- /* and can_unrestrictedly_redefine_classes is false */
-#define JVMDI_ERROR_METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED ((jvmdiError)71)
-
- /*
- * Miscellaneous errors
- */
-
- /* Not yet implemented */
-#define JVMDI_ERROR_NOT_IMPLEMENTED ((jvmdiError)99)
- /* null pointer */
-#define JVMDI_ERROR_NULL_POINTER ((jvmdiError)100)
- /* information is absent */
-#define JVMDI_ERROR_ABSENT_INFORMATION ((jvmdiError)101)
- /* invalid event type */
-#define JVMDI_ERROR_INVALID_EVENT_TYPE ((jvmdiError)102)
- /* invalid argument */
-#define JVMDI_ERROR_ILLEGAL_ARGUMENT ((jvmdiError)103)
-
- /*
- * Universal errors. These errors may be returned by
- * any JVMDI function, not just the ones for which they are listed
- * below.
- */
-
- /* no more memory available for allocation */
-#define JVMDI_ERROR_OUT_OF_MEMORY ((jvmdiError)110)
- /* debugging has not been enabled in this VM */
-#define JVMDI_ERROR_ACCESS_DENIED ((jvmdiError)111)
- /* VM is dead (implementation not required to gracefully catch) */
-#define JVMDI_ERROR_VM_DEAD ((jvmdiError)112)
- /* internal error */
-#define JVMDI_ERROR_INTERNAL ((jvmdiError)113)
- /* Thread calling JVMDI function not attached to VM */
-#define JVMDI_ERROR_UNATTACHED_THREAD ((jvmdiError)115)
-
-
- /*
- * Threads
- */
-
- /* Thread status is unknown */
-#define JVMDI_THREAD_STATUS_UNKNOWN ((jint)-1)
- /* Thread is waiting to die */
-#define JVMDI_THREAD_STATUS_ZOMBIE ((jint)0)
- /* Thread is runnable */
-#define JVMDI_THREAD_STATUS_RUNNING ((jint)1)
- /* Thread is sleeping - Thread.sleep() or JVM_Sleep() was called */
-#define JVMDI_THREAD_STATUS_SLEEPING ((jint)2)
- /* Thread is waiting on a java monitor */
-#define JVMDI_THREAD_STATUS_MONITOR ((jint)3)
- /* Thread is waiting - Thread.wait() or JVM_MonitorWait() was called */
-#define JVMDI_THREAD_STATUS_WAIT ((jint)4)
-
- /* Thread is suspended - Thread.suspend(), JVM_Suspend() or
- * JVMDI_Suspend was called */
-#define JVMDI_SUSPEND_STATUS_SUSPENDED ((jint)0x1)
- /* Thread is at a breakpoint */
-#define JVMDI_SUSPEND_STATUS_BREAK ((jint)0x2)
-
-
- /* Thread priority constants */
-#define JVMDI_THREAD_MIN_PRIORITY ((jint)1)
-#define JVMDI_THREAD_NORM_PRIORITY ((jint)5)
-#define JVMDI_THREAD_MAX_PRIORITY ((jint)10)
-
-typedef struct {
- char *name;
- jint priority;
- jboolean is_daemon;
- jthreadGroup thread_group;
- jobject context_class_loader;
-} JVMDI_thread_info;
-
-typedef struct {
- jthreadGroup parent;
- char *name;
- jint max_priority;
- jboolean is_daemon;
-} JVMDI_thread_group_info;
-
-#define JVMDI_DISABLE ((jint) 0)
-#define JVMDI_ENABLE ((jint) 1)
-
-/*
- * Initial function for debug threads created through JVMDI
- */
-typedef void (*JVMDI_StartFunction)(void *);
-
-/*
- * Type for debug monitors created through JVMDI
- */
-typedef void *JVMDI_RawMonitor;
-
-#define JVMDI_MONITOR_WAIT_FOREVER ((jlong)(-1))
-
-/*
- * Monitor information
- */
-typedef struct {
- jthread owner;
- jint entry_count;
- jint waiter_count;
- jthread *waiters;
-} JVMDI_monitor_info;
-
-typedef struct {
- jint owned_monitor_count;
- jobject *owned_monitors;
-} JVMDI_owned_monitor_info;
-
- /*
- * Events
- */
-
- /* kind = JVMDI_EVENT_SINGLE_STEP */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- } JVMDI_single_step_event_data;
-
- /* kind = JVMDI_EVENT_BREAKPOINT */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- } JVMDI_breakpoint_event_data;
-
- /* kind = JVMDI_EVENT_FIELD_ACCESS */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- jclass field_clazz;
- jobject object;
- jfieldID field;
- } JVMDI_field_access_event_data;
-
- /* kind = JVMDI_EVENT_FIELD_MODIFICATION */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- jclass field_clazz;
- jobject object;
- jfieldID field;
- char signature_type;
- jvalue new_value;
- } JVMDI_field_modification_event_data;
-
- /* kind = JVMDI_EVENT_FRAME_POP */
- /* kind = JVMDI_EVENT_METHOD_ENTRY */
- /* kind = JVMDI_EVENT_METHOD_EXIT */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jframeID frame;
- } JVMDI_frame_event_data;
-
- /* kind = JVMDI_EVENT_EXCEPTION */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- jobject exception;
- jclass catch_clazz;
- jmethodID catch_method;
- jlocation catch_location;
- } JVMDI_exception_event_data;
-
- /* kind = JVMDI_EVENT_EXCEPTION_CATCH */
- typedef struct {
- jthread thread;
- jclass clazz;
- jmethodID method;
- jlocation location;
- jobject exception;
- } JVMDI_exception_catch_event_data;
-
- /* kind = JVMDI_EVENT_USER_DEFINED */
- typedef struct {
- jobject object;
- jint key;
- } JVMDI_user_event_data;
-
- /* kind = JVMDI_EVENT_THREAD_END or */
- /* JVMDI_EVENT_THREAD_START */
- typedef struct {
- jthread thread;
- } JVMDI_thread_change_event_data;
-
- /* kind = JVMDI_EVENT_CLASS_LOAD, */
- /* JVMDI_EVENT_CLASS_UNLOAD, or */
- /* JVMDI_EVENT_CLASS_PREPARE */
- typedef struct {
- jthread thread;
- jclass clazz;
- } JVMDI_class_event_data;
-
-/* This stucture passes information about the event.
- * location is the index of the last instruction executed.
- */
-typedef struct {
- jint kind; /* the discriminant */
-
- union {
- /* kind = JVMDI_EVENT_SINGLE_STEP */
- JVMDI_single_step_event_data single_step;
-
- /* kind = JVMDI_EVENT_BREAKPOINT */
- JVMDI_breakpoint_event_data breakpoint;
-
- /* kind = JVMDI_EVENT_FRAME_POP */
- /* kind = JVMDI_EVENT_METHOD_ENTRY */
- /* kind = JVMDI_EVENT_METHOD_EXIT */
- JVMDI_frame_event_data frame;
-
- /* kind = JVMDI_EVENT_FIELD_ACCESS */
- JVMDI_field_access_event_data field_access;
-
- /* kind = JVMDI_EVENT_FIELD_MODIFICATION */
- JVMDI_field_modification_event_data field_modification;
-
- /* kind = JVMDI_EVENT_EXCEPTION */
- JVMDI_exception_event_data exception;
-
- /* kind = JVMDI_EVENT_EXCEPTION_CATCH */
- JVMDI_exception_catch_event_data exception_catch;
-
- /* kind = JVMDI_EVENT_USER_DEFINED */
- JVMDI_user_event_data user;
-
- /* kind = JVMDI_EVENT_THREAD_END or */
- /* JVMDI_EVENT_THREAD_START */
- JVMDI_thread_change_event_data thread_change;
-
- /* kind = JVMDI_EVENT_CLASS_LOAD, */
- /* JVMDI_EVENT_CLASS_UNLOAD, or */
- /* JVMDI_EVENT_CLASS_PREPARE */
- JVMDI_class_event_data class_event;
-
- /* kind = JVMDI_EVENT_VM_DEATH, JVMDI_EVENT_VM_INIT */
- /* no additional fields */
- } u;
-} JVMDI_Event;
-
- /*** event kinds ***/
-#define JVMDI_EVENT_SINGLE_STEP ((jint)1)
-#define JVMDI_EVENT_BREAKPOINT ((jint)2)
-#define JVMDI_EVENT_FRAME_POP ((jint)3)
-#define JVMDI_EVENT_EXCEPTION ((jint)4)
-#define JVMDI_EVENT_USER_DEFINED ((jint)5)
-#define JVMDI_EVENT_THREAD_START ((jint)6)
-#define JVMDI_EVENT_THREAD_END ((jint)7)
-#define JVMDI_EVENT_CLASS_PREPARE ((jint)8)
-#define JVMDI_EVENT_CLASS_UNLOAD ((jint)9)
-#define JVMDI_EVENT_CLASS_LOAD ((jint)10)
-#define JVMDI_EVENT_FIELD_ACCESS ((jint)20)
-#define JVMDI_EVENT_FIELD_MODIFICATION ((jint)21)
-#define JVMDI_EVENT_EXCEPTION_CATCH ((jint)30)
-#define JVMDI_EVENT_METHOD_ENTRY ((jint)40)
-#define JVMDI_EVENT_METHOD_EXIT ((jint)41)
-#define JVMDI_EVENT_VM_INIT ((jint)90)
-#define JVMDI_EVENT_VM_DEATH ((jint)99)
-
-#define JVMDI_MAX_EVENT_TYPE_VAL ((jint)99)
-
-
-
-/* event handler hook */
-typedef void (*JVMDI_EventHook)(JNIEnv *env, JVMDI_Event *event);
-
-typedef jvmdiError (*JVMDI_AllocHook) (jlong size, jbyte** memPtr);
-typedef jvmdiError (*JVMDI_DeallocHook) (jbyte* buffer);
-
-/*
- * Class states used in JVMDI_GetClassStatus
- */
-#define JVMDI_CLASS_STATUS_VERIFIED ((jint)0x01)
-#define JVMDI_CLASS_STATUS_PREPARED ((jint)0x02)
-#define JVMDI_CLASS_STATUS_INITIALIZED ((jint)0x04)
- /* Error prevents initialization */
-#define JVMDI_CLASS_STATUS_ERROR ((jint)0x08)
-
-/* structure for returning line number information
- */
-typedef struct {
- jlocation start_location;
- jint line_number;
-} JVMDI_line_number_entry;
-
-
-/* structure for returning local variable information
- */
-typedef struct {
- jlocation start_location; /* variable valid start_location */
- jint length; /* upto start_location+length */
- char *name; /* name in UTF8 */
- char *signature; /* type signature in UTF8 */
- jint slot; /* variable slot, see JVMDI_GetLocal*() */
-} JVMDI_local_variable_entry;
-
-/* structure for returning exception handler information
- */
-typedef struct {
- jlocation start_location;
- jlocation end_location;
- jlocation handler_location;
- jclass exception; /* if null, all exceptions */
-} JVMDI_exception_handler_entry;
-
-#define JVMDI_OPERAND_TYPE_REFERENCE ((jint)1)
-#define JVMDI_OPERAND_TYPE_INT ((jint)2)
-#define JVMDI_OPERAND_TYPE_FLOAT ((jint)3)
-#define JVMDI_OPERAND_TYPE_LONG0 ((jint)4) /* least sig. 32 bits */
-#define JVMDI_OPERAND_TYPE_LONG1 ((jint)5) /* most sig. 32 bits */
-#define JVMDI_OPERAND_TYPE_DOUBLE0 ((jint)6) /* least sig. 32 bits */
-#define JVMDI_OPERAND_TYPE_DOUBLE1 ((jint)7) /* most sig. 32 bits */
-#define JVMDI_OPERAND_TYPE_RETURN_ADDRESS ((jint)8)
-
-typedef struct {
- jint word; /* 32 bit operand stack quantities */
- jint type; /* type encoding of the operand word */
- /* one of JVMDI_OPERAND_TYPE_* */
-} JVMDI_operand_stack_element;
-
-typedef struct {
- jint instance_field_count; /* number of instance fields referencing obj */
- struct JVMDI_instance_field {
- jobject instance; /* instance referencing obj */
- jfieldID field; /* field holding reference */
- } *instance_fields; /* instanceField_count of them */
-
- jint static_field_count; /* number of static fields referencing obj */
- struct JVMDI_static_field {
- jclass clazz; /* class referencing obj */
- jfieldID static_field; /* field holding reference */
- } *static_fields; /* static_field_count of them */
-
- jint array_element_count; /* number of array elements referencing obj */
- struct JVMDI_array_element {
- jobjectArray array; /* array referencing obj */
- jint index; /* index holding reference */
- } *array_elements; /* array_element_count of them */
-
- jint frame_slot_count; /* number of frame slots referencing obj */
- struct JVMDI_frame_slot {
- jthread thread; /* thread of the frame */
- jframeID frame; /* frame referencing obj */
- jint slot; /* slot holding reference */
- } *frame_slots; /* frame_slot_count of them */
-} JVMDI_object_reference_info;
-
-/* structure for defining a class
-*/
-typedef struct {
- jclass clazz; /* Class object for this class */
- jint class_byte_count; /* number of bytes defining class (below) */
- jbyte *class_bytes; /* bytes defining class (in JVM spec */
- /* Class File Format) */
-} JVMDI_class_definition;
-
- /* For backwards compatibility */
-#define can_change_schema can_unrestrictedly_redefine_classes
-
-typedef struct {
- unsigned int can_watch_field_modification : 1;
- unsigned int can_watch_field_access : 1;
- unsigned int can_get_bytecodes : 1;
- unsigned int can_get_synthetic_attribute : 1;
- unsigned int can_get_owned_monitor_info : 1;
- unsigned int can_get_current_contended_monitor : 1;
- unsigned int can_get_monitor_info : 1;
- unsigned int can_get_heap_info : 1;
- unsigned int can_get_operand_stack : 1;
- unsigned int can_set_operand_stack : 1;
- unsigned int can_pop_frame : 1;
- unsigned int can_get_class_definition : 1;
- unsigned int can_redefine_classes : 1;
- unsigned int can_add_method : 1;
- unsigned int can_unrestrictedly_redefine_classes : 1;
- unsigned int reserved5 : 1;
-} JVMDI_capabilities;
-
-typedef struct JVMDI_Interface_1_ {
- jvmdiError (JNICALL *SetEventHook)
- (JVMDI_EventHook hook);
- jvmdiError (JNICALL *SetEventNotificationMode)
- (jint mode, jint eventType, jthread thread, ...);
-
- jvmdiError (JNICALL *GetThreadStatus)
- (jthread thread,
- jint *threadStatusPtr, jint *suspendStatusPtr);
- jvmdiError (JNICALL *GetAllThreads)
- (jint *threadsCountPtr, jthread **threadsPtr);
- jvmdiError (JNICALL *SuspendThread)
- (jthread thread);
- jvmdiError (JNICALL *ResumeThread)
- (jthread thread);
- jvmdiError (JNICALL *StopThread)
- (jthread thread, jobject exception);
- jvmdiError (JNICALL *InterruptThread)
- (jthread thread);
- jvmdiError (JNICALL *GetThreadInfo)
- (jthread thread, JVMDI_thread_info *infoPtr);
- jvmdiError (JNICALL *GetOwnedMonitorInfo)
- (jthread thread, JVMDI_owned_monitor_info *infoPtr);
- jvmdiError (JNICALL *GetCurrentContendedMonitor)
- (jthread thread, jobject *monitor);
- jvmdiError (JNICALL *RunDebugThread)
- (jthread thread, JVMDI_StartFunction proc, void *arg,
- int priority);
-
- jvmdiError (JNICALL *GetTopThreadGroups)
- (jint *groupCountPtr, jthreadGroup **groupsPtr);
- jvmdiError (JNICALL *GetThreadGroupInfo)
- (jthreadGroup group, JVMDI_thread_group_info *infoPtr);
- jvmdiError (JNICALL *GetThreadGroupChildren)
- (jthreadGroup group,
- jint *threadCountPtr, jthread **threadsPtr,
- jint *groupCountPtr, jthreadGroup **groupsPtr);
-
- jvmdiError (JNICALL *GetFrameCount)
- (jthread thread, jint *countPtr);
- jvmdiError (JNICALL *GetCurrentFrame)
- (jthread thread, jframeID *framePtr);
- jvmdiError (JNICALL *GetCallerFrame)
- (jframeID called, jframeID *framePtr);
- jvmdiError (JNICALL *GetFrameLocation)
- (jframeID frame, jclass *classPtr, jmethodID *methodPtr,
- jlocation *locationPtr);
- jvmdiError (JNICALL *NotifyFramePop)
- (jframeID frame);
- jvmdiError (JNICALL *GetLocalObject)
- (jframeID frame, jint slot, jobject *valuePtr);
- jvmdiError (JNICALL *GetLocalInt)
- (jframeID frame, jint slot, jint *valuePtr);
- jvmdiError (JNICALL *GetLocalLong)
- (jframeID frame, jint slot, jlong *valuePtr);
- jvmdiError (JNICALL *GetLocalFloat)
- (jframeID frame, jint slot, jfloat *valuePtr);
- jvmdiError (JNICALL *GetLocalDouble)
- (jframeID frame, jint slot, jdouble *valuePtr);
- jvmdiError (JNICALL *SetLocalObject)
- (jframeID frame, jint slot, jobject value);
- jvmdiError (JNICALL *SetLocalInt)
- (jframeID frame, jint slot, jint value);
- jvmdiError (JNICALL *SetLocalLong)
- (jframeID frame, jint slot, jlong value);
- jvmdiError (JNICALL *SetLocalFloat)
- (jframeID frame, jint slot, jfloat value);
- jvmdiError (JNICALL *SetLocalDouble)
- (jframeID frame, jint slot, jdouble value);
-
- jvmdiError (JNICALL *CreateRawMonitor)
- (char *name, JVMDI_RawMonitor *monitorPtr);
- jvmdiError (JNICALL *DestroyRawMonitor)
- (JVMDI_RawMonitor monitor);
- jvmdiError (JNICALL *RawMonitorEnter)
- (JVMDI_RawMonitor monitor);
- jvmdiError (JNICALL *RawMonitorExit)
- (JVMDI_RawMonitor monitor);
- jvmdiError (JNICALL *RawMonitorWait)
- (JVMDI_RawMonitor monitor, jlong millis);
- jvmdiError (JNICALL *RawMonitorNotify)
- (JVMDI_RawMonitor monitor);
- jvmdiError (JNICALL *RawMonitorNotifyAll)
- (JVMDI_RawMonitor monitor);
-
- jvmdiError (JNICALL *SetBreakpoint)
- (jclass clazz, jmethodID method, jlocation location);
- jvmdiError (JNICALL *ClearBreakpoint)
- (jclass clazz, jmethodID method, jlocation location);
- jvmdiError (JNICALL *ClearAllBreakpoints)
- ();
-
- jvmdiError (JNICALL *SetFieldAccessWatch)
- (jclass clazz, jfieldID field);
- jvmdiError (JNICALL *ClearFieldAccessWatch)
- (jclass clazz, jfieldID field);
- jvmdiError (JNICALL *SetFieldModificationWatch)
- (jclass clazz, jfieldID field);
- jvmdiError (JNICALL *ClearFieldModificationWatch)
- (jclass clazz, jfieldID field);
-
- jvmdiError (JNICALL *SetAllocationHooks)
- (JVMDI_AllocHook ahook, JVMDI_DeallocHook dhook);
- jvmdiError (JNICALL *Allocate)
- (jlong size, jbyte** memPtr);
- jvmdiError (JNICALL *Deallocate)
- (jbyte* mem);
-
- jvmdiError (JNICALL *GetClassSignature)
- (jclass clazz, char **sigPtr);
- jvmdiError (JNICALL *GetClassStatus)
- (jclass clazz, jint *statusPtr);
- jvmdiError (JNICALL *GetSourceFileName)
- (jclass clazz, char **sourceNamePtr);
- jvmdiError (JNICALL *GetClassModifiers)
- (jclass clazz, jint *modifiersPtr);
- jvmdiError (JNICALL *GetClassMethods)
- (jclass clazz, jint *methodCountPtr, jmethodID **methodsPtr);
- jvmdiError (JNICALL *GetClassFields)
- (jclass clazz, jint *fieldCountPtr, jfieldID **fieldsPtr);
- jvmdiError (JNICALL *GetImplementedInterfaces)
- (jclass clazz, jint *interfaceCountPtr, jclass **interfacesPtr);
- jvmdiError (JNICALL *IsInterface)
- (jclass clazz, jboolean *isInterfacePtr);
- jvmdiError (JNICALL *IsArrayClass)
- (jclass clazz, jboolean *isArrayClassPtr);
- jvmdiError (JNICALL *GetClassLoader)
- (jclass clazz, jobject *classloaderPtr);
-
- jvmdiError (JNICALL *GetObjectHashCode)
- (jobject object, jint *hashCodePtr);
- jvmdiError (JNICALL *GetMonitorInfo)
- (jobject object, JVMDI_monitor_info *infoPtr);
-
- jvmdiError (JNICALL *GetFieldName)
- (jclass clazz, jfieldID field, char **namePtr, char **signaturePtr);
- jvmdiError (JNICALL *GetFieldDeclaringClass)
- (jclass clazz, jfieldID field, jclass *declaringClassPtr);
- jvmdiError (JNICALL *GetFieldModifiers)
- (jclass clazz, jfieldID field, jint *modifiersPtr);
- jvmdiError (JNICALL *IsFieldSynthetic)
- (jclass clazz, jfieldID field, jboolean *isSyntheticPtr);
-
- jvmdiError (JNICALL *GetMethodName)
- (jclass clazz, jmethodID method,
- char **namePtr, char **signaturePtr);
- jvmdiError (JNICALL *GetMethodDeclaringClass)
- (jclass clazz, jmethodID method, jclass *declaringClassPtr);
- jvmdiError (JNICALL *GetMethodModifiers)
- (jclass clazz, jmethodID method, jint *modifiersPtr);
- jvmdiError (JNICALL *GetMaxStack)
- (jclass clazz, jmethodID method, jint *maxPtr);
- jvmdiError (JNICALL *GetMaxLocals)
- (jclass clazz, jmethodID method, jint *maxPtr);
- jvmdiError (JNICALL *GetArgumentsSize)
- (jclass clazz, jmethodID method, jint *sizePtr);
- jvmdiError (JNICALL *GetLineNumberTable)
- (jclass clazz, jmethodID method,
- jint *entryCountPtr, JVMDI_line_number_entry **tablePtr);
- jvmdiError (JNICALL *GetMethodLocation)
- (jclass clazz, jmethodID method,
- jlocation *startLocationPtr, jlocation *endLocationPtr);
- jvmdiError (JNICALL *GetLocalVariableTable)
- (jclass clazz, jmethodID method,
- jint *entryCountPtr, JVMDI_local_variable_entry **tablePtr);
- jvmdiError (JNICALL *GetExceptionHandlerTable)
- (jclass clazz, jmethodID method,
- jint *entryCountPtr, JVMDI_exception_handler_entry **tablePtr);
- jvmdiError (JNICALL *GetThrownExceptions)
- (jclass clazz, jmethodID method,
- jint *exceptionCountPtr, jclass **exceptionsPtr);
- jvmdiError (JNICALL *GetBytecodes)
- (jclass clazz, jmethodID method,
- jint *bytecodeCountPtr, jbyte **bytecodesPtr);
- jvmdiError (JNICALL *IsMethodNative)
- (jclass clazz, jmethodID method, jboolean *isNativePtr);
- jvmdiError (JNICALL *IsMethodSynthetic)
- (jclass clazz, jmethodID method, jboolean *isSyntheticPtr);
-
- jvmdiError (JNICALL *GetLoadedClasses)
- (jint *classCountPtr, jclass **classesPtr);
- jvmdiError (JNICALL *GetClassLoaderClasses)
- (jobject initiatingLoader, jint *classesCountPtr,
- jclass **classesPtr);
-
- jvmdiError (JNICALL *PopFrame)
- (jthread thread);
- jvmdiError (JNICALL *SetFrameLocation)
- (jframeID frame, jlocation location);
- jvmdiError (JNICALL *GetOperandStack)
- (jframeID frame, jint *operandStackSizePtr,
- JVMDI_operand_stack_element **operandStackPtr);
- jvmdiError (JNICALL *SetOperandStack)
- (jframeID frame, jint operandStackSize,
- JVMDI_operand_stack_element *operandStack);
- jvmdiError (JNICALL *AllInstances)
- (jclass clazz, jint *instanceCountPtr, jobject **instancesPtr);
- jvmdiError (JNICALL *References)
- (jobject obj, JVMDI_object_reference_info *refs);
- jvmdiError (JNICALL *GetClassDefinition)
- (jclass clazz, JVMDI_class_definition *classDefPtr);
- jvmdiError (JNICALL *RedefineClasses)
- (jint classCount, JVMDI_class_definition *classDefs);
-
- jvmdiError (JNICALL *GetVersionNumber)
- (jint *versionPtr);
- jvmdiError (JNICALL *GetCapabilities)
- (JVMDI_capabilities *capabilitiesPtr);
-
- jvmdiError (JNICALL *GetSourceDebugExtension)
- (jclass clazz, char **sourceDebugExtension);
- jvmdiError (JNICALL *IsMethodObsolete)
- (jclass clazz, jmethodID method, jboolean *isObsoletePtr);
-} JVMDI_Interface_1;
-
-#ifndef NO_JVMDI_MACROS
-
-#define JVMDI_ERROR_DUPLICATE_BREAKPOINT JVMDI_ERROR_DUPLICATE
-#define JVMDI_ERROR_NO_SUCH_BREAKPOINT JVMDI_ERROR_NOT_FOUND
-#define JVMDI_ERROR_DUPLICATE_FRAME_POP JVMDI_ERROR_DUPLICATE
-
-
-static JVMDI_Interface_1 *jvmdi_interface = NULL;
-static JavaVM *j_vm;
-
-#ifdef __cplusplus
-#define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
- ((a_env)->GetJavaVM(&j_vm), \
- (j_vm)->GetEnv((void **)&jvmdi_interface, \
- JVMDI_VERSION_1)):0)
-#else
-#define SetJVMDIfromJNIEnv(a_env) ( (jvmdi_interface == NULL)? \
- ((*a_env)->GetJavaVM(a_env, &j_vm), \
- (*j_vm)->GetEnv(j_vm, (void **)&jvmdi_interface, \
- JVMDI_VERSION_1)):0)
-#endif
-
-#define JVMDI_SetEventHook(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetEventHook(a1) )
-#define JVMDI_GetThreadStatus(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetThreadStatus(a1, a2, a3) )
-#define JVMDI_GetAllThreads(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetAllThreads(a1, a2) )
-#define JVMDI_SuspendThread(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SuspendThread(a1) )
-#define JVMDI_ResumeThread(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->ResumeThread(a1) )
-#define JVMDI_StopThread(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->StopThread(a1, a2) )
-#define JVMDI_InterruptThread(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->InterruptThread(a1) )
-#define JVMDI_SetSingleStep(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetEventNotificationMode( \
- (a2) ? JVMDI_ENABLE : JVMDI_DISABLE, \
- JVMDI_EVENT_SINGLE_STEP, a1) )
-#define JVMDI_GetThreadInfo(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetThreadInfo(a1, a2) )
-#define JVMDI_RunDebugThread(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RunDebugThread(a1, a2, a3, a4) )
-#define JVMDI_GetTopThreadGroups(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetTopThreadGroups(a1, a2) )
-#define JVMDI_GetThreadGroupInfo(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetThreadGroupInfo(a1, a2) )
-#define JVMDI_GetThreadGroupChildren(a_env, a1, a2, a3, a4, a5) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetThreadGroupChildren(a1, a2, a3, a4, a5) )
-#define JVMDI_GetCurrentFrame(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetCurrentFrame(a1, a2) )
-#define JVMDI_GetCallerFrame(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetCallerFrame(a1, a2) )
-#define JVMDI_GetFrameLocation(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetFrameLocation(a1, a2, a3, a4) )
-#define JVMDI_NotifyFramePop(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->NotifyFramePop(a1) )
-#define JVMDI_GetLocalObject(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalObject(a1, a2, a3) )
-#define JVMDI_GetLocalInt(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalInt(a1, a2, a3) )
-#define JVMDI_GetLocalLong(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalLong(a1, a2, a3) )
-#define JVMDI_GetLocalFloat(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalFloat(a1, a2, a3) )
-#define JVMDI_GetLocalDouble(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalDouble(a1, a2, a3) )
-#define JVMDI_SetLocalObject(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetLocalObject(a1, a2, a3) )
-#define JVMDI_SetLocalInt(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetLocalInt(a1, a2, a3) )
-#define JVMDI_SetLocalLong(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetLocalLong(a1, a2, a3) )
-#define JVMDI_SetLocalFloat(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetLocalFloat(a1, a2, a3) )
-#define JVMDI_SetLocalDouble(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetLocalDouble(a1, a2, a3) )
-#define JVMDI_CreateRawMonitor(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->CreateRawMonitor(a1, a2) )
-#define JVMDI_DestroyRawMonitor(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->DestroyRawMonitor(a1) )
-#define JVMDI_RawMonitorEnter(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RawMonitorEnter(a1) )
-#define JVMDI_RawMonitorExit(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RawMonitorExit(a1) )
-#define JVMDI_RawMonitorWait(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RawMonitorWait(a1, a2) )
-#define JVMDI_RawMonitorNotify(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RawMonitorNotify(a1) )
-#define JVMDI_RawMonitorNotifyAll(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->RawMonitorNotifyAll(a1) )
-#define JVMDI_SetBreakpoint(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetBreakpoint(a1, a2, a3) )
-#define JVMDI_ClearBreakpoint(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->ClearBreakpoint(a1, a2, a3) )
-#define JVMDI_ClearAllBreakpoints(a_env) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->ClearAllBreakpoints() )
-#define JVMDI_SetAllocationHooks(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->SetAllocationHooks(a1, a2) )
-#define JVMDI_Allocate(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->Allocate(a1, a2) )
-#define JVMDI_Deallocate(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->Deallocate(a1) )
-#define JVMDI_GetClassSignature(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassSignature(a1, a2) )
-#define JVMDI_GetClassStatus(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassStatus(a1, a2) )
-#define JVMDI_GetSourceFileName(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetSourceFileName(a1, a2) )
-#define JVMDI_GetClassModifiers(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassModifiers(a1, a2) )
-#define JVMDI_GetClassMethods(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassMethods(a1, a2, a3) )
-#define JVMDI_GetClassFields(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassFields(a1, a2, a3) )
-#define JVMDI_GetImplementedInterfaces(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetImplementedInterfaces(a1, a2, a3) )
-#define JVMDI_IsInterface(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->IsInterface(a1, a2) )
-#define JVMDI_IsArrayClass(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->IsArrayClass(a1, a2) )
-#define JVMDI_ClassLoader(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassLoader(a1, a2) )
-#define JVMDI_GetFieldName(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetFieldName(a1, a2, a3, a4) )
-#define JVMDI_GetFieldDeclaringClass(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetFieldDeclaringClass(a1, a2, a3) )
-#define JVMDI_GetFieldModifiers(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetFieldModifiers(a1, a2, a3) )
-#define JVMDI_GetMethodName(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMethodName(a1, a2, a3, a4) )
-#define JVMDI_GetMethodDeclaringClass(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMethodDeclaringClass(a1, a2, a3) )
-#define JVMDI_GetMethodModifiers(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMethodModifiers(a1, a2, a3) )
-#define JVMDI_GetMaxStack(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMaxStack(a1, a2, a3) )
-#define JVMDI_GetMaxLocals(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMaxLocals(a1, a2, a3) )
-#define JVMDI_GetArgumentsSize(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetArgumentsSize(a1, a2, a3) )
-#define JVMDI_GetLineNumberTable(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLineNumberTable(a1, a2, a3, a4) )
-#define JVMDI_GetMethodLocation(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetMethodLocation(a1, a2, a3, a4) )
-#define JVMDI_GetLocalVariableTable(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLocalVariableTable(a1, a2, a3, a4) )
-#define JVMDI_GetExceptionHandlerTable(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetExceptionHandlerTable(a1, a2, a3, a4) )
-#define JVMDI_GetThrownExceptions(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetThrownExceptions(a1, a2, a3, a4) )
-#define JVMDI_GetBytecodes(a_env, a1, a2, a3, a4) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetBytecodes(a1, a2, a3, a4) )
-#define JVMDI_IsMethodNative(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->IsMethodNative(a1, a2, a3) )
-#define JVMDI_GetLoadedClasses(a_env, a1, a2) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetLoadedClasses(a1, a2) )
-#define JVMDI_GetClassLoaderClasses(a_env, a1, a2, a3) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetClassLoaderClasses(a1, a2, a3) )
-#define JVMDI_GetVersionNumber(a_env, a1) ( \
- SetJVMDIfromJNIEnv(a_env), \
- jvmdi_interface->GetVersionNumber(a1) )
-
-#endif /* !NO_JVMDI_MACROS */
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif /* __cplusplus */
-
-#endif /* !_JAVASOFT_JVMDI_H_ */
-
-
View
637 ready/src/jni/jvmpi.h
@@ -1,637 +0,0 @@
-/*
- * @(#)jvmpi.h 1.24 01/12/03
- *
- * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
- * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
- */
-
-#ifndef _JAVASOFT_JVMPI_H_
-#define _JAVASOFT_JVMPI_H_
-
-#include "jni.h"
-
-#define JVMPI_VERSION_1 ((jint)0x10000001) /* implied 0 for minor version */
-#define JVMPI_VERSION_1_1 ((jint)0x10000002)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- typedef void (*jvmpi_void_function_of_void)(void *);
-#ifdef __cplusplus
-}
-#endif
-
-/****************************************************************
- * Profiler interface data structures.
- ****************************************************************/
-/* identifier types. */
-struct _jobjectID;
-typedef struct _jobjectID * jobjectID; /* type of object ids */
-
-/* raw monitors */
-struct _JVMPI_RawMonitor;
-typedef struct _JVMPI_RawMonitor * JVMPI_RawMonitor;
-
-/* call frame */
-typedef struct {
- jint lineno; /* line number in the source file */
- jmethodID method_id; /* method executed in this frame */
-} JVMPI_CallFrame;
-
-/* call trace */
-typedef struct {
- JNIEnv *env_id; /* Env where trace was recorded */
- jint num_frames; /* number of frames in this trace */
- JVMPI_CallFrame *frames; /* frames */
-} JVMPI_CallTrace;
-
-/* method */
-typedef struct {
- char *method_name; /* name of method */
- char *method_signature; /* signature of method */
- jint start_lineno; /* -1 if native, abstract .. */
- jint end_lineno; /* -1 if native, abstract .. */
- jmethodID method_id; /* id assigned to this method */
-} JVMPI_Method;
-
-/* Field */
-typedef struct {
- char *field_name; /* name of field */
- char *field_signature; /* signature of field */
-} JVMPI_Field;
-
-/* line number info for a compiled method */
-typedef struct {
- jint offset; /* offset from beginning of method */
- jint lineno; /* lineno from beginning of src file */
-} JVMPI_Lineno;
-
-/* event */
-typedef struct {
- jint event_type; /* event_type */
- JNIEnv *env_id; /* env where this event occured */
-
- union {
- struct {
- const char *class_name; /* class name */
- char *source_name; /* name of source file */
- jint num_interfaces; /* number of interfaces implemented */
- jint num_methods; /* number of methods in the class */
- JVMPI_Method *methods; /* methods */
- jint num_static_fields; /* number of static fields */
- JVMPI_Field *statics; /* static fields */
- jint num_instance_fields; /* number of instance fields */
- JVMPI_Field *instances; /* instance fields */
- jobjectID class_id; /* id of the class object */
- } class_load;
-
- struct {
- jobjectID class_id; /* id of the class object */
- } class_unload;
-
- struct {
- unsigned char *class_data; /* content of class file */
- jint class_data_len; /* class file length */
- unsigned char *new_class_data; /* instrumented class file */
- jint new_class_data_len; /* new class file length */
- void * (*malloc_f)(unsigned int); /* memory allocation function */
- } class_load_hook;
-
- struct {
- jint arena_id;
- jobjectID class_id; /* id of object class */
- jint is_array; /* JVMPI_NORMAL_OBJECT, ... */
- jint size; /* size in number of bytes */
- jobjectID obj_id; /* id assigned to this object */
- } obj_alloc;
-
- struct {
- jobjectID obj_id; /* id of the object */
- } obj_free;
-
- struct {
- jint arena_id; /* cur arena id */
- jobjectID obj_id; /* cur object id */
- jint new_arena_id; /* new arena id */
- jobjectID new_obj_id; /* new object id */
- } obj_move;
-
- struct {
- jint arena_id; /* id of arena */
- const char *arena_name; /* name of arena */
- } new_arena;
-
- struct {
- jint arena_id; /* id of arena */
- } delete_arena;
-
- struct {
- char *thread_name; /* name of thread */
- char *group_name; /* name of group */
- char *parent_name; /* name of parent */
- jobjectID thread_id; /* id of the thread object */
- JNIEnv *thread_env_id;
- } thread_start;
-
- struct {
- int dump_level; /* level of the heap dump info */
- char *begin; /* where all the root records begin,
- please see the heap dump buffer
- format described below */
- char *end; /* where the object records end. */
- jint num_traces; /* number of thread traces,
- 0 if dump level = JVMPI_DUMP_LEVEL_0 */
- JVMPI_CallTrace *traces; /* thread traces collected during
- heap dump */
- } heap_dump;
-
- struct {
- jobjectID obj_id; /* object id */
- jobject ref_id; /* id assigned to the globalref */
- } jni_globalref_alloc;
-
- struct {
- jobject ref_id; /* id of the global ref */
- } jni_globalref_free;
-
- struct {
- jmethodID method_id; /* method */
- } method;
-
- struct {
- jmethodID method_id; /* id of method */
- jobjectID obj_id; /* id of target object */
- } method_entry2;
-
- struct {
- jmethodID method_id; /* id of compiled method */
- void *code_addr; /* code start addr. in memory */
- jint code_size; /* code size */
- jint lineno_table_size; /* size of lineno table */
- JVMPI_Lineno *lineno_table; /* lineno info */
- } compiled_method_load;
-
- struct {
- jmethodID method_id; /* id of unloaded compiled method */
- } compiled_method_unload;
-
- struct {
- jmethodID method_id; /* id of the method the instruction belongs to */
- jint offset; /* instruction offset in the method's bytecode */
- union {
- struct {
- jboolean is_true; /* whether true or false branch is taken */
- } if_info;
- struct {
- jint key; /* top stack value used as an index */
- jint low; /* min value of the index */
- jint hi; /* max value of the index */
- } tableswitch_info;
- struct {
- jint chosen_pair_index; /* actually chosen pair index (0-based)
- * if chosen_pair_index == pairs_total then
- * the 'default' branch is taken
- */
- jint pairs_total; /* total number of lookupswitch pairs */
- } lookupswitch_info;
- } u;
- } instruction;
-
- struct {
- char *begin; /* beginning of dump buffer,
- see below for format */
- char *end; /* end of dump buffer */
- jint num_traces; /* number of traces */
- JVMPI_CallTrace *traces; /* traces of all threads */
- jint *threads_status; /* status of all threads */
- } monitor_dump;
-
- struct {
- const char *name; /* name of raw monitor */
- JVMPI_RawMonitor id; /* id */
- } raw_monitor;
-
- struct {
- jobjectID object; /* Java object */
- } monitor;
-
- struct {
- jobjectID object; /* Java object */
- jlong timeout; /* timeout period */
- } monitor_wait;
-
- struct {
- jlong used_objects;
- jlong used_object_space;
- jlong total_object_space;
- } gc_info;
-
- struct {
- jint data_len;
- char *data;
- } object_dump;
- } u;
-} JVMPI_Event;
-
-/* interface functions */
-typedef struct {
- jint version; /* JVMPI version */
-
- /* ------interface implemented by the profiler------ */
-
- /**
- * Function called by the JVM to notify an event.
- */
- void (*NotifyEvent)(JVMPI_Event *event);
-
- /* ------interface implemented by the JVM------ */
-
- /**
- * Function called by the profiler to enable/disable/send notification
- * for a particular event type.
- *
- * event_type - event_type
- * arg - event specific arg
- *
- * return JVMPI_NOT_AVAILABLE, JVMPI_SUCCESS or JVMPI_FAIL
- */
- jint (*EnableEvent)(jint event_type, void *arg);
- jint (*DisableEvent)(jint event_type, void *arg);
- jint (*RequestEvent)(jint event_type, void *arg);
-
- /**
- * Function called by the profiler to get a stack
- * trace from the JVM.
- *
- * trace - trace data structure to be filled
- * depth - maximum depth of the trace.
- */
- void (*GetCallTrace)(JVMPI_CallTrace *trace, jint depth);
-
- /**
- * Function called by profiler when it wants to exit/stop.
- */
- void (*ProfilerExit)(jint);
-
- /**
- * Utility functions provided by the JVM.
- */
- JVMPI_RawMonitor (*RawMonitorCreate)(char *lock_name);
- void (*RawMonitorEnter)(JVMPI_RawMonitor lock_id);
- void (*RawMonitorExit)(JVMPI_RawMonitor lock_id);
- void (*RawMonitorWait)(JVMPI_RawMonitor lock_id, jlong ms);
- void (*RawMonitorNotifyAll)(JVMPI_RawMonitor lock_id);
- void (*RawMonitorDestroy)(JVMPI_RawMonitor lock_id);
-
- /**
- * Function called by the profiler to get the current thread's CPU time.
- *
- * return time in nanoseconds;
- */
- jlong (*GetCurrentThreadCpuTime)(void);
-
- void (*SuspendThread)(JNIEnv *env);
- void (*ResumeThread)(JNIEnv *env);
- jint (*GetThreadStatus)(JNIEnv *env);
- jboolean (*ThreadHasRun)(JNIEnv *env);
-
- /* This function can be called safely only after JVMPI_EVENT_VM_INIT_DONE
- notification by the JVM. */
- jint (*CreateSystemThread)(char *name, jint priority, void (*f)(void *));
-
- /* thread local storage access functions to avoid locking in time
- critical functions */
- void (*SetThreadLocalStorage)(JNIEnv *env_id, void *ptr);
- void * (*GetThreadLocalStorage)(JNIEnv *env_id);
-
- /* control GC */
- void (*DisableGC)(void);
- void (*EnableGC)(void);
- void (*RunGC)(void);
-
- jobjectID (*GetThreadObject)(JNIEnv *env);
- jobjectID (*GetMethodClass)(jmethodID mid);
-
- /* JNI <-> jobject conversions */
- jobject (*jobjectID2jobject)(jobjectID jid);
- jobjectID (*jobject2jobjectID)(jobject jobj);
-
-} JVMPI_Interface;
-
-/* type of argument passed to RequestEvent for heap dumps */
-typedef struct {
- jint heap_dump_level;
-} JVMPI_HeapDumpArg;
-
-/**********************************************************************
- * Constants and formats used in JVM Profiler Interface.
- **********************************************************************/
-/*
- * Event type constants.
- */
-#define JVMPI_EVENT_METHOD_ENTRY ((jint)1)
-#define JVMPI_EVENT_METHOD_ENTRY2 ((jint)2)
-#define JVMPI_EVENT_METHOD_EXIT ((jint)3)
-
-#define JVMPI_EVENT_OBJECT_ALLOC ((jint)4)
-#define JVMPI_EVENT_OBJECT_FREE ((jint)5)
-#define JVMPI_EVENT_OBJECT_MOVE ((jint)6)
-
-#define JVMPI_EVENT_COMPILED_METHOD_LOAD ((jint)7)
-#define JVMPI_EVENT_COMPILED_METHOD_UNLOAD ((jint)8)
-
-#define JVMPI_EVENT_INSTRUCTION_START ((jint)9)
-
-#define JVMPI_EVENT_THREAD_START ((jint)33)
-#define JVMPI_EVENT_THREAD_END ((jint)34)
-
-#define JVMPI_EVENT_CLASS_LOAD_HOOK ((jint)35)
-
-#define JVMPI_EVENT_HEAP_DUMP ((jint)37)
-#define JVMPI_EVENT_JNI_GLOBALREF_ALLOC ((jint)38)
-#define JVMPI_EVENT_JNI_GLOBALREF_FREE ((jint)39)
-#define JVMPI_EVENT_JNI_WEAK_GLOBALREF_ALLOC ((jint)40)
-#define JVMPI_EVENT_JNI_WEAK_GLOBALREF_FREE ((jint)41)
-#define JVMPI_EVENT_CLASS_LOAD ((jint)42)
-#define JVMPI_EVENT_CLASS_UNLOAD ((jint)43)
-#define JVMPI_EVENT_DATA_DUMP_REQUEST ((jint)44)
-#define JVMPI_EVENT_DATA_RESET_REQUEST ((jint)45)
-
-#define JVMPI_EVENT_JVM_INIT_DONE ((jint)46)
-#define JVMPI_EVENT_JVM_SHUT_DOWN ((jint)47)
-
-#define JVMPI_EVENT_ARENA_NEW ((jint)48)
-#define JVMPI_EVENT_ARENA_DELETE ((jint)49)
-
-#define JVMPI_EVENT_OBJECT_DUMP ((jint)50)
-
-#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER ((jint)51)
-#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED ((jint)52)
-#define JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT ((jint)53)
-#define JVMPI_EVENT_MONITOR_CONTENDED_ENTER ((jint)54)
-#define JVMPI_EVENT_MONITOR_CONTENDED_ENTERED ((jint)55)
-#define JVMPI_EVENT_MONITOR_CONTENDED_EXIT ((jint)56)
-#define JVMPI_EVENT_MONITOR_WAIT ((jint)57)
-#define JVMPI_EVENT_MONITOR_WAITED ((jint)58)
-#define JVMPI_EVENT_MONITOR_DUMP ((jint)59)
-
-#define JVMPI_EVENT_GC_START ((jint)60)
-#define JVMPI_EVENT_GC_FINISH ((jint)61)
-
-#define JVMPI_MAX_EVENT_TYPE_VAL ((jint)61)
-
-/* old definitions, to be removed */
-#define JVMPI_EVENT_LOAD_COMPILED_METHOD ((jint)7)
-#define JVMPI_EVENT_UNLOAD_COMPILED_METHOD ((jint)8)
-#define JVMPI_EVENT_NEW_ARENA ((jint)48)
-#define JVMPI_EVENT_DELETE_ARENA ((jint)49)
-#define JVMPI_EVENT_DUMP_DATA_REQUEST ((jint)44)
-#define JVMPI_EVENT_RESET_DATA_REQUEST ((jint)45)
-#define JVMPI_EVENT_OBJ_ALLOC ((jint)4)
-#define JVMPI_EVENT_OBJ_FREE ((jint)5)
-#define JVMPI_EVENT_OBJ_MOVE ((jint)6)
-
-#define JVMPI_REQUESTED_EVENT ((jint)0x10000000)
-
-
-
-/*
- * enabling/disabling event notification.
- */
-/* results */
-#define JVMPI_SUCCESS ((jint)0)
-#define JVMPI_NOT_AVAILABLE ((jint)1)
-#define JVMPI_FAIL ((jint)-1)
-
-/*
- * Thread status
- */
-enum {
- JVMPI_THREAD_RUNNABLE = 1,
- JVMPI_THREAD_MONITOR_WAIT,
- JVMPI_THREAD_CONDVAR_WAIT
-};
-
-#define JVMPI_THREAD_SUSPENDED 0x8000
-#define JVMPI_THREAD_INTERRUPTED 0x4000
-
-/*
- * Thread priority
- */
-#define JVMPI_MINIMUM_PRIORITY 1
-#define JVMPI_MAXIMUM_PRIORITY 10
-#define JVMPI_NORMAL_PRIORITY 5
-
-/*
- * Object type constants.
- */
-#define JVMPI_NORMAL_OBJECT ((jint)0)
-#define JVMPI_CLASS ((jint)2)
-#define JVMPI_BOOLEAN ((jint)4)
-#define JVMPI_CHAR ((jint)5)
-#define JVMPI_FLOAT ((jint)6)
-#define JVMPI_DOUBLE ((jint)7)
-#define JVMPI_BYTE ((jint)8)
-#define JVMPI_SHORT ((jint)9)
-#define JVMPI_INT ((jint)10)
-#define JVMPI_LONG ((jint)11)
-
-/*
- * Monitor dump constants.
- */
-
-#define JVMPI_MONITOR_JAVA 0x01
-#define JVMPI_MONITOR_RAW 0x02
-
-/*
- * Heap dump constants.
- */
-#define JVMPI_GC_ROOT_UNKNOWN 0xff
-#define JVMPI_GC_ROOT_JNI_GLOBAL 0x01
-#define JVMPI_GC_ROOT_JNI_LOCAL 0x02
-#define JVMPI_GC_ROOT_JAVA_FRAME 0x03
-#define JVMPI_GC_ROOT_NATIVE_STACK 0x04
-#define JVMPI_GC_ROOT_STICKY_CLASS 0x05
-#define JVMPI_GC_ROOT_THREAD_BLOCK 0x06
-#define JVMPI_GC_ROOT_MONITOR_USED 0x07
-#define JVMPI_GC_ROOT_THREAD_OBJ 0x08
-
-#define JVMPI_GC_CLASS_DUMP 0x20
-#define JVMPI_GC_INSTANCE_DUMP 0x21
-#define JVMPI_GC_OBJ_ARRAY_DUMP 0x22
-#define JVMPI_GC_PRIM_ARRAY_DUMP 0x23
-
-/*
- * Dump levels
- */
-#define JVMPI_DUMP_LEVEL_0 ((jint)0)
-#define JVMPI_DUMP_LEVEL_1 ((jint)1)
-#define JVMPI_DUMP_LEVEL_2 ((jint)2)
-
-/* Types used in dumps -
- *
- * u1: 1 byte
- * u2: 2 bytes
- * u4: 4 bytes
- * u8: 8 bytes
- *
- * ty: u1 where:
- * JVMPI_CLASS: object
- * JVMPI_BOOLEAN: boolean
- * JVMPI_CHAR: char
- * JVMPI_FLOAT: float
- * JVMPI_DOUBLE: double
- * JVMPI_BYTE: byte
- * JVMPI_SHORT: short
- * JVMPI_INT: int
- * JVMPI_LONG: long
- *
- * vl: values, exact type depends on the type of the value:
- * JVMPI_BOOLEAN & JVMPI_BYTE: u1
- * JVMPI_SHORT & JVMPI_CHAR: u2
- * JVMPI_INT & JVMPI_FLOAT: u4
- * JVMPI_LONG & JVMPI_DOUBLE: u8
- * JVMPI_CLASS: jobjectID
- */
-
-/* Format of the monitor dump buffer:
- *
- * u1 monitor type
- *
- * JVMPI_MONITOR_JAVA Java monitor
- *
- * jobjectID object
- * JNIEnv * owner thread
- * u4 entry count
- * u4 # of threads waiting to enter
- * [JNIEnv *]* threads waiting to enter
- * u4 # of threads waiting to be notified
- * [JNIEnv *]* threads waiting to be notified
- *
- * JVMPI_MONITOR_RAW raw monitor
- *
- * char * name
- * JVMPI_RawMonitor raw monitor
- * JNIEnv * owner thread
- * u4 entry count
- * u4 # of threads waiting to enter
- * [JNIEnv *]* threads waiting to enter
- * u4 # of threads waiting to be notified
- * [JNIEnv *]* threads waiting to be notified
- */
-
-/* Format of the heap dump buffer depends on the dump level
- * specified in the JVMPI_HeapDumpArg passed to RequestEvent as arg.
- * The default is JVMPI_DUMP_LEVEL_2.