Open sbailliez opened 7 months ago
I agree with (1) and already added the property to the exception. (4) should come implicit with that as Byte Buddy controls the output within the Attacher
main method. I do however not want to offer (2) and (3) for security reasons, this can be debugged differently, I think. When knowing the code, a user can explicitly log the passed statements in a more secure manner, for example. byte-buddy-agent is small enough so that everybody should be able to click through.
It might be useful to have some better diagnostic features to help troubleshoot the agent misbehaving during the attachment process.
net.bytebuddy.agent.attacher.dump
and if the agent fails, provide some recommendations to use it if it is not enabled already.Additional idea to consider, when debugging an agent issue with mockito, I found that the openjdk jvm checks that the
.attach_pid<pid>
file created has the same uid that the current user and does not attach if they are different, it would be nice to provide a check to help guide the user when such case is detected and make this part of bytebuddy. See https://github.com/mockito/mockito/issues/2436#issuecomment-1966473650 for more details.