Hi,
I have a weird initialization order fiasco (at least it looks like that) that I wanted to solve using the Debugger. I’m new to that tool so when I pressed the “start” button, I got the following error:
I thought that’s a quick one as a “release” compile would give me smaller size but even with compiler optimization set to -Os (optimized for size) would still give me near 130% which is why I cannot debug
I assume I cannot reduce size more because the debugger just needs the symbols. Just a bit disappointing as for complex projects flash useage of >50% “release” mode will most likely kill any try for a debug session.
Are there other Ideas I could try? My UnitTests are fine and the Inspector also tells everything OK (well, apart from size…) Else, I’ll go down the long and painful road of printfs.
Yep, did that.
To track down the segfault I wanted to keep all objects/libs in place. But maybe it’s quicker to remove them one by one than going through the println hell.
I mean the bad way. As soon as I set my normal build environment to debug, it will produce ~50% larger builds.
When I set it back to release I’ll get the “normal” results
So what flash size do you have when you build it with release? Should be noticeably smaller due to the symbols not being built. I’m slowly starting to think that this is the way it is, and will start manual debugging tomorrow. Thanks for your extremely quick and engaged help!
I must make a mistake here. Does it really build in [env:debug] when I hit the button?
It somehow builds without optimizations. Will look into that tomorrow, your post shows there must be a solution for this.
Found it!
Both “Inspect” and “Debug” options by default DO NOT use [env:debug] but instead use the normal release environment, for me in this environment this is [env:nanoatmega328] so when I add the debug build flags while keeping the build_type = release like this
Then the result is both a working inspection without [checkprogsize] error AND a working debugger on simavr!
Only remaining open question: why does [env:debug] neither affect Debug nor Inspect by default and how do I change that?
I don’t think PlatformIO is lookking for special environment names. Debugging might take the first available environment, so make sure it’s placed first or use default_envs.
Yeah, assumptions might turn out wrong in the end Thanks for your help with this!
Anyways, how can I link an application like Debug or Inspect to a custom [env:xxx] ?