Wolfgang Thallergcc16 merge934c3885 months agoHistory
1639 lines · 42.6 KB · C++
RawDownload
/* Copyright (C) 2021-2026 Free Software Foundation, Inc.   Contributed by Oracle.    This file is part of GNU Binutils.    This program is free software; you can redistribute it and/or modify   it under the terms of the GNU General Public License as published by   the Free Software Foundation; either version 3, or (at your option)   any later version.    This program is distributed in the hope that it will be useful,   but WITHOUT ANY WARRANTY; without even the implied warranty of   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   GNU General Public License for more details.    You should have received a copy of the GNU General Public License   along with this program; if not, write to the Free Software   Foundation, 51 Franklin Street - Fifth Floor, Boston,   MA 02110-1301, USA.  */ #include "config.h"#include <fcntl.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h> #include "util.h"#include "DbeSession.h"#include "ClassFile.h"#include "Function.h"#include "StringBuilder.h"#include "DbeFile.h" class ByteCodeInfo{public:   ByteCodeInfo (JMethod *_func, int _bci, int _lno)  {    func = _func;    bci = _bci;    lno = _lno;  };   JMethod *func;  int bci;  int lno;}; typedef unsigned char u1;typedef unsigned short u2;typedef unsigned int u4; // Class File Constants#define JAVA_MAGIC        0xcafebabe enum {  // First argument in access_flags_to_str()  ClassAccess = 1,  FieldAccess,  MethodAccess,  NestedClassAccess,   // jdk/src/share/classes/sun/tools/java/RuntimeConstants.java  // Type codes  T_CLASS             = 0x00000002,  T_BOOLEAN           = 0x00000004,  T_CHAR              = 0x00000005,  T_FLOAT             = 0x00000006,  T_DOUBLE            = 0x00000007,  T_BYTE              = 0x00000008,  T_SHORT             = 0x00000009,  T_INT               = 0x0000000a,  T_LONG              = 0x0000000b, // Access and modifier flags  ACC_PUBLIC          = 0x00000001,  ACC_PRIVATE         = 0x00000002,  ACC_PROTECTED       = 0x00000004,  ACC_STATIC          = 0x00000008,  ACC_FINAL           = 0x00000010,  ACC_SYNCHRONIZED    = 0x00000020,  ACC_VOLATILE        = 0x00000040,  ACC_TRANSIENT       = 0x00000080,  ACC_NATIVE          = 0x00000100,  ACC_INTERFACE       = 0x00000200,  ACC_ABSTRACT        = 0x00000400,  ACC_STRICT          = 0x00000800,  ACC_SYNTHETIC       = 0x00001000,  ACC_ANNOTATION      = 0x00002000,  ACC_ENUM            = 0x00004000,   ACC_SUPER           = 0x00000020,  ACC_BRIDGE          = 0x00000040,  ACC_VARARGS         = 0x00000080, // Opcodes  opc_try             = -3,  opc_dead            = -2,  opc_label           = -1,  opc_nop             = 0,  opc_aconst_null     = 1,  opc_iconst_m1       = 2,  opc_iconst_0        = 3,  opc_iconst_1        = 4,  opc_iconst_2        = 5,  opc_iconst_3        = 6,  opc_iconst_4        = 7,  opc_iconst_5        = 8,  opc_lconst_0        = 9,  opc_lconst_1        = 10,  opc_fconst_0        = 11,  opc_fconst_1        = 12,  opc_fconst_2        = 13,  opc_dconst_0        = 14,  opc_dconst_1        = 15,  opc_bipush          = 16,  opc_sipush          = 17,  opc_ldc             = 18,  opc_ldc_w           = 19,  opc_ldc2_w          = 20,  opc_iload           = 21,  opc_lload           = 22,  opc_fload           = 23,  opc_dload           = 24,  opc_aload           = 25,  opc_iload_0         = 26,  opc_iload_1         = 27,  opc_iload_2         = 28,  opc_iload_3         = 29,  opc_lload_0         = 30,  opc_lload_1         = 31,  opc_lload_2         = 32,  opc_lload_3         = 33,  opc_fload_0         = 34,  opc_fload_1         = 35,  opc_fload_2         = 36,  opc_fload_3         = 37,  opc_dload_0         = 38,  opc_dload_1         = 39,  opc_dload_2         = 40,  opc_dload_3         = 41,  opc_aload_0         = 42,  opc_aload_1         = 43,  opc_aload_2         = 44,  opc_aload_3         = 45,  opc_iaload          = 46,  opc_laload          = 47,  opc_faload          = 48,  opc_daload          = 49,  opc_aaload          = 50,  opc_baload          = 51,  opc_caload          = 52,  opc_saload          = 53,  opc_istore          = 54,  opc_lstore          = 55,  opc_fstore          = 56,  opc_dstore          = 57,  opc_astore          = 58,  opc_istore_0        = 59,  opc_istore_1        = 60,  opc_istore_2        = 61,  opc_istore_3        = 62,  opc_lstore_0        = 63,  opc_lstore_1        = 64,  opc_lstore_2        = 65,  opc_lstore_3        = 66,  opc_fstore_0        = 67,  opc_fstore_1        = 68,  opc_fstore_2        = 69,  opc_fstore_3        = 70,  opc_dstore_0        = 71,  opc_dstore_1        = 72,  opc_dstore_2        = 73,  opc_dstore_3        = 74,  opc_astore_0        = 75,  opc_astore_1        = 76,  opc_astore_2        = 77,  opc_astore_3        = 78,  opc_iastore         = 79,  opc_lastore         = 80,  opc_fastore         = 81,  opc_dastore         = 82,  opc_aastore         = 83,  opc_bastore         = 84,  opc_castore         = 85,  opc_sastore         = 86,  opc_pop             = 87,  opc_pop2            = 88,  opc_dup             = 89,  opc_dup_x1          = 90,  opc_dup_x2          = 91,  opc_dup2            = 92,  opc_dup2_x1         = 93,  opc_dup2_x2         = 94,  opc_swap            = 95,  opc_iadd            = 96,  opc_ladd            = 97,  opc_fadd            = 98,  opc_dadd            = 99,  opc_isub            = 100,  opc_lsub            = 101,  opc_fsub            = 102,  opc_dsub            = 103,  opc_imul            = 104,  opc_lmul            = 105,  opc_fmul            = 106,  opc_dmul            = 107,  opc_idiv            = 108,  opc_ldiv            = 109,  opc_fdiv            = 110,  opc_ddiv            = 111,  opc_irem            = 112,  opc_lrem            = 113,  opc_frem            = 114,  opc_drem            = 115,  opc_ineg            = 116,  opc_lneg            = 117,  opc_fneg            = 118,  opc_dneg            = 119,  opc_ishl            = 120,  opc_lshl            = 121,  opc_ishr            = 122,  opc_lshr            = 123,  opc_iushr           = 124,  opc_lushr           = 125,  opc_iand            = 126,  opc_land            = 127,  opc_ior             = 128,  opc_lor             = 129,  opc_ixor            = 130,  opc_lxor            = 131,  opc_iinc            = 132,  opc_i2l             = 133,  opc_i2f             = 134,  opc_i2d             = 135,  opc_l2i             = 136,  opc_l2f             = 137,  opc_l2d             = 138,  opc_f2i             = 139,  opc_f2l             = 140,  opc_f2d             = 141,  opc_d2i             = 142,  opc_d2l             = 143,  opc_d2f             = 144,  opc_i2b             = 145,  opc_i2c             = 146,  opc_i2s             = 147,  opc_lcmp            = 148,  opc_fcmpl           = 149,  opc_fcmpg           = 150,  opc_dcmpl           = 151,  opc_dcmpg           = 152,  opc_ifeq            = 153,  opc_ifne            = 154,  opc_iflt            = 155,  opc_ifge            = 156,  opc_ifgt            = 157,  opc_ifle            = 158,  opc_if_icmpeq       = 159,  opc_if_icmpne       = 160,  opc_if_icmplt       = 161,  opc_if_icmpge       = 162,  opc_if_icmpgt       = 163,  opc_if_icmple       = 164,  opc_if_acmpeq       = 165,  opc_if_acmpne       = 166,  opc_goto            = 167,  opc_jsr             = 168,  opc_ret             = 169,  opc_tableswitch     = 170,  opc_lookupswitch    = 171,  opc_ireturn         = 172,  opc_lreturn         = 173,  opc_freturn         = 174,  opc_dreturn         = 175,  opc_areturn         = 176,  opc_return          = 177,  opc_getstatic       = 178,  opc_putstatic       = 179,  opc_getfield        = 180,  opc_putfield        = 181,  opc_invokevirtual   = 182,  opc_invokespecial   = 183,  opc_invokestatic    = 184,  opc_invokeinterface = 185,  opc_invokedynamic   = 186,  opc_new             = 187,  opc_newarray        = 188,  opc_anewarray       = 189,  opc_arraylength     = 190,  opc_athrow          = 191,  opc_checkcast       = 192,  opc_instanceof      = 193,  opc_monitorenter    = 194,  opc_monitorexit     = 195,  opc_wide            = 196,  opc_multianewarray  = 197,  opc_ifnull          = 198,  opc_ifnonnull       = 199,  opc_goto_w          = 200,  opc_jsr_w           = 201,  opc_breakpoint      = 202, // Constant table  CONSTANT_UTF8       = 1,  CONSTANT_UNICODE    = 2,  CONSTANT_INTEGER    = 3,  CONSTANT_FLOAT      = 4,  CONSTANT_LONG       = 5,  CONSTANT_DOUBLE     = 6,  CONSTANT_CLASS      = 7,  CONSTANT_STRING     = 8,  CONSTANT_FIELD      = 9,  CONSTANT_METHOD     = 10,  CONSTANT_INTERFACEMETHOD = 11,  CONSTANT_NAMEANDTYPE    = 12,  CONSTANT_METHODHANDLE   = 15,  CONSTANT_METHODTYPE     = 16,  CONSTANT_INVOKEDYNAMIC  = 18}; static char *opcNames[] = {  NTXT ("nop"),  NTXT ("aconst_null"),  NTXT ("iconst_m1"),  NTXT ("iconst_0"),  NTXT ("iconst_1"),  NTXT ("iconst_2"),  NTXT ("iconst_3"),  NTXT ("iconst_4"),  NTXT ("iconst_5"),  NTXT ("lconst_0"),  NTXT ("lconst_1"),  NTXT ("fconst_0"),  NTXT ("fconst_1"),  NTXT ("fconst_2"),  NTXT ("dconst_0"),  NTXT ("dconst_1"),  NTXT ("bipush"),  NTXT ("sipush"),  NTXT ("ldc"),  NTXT ("ldc_w"),  NTXT ("ldc2_w"),  NTXT ("iload"),  NTXT ("lload"),  NTXT ("fload"),  NTXT ("dload"),  NTXT ("aload"),  NTXT ("iload_0"),  NTXT ("iload_1"),  NTXT ("iload_2"),  NTXT ("iload_3"),  NTXT ("lload_0"),  NTXT ("lload_1"),  NTXT ("lload_2"),  NTXT ("lload_3"),  NTXT ("fload_0"),  NTXT ("fload_1"),  NTXT ("fload_2"),  NTXT ("fload_3"),  NTXT ("dload_0"),  NTXT ("dload_1"),  NTXT ("dload_2"),  NTXT ("dload_3"),  NTXT ("aload_0"),  NTXT ("aload_1"),  NTXT ("aload_2"),  NTXT ("aload_3"),  NTXT ("iaload"),  NTXT ("laload"),  NTXT ("faload"),  NTXT ("daload"),  NTXT ("aaload"),  NTXT ("baload"),  NTXT ("caload"),  NTXT ("saload"),  NTXT ("istore"),  NTXT ("lstore"),  NTXT ("fstore"),  NTXT ("dstore"),  NTXT ("astore"),  NTXT ("istore_0"),  NTXT ("istore_1"),  NTXT ("istore_2"),  NTXT ("istore_3"),  NTXT ("lstore_0"),  NTXT ("lstore_1"),  NTXT ("lstore_2"),  NTXT ("lstore_3"),  NTXT ("fstore_0"),  NTXT ("fstore_1"),  NTXT ("fstore_2"),  NTXT ("fstore_3"),  NTXT ("dstore_0"),  NTXT ("dstore_1"),  NTXT ("dstore_2"),  NTXT ("dstore_3"),  NTXT ("astore_0"),  NTXT ("astore_1"),  NTXT ("astore_2"),  NTXT ("astore_3"),  NTXT ("iastore"),  NTXT ("lastore"),  NTXT ("fastore"),  NTXT ("dastore"),  NTXT ("aastore"),  NTXT ("bastore"),  NTXT ("castore"),  NTXT ("sastore"),  NTXT ("pop"),  NTXT ("pop2"),  NTXT ("dup"),  NTXT ("dup_x1"),  NTXT ("dup_x2"),  NTXT ("dup2"),  NTXT ("dup2_x1"),  NTXT ("dup2_x2"),  NTXT ("swap"),  NTXT ("iadd"),  NTXT ("ladd"),  NTXT ("fadd"),  NTXT ("dadd"),  NTXT ("isub"),  NTXT ("lsub"),  NTXT ("fsub"),  NTXT ("dsub"),  NTXT ("imul"),  NTXT ("lmul"),  NTXT ("fmul"),  NTXT ("dmul"),  NTXT ("idiv"),  NTXT ("ldiv"),  NTXT ("fdiv"),  NTXT ("ddiv"),  NTXT ("irem"),  NTXT ("lrem"),  NTXT ("frem"),  NTXT ("drem"),  NTXT ("ineg"),  NTXT ("lneg"),  NTXT ("fneg"),  NTXT ("dneg"),  NTXT ("ishl"),  NTXT ("lshl"),  NTXT ("ishr"),  NTXT ("lshr"),  NTXT ("iushr"),  NTXT ("lushr"),  NTXT ("iand"),  NTXT ("land"),  NTXT ("ior"),  NTXT ("lor"),  NTXT ("ixor"),  NTXT ("lxor"),  NTXT ("iinc"),  NTXT ("i2l"),  NTXT ("i2f"),  NTXT ("i2d"),  NTXT ("l2i"),  NTXT ("l2f"),  NTXT ("l2d"),  NTXT ("f2i"),  NTXT ("f2l"),  NTXT ("f2d"),  NTXT ("d2i"),  NTXT ("d2l"),  NTXT ("d2f"),  NTXT ("i2b"),  NTXT ("i2c"),  NTXT ("i2s"),  NTXT ("lcmp"),  NTXT ("fcmpl"),  NTXT ("fcmpg"),  NTXT ("dcmpl"),  NTXT ("dcmpg"),  NTXT ("ifeq"),  NTXT ("ifne"),  NTXT ("iflt"),  NTXT ("ifge"),  NTXT ("ifgt"),  NTXT ("ifle"),  NTXT ("if_icmpeq"),  NTXT ("if_icmpne"),  NTXT ("if_icmplt"),  NTXT ("if_icmpge"),  NTXT ("if_icmpgt"),  NTXT ("if_icmple"),  NTXT ("if_acmpeq"),  NTXT ("if_acmpne"),  NTXT ("goto"),  NTXT ("jsr"),  NTXT ("ret"),  NTXT ("tableswitch"),  NTXT ("lookupswitch"),  NTXT ("ireturn"),  NTXT ("lreturn"),  NTXT ("freturn"),  NTXT ("dreturn"),

Lines 1–500 of 1639.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t