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

jvmutil.c File Reference


Detailed Description

Utilities for operating the JVM on this real machine implementation.

Control

$URL: https://svn.apache.org/path/name/jvmutil.c $ $Id: jvmutil.c 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 jvmutil.c.

#include "arch.h"
#include "jvmcfg.h"
#include "cfmacros.h"
#include "classfile.h"
#include "attribute.h"
#include "jvm.h"
#include "linkage.h"
#include "util.h"

Go to the source code of this file.

Debug message verbosity utilities for sysDbgMsg().

Set and get an integer value that determines the number of debug messages that get displayed by sysDbgMsg().

When sysDbgMsg() is inserted into the code of a function, a verbosity level is its first parameter. The higher the number, the more verbose the debug output becomes, up to level DMLMAX. The lower the number, the less it is displayed at run time, down to DMLMIN. At level DMLOFF, only vital diagnostic messages are displayed. The rest are suppressed.

This value is heuristically applied by the developer as to the importance of that information in various development and testing situations.

The importance of the situation defaults to DMLDEFAULT at compile time and may be changed at run time with the -Xdebug_level command line parameter.

See also:
jvm_debug_level_enum

sysDbgMsg()



jvm_debug_level_enum jvmutil_get_dml ()
 Get current debug message level.
rvoid jvmutil_set_dml (jvm_debug_level_enum level)
 Set current debug message level.

Stack dump utilities.

Print contents of a thread's stack to standard error.

Several forms are available that provide various amounts of stack frame detail. The most verbose also shows local variables in the stack frame.

Attention:
These routines are not intended as a replacement for the normal routine java.lang.Throwable.printStackTrace() !!!
Parameters:
thridx Thread table index of thread to show
pheader Null-terminated header string. If no header is desired, pass a rnull pointer here.
showdetails If rtrue, show frame details, else less verbose.
showlocals If rtrue, show local variables also, but only if showdetails is also rtrue.
Returns:
rvoid
Todo:
This function needs unit testing.
Todo:
Add line numbers to output. Sample output might look like this (when line numbers are added):
 * Exception in thread "main" java.lang.NullPointerException
        at Testit.sub1(Testit.java:9)
        at Testit.main(Testit.java:23)
   


rvoid jvmutil_print_error_stack (jvm_thread_index thridx)
 Print basic stack frame summary reporting an error versus an exception.
static rvoid jvmutil_print_errtype_stack (jvm_thread_index thridx, rchar *errtype)
 Common print basic stack frame summary showing error type.
rvoid jvmutil_print_exception_stack (jvm_thread_index thridx)
 Print basic stack frame summary reporting an exception versus an error.
rvoid jvmutil_print_stack (jvm_thread_index thridx, rchar *pheader)
 Print basic stack frame summary only.
static rvoid jvmutil_print_stack_common (jvm_thread_index thridx, rchar *pheader, rboolean showdetails, rboolean showlocals)
 Common function to perform final output from all stack print utilities.
rvoid jvmutil_print_stack_details (jvm_thread_index thridx, rchar *pheader)
 Print stack frame with some details.
rvoid jvmutil_print_stack_locals (jvm_thread_index thridx, rchar *pheader)
 Print stack frame with details and local variables.

Functions

static void jvmutil_c_dummy (void)

Variables

static char * jvmutil_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/jvmutil.c $ $Id: jvmutil.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable."


Function Documentation

static void jvmutil_c_dummy void   )  [static]
 

Definition at line 41 of file jvmutil.c.

rvoid jvmutil_set_dml jvm_debug_level_enum  level  ) 
 

Set current debug message level.

Parameters:
level New level to set.
Returns:
rvoid

Definition at line 96 of file jvmutil.c.

References rjvm::debug_message_level, and pjvm.

Referenced by argv_init().

jvm_debug_level_enum jvmutil_get_dml  ) 
 

Get current debug message level.

Parameters: rvoid

Returns:
current debug message verbosity

Definition at line 113 of file jvmutil.c.

References rjvm::debug_message_level, and pjvm.

Referenced by sysDbgMsg().

static rvoid jvmutil_print_stack_common jvm_thread_index  thridx,
rchar pheader,
rboolean  showdetails,
rboolean  showlocals
[static]
 

Common function to perform final output from all stack print utilities.

< References java.lang.Object todo 97

Todo:
Show details of stack frame
Todo:
Show local variables in stack frame

Definition at line 172 of file jvmutil.c.

References attribute_info_dup::ai, attribute_find_in_class_by_enum(), ClassFile::attributes, CHECK_FINAL_STACK_FRAME_GENERIC, CLASS_OBJECT_LINKAGE, CLASSNAME_EXTERNAL_DELIMITER_CHAR, CONSTANT_CP_DEFAULT_INDEX, CP1_NAME_STRLEN, CP_THIS_STRLEN, FIRST_STACK_FRAME, fprintfLocalStderr(), GET_FP, jvm_attribute_index_bad, JVMREG_STACK_PC_CLSIDX_OFFSET, JVMREG_STACK_PC_MTHIDX_OFFSET, LOCAL_SOURCEFILE_ATTRIBUTE, NEXT_STACK_FRAME_GENERIC, PTR_CP1_NAME_STRNAME, PTR_CP_THIS_STRNAME, rnull, rtrue, STACK, and ClassFile::this_class.

Referenced by jvmutil_print_stack(), jvmutil_print_stack_details(), and jvmutil_print_stack_locals().

rvoid jvmutil_print_stack jvm_thread_index  thridx,
rchar pheader
 

Print basic stack frame summary only.

Definition at line 284 of file jvmutil.c.

References jvmutil_print_stack_common(), and rfalse.

Referenced by jvmutil_print_errtype_stack(), object_run_method(), opcode_load_run_throwable(), and opcode_run().

rvoid jvmutil_print_stack_details jvm_thread_index  thridx,
rchar pheader
 

Print stack frame with some details.

Definition at line 295 of file jvmutil.c.

References jvmutil_print_stack_common(), rfalse, and rtrue.

rvoid jvmutil_print_stack_locals jvm_thread_index  thridx,
rchar pheader
 

Print stack frame with details and local variables.

Definition at line 307 of file jvmutil.c.

References jvmutil_print_stack_common(), and rtrue.

static rvoid jvmutil_print_errtype_stack jvm_thread_index  thridx,
rchar errtype
[static]
 

Common print basic stack frame summary showing error type.

< Convenient size for any stdio msg

Definition at line 319 of file jvmutil.c.

References CLASS_OBJECT_LINKAGE, CP1_NAME_STRLEN, GET_FP, HEAP_FREE_DATA, HEAP_GET_DATA, JVMCFG_STDIO_BFR, JVMREG_STACK_PC_CLSIDX_OFFSET, jvmutil_print_stack(), PTR_CP1_NAME_STRNAME, rfalse, sprintfLocal(), STACK, ClassFile::this_class, and THREAD.

Referenced by jvmutil_print_error_stack(), and jvmutil_print_exception_stack().

rvoid jvmutil_print_error_stack jvm_thread_index  thridx  ) 
 

Print basic stack frame summary reporting an error versus an exception.

Definition at line 358 of file jvmutil.c.

References jvmutil_print_errtype_stack().

rvoid jvmutil_print_exception_stack jvm_thread_index  thridx  ) 
 

Print basic stack frame summary reporting an exception versus an error.

Definition at line 370 of file jvmutil.c.

References jvmutil_print_errtype_stack().


Variable Documentation

char* jvmutil_c_copyright = "\0" "$URL: https://svn.apache.org/path/name/jvmutil.c $ $Id: jvmutil.c 0 09/28/2005 dlydick $" " " "Copyright 2005 The Apache Software Foundation or its licensors, as applicable." [static]
 

Definition at line 41 of file jvmutil.c.


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