Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native: compile with -g, "make term" runs through gdb #5160

Merged
merged 2 commits into from
Mar 23, 2016

Conversation

kaspar030
Copy link
Contributor

Trying to debug #5040...

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: native Platform: This PR/issue effects the native platform labels Mar 23, 2016
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 23, 2016
@kaspar030
Copy link
Contributor Author

Let's see if this shows a backtrace in Murdock ...

@cgundogan
Copy link
Member

I am full of excitement

@cgundogan
Copy link
Member

Terminal program gdb -ex r -ex bt -batch /data/riotbuild/tests/unittests/bin/native/unittests.elf not found. Aborting.

@kaspar030
Copy link
Contributor Author

No gdb in the riot docker images?

@cgundogan
Copy link
Member

No gdb in the riot docker images?

ah yes, I had to install gdb manually yesterday, too when I was testing out docker

@kaspar030
Copy link
Contributor Author

I'll add it to the murdock image...

@kaspar030 kaspar030 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 23, 2016
@OlegHahm
Copy link
Member

Program received signal SIGSEGV, Segmentation fault.
0x0804baaf in main () at main.c:40
40 while(1) *fail++ = '\0';
#0 0x0804baaf in main () at main.c:40

looks "good" 👍

@kaspar030
Copy link
Contributor Author

Ok, I'll drop the fail commit.

@kaspar030 kaspar030 force-pushed the native_make_term_through_gdb branch from 3dc4028 to 8163fee Compare March 23, 2016 22:28
@cgundogan
Copy link
Member

hmm .. not sure if we should opt for running gdb as TERMPROG default.. Isn't this why we have the targets all-debug and debug on native?

@kaspar030
Copy link
Contributor Author

Hm. I see your point.
Does it hurt?

@kaspar030
Copy link
Contributor Author

"all-debug" builds with debug symbols, so indeed, that would be redundant.
"debug" starts a full debugging session. This PR uses gdb's "-batch" mode, which is exactly for the purpose of getting backtraces, without launching a full interactive session.

IMHO, for native, performance didn't really matter in the past (as we're building without any optimization), and so always adding the debug symbols will probably make life easier for us devs.

@cgundogan
Copy link
Member

well .. for now this will break our riot docker image, because we have no gdb installed there by default. I agree with you that this will not hurt anything on native, so I will probably ACK because of the usefulness that we win from this. An alternative would be to use the gdb command in the test scripts instead of using make term/test What do you think about that?

@kaspar030
Copy link
Contributor Author

An alternative would be to use the gdb command in the test scripts instead of using make term/test What do you think about that?

Yes, or better, just set the term line for our static tests. I'll update.

@cgundogan
Copy link
Member

Yes, or better, just set the term line for our static tests. I'll update.

ah right 👍

@kaspar030 kaspar030 force-pushed the native_make_term_through_gdb branch from 8163fee to 7a18922 Compare March 23, 2016 23:02
@kaspar030
Copy link
Contributor Author

Works perfectly. Should we merge, so we can see what's wrong in #5040? ;)

@OlegHahm
Copy link
Member

Let's go!

@OlegHahm OlegHahm merged commit 4ae8980 into RIOT-OS:master Mar 23, 2016
@kaspar030 kaspar030 deleted the native_make_term_through_gdb branch March 23, 2016 23:20
@kaspar030
Copy link
Contributor Author

dockerfile PR: RIOT-OS/riotdocker#20

@Yonezawa-T2
Copy link
Contributor

I got the following message from Travis:

 Terminal program gdb -batch -ex r -ex bt /home/travis/build/RIOT-OS/RIOT/tests/unittests/bin/native/unittests.elf not found. Aborting.

https://travis-ci.org/RIOT-OS/RIOT/jobs/118144712

The message is also generated from CI of this PR.
https://travis-ci.org/RIOT-OS/RIOT/jobs/118095472

Is the message relate to this PR? Is Travis deprecated in favor of RIOT CI?

@kaspar030 kaspar030 mentioned this pull request Mar 24, 2016
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants