Browse Prior Art Database

Exception handling for an interrupt-time driven system RPN interpreter Disclosure Number: IPCOM000010760D
Original Publication Date: 2003-Jan-16
Included in the Prior Art Database: 2003-Jan-16
Document File: 5 page(s) / 86K

Publishing Venue



This is a scheme for implementing an exception handling mechanism within a Reverse Polish Notation instruction set of a real or virtual machine. The instruction extensions permit easy adoption of try-catch semantics by high-level languages that generate RPN code. This scheme also implements support for a diagnostic call back or stack trace mechanism at the machine instruction level - again this affords advantages for high-level language compilers. This particular mechanism was designed for use by Dynamic Probes, which employs an RPN based Virtual Machine interpreter that operates stand-alone, without immediate access to user interfaces within the context of a system interrupt service routine.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 27% of the total text.

Page 1 of 5

Exception handling for an interrupt-time driven system RPN interpreter

  This exception handling scheme is designed for use by both a c-compiler that generates instructions for an Reverse Polish Notation machine and also for programmer that may wish to code directly using the RPN instruction set. The key objectives are:

    1. To provide RPN instructions that facility a try-catch exception handling syntax in the c-language

2. To provide a debugging mechanism in the form of stack-tracing and reporting
3. To provide these extensions for an RPN machine that is emulated by an RPN interpreted; the interpreted is self-contained as far as the underlying operating system is concerned; it has no direct user interface and operates within a system breakpoint exception handler, providing automated system debugging services.

    4. To provide a minimal extension to the RPN interpreter that is reasonably intuitive to code in RPN instructions while supporting a try-catch mechanism that is natural to c-language.

    5. To provide the stack trace to the user in a manner that is compatible with providing any data logged up to the time the exception is generated.

    The embodiment of this scheme is applied to Dynamic Probes for Linux, which is an automated system-wide debugging mechanism that can be used to generate log, trace and diagnostic information from task-time, interrupt-time, system-initialization time and inter-context switch code where the system may be either enabled or disabled for interrupts. This is achieved dynamically without the need for debugee code preparation - hence the dynamic nature of Dynamic Probes.

    Prior art comprises a number of filed disclosures that related to Dynamic Probes; however, this scheme is concerned solely with providing an exception handling mechanism to serve the needs of a high-level-language compiler - such as C - that generates RPN instructions for the underlying RPN interpreter.

Detailed exception handling characteristics of this scheme:
1. Support for try/catch HLL semantic.
2. Nested exception handlers will not be supported by the RPN interpreted - this will not prohibit their simulation by the HLL compiler

3. Exceptions will percolate to calling routines until a handler is found.
1. Unhandled exceptions terminate the interpreted.
2. The type of exceptions that will generated will be governed by an exception mask which will be defined in the RPN probe handler header.

3. An exception is implicitly handled/cancelled when a handler is called.
4. Ability to raise user exceptions
5. Provision of debugging support by means of stack tracing.
6. Support for re-throwing an exception.
7. Support for backing out log buffer changes To support this the following extensions have been made to the RPN interpreter:

Additional instructions:

sx Set an exception handler label local to a subroutine. ux Unset an exception handler.

Page 2 of 5

rx Raise an exception. push x Push exception information for the current (last raised or zeros) exception.