Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

exit.h File Reference


Detailed Description

Exit codes for JVM diagnostics.

Notice that if a Java program calls System.exit() , then the system call exit(2) will still be made, but with that requested exit code, having nothing to do with these codes. However, Most exit situations are set up with fprintf(stderr) immediately before the exit(2) call itself, so console output should demonstrate proper context if there is ever a question.

Control

$URL: https://svn.apache.org/path/name/exit.h $ $Id: exit.h 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file exit.h.

Go to the source code of this file.

Exit code enumeration definitions and name strings.

Codes and null-terminated strings for constructing exit_code_enum enum and exit_get_name() switch, respectively.

NEVER change definition of EXIT_MAIN_OKAY! It is the normal return from exit_init() function by virtue of setjmp(3) definition.

NEVER change the definition of EXIT_LONGJMP_ARGERROR! It is defined by longjmp(3) when an attempt is made to use EXIT_MAIN_OKAY as its return code.

#define EXIT_ARGV_COPYRIGHT_DESC   "copyright request"
#define EXIT_ARGV_ENVIRONMENT_DESC   "environment request"
#define EXIT_ARGV_HELP_DESC   "help request"
#define EXIT_ARGV_LICENSE_DESC   "license request"
#define EXIT_ARGV_VERSION_DESC   "version request"
#define EXIT_CLASSPATH_JAR_DESC   "cannot run jar command"
#define EXIT_GC_ALLOC_DESC   "Garbage collection heap error"
#define EXIT_HEAP_ALLOC_DESC   "Heap allocation error"
#define EXIT_JVM_ATTRIBUTE_DESC   "attribute access error"
#define EXIT_JVM_BYTECODE_DESC   "JVM byte code execution error"
#define EXIT_JVM_CLASS_DESC   "class load error"
#define EXIT_JVM_FIELD_DESC   "field access error"
#define EXIT_JVM_GC_DESC   "Garbage collection error"
#define EXIT_JVM_INTERNAL_DESC   "Internal JVM logic error"
#define EXIT_JVM_METHOD_DESC   "method invocation error"
#define EXIT_JVM_OBJECT_DESC   "object load error"
#define EXIT_JVM_SIGNAL_DESC   "OS signal abort trapped"
#define EXIT_JVM_THREAD_DESC   "thread start error"
#define EXIT_JVM_THROWABLE_DESC   "throwable event abort"
#define EXIT_LONGJMP_ARGERROR_DESC   "longjmp(3) argument error"
#define EXIT_MAIN_OKAY_DESC   "no error"
#define EXIT_MANIFEST_JAR_DESC   "cannot process jar manifest file"
#define EXIT_THREAD_STACK_DESC   "Stack overflow suppressed"
#define EXIT_TIMESLICE_START_DESC   "cannot start timer"
#define EXIT_TMPAREA_MKDIR_DESC   "cannot make temp directory"
#define EXIT_TMPAREA_RMDIR_DESC   "cannot remove temp directory"
enum  exit_code_enum {
  EXIT_MAIN_OKAY = 0, EXIT_LONGJMP_ARGERROR = 1, EXIT_ARGV_HELP = 10, EXIT_ARGV_VERSION = 11,
  EXIT_ARGV_COPYRIGHT = 12, EXIT_ARGV_LICENSE = 13, EXIT_ARGV_ENVIRONMENT = 14, EXIT_JVM_THREAD = 20,
  EXIT_JVM_CLASS = 21, EXIT_JVM_OBJECT = 22, EXIT_JVM_METHOD = 23, EXIT_JVM_FIELD = 24,
  EXIT_JVM_ATTRIBUTE = 25, EXIT_JVM_THROWABLE = 26, EXIT_JVM_SIGNAL = 27, EXIT_JVM_BYTECODE = 28,
  EXIT_JVM_GC = 29, EXIT_JVM_INTERNAL = 30, EXIT_HEAP_ALLOC = 31, EXIT_GC_ALLOC = 32,
  EXIT_THREAD_STACK = 33, EXIT_TIMESLICE_START = 34, EXIT_TMPAREA_MKDIR = 35, EXIT_TMPAREA_RMDIR = 36,
  EXIT_CLASSPATH_JAR = 37, EXIT_MANIFEST_JAR = 38
}

Functions

 ARCH_COPYRIGHT_APACHE (exit, h,"$URL: https://svn.apache.org/path/name/exit.h $ $Id: exit.h 0 09/28/2005 dlydick $")
int exit_end_thread_setup (rvoid)
rvoid exit_end_thread_test (jvm_thread_index thridx)
int exit_exception_setup (rvoid)
 Global handler setup for fatal jvm_init() errors and other java.lang.Throwable events-- implements setjmp(3).
rcharexit_get_name (exit_code_enum code)
 Return a descriptive name string for each exit code.
int exit_init (rvoid)
rvoid exit_jvm (exit_code_enum rc)
 Global handler invocation for fatal JVM errors-- implements longjmp(3).
rvoid exit_throw_exception (exit_code_enum rc, rchar *preason)
 Global handler for initialization linkage errors, per spec section 2.17.x -- implements longjmp(3).

Variables

rcharexit_LinkageError_subclass
jvm_thread_index exit_LinkageError_thridx


Define Documentation

#define EXIT_MAIN_OKAY_DESC   "no error"
 

Definition at line 76 of file exit.h.

Referenced by exit_get_name().

#define EXIT_LONGJMP_ARGERROR_DESC   "longjmp(3) argument error"
 

Definition at line 77 of file exit.h.

Referenced by exit_get_name().

#define EXIT_ARGV_HELP_DESC   "help request"
 

Definition at line 79 of file exit.h.

Referenced by exit_get_name().

#define EXIT_ARGV_VERSION_DESC   "version request"
 

Definition at line 80 of file exit.h.

Referenced by exit_get_name().

#define EXIT_ARGV_COPYRIGHT_DESC   "copyright request"
 

Definition at line 81 of file exit.h.

Referenced by exit_get_name().

#define EXIT_ARGV_LICENSE_DESC   "license request"
 

Definition at line 82 of file exit.h.

Referenced by exit_get_name().

#define EXIT_ARGV_ENVIRONMENT_DESC   "environment request"
 

Definition at line 83 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_THREAD_DESC   "thread start error"
 

Definition at line 85 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_CLASS_DESC   "class load error"
 

Definition at line 86 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_OBJECT_DESC   "object load error"
 

Definition at line 87 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_METHOD_DESC   "method invocation error"
 

Definition at line 88 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_FIELD_DESC   "field access error"
 

Definition at line 89 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_ATTRIBUTE_DESC   "attribute access error"
 

Definition at line 90 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_THROWABLE_DESC   "throwable event abort"
 

Definition at line 91 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_SIGNAL_DESC   "OS signal abort trapped"
 

Definition at line 92 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_BYTECODE_DESC   "JVM byte code execution error"
 

Definition at line 93 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_GC_DESC   "Garbage collection error"
 

Definition at line 94 of file exit.h.

Referenced by exit_get_name().

#define EXIT_JVM_INTERNAL_DESC   "Internal JVM logic error"
 

Definition at line 95 of file exit.h.

Referenced by exit_get_name().

#define EXIT_HEAP_ALLOC_DESC   "Heap allocation error"
 

Definition at line 97 of file exit.h.

Referenced by exit_get_name().

#define EXIT_GC_ALLOC_DESC   "Garbage collection heap error"
 

Definition at line 98 of file exit.h.

Referenced by exit_get_name().

#define EXIT_THREAD_STACK_DESC   "Stack overflow suppressed"
 

Definition at line 99 of file exit.h.

Referenced by exit_get_name().

#define EXIT_TIMESLICE_START_DESC   "cannot start timer"
 

Definition at line 100 of file exit.h.

Referenced by exit_get_name().

#define EXIT_TMPAREA_MKDIR_DESC   "cannot make temp directory"
 

Definition at line 101 of file exit.h.

Referenced by exit_get_name().

#define EXIT_TMPAREA_RMDIR_DESC   "cannot remove temp directory"
 

Definition at line 102 of file exit.h.

Referenced by exit_get_name().

#define EXIT_CLASSPATH_JAR_DESC   "cannot run jar command"
 

Definition at line 103 of file exit.h.

Referenced by exit_get_name().

#define EXIT_MANIFEST_JAR_DESC   "cannot process jar manifest file"
 

Definition at line 104 of file exit.h.

Referenced by exit_get_name().


Enumeration Type Documentation

enum exit_code_enum
 

Enumerator:
EXIT_MAIN_OKAY  Everything went fine.

No Java code called java.lang.System.exit() , either.

EXIT_LONGJMP_ARGERROR  longjmp(3) called with 0 arg
EXIT_ARGV_HELP  Help invoked on command line
EXIT_ARGV_VERSION  Version invoked on command line
EXIT_ARGV_COPYRIGHT  Copyright invoked on cmd line
EXIT_ARGV_LICENSE  Copyright invoked on cmd line
EXIT_ARGV_ENVIRONMENT  Environment variable error.
EXIT_JVM_THREAD  Thread start error.
EXIT_JVM_CLASS  Class load error.
EXIT_JVM_OBJECT  Object load error.
EXIT_JVM_METHOD  Method invocation error.
EXIT_JVM_FIELD  Field access error.
EXIT_JVM_ATTRIBUTE  Attribute access error.
EXIT_JVM_THROWABLE  Throwable event abort.
EXIT_JVM_SIGNAL  OS signal abort trapped.
EXIT_JVM_BYTECODE  JVM byte code execution error.
EXIT_JVM_GC  Garbage collection error.
EXIT_JVM_INTERNAL  Internal JVM logic error.
EXIT_HEAP_ALLOC  Heap allocation error.
EXIT_GC_ALLOC  Garbage collection heap error.
EXIT_THREAD_STACK  Stack overflow suppressed.
EXIT_TIMESLICE_START  Cannot start timer.
EXIT_TMPAREA_MKDIR  Cannot make temp directory.
EXIT_TMPAREA_RMDIR  Cannot remove temp directory.
EXIT_CLASSPATH_JAR  Cannot run jar command.
EXIT_MANIFEST_JAR  Cannot process jar manifest file.

Definition at line 107 of file exit.h.


Function Documentation

ARCH_COPYRIGHT_APACHE exit  ,
,
"$URL: https://svn.apache.org/path/name/exit.h $ $Id: exit.h 0 09/28/2005 dlydick $" 
 

int exit_init rvoid   ) 
 

rchar* exit_get_name exit_code_enum  code  ) 
 

Return a descriptive name string for each exit code.

Parameters:
code Exit code enumeration
Returns:
Null-terminated string describing the exit code.

Definition at line 105 of file exit.c.

References EXIT_ARGV_COPYRIGHT, EXIT_ARGV_COPYRIGHT_DESC, EXIT_ARGV_ENVIRONMENT, EXIT_ARGV_ENVIRONMENT_DESC, EXIT_ARGV_HELP, EXIT_ARGV_HELP_DESC, EXIT_ARGV_LICENSE, EXIT_ARGV_LICENSE_DESC, EXIT_ARGV_VERSION, EXIT_ARGV_VERSION_DESC, EXIT_CLASSPATH_JAR, EXIT_CLASSPATH_JAR_DESC, EXIT_GC_ALLOC, EXIT_GC_ALLOC_DESC, EXIT_HEAP_ALLOC, EXIT_HEAP_ALLOC_DESC, EXIT_JVM_ATTRIBUTE, EXIT_JVM_ATTRIBUTE_DESC, EXIT_JVM_BYTECODE, EXIT_JVM_BYTECODE_DESC, EXIT_JVM_CLASS, EXIT_JVM_CLASS_DESC, EXIT_JVM_FIELD, EXIT_JVM_FIELD_DESC, EXIT_JVM_GC, EXIT_JVM_GC_DESC, EXIT_JVM_INTERNAL, EXIT_JVM_INTERNAL_DESC, EXIT_JVM_METHOD, EXIT_JVM_METHOD_DESC, EXIT_JVM_OBJECT, EXIT_JVM_OBJECT_DESC, EXIT_JVM_SIGNAL, EXIT_JVM_SIGNAL_DESC, EXIT_JVM_THREAD, EXIT_JVM_THREAD_DESC, EXIT_JVM_THROWABLE, EXIT_JVM_THROWABLE_DESC, EXIT_LONGJMP_ARGERROR, EXIT_LONGJMP_ARGERROR_DESC, EXIT_MAIN_OKAY, EXIT_MAIN_OKAY_DESC, EXIT_MANIFEST_JAR, EXIT_MANIFEST_JAR_DESC, EXIT_THREAD_STACK, EXIT_THREAD_STACK_DESC, EXIT_TIMESLICE_START, EXIT_TIMESLICE_START_DESC, EXIT_TMPAREA_MKDIR, EXIT_TMPAREA_MKDIR_DESC, EXIT_TMPAREA_RMDIR, and EXIT_TMPAREA_RMDIR_DESC.

Referenced by opcode_load_run_throwable().

int exit_exception_setup rvoid   ) 
 

Global handler setup for fatal jvm_init() errors and other java.lang.Throwable events-- implements setjmp(3).

Use this function to arm handler for throwing java.lang.Error and java.lang.Exception throwable events.

Parameters: rvoid

Returns:
From normal setup, integer EXIT_MAIN_OKAY. Otherwise, return exit code enumeration from exit_jvm().

Definition at line 215 of file exit.c.

References exit_LinkageError, exit_LinkageError_subclass, exit_LinkageError_thridx, jvm_thread_index_null, and rnull.

Referenced by opcode_load_run_throwable().

rvoid exit_throw_exception exit_code_enum  rcenum,
rchar preason
 

Global handler for initialization linkage errors, per spec section 2.17.x -- implements longjmp(3).

Use this function to throw java.lang.Error and java.lang.Exception throwable events.

This is a global handler invocation first for jvm_init() during startup and then runtime events. A wide variety of runtime conditions may be expressed in the combination of rc and preason. Judicious combinations of exit codes and error classes will greatly limit the need for expanding on the number of values for either parameter, yet can express many different nuances of errors.

Parameters:
rcenum Return code to pass back out of failed routine, which must be an exit code enumeration other than EXIT_MAIN_OKAY, which will get translated into EXIT_LONGJMP_ARGERROR.
preason Error class, which must be a subclass of java.lang.LinkageError , namely:

Returns:
non-local state restoration from setup via setjmp(3) as stored in exit_LinkageError buffer by exit_init() in jvm_init() before any of these errors could occur. All code invoking this function should use the standard lint(1) comment for "code not reached" as shown after the longjmp(3) function call in the source code of this function: /*NOTREACHED*/
< Access structures of the thread now running in the JVM.

Definition at line 287 of file exit.c.

References CURRENT_THREAD, exit_LinkageError, exit_LinkageError_subclass, and exit_LinkageError_thridx.

Referenced by class_allocate_slot(), class_load_primative(), field_find_by_cp_entry(), heap_get_common_simple_bimodal(), linkage_resolve_class(), method_find_by_cp_entry(), native_run_local_return_jdouble(), native_run_local_return_jfloat(), native_run_local_return_jint(), native_run_local_return_jlong(), native_run_local_return_jobject(), native_run_local_return_jvoid(), native_run_method(), native_verify_ordinal_definition(), object_allocate_slot(), object_run_method(), opcode_run(), thread_exception_setup(), thread_new(), and thread_state_get_name().

int exit_end_thread_setup rvoid   ) 
 

rvoid exit_end_thread_test jvm_thread_index  thridx  ) 
 

rvoid exit_jvm exit_code_enum  rcenum  ) 
 

Global handler invocation for fatal JVM errors-- implements longjmp(3).

Parameters:
rcenum Return code to pass back out of JVM.
Returns:
non-local state restoration from setup via setjmp(3) above as stored in exit_general_failure. All code invoking this function should use the standard lint(1) comment for "code not reached" as shown after the longjmp(3) function call in the source code of this function: /*NOTREACHED*/

Definition at line 321 of file exit.c.

Referenced by argv_init(), heap_init_bimodal(), jvm_manual_thread_run(), manifest_get_main(), object_run_method(), opcode_load_run_throwable(), opcode_run(), timeslice_init(), and timeslice_run().


Variable Documentation

rchar* exit_LinkageError_subclass
 

Class to run on non-local return. Give global visibility for use by users of exit_throw_exception().

Definition at line 159 of file exit.c.

Referenced by exit_exception_setup(), exit_throw_exception(), and opcode_load_run_throwable().

jvm_thread_index exit_LinkageError_thridx
 

Thread where error occurred. Give global visibility for use by users of exit_throw_exception().

Definition at line 167 of file exit.c.

Referenced by exit_exception_setup(), and exit_throw_exception().


Generated on Fri Sep 30 19:00:07 2005 by  doxygen 1.4.4