Skip to content

Add '-g3' flag to gcc debug flags #3295

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

Merged
merged 1 commit into from
Nov 22, 2016
Merged

Add '-g3' flag to gcc debug flags #3295

merged 1 commit into from
Nov 22, 2016

Conversation

geky
Copy link
Contributor

@geky geky commented Nov 18, 2016

This is a gcc specific flag that increases debug information, most useful is allowing the expansion of macros.

http://stackoverflow.com/questions/10475040/gcc-g-vs-g3-gdb-flag-what-is-the-difference/10475077#10475077

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

cc @theotherjimmy, @c1728p9

Includes extra information, such as all the macro definitions present
in the program
@@ -5,7 +5,7 @@
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
"-ffunction-sections", "-fdata-sections", "-funsigned-char",
"-MMD", "-fno-delete-null-pointer-checks",
"-fomit-frame-pointer", "-O0", "-g"],
"-fomit-frame-pointer", "-O0", "-g3"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this change set smaller?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

: I

@c1728p9
Copy link
Contributor

c1728p9 commented Nov 18, 2016

Looks good to me. What kind of an effect does this have on build time and elf size?

@geky
Copy link
Contributor Author

geky commented Nov 18, 2016

Quick measurements with time mbed compile --profile debug and just ls -lh for size:

size time
g 624K 14.851s
g3 1.3M 24.373s

@bridadan
Copy link
Contributor

CI doesn't hit this profile, so shouldn't need to run the bots on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants