<?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>Cant modify locals</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/22864/cant-modify-locals</link><description> 
Hi, whilst debugging code running on my XC161board i cant seem to
modify the locals in the watch window. Does anyone know why this
is? 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/113363?ContentTypeID=1</link><pubDate>Thu, 08 Nov 2007 08:24:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:17cf0674-054f-40ce-95d8-a8b4b765d859</guid><dc:creator>Georget Stephane</dc:creator><description>&lt;p&gt;&lt;p&gt;
I too have seen strange things happen sometimes, especially when
remote target debugging on several targets at the same time. Food for
thought:&lt;/p&gt;

&lt;p&gt;
- if the variable is a register, than for sure you can change it.
You can even change the register itself in the registers window.&lt;/p&gt;

&lt;p&gt;
- how would you know if it is a register by the way? Don&amp;#39;t be
affraid to open the disassembly window and look at the assembly code.
It won&amp;#39;t hurt, and you will get a better idea if something was
optimized away.&lt;/p&gt;

&lt;p&gt;
- try again with a clean build:&lt;/p&gt;

&lt;p&gt;
- close all IDEs (if you had several open at the same time)&lt;/p&gt;

&lt;p&gt;
- make a backup of your project&lt;/p&gt;

&lt;p&gt;
- delete all these files: *._ii, *.obj, *.i, *.lst, *.__i,
*.ic&lt;/p&gt;

&lt;p&gt;
- open the project (only one instance of the IDE)&lt;/p&gt;

&lt;p&gt;
- in the compiler options, use the optimization up to 7 (common
tail merging) but not above&lt;/p&gt;

&lt;p&gt;
- build&lt;/p&gt;

&lt;p&gt;
- try to debug again&lt;/p&gt;

&lt;p&gt;
Good luck...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/141887?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 06:13:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:045452db-6a4c-41d1-8a8e-73c0b37882dc</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
... is trying to view/change them when they are not in scope.&lt;/p&gt;

&lt;p&gt;
It happens to me about once a year that I goof in this way.&lt;/p&gt;

&lt;p&gt;
A &lt;b&gt;really smart&lt;/b&gt; debugger would grey out locals and remove
the value in the watch window when they are not in scope. Have not
seen that in any debugger, but it would be a nice feature.&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/138598?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 05:51:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b2693f04-815c-46bc-b870-89bfe4828647</guid><dc:creator>Keil Software Support Intl.</dc:creator><description>&lt;p&gt;&lt;p&gt;
The debugger can modify local variables that are in registers.&lt;/p&gt;

&lt;p&gt;
Example:&lt;br /&gt;
MEASURE.C function main () int i;&lt;/p&gt;

&lt;p&gt;
This variable is register R13 and can be modified.&lt;/p&gt;

&lt;p&gt;
So it must be a special case.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/135198?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 05:11:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5dcc90a5-6560-4770-b9b7-4a7ed0b141dc</guid><dc:creator>Chris Wunderlich</dc:creator><description>&lt;p&gt;&lt;p&gt;
If you are having a problem to debug your program because the
locals (being in/out of scope) then go ahead and make them global
(declare them with file scope and as volatile) until you are sure
this is not your problem.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/150239?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 02:59:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:758c0a53-d3fa-44d1-a678-322acef8fccc</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;result is that the variable goes out of scope for the
debugger, even if you still are within the block scope of the source
code.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
That&amp;#39;s true, although a truly &lt;i&gt;&lt;b&gt;integrated&lt;/b&gt;&lt;/i&gt; debugger
worthy of the name should be able to cope with it.&lt;/p&gt;

&lt;p&gt;
The trouble really is that the debugger technology (certainly
within uVision) really is a long way behind the compiler technology -
especially when it comes to oprimisation.&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;:-(&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/149798?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 01:54:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7e478349-c3f4-47dd-92c7-17fa2c592882</guid><dc:creator>Per Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
It depends a bit.&lt;/p&gt;

&lt;p&gt;
All real debuggers should support edit of variables even if stored
in registers.&lt;/p&gt;

&lt;p&gt;
The problem comes when the variable is only used in some part of a
function. The compiler may then reuse the register for a different
variable in other parts of the function. The result is that the
variable goes out of scope for the debugger, even if you still are
within the block scope of the source code.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/149301?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 01:47:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c234db26-5309-4edb-935d-7a31d8891d73</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
This is a very valid question!&lt;/p&gt;

&lt;p&gt;
The whole point of an &lt;b&gt;I&lt;/b&gt;DE is that it&amp;#39;s supposed to be
&lt;i&gt;&lt;b&gt;Integrated&lt;/b&gt;&lt;/i&gt; - that&amp;#39;s what the &amp;#39;I&amp;#39; stands for, isn&amp;#39;t
it?&lt;/p&gt;

&lt;p&gt;
[rant]&lt;br /&gt;
How can this be called &amp;quot;Integrated&amp;quot; if the &lt;b&gt;Keil&lt;/b&gt; debugger can&amp;#39;t
even understand such basic optimisations as this done by the
&lt;b&gt;Keil&lt;/b&gt; compiler?!&lt;/p&gt;

&lt;p&gt;
This is not some fancy new and revolutionary optimisation
technique; compilers - including Keil compilers - have been doing it
for years!&lt;br /&gt;
Is the state of debugger technology really this far behind?!&lt;br /&gt;
[/rant]&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/148858?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 01:40:58 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3f26e8e9-6df6-46a8-b2df-44601f37d381</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;what make them decide to be in registers?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
It&amp;#39;s the compiler that decides.&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;&amp;quot;can i change this behaviour?&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You might be able to change it via the compiler&amp;#39;s
&lt;b&gt;Optimisation&lt;/b&gt; settings - see the &lt;b&gt;Manual&lt;/b&gt; for
details...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/124208?ContentTypeID=1</link><pubDate>Tue, 06 Nov 2007 01:02:59 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:90fa6914-0553-4d44-892a-f33875d1f0e4</guid><dc:creator>John Marchant Information Systems</dc:creator><description>&lt;p&gt;&lt;p&gt;
Sorry, im really new to this, so if they are in registers you cant
modify them in the watch window? what make them decide to be in
registers? I noticed that i could modify some locals but not most at
one point, so why when i stop execution in a function was some
editable and some not? and can i change this behaviour?&lt;br /&gt;
Thanks,&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/113362?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2007 08:41:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cbe621af-c129-4d8a-8470-bd8bc977f771</guid><dc:creator>Per Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Why would they be? Because they are locals, and the compiler want
to use registers for locals since most processors and processor
instructions works best on registers.&lt;/p&gt;

&lt;p&gt;
Registers have much better bandwidth than memory cells.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/99895?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2007 08:16:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:27ec0f5f-62b9-425d-b4a1-81799c69a60d</guid><dc:creator>John Marchant Information Systems</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi, yes they are in scope, they are displayed in the local window
with values when stop executing, but if i change them, they dont
accept the change, using F2 in watch window to change.&lt;br /&gt;
I dont know if they are register? how would you know and why would
they be?&lt;/p&gt;

&lt;p&gt;
Cheers.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/88658?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2007 06:34:17 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ee2ae025-b6d7-4893-9110-50f7a1fbbc3c</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are the local in-scope when you try to modify them?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cant modify locals</title><link>https://community.arm.com/thread/51259?ContentTypeID=1</link><pubDate>Mon, 05 Nov 2007 05:54:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f1b2a91c-f4fc-4761-9e0d-745a9962c25e</guid><dc:creator>Chris Wunderlich</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are you in run mode or stopped when trying to modify the
locals?&lt;/p&gt;

&lt;p&gt;
Is the local allocated to a register?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>