We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i am writing a AGDI Driver for the uVision Debugger base on apntex_173. my chip is using Cortex-M0, many functions (r/w registers, r/w memory, start/stop debug session, run, run to cursor line, step out of current function, breakpoint and so on) have realized. only one thing makes me confused, as follow: i compile a project and then debug it, when arrive a subroutine, F10 and F11(step and step over) do same thing, they both go into subrountine, F10 should execute step over but execute step into .
i track souce, when F10 and F11, they both go into AG_GoStep, parameters nCode is 2, nSteps always is 1(only execute a step), F10 should execute n step. Somebody can give me some advice?
Thans a lot!!!
> how can i depart step into and step over from the debugger does this for you, AG_GoStep() should be called several times.
That is: when i press F10, if current address is subroutine start address, keil will tell AGDI driver nCode = 3 let AGDI go to execute GoUtil(addr), addr is next address of whole subroutine. if current address is not subroutine start address, keil will tell AGDI driver nCode = 2, nSteps = 1 let it go to execute Step, is this right?
'Step Into' and 'Step Over' do the same except for function calls. There is also a difference if you select these commands from a source window or from the disassembly window. Let's start with the simple one:
'Step Into' executed in the disassembly window: Will always create one call to "AG_GoStep with nCode = 2 (AG_NSTEP) and nStep=1".
'Step Over' executed in the disassembly window: Will create one call to "AG_GoStep with nCode = 2 (AG_NSTEP) and nStep=1" for all instructions except CALLs. For CALLs, a breakpoint will be set after the CALL and then one "AG_GoStep with nCode = 3 (AG_GOTILADR)" will be executed.
'Step Into' executed in the C-source window: Will create one or more calls to "AG_GoStep with nCode = 2 (AG_NSTEP) and nStep=1" until the next C-source line is reached.
'Step Over' executed in the C-source window: Will create one or more calls to "AG_GoStep' until the next source line is reached. One C-source line is usually translated into many assembly instructions. As explained above, CALLs will be handled with a breakpoint and a AG_GOTILADR and all other instructions with a AG_NSTEP command. In your example, a 'printf("hello");' will create a few AG_NSTEP to load the function parameter and then one AG_GOTILADR.
You will only see a nStep value greater than 1 if you enter a command like "t 100" in the command window of the uVision debugger.
oh yeah, you did me a great favor
Hi, Thank you for giving us this information.
We still can not get the correct result, both F10 (Pstep) and F11 (Istep) always step into the functions, and did not set breakpoint.
For F10 and F11, It's OK to step the whole C source line, which calls "AG_GoStep(AG_NSTEP)" for serveral times internally. So Keil or upper layer dll(SARMCM3.DLL) must has the ability to know the PC address of next line.
It seems that it just can not understand the code of function call (such as BL, BX).
How Keil know if the code is a function call? Do we need to provide any information about it in ADGI driver?
Best regards,
xhchen at nuvoton.com