possible compiler debugger proble?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

possible compiler debugger proble?

352 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Wed Apr 07 13:19:52 MST 2010
I have been running the  debugger with v3.3.2 and it had this peculiar problem where a program runs ok but when I stop and single step (over) the code, some 3-4 instructions on the screen are totally  unrelated to the code that is actually being executed. It would eventually fall back into sync  and start displaying the correct code for awhile and then act up again.

In the hope that the new v3.3.3 fixed this, I installed this new version and tried it and now it is much worse. Any ideas are welcome.
0 Kudos
10 Replies

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Thu Apr 08 13:39:12 MST 2010
For now I got everything to work and want to finish something before I do any experimenting. To get it to work, I created 2 new files (.c, .h) from my app in the blinky folder and did a call to my main routine (renamed) from the blinky program. This seem to displease blinky a lot less and everything worked. Also, I didn't change the name because I think this is also part of the problem.  I will let you know what happens in a few days. Thanks for your help.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Apr 08 11:06:09 MST 2010
For restart to work, you have to click on one of the entries in the stack trace of the Debug View e.g. One of the entries under MCU GDB Debugger

However, you still haven't told us how to reproduce the problem you  initially reported.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Thu Apr 08 10:43:46 MST 2010
I totally deleted the blinky program (including from disk) and reimported the example. It does build ok and runs ok and stops and starts ok but the restart is not enabled and does not work.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Apr 08 09:37:22 MST 2010
Hi,

I am sorry you are having these problems. Can you send us an example so that we can reproduce the problem here. This is the first time we have heard of a problem with single stepping with Debug builds, so if you can help us to reproduce the problem, we can try to resolve your problems.

I suggest that you start from one of the example projects and modify it until you reproduce the problem. Alternatively, contact us using the contact form (http://www.code-red-tech.com/contact.php) and send us your project directly.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Thu Apr 08 09:33:16 MST 2010
I got my program to run again by completely re-installing v 3.3.3 and I can see on the scope it is running properly in debug. I can suspend and restart it but the single step is  still not in sync with the actual code. The optimizing is at -0O. Also the restart button no longer works and is not enabled for some reason.

I appreciate your help and have been trying to use the help menu to solve these problems but that hasn't worked out well. For instance, there are so many icons and toolbars that I tried to simplify it some. Under tips and tricks it says I can go to Windom>Customize Prespective but there isn't such a window on my system.

Anyway, I am close to functioning but without being able to single step it isn't workable.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 07 23:38:51 MST 2010
That is not an error.

Can you please post an example that we can use to reproduce the problem you are experiencing.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Wed Apr 07 19:19:09 MST 2010
After testing many options, the blinky program and my program will no longer build. I get the following error message:

o symbol "new" in current context.
set remotetimeout 60000
set mem inaccessible-by-default off
mon ondisconnect nochange
mi_cmd_var_create: unable to create variable object
mi_cmd_var_create: unable to create variable object
Note: automatically using hardware breakpoints for read-only addresses.

Help. Things are going in the wrong direction.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Wed Apr 07 15:29:34 MST 2010
disregard that comment about the length. I had a while(1) on line 10 for testing purposes.
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mayotte1 on Wed Apr 07 14:56:11 MST 2010
Both of them are set to -0o. Now when I went back to the old version, which I kept intact, it also will no longer single step properly.

The first  4 functions exectued in program are identical to the first 4 from the blinky program. The blinky program single steps ok but the very first instruction in my program won't single step properly.

On thing that does seem odd to me is blinky builds with a text length of 2228 and my program builds with a length of 2728. But my program is 1213 lines long where the blinky program is just 54 lines long.. Maybe the compiler is just real efficient?
0 Kudos

344 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Wed Apr 07 13:31:22 MST 2010
What optimisation level are you building for? The behaviour that you are seeing sounds like you are building at -O1 or higher.

At -O0, one or more machine instructions can effectively be mapped onto a specific source statement. However as the level of optimization carried out by the compiler increases, the mapping between source code and the generated machine instructions becomes much more complex. For example, this may lead to instructions originally generated from a number of source lines being merged or reordered.

This can lead to seemingly strange behaviour when debugging, particularly when looking at both the source and disassembly. There is more information on this at:

http://lpcxpresso.code-red-tech.com/LPCXpresso/node/26

Regards,
CodeRedSupport
0 Kudos