hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dbx/DbxDebuggerLocal.java

Print this page
rev 611 : Merge
   1 /*
   2  * Copyright 2000-2004 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


 443       // Only slightly relaxed semantics -- this is a hack, but is
 444       // necessary on Solaris/x86 where it seems the compiler is
 445       // putting some global 64-bit data on 32-bit boundaries
 446       if (numBytes == 8) {
 447         utils.checkAlignment(address, 4);
 448       } else {
 449         utils.checkAlignment(address, numBytes);
 450       }
 451     }
 452     byte[] data = readBytes(address, numBytes);
 453     return utils.dataToCInteger(data, isUnsigned);
 454   }
 455 
 456   /** From the DbxDebugger interface */
 457   public DbxAddress readAddress(long address)
 458     throws UnmappedAddressException, UnalignedAddressException {
 459     long value = readAddressValue(address);
 460     return (value == 0 ? null : new DbxAddress(this, value));
 461   }
 462 






 463   /** From the DbxDebugger interface */
 464   public DbxOopHandle readOopHandle(long address)
 465     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 466     long value = readAddressValue(address);
 467     return (value == 0 ? null : new DbxOopHandle(this, value));
 468   }





 469 
 470   //--------------------------------------------------------------------------------
 471   // Thread context access. Can not be package private, but should
 472   // only be accessed by the architecture-specific subpackages.
 473 
 474   /** From the DbxDebugger interface. May have to redefine this later. */
 475   public synchronized long[] getThreadIntegerRegisterSet(int tid) {
 476     try {
 477       printlnToOutput("thr_gregs " + tid);
 478       int num = in.parseInt();
 479       long[] res = new long[num];
 480       for (int i = 0; i < num; i++) {
 481         res[i] = in.parseAddress();
 482       }
 483       return res;
 484     }
 485     catch (Exception e) {
 486       e.printStackTrace();
 487       return null;
 488     }


   1 /*
   2  * Copyright 2000-2008 Sun Microsystems, Inc.  All Rights Reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  20  * CA 95054 USA or visit www.sun.com if you need additional information or
  21  * have any questions.
  22  *  


 443       // Only slightly relaxed semantics -- this is a hack, but is
 444       // necessary on Solaris/x86 where it seems the compiler is
 445       // putting some global 64-bit data on 32-bit boundaries
 446       if (numBytes == 8) {
 447         utils.checkAlignment(address, 4);
 448       } else {
 449         utils.checkAlignment(address, numBytes);
 450       }
 451     }
 452     byte[] data = readBytes(address, numBytes);
 453     return utils.dataToCInteger(data, isUnsigned);
 454   }
 455 
 456   /** From the DbxDebugger interface */
 457   public DbxAddress readAddress(long address)
 458     throws UnmappedAddressException, UnalignedAddressException {
 459     long value = readAddressValue(address);
 460     return (value == 0 ? null : new DbxAddress(this, value));
 461   }
 462 
 463   public DbxAddress readCompOopAddress(long address)
 464     throws UnmappedAddressException, UnalignedAddressException {
 465     long value = readCompOopAddressValue(address);
 466     return (value == 0 ? null : new DbxAddress(this, value));
 467   }
 468 
 469   /** From the DbxDebugger interface */
 470   public DbxOopHandle readOopHandle(long address)
 471     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 472     long value = readAddressValue(address);
 473     return (value == 0 ? null : new DbxOopHandle(this, value));
 474   }
 475   public DbxOopHandle readCompOopHandle(long address)
 476     throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
 477     long value = readCompOopAddressValue(address);
 478     return (value == 0 ? null : new DbxOopHandle(this, value));
 479   }
 480 
 481   //--------------------------------------------------------------------------------
 482   // Thread context access. Can not be package private, but should
 483   // only be accessed by the architecture-specific subpackages.
 484 
 485   /** From the DbxDebugger interface. May have to redefine this later. */
 486   public synchronized long[] getThreadIntegerRegisterSet(int tid) {
 487     try {
 488       printlnToOutput("thr_gregs " + tid);
 489       int num = in.parseInt();
 490       long[] res = new long[num];
 491       for (int i = 0; i < num; i++) {
 492         res[i] = in.parseAddress();
 493       }
 494       return res;
 495     }
 496     catch (Exception e) {
 497       e.printStackTrace();
 498       return null;
 499     }