From 0f546316f4ce2d2d224981b532d45a20332f0ed1 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Sat, 14 Oct 2006 20:11:12 +0000 Subject: java-insns.h (enum java_code): Add op_breakpoint. * include/java-insns.h (enum java_code): Add op_breakpoint. * include/java-interp.h (_Jv_InterpMethod): Declare breakpoint_insn. [INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_slot. [!INTERPRETER]: Declare _Jv_InterpMethod::bp_insn_opcode. (install_break): Declare. * interpret.cc (breakpoint_insn): Define breakpoint insn. (compile): Add op_breakpoint to "can't happen" cases. [INTERPRETER] Initialize breakpoint insn if necessary. (install_break): New method. * interpret-run.cc: Add op_breakpoint to insn_targets. Add insn_breakpoint label. * verify.cc (branch_prepass): Add op_breakpoint to unrecognized opcodes section of switch statement. (verify_instructions_0): Likewise. From-SVN: r117734 --- libjava/include/java-insns.h | 6 ++---- libjava/include/java-interp.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'libjava/include') diff --git a/libjava/include/java-insns.h b/libjava/include/java-insns.h index a065987..824e441 100644 --- a/libjava/include/java-insns.h +++ b/libjava/include/java-insns.h @@ -1,6 +1,6 @@ // java-insns.h - Instruction encodings. This is -*- c++ -*- -/* Copyright (C) 1999, 2001, 2002 Free Software Foundation +/* Copyright (C) 1999, 2001, 2002, 2006 Free Software Foundation This file is part of libgcj. @@ -199,9 +199,7 @@ enum java_opcode op_invokespecial = 0xb7, op_invokestatic = 0xb8, op_invokeinterface = 0xb9, - - // 0xba is unused. - + op_breakpoint = 0xba, op_new = 0xbb, op_newarray = 0xbc, op_anewarray = 0xbd, diff --git a/libjava/include/java-interp.h b/libjava/include/java-interp.h index 276a887..74846c9 100644 --- a/libjava/include/java-interp.h +++ b/libjava/include/java-interp.h @@ -133,6 +133,14 @@ struct _Jv_LineTableEntry class _Jv_InterpMethod : public _Jv_MethodBase { + // Breakpoint instruction + static pc_t breakpoint_insn; +#ifdef DIRECT_THREADED + static insn_slot bp_insn_slot; +#else + static unsigned char bp_insn_opcode; +#endif + _Jv_ushort max_stack; _Jv_ushort max_locals; int code_length; @@ -206,6 +214,10 @@ class _Jv_InterpMethod : public _Jv_MethodBase void get_line_table (jlong& start, jlong& end, jintArray& line_numbers, jlongArray& code_indices); + /* Installs a break instruction at the given code index. Returns + the pc_t of the breakpoint or NULL if index is invalid. */ + pc_t install_break (jlong index); + // Gets the instruction at the given index pc_t get_insn (jlong index); -- cgit v1.1