Print this page


Split Close
Expand all
Collapse all
          --- old/src/os/solaris/dtrace/libjvm_db.c
          +++ new/src/os/solaris/dtrace/libjvm_db.c
   1    1  /*
   2      - * Copyright 2003-2009 Sun Microsystems, Inc.  All Rights Reserved.
        2 + * Copyright 2003-2010 Sun Microsystems, Inc.  All Rights Reserved.
   3    3   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4    4   *
   5    5   * This code is free software; you can redistribute it and/or modify it
   6    6   * under the terms of the GNU General Public License version 2 only, as
   7    7   * published by the Free Software Foundation.
   8    8   *
   9    9   * This code is distributed in the hope that it will be useful, but WITHOUT
  10   10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11   11   * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12   12   * version 2 for more details (a copy is included in the LICENSE file that
↓ open down ↓ 110 lines elided ↑ open up ↑
 123  123    uint64_t pc;
 124  124    uint64_t pc_desc;
 125  125  
 126  126    int32_t  orig_pc_offset;      /* _orig_pc_offset */
 127  127    int32_t  instrs_beg;          /* _instructions_offset */
 128  128    int32_t  instrs_end;
 129  129    int32_t  deopt_beg;           /* _deoptimize_offset */
 130  130    int32_t  scopes_data_beg;     /* _scopes_data_offset */
 131  131    int32_t  scopes_data_end;
 132  132    int32_t  oops_beg;            /* _oops_offset */
 133      -  int32_t  oops_len;            /* _oops_length */
      133 +  int32_t  oops_end;
 134  134    int32_t  scopes_pcs_beg;      /* _scopes_pcs_offset */
 135  135    int32_t  scopes_pcs_end;
 136  136  
 137  137    int      vf_cnt;
 138  138    Vframe_t vframes[MAX_VFRAMES_CNT];
 139  139  } Nmethod_t;
 140  140  
 141  141  struct jvm_agent {
 142  142    struct ps_prochandle* P;
 143  143  
↓ open down ↓ 446 lines elided ↑ open up ↑
 590  590    err = ps_pread(J->P, nm + OFFSET_CodeBlob_instructions_offset, &N->instrs_beg, SZ32);
 591  591    CHECK_FAIL(err);
 592  592    err = ps_pread(J->P, nm + OFFSET_CodeBlob_data_offset, &N->instrs_end, SZ32);
 593  593    CHECK_FAIL(err);
 594  594    err = ps_pread(J->P, nm + OFFSET_nmethod_deoptimize_offset, &N->deopt_beg, SZ32);
 595  595    CHECK_FAIL(err);
 596  596    err = ps_pread(J->P, nm + OFFSET_nmethod_orig_pc_offset, &N->orig_pc_offset, SZ32);
 597  597    CHECK_FAIL(err);
 598  598  
 599  599    /* Oops */
 600      -  err = ps_pread(J->P, nm + OFFSET_CodeBlob_oops_offset, &N->oops_beg, SZ32);
      600 +  err = ps_pread(J->P, nm + OFFSET_nmethod_oops_offset, &N->oops_beg, SZ32);
 601  601    CHECK_FAIL(err);
 602      -  err = ps_pread(J->P, nm + OFFSET_CodeBlob_oops_length, &N->oops_len, SZ32);
      602 +  err = ps_pread(J->P, nm + OFFSET_nmethod_scopes_data_offset, &N->oops_end, SZ32);
 603  603    CHECK_FAIL(err);
 604  604  
 605  605    /* scopes_pcs */
 606  606    err = ps_pread(J->P, nm + OFFSET_nmethod_scopes_pcs_offset, &N->scopes_pcs_beg, SZ32);
 607  607    CHECK_FAIL(err);
 608  608    err = ps_pread(J->P, nm + OFFSET_nmethod_handler_table_offset, &N->scopes_pcs_end, SZ32);
 609  609    CHECK_FAIL(err);
 610  610  
 611  611    /* scopes_data */
 612  612    err = ps_pread(J->P, nm + OFFSET_nmethod_scopes_data_offset, &N->scopes_data_beg, SZ32);
↓ open down ↓ 4 lines elided ↑ open up ↑
 617  617  
 618  618        fprintf(stderr, "\t nmethod_info: instrs_beg: %#x, instrs_end: %#x\n",
 619  619                         N->instrs_beg, N->instrs_end);
 620  620  
 621  621        fprintf(stderr, "\t nmethod_info: deopt_beg: %#x \n",
 622  622                         N->deopt_beg);
 623  623  
 624  624        fprintf(stderr, "\t nmethod_info: orig_pc_offset: %#x \n",
 625  625                         N->orig_pc_offset);
 626  626  
 627      -      fprintf(stderr, "\t nmethod_info: oops_beg: %#x, oops_len: %#x\n",
 628      -                       N->oops_beg, N->oops_len);
      627 +      fprintf(stderr, "\t nmethod_info: oops_beg: %#x, oops_end: %#x\n",
      628 +                       N->oops_beg, N->oops_end);
 629  629  
 630  630        fprintf(stderr, "\t nmethod_info: scopes_data_beg: %#x, scopes_data_end: %#x\n",
 631  631                         N->scopes_data_beg, N->scopes_data_end);
 632  632  
 633  633        fprintf(stderr, "\t nmethod_info: scopes_pcs_beg: %#x, scopes_pcs_end: %#x\n",
 634  634                         N->scopes_pcs_beg, N->scopes_pcs_end);
 635  635  
 636  636        fprintf(stderr, "\t nmethod_info: END \n\n");
 637  637    }
 638  638    return PS_OK;
↓ open down ↓ 313 lines elided ↑ open up ↑
 952  952    while (decode_offset > 0) {
 953  953      Vframe_t *vf = &N->vframes[N->vf_cnt];
 954  954  
 955  955      if (debug > 2) {
 956  956        fprintf(stderr, "\t scopeDesc_chain: decode_offset: %#x\n", decode_offset);
 957  957      }
 958  958  
 959  959      err = scope_desc_at(N, decode_offset, vf);
 960  960      CHECK_FAIL(err);
 961  961  
 962      -    if (vf->methodIdx > N->oops_len) {
 963      -      fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops_len) !\n");
      962 +    if (vf->methodIdx > ((N->oops_end - N->oops_beg) / POINTER_SIZE)) {
      963 +      fprintf(stderr, "\t scopeDesc_chain: (methodIdx > oops length) !\n");
 964  964        return -1;
 965  965      }
 966  966      err = read_pointer(N->J, N->nm + N->oops_beg + (vf->methodIdx-1)*POINTER_SIZE,
 967  967                         &vf->methodOop);
 968  968      CHECK_FAIL(err);
 969  969  
 970  970      if (vf->methodOop) {
 971  971        N->vf_cnt++;
 972  972        err = line_number_from_bci(N->J, vf);
 973  973        CHECK_FAIL(err);
↓ open down ↓ 572 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX