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: use -g3 instead of -g #10877

Merged
merged 1 commit into from
Mar 26, 2019
Merged

native: use -g3 instead of -g #10877

merged 1 commit into from
Mar 26, 2019

Conversation

miri64
Copy link
Member

@miri64 miri64 commented Jan 26, 2019

Contribution description

I use CFLAGS=-g3 for years and it is far more useful than the provided -g in most of our native-specific targets. I finally got fed up with it enough to try to change it ;-).

Testing procedure

The affected targets should still be able to compile an application:

  • all-valgrind
  • all-debug
  • all-cachegrind
  • all-asan

The application should still be running without any problems.

Issues/PRs references

#4413 I guess, but this only focuses on native

@miri64 miri64 added Platform: native Platform: This PR/issue effects the native platform Area: build system Area: Build system Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … labels Jan 26, 2019
@miri64 miri64 added this to the Release 2019.04 milestone Jan 26, 2019
@miri64 miri64 requested a review from cladmi January 26, 2019 12:39
@jnohlgard
Copy link
Member

This usually increases the size of the debug symbols significantly, but on the other hand we already use it on arm since a long time ago. The major difference is that all preprocessor macros are included in the debug table.

@miri64
Copy link
Member Author

miri64 commented Jan 27, 2019

This usually increases the size of the debug symbols significantly, but on the other hand we already use it on arm since a long time ago.

I think size isn't really an issue on native ;-).

@miri64
Copy link
Member Author

miri64 commented Jan 27, 2019

(especially since we don't compile with debug symbols per default [edit: with native], so it won't affect e.g. disk space on CI)

@miri64 miri64 added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Jan 27, 2019
@jnohlgard
Copy link
Member

👍 I was mostly thinking of the CI disk usage.

@miri64
Copy link
Member Author

miri64 commented Mar 26, 2019

Rebased to current master.

@cladmi
Copy link
Contributor

cladmi commented Mar 26, 2019

I used test/shell to run the test.

I could run without problem

  • all-debug term
  • all-cachegrind term-cachegrind

I did not test the new debug output as I do not really know how to do it.

I cannot compile all-asan on my machine it gives undefined qdecs_value in both master and this PR. And all-valgrind term-valgrind fails from missing libc6-dbg but I do not know which version I am supposed to install. But it can run with term.

The issue with the size is not important here.

@cladmi
Copy link
Contributor

cladmi commented Mar 26, 2019

From man gcc:

Level 3 includes extra information, such as all the macro definitions present in the program.  Some debuggers support macro expansion when you use -g3.

So it make sense to enable it for native.

@cladmi cladmi added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 26, 2019
Copy link
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If somebody finds any issue with this in the future, it could be changed back but it makes sense to help debugging.

@miri64 miri64 merged commit 231bd1c into RIOT-OS:master Mar 26, 2019
@miri64
Copy link
Member Author

miri64 commented Mar 26, 2019

Thanks @cladmi

@miri64 miri64 deleted the native/enh/g3 branch March 26, 2019 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system Area: toolchain Area: toolchains; everything related to compilation, libc, linking, … 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.

3 participants