1 /* 2 * Copyright (c) 2002, 2013, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifdef INCLUDE_SA_ATTACH 26 27 #include <jni.h> 28 #include "libproc.h" 29 30 #include <elf.h> 31 #include <sys/types.h> 32 #include <sys/stat.h> 33 #include <fcntl.h> 34 #include <stdlib.h> 35 #include <string.h> 36 #include <limits.h> 37 38 #if defined(x86_64) && !defined(amd64) 39 #define amd64 1 40 #endif 41 42 #ifdef i386 43 #include "sun_jvm_hotspot_debugger_x86_X86ThreadContext.h" 44 #endif 45 46 #ifdef amd64 47 #include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h" 48 #endif 518 regs[REG_INDEX(R19)] = gregs.gpr[19]; 519 regs[REG_INDEX(R20)] = gregs.gpr[20]; 520 regs[REG_INDEX(R21)] = gregs.gpr[21]; 521 regs[REG_INDEX(R22)] = gregs.gpr[22]; 522 regs[REG_INDEX(R23)] = gregs.gpr[23]; 523 regs[REG_INDEX(R24)] = gregs.gpr[24]; 524 regs[REG_INDEX(R25)] = gregs.gpr[25]; 525 regs[REG_INDEX(R26)] = gregs.gpr[26]; 526 regs[REG_INDEX(R27)] = gregs.gpr[27]; 527 regs[REG_INDEX(R28)] = gregs.gpr[28]; 528 regs[REG_INDEX(R29)] = gregs.gpr[29]; 529 regs[REG_INDEX(R30)] = gregs.gpr[30]; 530 regs[REG_INDEX(R31)] = gregs.gpr[31]; 531 532 #endif 533 534 (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); 535 return array; 536 } 537 #endif 538 539 #endif // INCLUDE_SA_ATTACH | 1 /* 2 * Copyright (c) 2002, 2017, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #include <jni.h> 26 #include "libproc.h" 27 #include "libproc_impl.h" 28 29 #include <elf.h> 30 #include <sys/types.h> 31 #include <sys/stat.h> 32 #include <fcntl.h> 33 #include <stdlib.h> 34 #include <string.h> 35 #include <limits.h> 36 37 #if defined(x86_64) && !defined(amd64) 38 #define amd64 1 39 #endif 40 41 #ifdef i386 42 #include "sun_jvm_hotspot_debugger_x86_X86ThreadContext.h" 43 #endif 44 45 #ifdef amd64 46 #include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h" 47 #endif 517 regs[REG_INDEX(R19)] = gregs.gpr[19]; 518 regs[REG_INDEX(R20)] = gregs.gpr[20]; 519 regs[REG_INDEX(R21)] = gregs.gpr[21]; 520 regs[REG_INDEX(R22)] = gregs.gpr[22]; 521 regs[REG_INDEX(R23)] = gregs.gpr[23]; 522 regs[REG_INDEX(R24)] = gregs.gpr[24]; 523 regs[REG_INDEX(R25)] = gregs.gpr[25]; 524 regs[REG_INDEX(R26)] = gregs.gpr[26]; 525 regs[REG_INDEX(R27)] = gregs.gpr[27]; 526 regs[REG_INDEX(R28)] = gregs.gpr[28]; 527 regs[REG_INDEX(R29)] = gregs.gpr[29]; 528 regs[REG_INDEX(R30)] = gregs.gpr[30]; 529 regs[REG_INDEX(R31)] = gregs.gpr[31]; 530 531 #endif 532 533 (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); 534 return array; 535 } 536 #endif |