<?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>Using Simulator printf(&amp;quot;%s&amp;quot;)</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14051/using-simulator-printf-s</link><description> Can anyone tell me how to print the value of a source code string in the simulator? I am trying to use the simulator printf() function in a breakpoint assignment as follows: 
 bs \assertions\assert\81, 1, &amp;quot;printf(\&amp;quot;%s.\&amp;quot;,\\assertions\\assert\\debugstr</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Using Simulator printf("%s")</title><link>https://community.arm.com/thread/37371?ContentTypeID=1</link><pubDate>Wed, 28 Mar 2001 11:45:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:27821e4c-17e8-435c-a5d9-95fc5d998632</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;Type the following in the comand window:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
d debugStr, &amp;amp;(((debugStr)) [sizeof(debugStr)-1])
&lt;/pre&gt;
&lt;br /&gt;
This should display the string.  If it does, then change your breakpoint to:&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;
bs \assertions\assert\81, 1, &amp;quot;d debugStr, &amp;amp;(((debugStr)) [sizeof(debugStr)-1])&amp;quot;
&lt;/pre&gt;
&lt;br /&gt;
I&amp;#39;m pretty sure this will work.  You may need to use the EXEC debugger function, but I don&amp;#39;t think so.&lt;br /&gt;
&lt;br /&gt;
The reason that the printf Debugger Function doesn&amp;#39;t work is because its arguments must be Debugger Variables and not variables in your program.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;br /&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>