home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / breakpoints.h < prev    next >
C/C++ Source or Header  |  1997-11-24  |  2KB  |  81 lines

  1. /*
  2.  * @(#)breakpoints.h    1.1 97/07/17
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. /*
  24.  * Definitions for the breakpoints, single-step and debugger events
  25.  */
  26.  
  27. #ifndef _BREAKPOINTS_H_
  28. #define _BREAKPOINTS_H_
  29.  
  30. #include <stdio.h>
  31. #include <stdlib.h>
  32.  
  33. #include "bool.h"
  34. #include "jni.h"
  35. #include "interpreter.h"
  36. #include "threads.h"
  37.  
  38. /*
  39.  * This section for general use
  40.  */
  41.  
  42. extern int get_opcode(ExecEnv *ee, unsigned char *pc);
  43.  
  44. /*
  45.  * This section for use by a debugger 
  46.  */
  47.  
  48. #ifdef BREAKPTS
  49.  
  50. /* Typedefs for debugger-notification hooks */
  51. typedef void (*HandleSingleStepHook)(ExecEnv *ee, unsigned char *pc);
  52. typedef void (*HandleBreakpointHook)(ExecEnv *ee, unsigned char *pc);
  53. typedef void (*HandleExceptionHook)(ExecEnv *ee, unsigned char *pc,
  54.                 HObject *object);
  55.  
  56. JNIEXPORT void JNICALL
  57. set_debugger_hooks(HandleSingleStepHook hssh,
  58.            HandleBreakpointHook hbh,
  59.            HandleExceptionHook heh);
  60.  
  61. extern void set_single_step_thread(TID tid, bool_t shouldStep);
  62. extern bool_t set_breakpoint(ExecEnv *ee, unsigned char *pc);
  63. extern bool_t clear_breakpoint(ExecEnv *ee, unsigned char *pc);
  64. extern void clear_all_breakpoints(ExecEnv *ee);
  65.  
  66. #endif BREAKPTS
  67.  
  68. /*
  69.  * This section for use by the interpreter
  70.  */
  71. extern void notify_debugger_of_exception(unsigned char *pc, ExecEnv *ee, HObject *object);
  72. extern void notify_debugger_of_single_step(unsigned char *pc, ExecEnv *ee);
  73.  
  74. #ifdef BREAKPTS
  75. extern bool_t single_stepping; /* set ONLY by breakpoints.c */
  76. extern int get_breakpoint_opcode(ExecEnv *ee, unsigned char *pc, bool_t notify);
  77. extern bool_t set_breakpoint_opcode(ExecEnv *ee, unsigned char *pc, unsigned char opcode);
  78. #endif BREAKPTS
  79.  
  80. #endif _BREAKPOINTS_H_ 
  81.