NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Debugging with sudo not working whatever I tried

 
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users
View previous topic :: View next topic  
Author Message
dk1979



Joined: 31 Jan 2017
Posts: 6

PostPosted: Tue Jan 31, 2017 6:40 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Hi all,
I'm using Netbeans 8.2 under ubuntu 16.04 and gdb 7.11. I'm trying to debug a c++ app that need sudo to run. The thing I've tried are the following:
1) Use the script solution with #!/bin/bash sudo /usr/bin/gdb $* script loaded in debug command under tools->c++->debug command
2) I updated the gdp into 7.12.


Every time I get the following pop up message :

gdb has unexpectedly stopped with return 1

Does anyone has any idea how to solve it ?
Back to top
Paulo R. Panhoto
Posted via mailing list.





PostPosted: Tue Jan 31, 2017 10:19 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Don't sudo. Create a "remote location" root@localhost and set it for your project configuration.


It's a lot less trouble with the same result.


Or you can setcap on you executable so you don't need to be root.

On 31 Jan 2017 16:53, "dk1979" <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi all,
I'm using Netbeans 8.2 under ubuntu 16.04 and gdb 7.11. I'm trying to debug a c++ app that need sudo to run. The thing I've tried are the following:
1) Use the script solution with #!/bin/bash sudo /usr/bin/gdb $*  script loaded in debug command under tools->c++->debug command
2) I updated the gdp into 7.12.


Every time I get the following pop up message :

gdb has unexpectedly stopped with return 1

Does anyone has any idea how to solve it ?




Back to top
dk1979



Joined: 31 Jan 2017
Posts: 6

PostPosted: Tue Jan 31, 2017 10:31 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Hi Paulo and thanks for your quick response. However since I'm quite new in linux development where can I find more details regarding setcap ?
Back to top
Paulo R. Panhoto
Posted via mailing list.





PostPosted: Wed Feb 01, 2017 3:56 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Try googling setcap manpage

On 1 Feb 2017 05:14, "dk1979" <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi Paulo and thanks for your quick response. However since I'm quite new in linux development where can I find more details regarding setcap ?




Back to top
dk1979



Joined: 31 Jan 2017
Posts: 6

PostPosted: Thu Feb 02, 2017 6:09 am    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Hi again
I tried the command setcap cap_net_raw+ep myapp
at the distributable c++ file that was created by Netbeans when Debug mode was used. When I run the app I had no problem but when I tried to debug I again got the pop up message:
gdb has unexpectedly stopped with return 1
Regarding the second alternative which included the root@localhost I created a new topic because it didn't work either.
Perhaps this is a bug and since it's crucial for the development of my project if I can't get it work my only alternative left is to change IDE
Back to top
Paulo R. Panhoto
Posted via mailing list.





PostPosted: Thu Feb 02, 2017 12:54 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Did you remove the sudo gdb command?

On 2 Feb 2017 05:16, "dk1979" <address-removed ([email]address-removed[/email])> wrote:
Quote:
Hi again
I tried the command setcap cap_net_raw+ep  myapp
at the distributable c++ file that was created by Netbeans when Debug mode was used. When I run the app I had no problem but when I tried to debug I again got the pop up message:
gdb has unexpectedly stopped with return 1
Regarding the second alternative which included the root@localhost I created a new topic because it didn't work either.
Perhaps this is a bug and since it's crucial for the development of my project if I can't get it work my only alternative left is to change IDE




Back to top
dk1979



Joined: 31 Jan 2017
Posts: 6

PostPosted: Thu Feb 02, 2017 5:31 pm    Post subject: Debugging with sudo not working whatever I tried Reply with quote

Yes I removed it.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> C/C++ Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo