Bug in variable view?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Bug in variable view?

2,181 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Brinkand on Thu Mar 11 06:40:51 MST 2010
It seems like the variables in variable view do not get read out correctly.

The following code extract shows overlapping of bits:

volatile uint16_t i = 0 ;
volatile uint8_t check_state = 0x00;
volatile uint8_t check_state2 = 0x00;
check_state = 0x00;
while(1) {
        check_state2 = 0;
        LPC_TMR32B0->MR1 = check_state2;
        i++ ;
}
results in the following variable location (.map -file)
 .bss           0x10000024        0x4 ./src/main.o
                0x10000024                i
                0x10000026                check_state
                0x10000027                check_state2
And the variable view shows:
i:            0x129F
check_state: 0x12
checkstate:  0x12
If i is changed to uint32_t there is no readout problem. If all are 32bit no problem too.

Am I right that this is a bug? Otherwise I would like to know where I should have found the information to understand this and how to get the variable view correct. No optimization: O0.
0 项奖励
回复
12 回复数

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jappelino on Mon Mar 29 23:18:36 MST 2010
The bug is gone, thank you.

Of course I will take the opportunity to temporarely raise the viewers of my private project: http://jappelino.blogg.se
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Mar 29 04:07:53 MST 2010
Hi,

If you would like to contact us, using the contact form:
http://www.code-red-tech.com/contact.php

and mention this post, then we can make the beta release of the next version available to you, to confirm the the fix works for you.
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hfischer on Mon Mar 29 02:08:37 MST 2010
Hi,

thanks for quick answer :)
I'm looking forward to a 8bit debug able IDE :p

It's a really good and fast support, good team nice to use this forum and developing with your Software.
Thanks a lot.

Regards
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Mar 29 00:38:18 MST 2010
Hi,

This problem is fixed in the next release.
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hfischer on Sun Mar 28 23:07:10 MST 2010
Hi CodeRedSupport,

thanks for your fast answer, that you do have the same probleme. But my interest is the status of problemsearch :)
It is some stupid to use 32bit types to debug with the Debugger views, because the 8bit types are not displayed right.

I did not install the newest version of lpcxpresse, is it fixed in this version?

Best regards.
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Mar 22 08:19:47 MST 2010
Hi,

Thanks for your code snippet. We have run it and there does appear to be a display problem on the LPC1114 which we are now investigating.

Thanks
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hfischer on Mon Mar 22 01:50:41 MST 2010
Hi,

using the LPCXpresso with the LPC1114 I found a similar problem. Using a function with a uint8_t parameter which is given a value of static 1 oder static 0 the problem occurs.
Functioncall:
DeMod_Put_Bit(1);
Function:
void DeMod_Put_Bit(uint8_t u8_PutBit)
{

  if(u16_DeMod_Put_BitIndex >255)
    u16_DeMod_Put_BitIndex=0;

  if(u8_PutBit == 1)
  ...
}
So if i debug this function with the parameter set to 1, the memory view shows for u8_PutBit that its value is 0. But in the if condition it matches and steps into the true case of checking u8_PutBit==1.

In the watch expression view and in the variable view it shows 0. Trying to step to the raw memory view, by using "rclick-> view memory" displays an error: [SIZE=4]"Add Memory Monitor Failed. Expression 'u8_PutBit' evaluated to invalid address value."[/SIZE]
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Mon Mar 15 04:45:33 MST 2010
I've spent some more time looking at this, and unfortunately still can't replicate the problem.

[jappelino's example didn't really help me, as I don't have access to the hardware for it to run in a meaningful way].

I can quite easily get globals aligned in the same way that your globals are aligned (from your map file info), but unfortunately they display in the variables view without problem.

From your original post, it **looks** like the variable view is reading the values from the wrong position in the 32-bit word that contains all three variables.

But in order to progress with this, we really need a minimal example that replicates the problem.

Regards,

CodeRedSupport.
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jappelino on Fri Mar 12 06:41:57 MST 2010
I guess this problem is similar or equal to http://knowledgebase.nxp.com/showthread.php?t=65
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Fri Mar 12 05:47:58 MST 2010
Without a runable example, it is hard to say for sure what is going on here. However a bit more information may well help us to narrow things down.

If you could run your "problem code" and get to the point where it displays the "faulty data" in the variable view. Then highlight each variable in turn within the variable view. The debugger should then display the value of each individual variable at the bottom of the variable view (below where the variable are displayed in "column form" ).

Do the value you see at the bottom match the values in the column entries?

It would perhaps also be worth while displaying the memory locations storing these variables (which you can see in the map file) in a monitor in the Memory view.

Regards,

CodeRedSupport
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Brinkand on Thu Mar 11 08:38:02 MST 2010
Removing --gc-sections under Linker Miscellaneous moved the variables in memory space, but changed nothing in the variables view.

 .bss           0x10000028        0x4 ./src/main.o
                0x10000028                i
                0x1000002a                check_state
                0x1000002b                check_state2
Meanwhile I switched to 32bit variables. RAM is not critical yet.

I cannot tell whether the compiled code is wrong or it is just the debugger that shows information wrongly.
0 项奖励
回复

2,157 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Mar 11 07:03:29 MST 2010
Can you try removing the option --gc-sections from the link step of your build?

You might also like to take a look at the following posts...

  http://knowledgebase.nxp.com/showthread.php?t=143

Regards,

CodeRedSupport
0 项奖励
回复