Reputation: 2541
tried to run simple c++ applciation in Cloud9 online IDE. I'm newbie in remote gdb debugging ("remote - I don't mean real remote debug, but a using client/server debug , as I see there is actually local debugging but, anyway , I see runner configuration that uses gdbserver and gdb on the same host). I'm using c++ runner provided on the community forum, which has an only difference from default c++ runner that builds using makefile instead of direct g++ compilation. here it is:
{
"script": [
"set -e",
"cd /home/ubuntu/workspace/build",
"make",
"chmod 755 \"my_app\"",
"if [ \"$debug\" == true ]; then ",
"gdbserver --once :15470 \"my_app\" $args",
"else",
"my_app $args",
"fi"
],
"info": "Running Project",
"debugport": 15470,
"debugger": "gdb",
"executable": "my",
"maxdepth": 50,
"$debugDefaultState": false,
"env": {},
"selector": "^.*\\.(cpp|cc)$"
}
when I'm running this with enabled debug, I see this output:
Running Project
....
[100%] Built target my_app
Process my_app created; pid = 25969
Listening on port 15470
Remote debugging from host 127.0.0.1
My Test Application
description of my test applciation
usage:
my_app [task_name] [task_parameters ...]
Child exited with status 1
GDBserver exiting
so this is a default run of the app without parameters , which only shows a description . however it doesn't stop on any breakpoint. this is a primary issue and my question here
From the output above , for me, it is unclear - is gdb successfully connected to gdbserver or not? so the problem is in the connection between gdbserver and gdb ? or in IDE which didn't stop on the breakpoint? (I've set the breakpoints in a lot of places, including before/after description output and at start/end of main function)
Upvotes: 2
Views: 1504
Reputation: 2541
As suggested in comments, the problem was resolved by adding gcc flags to add debug info into the build, I mean
"/usr/bin/g++ -ggdb3
actually I was using C9 for a build and debug c++ project based on cmake . so it works , no problem but requires some effort to tune builders and runners. against each target in cmake manually. it's not so useful, but can be used
Upvotes: 1