0

I managed to set up remote development on RPi with Netbeans 8.0.2 over direct connection to my laptop. my simple program compiled, run and debugged.

#include <iostream>
using namespace std;

int main() {
    cout<<"hello Raspberry Pi";
    int e=8;//to see something in variables view
    return 0;
}

I was satisfied with the result, but default RPi compiler is quite old (version 4.6.3) and does not support C++ 11, so I upgraded gcc and g++ to 4.8.2 and changed the links in /usr/bin. That solved the problem with -std=c++11 not being recognized.

But then another problem arose: while it the code still compiles and runs normally, it can no more be properly debugged: stepping through the code does not work, the debugger goes to disassembly instead, the breakpoint is ignored and the variables view is empty. May be I need to upgrade anything else? here is output of Netbeans build

Copying project files to /home/netbeans/.netbeans/remote/192.1.2.200/andrey-laptop-Windows-x86_64 at netbeans@192.1.2.200
Building project files list...
Checking directory structure...
Checking previously uploaded files...
Checking links...
Uploading changed files:
    Zipping 1 changed files...
    Uploading zip to netbeans@192.1.2.200...
    Unzipping changed files...
Checking exec permissions...
Uploading changed files finished successfully.

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/netbeans/.netbeans/remote/192.1.2.200/andrey-laptop-Windows-x86_64/C/Doc/NetBeansProjects/HelloRPi'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/hellorpi
make[2]: Entering directory '/home/netbeans/.netbeans/remote/192.1.2.200/andrey-laptop-Windows-x86_64/C/Doc/NetBeansProjects/HelloRPi'
mkdir -p build/Debug/GNU-Linux-x86
rm -f "build/Debug/GNU-Linux-x86/main.o.d"
g++    -c -MMD -MP -MF "build/Debug/GNU-Linux-x86/main.o.d" -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/hellorpi build/Debug/GNU-Linux-x86/main.o 
make[2]: Leaving directory '/home/netbeans/.netbeans/remote/192.1.2.200/andrey-laptop-Windows-x86_64/C/Doc/NetBeansProjects/HelloRPi'
make[1]: Leaving directory '/home/netbeans/.netbeans/remote/192.1.2.200/andrey-laptop-Windows-x86_64/C/Doc/NetBeansProjects/HelloRPi'

BUILD SUCCESSFUL (total time: 2s)
Jacobm001
  • 11,904
  • 7
  • 47
  • 58
Andrey Pro
  • 278
  • 1
  • 2
  • 8

1 Answers1

0

You should compile a compiler by hand with CFLAGS "-g -ggdb" and compile the GDB itself too, use last versions. I've faced same problem in different circumstances, but IDE restored it's normal debugging abilities after a recompile cycle I've mentioned upstrings. And - when you're replacing something in Debian systems - make SURE that you're using update-alternatives script, not just simple replacement

Alexey Vesnin
  • 926
  • 10
  • 17