1 /*
2 * Copyright (c) 1998, 2025, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
56 #include "vm_interface.h"
57 #include "JDWP.h"
58 #include "util_md.h"
59 #include "error_messages.h"
60 #include "debugInit.h"
61
62 /* To handle "format string is not a string literal" warning. */
63 #if !defined(_MSC_VER)
64 #define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num) \
65 __attribute__((format(printf, fmt_pos_num, vargs_pos_num)))
66 #else
67 #define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num)
68 #endif
69
70 /* Definition of a CommonRef tracked by the backend for the frontend */
71 typedef struct RefNode {
72 jlong seqNum; /* ID of reference, also key for hash table */
73 jobject ref; /* could be strong or weak */
74 struct RefNode *next; /* next RefNode* in bucket chain */
75 jint count; /* count of references */
76 jboolean isPinAll; /* true if this is a strong reference due to a commonRef_pinAll() */
77 jboolean isCommonPin; /* true if this is a strong reference due to a commonRef_pin() */
78 } RefNode;
79
80 /* Value of a NULL ID */
81 #define NULL_OBJECT_ID ((jlong)0)
82
83 /*
84 * Globals used throughout the back end
85 */
86
87 typedef jint FrameNumber;
88
89 typedef struct {
90 jvmtiEnv *jvmti;
91 JavaVM *jvm;
92 volatile jboolean vmDead; /* Once VM is dead it stays that way - don't put in init */
93 jboolean assertOn;
94 jboolean assertFatal;
95 jboolean vthreadsSupported; /* If true, debugging support for vthreads is enabled. */
|
1 /*
2 * Copyright (c) 1998, 2026, 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. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
56 #include "vm_interface.h"
57 #include "JDWP.h"
58 #include "util_md.h"
59 #include "error_messages.h"
60 #include "debugInit.h"
61
62 /* To handle "format string is not a string literal" warning. */
63 #if !defined(_MSC_VER)
64 #define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num) \
65 __attribute__((format(printf, fmt_pos_num, vargs_pos_num)))
66 #else
67 #define ATTRIBUTE_PRINTF(fmt_pos_num, vargs_pos_num)
68 #endif
69
70 /* Definition of a CommonRef tracked by the backend for the frontend */
71 typedef struct RefNode {
72 jlong seqNum; /* ID of reference, also key for hash table */
73 jobject ref; /* could be strong or weak */
74 struct RefNode *next; /* next RefNode* in bucket chain */
75 jint count; /* count of references */
76 jboolean isValueObject; /* references to value objects are always strong */
77 jboolean isPinAll; /* true if this is a strong reference due to a commonRef_pinAll() */
78 jboolean isCommonPin; /* true if this is a strong reference due to a commonRef_pin() */
79 } RefNode;
80
81 /* Value of a NULL ID */
82 #define NULL_OBJECT_ID ((jlong)0)
83
84 /*
85 * Globals used throughout the back end
86 */
87
88 typedef jint FrameNumber;
89
90 typedef struct {
91 jvmtiEnv *jvmti;
92 JavaVM *jvm;
93 volatile jboolean vmDead; /* Once VM is dead it stays that way - don't put in init */
94 jboolean assertOn;
95 jboolean assertFatal;
96 jboolean vthreadsSupported; /* If true, debugging support for vthreads is enabled. */
|