This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem about source level debugging

Hi,

We're writing an ADGI driver for cortex M0 now,
and have some problem about the source level debugging.
Sometime the debugger line can not locate on C source code correctly.

For example, we have two functions: int main() in Main.c

                int main()
                {
                        test();
                        return 0;
                }

and void test() in Test.c

If Test.c has not been opened by IDE, "Step Into" at test() will open the ASM window and will not open "Test.c" automatically.

If Test.c has already opened, "Step Into" at test() will go to the 1st line in test() correctly.

It seems just like a problem of source navigation. The Cortex-M0's application runs correctly and the data shown in memory window is correct.

What's the information that Keil needs for source level debugging?
Thanks for any advice!

Best regards,
Xhchen

Parents Reply Children
  • Sorry Tamir, I couldn't help myself...

    int main( )
    {
         test( );
         while( TRUE ); // infinite loop 
    }
    


    --Cpt. Vince Foster
    2nd Cannon Place
    Fort Marcy Park, VA

  • Hi, Tamirst,

    Function main() and test() are just used to explain the problem that we meet when developping the ADGI driver.

    If the debug line step into some function in another file and the file has not been opened in IDE, the debug line will not shows in C source window but in ASM window. We can meet the problem in any funcitons.

    In the AGDI driver, we can call the "pCbFunc()" to get the source file's name and current debug line by the following code:

    AG_SCOPE ac;
    ac.AddrIn = curPC; // Current PC
    pCbFunc (AG_CB_GETSCOPEINFO, (void *) &ac);
    printf("debug stopped in file %s, at line: %d\n", ac.szPath, ac.curLine);
    

    Is there a way to force Keil to open the C file with path ac.szPath in the AGDI driver?

    Best regards,
    xhchen