Skip to content

Commit 73942ee

Browse files
qwwdfsadPierfrancesco Soffritti
andauthored
Move DebugProbesKt from debug to core module (#2716)
Co-authored-by: Pierfrancesco Soffritti <[email protected]>
1 parent d858cba commit 73942ee

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3+
*/
4+
5+
@file:Suppress("unused")
6+
7+
package kotlinx.coroutines.debug.internal
8+
9+
import kotlin.coroutines.*
10+
11+
/*
12+
* This class is used by ByteBuddy from kotlinx-coroutines-debug as kotlin.coroutines.jvm.internal.DebugProbesKt replacement.
13+
* In theory, it should belong to kotlinx-coroutines-debug, but placing it here significantly simplifies the
14+
* Android AS debugger that does on-load DEX transformation
15+
*/
16+
17+
// Stubs which are injected as coroutine probes. Require direct match of signatures
18+
internal fun probeCoroutineResumed(frame: Continuation<*>) = DebugProbesImpl.probeCoroutineResumed(frame)
19+
20+
internal fun probeCoroutineSuspended(frame: Continuation<*>) = DebugProbesImpl.probeCoroutineSuspended(frame)
21+
internal fun <T> probeCoroutineCreated(completion: Continuation<T>): Continuation<T> =
22+
DebugProbesImpl.probeCoroutineCreated(completion)

kotlinx-coroutines-debug/src/DebugProbes.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,3 @@ public object DebugProbes {
143143
*/
144144
public fun dumpCoroutines(out: PrintStream = System.out): Unit = DebugProbesImpl.dumpCoroutines(out)
145145
}
146-
147-
// Stubs which are injected as coroutine probes. Require direct match of signatures
148-
internal fun probeCoroutineResumed(frame: Continuation<*>) = DebugProbesImpl.probeCoroutineResumed(frame)
149-
150-
internal fun probeCoroutineSuspended(frame: Continuation<*>) = DebugProbesImpl.probeCoroutineSuspended(frame)
151-
internal fun <T> probeCoroutineCreated(completion: Continuation<T>): Continuation<T> =
152-
DebugProbesImpl.probeCoroutineCreated(completion)

kotlinx-coroutines-debug/src/internal/Attach.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal class ByteBuddyDynamicAttach : Function1<Boolean, Unit> {
2020
private fun attach() {
2121
ByteBuddyAgent.install(ByteBuddyAgent.AttachmentProvider.ForEmulatedAttachment.INSTANCE)
2222
val cl = Class.forName("kotlin.coroutines.jvm.internal.DebugProbesKt")
23-
val cl2 = Class.forName("kotlinx.coroutines.debug.DebugProbesKt")
23+
val cl2 = Class.forName("kotlinx.coroutines.debug.internal.DebugProbesKt")
2424

2525
ByteBuddy()
2626
.redefine(cl2)

0 commit comments

Comments
 (0)