NetBeans Forums

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

Remote debugging with source code on different machine

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



Joined: 07 Feb 2017
Posts: 6

PostPosted: Wed Feb 15, 2017 5:48 pm    Post subject: Remote debugging with source code on different machine Reply with quote

Here is a simple sample that I used (from another thread) and it actually works.

- Local platform is Windows 7 with NetBeans 8.2 and just apply latest patches.
- Remote host is Linux and the following was created

#include <stdio.h>
#include <unistd.h>

int main(int argc, char** argv) {
for (int i = 0; i < 100; i++) {
printf("%d\n", i);
sleep(1);
}
return 0;
}

- Built the file with debug and executed it.
> g++ -g -o test test.cpp
> ./test

- On Windows In NetBeans I pressed Debug|Attach Debugger
- Selected "Gdb Debugger", "user1@host", "./test" process and "<no project>" filter
- Pressed OK button
This successfully attaches to the process and the IDE opens "test.cpp"file in Full Remote mode.


Now, if the executable is moved to Linux Machine #2, I am still able to attach, but there is no associated source so the Disassembly tab appears.

Is it possible to debug a process on Linux Machine 2 while the source is on Linux Machine 1?
I am hoping this is possible without having to configure any shared/mapped drive between the 2 servers as that won't always be possible.
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