Page 1 of 1

'Exclude From Build' options for build error debug

Posted: Thu May 08, 2025 5:24 pm
by Brendan
Quite often it can be somewhat frustrating getting to the bottom of build errors, whether they be embedded in macros, conflicts in var types, interrupts, etc.

It's certainly possible to copy the project to a new file, deleting macros and variables (etc) until a successful exploratory build points at the problem, though would be nice to be able to simply right-click macros and select 'Exclude from build', as though they weren't there (for build purposes) but remaining available for reinstatement within the project. Naturally, validation must still apply, in the same way that it would if attempting to delete macros and variables with existing dependencies for example.

I believe such feature might save a lot of time to debug some problem projects.

Just a thought - Don't ask me "why" :)

All the best,
Brendan

Re: 'Exclude From Build' options for build error debug

Posted: Thu May 08, 2025 5:50 pm
by Steve-Matrix
Thanks for the suggestion. I have added it to my list.

Re: 'Exclude From Build' options for build error debug

Posted: Fri May 09, 2025 1:57 am
by Brendan
Thank you Steve - Entirely appreciated.

Re: 'Exclude From Build' options for build error debug

Posted: Sun Jul 06, 2025 12:37 pm
by jay_dee
Any tool that helps with de-bugging are always great additions.

Re: 'Exclude From Build' options for build error debug

Posted: Sun Jul 06, 2025 1:50 pm
by mnfisher
In a way, you can mimic this using a global constant let's call DEBUG and then in each macro have a code block at the start with

Code: Select all

#ifdef DEBUG 
And sat the end of the macro

Code: Select all

#endif
The problem might be that the macro will call other macros - dsi knocking out one actually might mean a while chain of macros are not compiled.

I would also suggest looking at a form of 'test driven development' - test that each function compiles (and for the full TDD effect runs passing appropriate tests) before creating another test etc -there is a book called Test Driven Development for microcontrollers on this.

Making small macros (functions) with no side effects that perform a single function of key.

Martin