[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Date: Sun, 2 Mar 2008 19:38:29 +0200
- From: leonp at plris.com (Leon Pollak)
- Subject: gdb stepping
As the question may be a bit off-topic, I ask your pardon ahead.
But it seems tome that this may be interesting to many embedded programmers.
Anyway, I am using the BDI2000 device for COP interface to the target and it
has additional option to see what is happening via the telnet interface.
Using this interface I noticed the following:
The simplest operator IdleTaskCycles++ is translated by compiler into 5
assembler comands (with -O0):
0x0002b4cc _Thread_Idle_body+24 lis r9,15
0x0002b4d0 _Thread_Idle_body+28 lwz r9,-15912(r9)
0x0002b4d4 _Thread_Idle_body+32 addi r0,r9,1
0x0002b4d8 _Thread_Idle_body+36 lis r9,15
0x0002b4dc _Thread_Idle_body+40 stw r0,-15912(r9)
OK. Now, when, standing on this line (IdleTaskCycles++) I ask the gdp to
do "next" command, it does it as required, but the BDI shows me that it has
done 5 step commands!
The same is with "step" command, which seems obvious.
OK, now I put a break point on the next line - one start and one stop, and the
result much faster.
Assuming that most of us work with some kind of remote connection, you
understand that this takes 5 times slower to do a step!
What is the catch here? Why do the gdb uses such a strange technique?
- gdb stepping
- From: alexandre.constantino at edisoft.pt (Alexandre Constantino)