April 9, 2010 - 11:14pm
Guest |
I just try to use the simulator to debug a function I call at the early begining of my main (as a debug short cut).
I use the "Step Into" but the simulator does not enter this function.
Then I had a look at the disassembly and it is very strange as you can see in the following comparison between the listing file and disassembly windows results:
In the listing file: (I want to enter the InitIIR() function for debug):
int main(void); // prototype pour éviter le warning du compilo
int main()
{
0: e1a0c00d mov ip, sp
4: e92dd830 push {r4, r5, fp, ip, lr, pc}
8: e24cb004 sub fp, ip, #4 ; 0x4
c: e24dd028 sub sp, sp, #40 ; 0x28
D:\PLSM\tampo_boulot\session 12\Base_NG_ARM_V03\Logiciel\BaseArmNG_P03_V0103_Ride\Src/main.c:74
s16 Tamp16s; // pour test/debug des fonctions I2C
s8 Tamp8s; // pour Test/debug des fonctions I2C
// Court-Circuit debug simul
InitIIR();
10: e59f3bf8 ldr r3, [pc, #3064] ; c10
14: e12fff33 blx r3
D:\PLSM\tampo_boulot\session 12\Base_NG_ARM_V03\Logiciel\BaseArmNG_P03_V0103_Ride\Src/main.c:82
Where the simulator disassembles as:
InitIIR();
00005FD0 F83B9FE5 LDR R3,[PC,#+0xBF8]
00005FD4 33FF2FE1 MSRR(Mic) addr_CPSR(Mic)_fsxc, R3
The blx R3 just change to a CPSR mov ??
What is the wrong setting (I use a STR911FAM44 µC) ??
Thanks
|
Hi Jomed
May ask you if you could send a project reproducing this issue to support address of raisonance.
Usually such a problem can be related to a lot of points so with a project it should be easier to reproduce.
Regards
Matloub
I have sent a very simple example of project that shows the strange behavior.
Just debug it using the simulator and try to step into the AddFloats function. It does not, there is no branch instruction but the curious "MSRR(Mic) addr_CPSR(Mic)_fsxc, R3" instead.
If you have an idea?
Thanks,
Hi
We have received the project and we are going to have a look at the problem.
Matloub
Dear Matloub,
Did you get a chance to check this very simple project and find out what happend?
Sorry Jomed
I have received your project and seen the behavior you described above.
I am still waiting for some feedback about this question.
Regards
Matloub
Hi
I have received some feedback about the project you have sent to me.
The strange behavior that you are seeing seems to the fact that the function is inlined
Matloub
Dear Matloub,
Sorry but I do not understand what you mean by "inlined" function.
Can you be more specific?
Thanks in advance,
Joel
Sorry Joel
The feedback I received was not correct, it was assuming that the strange behavior would come from the fact
that the function was inlined (the code of the inline function is written directly written in the code of the function which calls the inline function).
But indeed the strange behavior comes from a bug when disassembling the code.
The bug is now corrected and I will get back to you as soon as I know how we would proceed
for providing a fix.
Regards
Matloub
Hi Joel
An update to what have been said previously: next release of RKit-ARM will fix this issue.
The release is planned next week if no problem is found during tests.
Regards,
Matloub
Dear Matloub,
Thanks for your stong support, I will wait for next release then.
Regards,
Joel