macOS M1 芯片 IDEA Debug Rust 无法运行问题

Rust Debug macOS About 4,947 words

问题一

无法attach,权限问题。

process exited with status -1 (attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries, when the attach failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.))

问题一解决方法

Edit Configurations中编辑设置,勾选Run with root privileges,以root权限执行即可解决上诉报错。

问题二

开发模式未启用。

process exited with status -1 (developer mode is not enabled on this machine and this is a non-interactive debug session.)

问题二决方法

使用命令行,执行以下命令,开启开发模式。

sudo DevToolsSecurity -enable

输出

❯ sudo DevToolsSecurity -enable
Developer mode is now enabled.

问题三(未解决)

无法获取debug进程权限。

process exited with status -1 (this is a non-interactive debug session, cannot get permission to debug processes.)

错误日志

idea.log中查看trace级别信息。

2023-02-24 12:09:18,287 [ 112522]   FINE - #c.j.c.e.debugger - [protobuf client 1] 5430 res:launch {
  common_response {
    is_valid: false
    error_message: "process exited with status -1 (this is a non-interactive debug session, cannot get permission to debug processes.)"
  }
}
2023-02-24 12:09:18,287 [ 112522]   FINE - #c.j.c.e.debugger - 
com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriverException: process exited with status -1 (this is a non-interactive debug session, cannot get permission to debug processes.)
    at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$ThrowIfNotValid.throwError(LLDBDriver.java:307)
    at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$ResponseMessageConsumer.throwIfNeeded(LLDBDriver.java:272)
    at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$ThrowIfNotValid.throwIfNeeded(LLDBDriver.java:302)
    at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver.doLaunch(LLDBDriver.java:925)
    at com.jetbrains.cidr.execution.debugger.backend.lldb.LLDBDriver$6.startImpl(LLDBDriver.java:520)
    at com.jetbrains.cidr.execution.debugger.backend.DebuggerDriver$Inferior.start(DebuggerDriver.java:933)
    at com.jetbrains.cidr.execution.debugger.CidrDebugProcess.doStartTarget(CidrDebugProcess.java:714)
    at com.jetbrains.cidr.execution.debugger.CidrDebugProcess.lambda$sessionInitialized$4(CidrDebugProcess.java:707)
    at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$VoidDebuggerCommand.call(CidrDebugProcess.java:1152)
    at com.jetbrains.cidr.execution.debugger.CidrDebugProcess$VoidDebuggerCommand.call(CidrDebugProcess.java:1146)
    at com.jetbrains.cidr.execution.debugger.CidrDebuggerCommandExecutor$executeCommand$3.invokeSuspend(CidrDebuggerCommandExecutor.kt:89)
    at com.jetbrains.cidr.execution.debugger.CidrDebuggerCommandExecutor$executeCommand$3.invoke(CidrDebuggerCommandExecutor.kt)
    at com.jetbrains.cidr.execution.debugger.CidrDebuggerCommandExecutor$executeCommand$3.invoke(CidrDebuggerCommandExecutor.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89)
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169)
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
    at com.jetbrains.cidr.execution.debugger.CidrDebuggerCommandExecutor.executeCommand(CidrDebuggerCommandExecutor.kt:81)
    at com.jetbrains.cidr.execution.debugger.CidrDebuggerCommandExecutor$executeCommandAsync$1.invokeSuspend(CidrDebuggerCommandExecutor.kt:61)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:243)
    at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:29)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:216)
    at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:212)
    at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:205)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
    at java.base/java.lang.Thread.run(Thread.java:833)

如何查看 IDEA 系统日志

步骤一

双击Shift,输入:

Debug Log Settings

弹出对话框,输入:

#com.jetbrains.cidr.execution.debugger:trace

步骤二

再次运行Debug

步骤三

Finder中打开IDEA日志目录。

双击Shift,输入:

Show Log in Finder

步骤四

查看idea.log

相关 issue

https://github.com/intellij-rust/intellij-rust/issues/6616

Views: 1,669 · Posted: 2023-05-08

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh