New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LLDB] attach failed,(Not allowed to attach to process.) #52829
Comments
@llvm/issue-subscribers-lldb |
Based on the version number, it sounds like this is an issue with the LLDB that ships with Xcode. Unless it also reproduces with the lldb from llvm.org, I recommend filing a bug report with Apple. That said, the logs you pasted here are not the logs the error message is talking about. They are system logs that you can access through Console.app.
|
Note, however, that on macOS you can only attach the debugger to programs that have specifically marked themselves as allowing debugging. Standard practice for most apps/executables is not to mark the release builds "debuggable". So this failure is actually expected behavior for something like a java you installed rather than hand-building. As Jonas said, you can look in console for error messages, but most likely you are going to find that java was not built to allow debugging. You can also verify this by running: codesign -d --entitlements -- if that doesn't include the get_task_allow entitlement, you won't be allowed to attach to it. If you want to debug an app on macOS, you either have to disable SIP, or build a copy of the binary that opts into debugging (the debug builds of most projects will allow debugging...) Anyway, lldb has no control over what it is and isn't allowed to attach to, that's a policy decision made by the OS, and quite deliberately placed outside the debugger's hands. So this isn't an lldb bug... |
Thx for reply!!! I downloaded the sourcecode from llvm.org and build the lldb. It still didn't work for me. And I forgot to reply you. thx again! |
Finding the reason why the attach is denied is a little annoying because of how Console filtering works. What you want to do is find the "task_for_pid" failure message from debugserver, then look at the other - non-debugserver logs from the same time, and in there will be some complaint about the binary. But the search field in Console is a filter not a search, so you have to remember where the interesting debugserver entry is, undo the filter, then find that entry again (I usually mark the time) and look around there. |
M1chip macOS 11.6
when I debug a jni project, I want to attach to this jni process.
·use
jps
to get the java pid.·lldb attach to this pid, and then I got this error.
I also get the lldb log from clion
(clion use the system default lldb. I get the same error both in clion and terminal using lldb)
if you need more info,plz tell me.
The text was updated successfully, but these errors were encountered: