开发者

netbeans 6.91 and gdb - attaching to a process run by another user

开发者 https://www.devze.com 2023-02-09 08:23 出处:网络
I am trying to debug a program run as another user, using Netbeans. I can do this manually at the command line, by running sudo gdm and then attaching to the pid.

I am trying to debug a program run as another user, using Netbeans. I can do this manually at the command line, by running sudo gdm and then attaching to the pid.

However, I would like to make use of the Netbeans GUI for easier/quicker/visual debugging. When I select the pid from the list of running processes, I get the error:

GDB failed to attach to process

When I attempt to attach manually (i.e. by开发者_开发问答 running gdb at the command line - without sudo), I get an 'Operation not permitted', so I know Netneans is failing to attach because of permissioning.

Does anyone know how I can attach to processes being run by another user?.

BTW I am running all this on my dev machine at home (Ubuntu), so security is not an issue.


Have you tried running netbeans as the target user?

You can do "sudo -u username netbeans" With that, you shouldnt have a problem attaching to the process. If the target user is in another computer, I would suggest ssh with X forwarding (ssh -X user@machine).

Actually, if the target (local) user has no password set, you can try changing your gdb command to "sudo -u username gdb" to start the debugger as that user.

0

精彩评论

暂无评论...
验证码 换一张
取 消