hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java

Print this page
rev 611 : Merge
   1 /*
   2  * Copyright 2002-2006 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  *  


 406     public ThreadProxy getThreadForThreadId(long id) {
 407         return new LinuxThread(this, id);
 408     }
 409 
 410     //----------------------------------------------------------------------
 411     // Internal routines (for implementation of LinuxAddress).
 412     // These must not be called until the MachineDescription has been set up.
 413     //
 414 
 415     /** From the LinuxDebugger interface */
 416     public String addressValueToString(long address) {
 417         return utils.addressValueToString(address);
 418     }
 419 
 420     /** From the LinuxDebugger interface */
 421     public LinuxAddress readAddress(long address)
 422             throws UnmappedAddressException, UnalignedAddressException {
 423         long value = readAddressValue(address);
 424         return (value == 0 ? null : new LinuxAddress(this, value));
 425     }





 426 
 427     /** From the LinuxDebugger interface */
 428     public LinuxOopHandle readOopHandle(long address)
 429             throws UnmappedAddressException, UnalignedAddressException,
 430                 NotInHeapException {
 431         long value = readAddressValue(address);
 432         return (value == 0 ? null : new LinuxOopHandle(this, value));
 433     }






 434 
 435     //----------------------------------------------------------------------
 436     // Thread context access
 437     //
 438 
 439     public synchronized long[] getThreadIntegerRegisterSet(int lwp_id)
 440                                             throws DebuggerException {
 441         requireAttach();
 442         if (isCore) {
 443             return getThreadIntegerRegisterSet0(lwp_id);
 444         } else {
 445             class GetThreadIntegerRegisterSetTask implements WorkerThreadTask {
 446                 int lwp_id;
 447                 long[] result;
 448                 public void doit(LinuxDebuggerLocal debugger) {
 449                     result = debugger.getThreadIntegerRegisterSet0(lwp_id);
 450                 }
 451             }
 452 
 453             GetThreadIntegerRegisterSetTask task = new GetThreadIntegerRegisterSetTask();


   1 /*
   2  * Copyright 2002-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  *  


 406     public ThreadProxy getThreadForThreadId(long id) {
 407         return new LinuxThread(this, id);
 408     }
 409 
 410     //----------------------------------------------------------------------
 411     // Internal routines (for implementation of LinuxAddress).
 412     // These must not be called until the MachineDescription has been set up.
 413     //
 414 
 415     /** From the LinuxDebugger interface */
 416     public String addressValueToString(long address) {
 417         return utils.addressValueToString(address);
 418     }
 419 
 420     /** From the LinuxDebugger interface */
 421     public LinuxAddress readAddress(long address)
 422             throws UnmappedAddressException, UnalignedAddressException {
 423         long value = readAddressValue(address);
 424         return (value == 0 ? null : new LinuxAddress(this, value));
 425     }
 426     public LinuxAddress readCompOopAddress(long address)
 427             throws UnmappedAddressException, UnalignedAddressException {
 428         long value = readCompOopAddressValue(address);
 429         return (value == 0 ? null : new LinuxAddress(this, value));
 430     }
 431 
 432     /** From the LinuxDebugger interface */
 433     public LinuxOopHandle readOopHandle(long address)
 434             throws UnmappedAddressException, UnalignedAddressException,
 435                 NotInHeapException {
 436         long value = readAddressValue(address);
 437         return (value == 0 ? null : new LinuxOopHandle(this, value));
 438     }
 439     public LinuxOopHandle readCompOopHandle(long address)
 440             throws UnmappedAddressException, UnalignedAddressException,
 441                 NotInHeapException {
 442         long value = readCompOopAddressValue(address);
 443         return (value == 0 ? null : new LinuxOopHandle(this, value));
 444     }
 445 
 446     //----------------------------------------------------------------------
 447     // Thread context access
 448     //
 449 
 450     public synchronized long[] getThreadIntegerRegisterSet(int lwp_id)
 451                                             throws DebuggerException {
 452         requireAttach();
 453         if (isCore) {
 454             return getThreadIntegerRegisterSet0(lwp_id);
 455         } else {
 456             class GetThreadIntegerRegisterSetTask implements WorkerThreadTask {
 457                 int lwp_id;
 458                 long[] result;
 459                 public void doit(LinuxDebuggerLocal debugger) {
 460                     result = debugger.getThreadIntegerRegisterSet0(lwp_id);
 461                 }
 462             }
 463 
 464             GetThreadIntegerRegisterSetTask task = new GetThreadIntegerRegisterSetTask();