Skip to content

Commit a22e932

Browse files
committed
8337163: Improve SA error message when failing to attach to a core file
Reviewed-by: amenkov, kevinw
1 parent a7120e2 commit a22e932

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/jdk.hotspot.agent/linux/native/libsaproc/LinuxDebuggerLocal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2019, 2021, NTT DATA.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -319,7 +319,7 @@ JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_at
319319
CHECK_EXCEPTION;
320320

321321
if ( (ph = Pgrab_core(execName_cstr, coreName_cstr)) == NULL) {
322-
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file");
322+
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file. For more information, export LIBSAPROC_DEBUG=1 and try again.");
323323
}
324324
env->SetLongField(this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
325325
fillThreadsAndLoadObjects(env, this_obj, ph);

src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -1146,7 +1146,7 @@ static void fillLoadObjects(JNIEnv* env, jobject this_obj, struct ps_prochandle*
11461146
if ( (ph = Pgrab_core(execName_cstr, coreName_cstr)) == NULL) {
11471147
(*env)->ReleaseStringUTFChars(env, execName, execName_cstr);
11481148
(*env)->ReleaseStringUTFChars(env, coreName, coreName_cstr);
1149-
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file");
1149+
THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the core file. For more information, export LIBSAPROC_DEBUG=1 and try again.");
11501150
}
11511151
(*env)->SetLongField(env, this_obj, p_ps_prochandle_ID, (jlong)(intptr_t)ph);
11521152
(*env)->ReleaseStringUTFChars(env, execName, execName_cstr);

0 commit comments

Comments
 (0)