<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Determining when DEBUG is in effect</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/17116/determining-when-debug-is-in-effect</link><description> Does anyone know how to test that the &amp;quot;DEBUG&amp;quot; compiler option (active when &amp;quot;Debug Information&amp;quot; is checked on the Target Options Output tab) is enabled? I would like a simple test such as #ifdef DEBUG but this does not work of course. 
 
Thanks. </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Determining when DEBUG is in effect</title><link>https://community.arm.com/thread/86641?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2004 08:27:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4d949e16-206f-448e-9c6d-b88b13ee3030</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;I have found so many things I need done that uVision can not do (file replacement/renaming - debug mode - many builds from same group of files) so I have reverted to commandline operation.  I do this by regular .bat files and if if you want to know how, let me know.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining when DEBUG is in effect</title><link>https://community.arm.com/thread/72223?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2004 16:59:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7f95a621-e32e-4c68-bcc7-3bc87fdc1d15</guid><dc:creator>Barry Shonbeck</dc:creator><description>&lt;p&gt;This is exactly what I meant and need.  I have numerous #ifdef&amp;#39;s in the code allowing it to be built for multiple flavors of the same machine.  Based on an ID being defined, I place an identifying letter on the end of a part number string to show all the options it was compiled with while it is in development.  This allows a double check to make sure a piece of code being tested is designed for the machine in question.&lt;br /&gt;
&lt;br /&gt;
When &amp;quot;Debug Information&amp;quot; is selected, is there anything that I can do an #ifdef on to determine that the debug code is compiled in (source file names, line numbers, etc)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining when DEBUG is in effect</title><link>https://community.arm.com/thread/41566?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2004 16:19:54 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1d47f4d3-49fb-4cbf-add5-bec671eeb70c</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;Could you turn the problem around?&lt;br /&gt;
&lt;br /&gt;
Instead of enabling the compiler debug info in the uVision options, you define (or not) a preprocessor symbol, and then use that in your source files to determine whether or not to enable debug features; &lt;i&gt;eg,&lt;/i&gt;&lt;pre&gt;#ifdef DEBUG_MODE
&lt;b&gt;#pragma db&lt;/b&gt;
//Debug mode - TRACE causes printf output
#include &amp;lt;stdio.h&amp;gt;
#define TRACE(params) printf params;
#else
//Release mode - TRACE expands to nothing!
#define TRACE(params)
#endif&lt;/pre&gt;
&lt;br /&gt;
See this thread for a discussion of TRACE-type macros:&lt;br /&gt;
&lt;a href="http://www.keil.com/forum/docs/thread3796.asp"&gt;http://www.keil.com/forum/docs/thread3796.asp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Determining when DEBUG is in effect</title><link>https://community.arm.com/thread/41556?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2004 16:10:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fb5c18ea-d619-4e53-97f8-9067ed4e95ed</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;how to test that the &amp;#39;DEBUG&amp;#39; compiler option ... is enabled?.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
See my &amp;quot;digression&amp;quot; (Posted 10/31/02 8:01:43) in this thread:&lt;br /&gt;
&lt;a href="http://www.keil.com/forum/docs/thread1940.asp"&gt;http://www.keil.com/forum/docs/thread1940.asp&lt;/a&gt;&lt;br /&gt;
- This is another one to add to the list!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>