Tracing through multiple source files

My team and I are working on a project programming about 40 different units that all use the same serial communication protocol. I'm currently using uVision3, but we have purchased uVision4, and it should be installed soon. I have written a header (.h) file to list function headers, global variables and constants, and #define statements. The header file then includes an implementation (.c) file for the function implementations.

The files are located in a general "include" folder on the network so that we can all access them. In each project file (one for each unit) we list the network folder in the C51 include directories, and everything compiles, links, and runs wonderfully.

The problem I'm having is that it appears that breakpoints in the implementation file don't work. What I found interesting is that if I place a breakpoint on the corresponding line in the main source file, the program will break in the implementation file at that line. Similarly, if I break execution and step into functions that are in the implementation file, the trace indicator (yellow arrow) will go to the correct line, but stay in the main source file rather than moving to the implementation file.

Is there a way to get uVision to trace into the implementation file?

Example:

Main.c

#include <header.h>

void main(void)
{
    ...
    foo();
    ...
}

header.h

#ifndef _HEADER_H
#define _HEADER_H

void foo(void);

#include "header.c"

#endif

header.c

#ifndef _HEADER_C
#define _HEADER_C

void foo(void)
{
    ...
}

#endif

Thanks.

Parents
  • The header file then includes an implementation (.c) file for the function implementations.

    Don't do that! *.c files are supposed to #include headers, not the other way round.

    The problems you're having with attributing code to source files are just the top of the iceberg of problems you bought yourself with that crazy program structure.

    Is there a way to get uVision to trace into the implementation file?

    Just don't (mis)treat them as headers.

Reply
  • The header file then includes an implementation (.c) file for the function implementations.

    Don't do that! *.c files are supposed to #include headers, not the other way round.

    The problems you're having with attributing code to source files are just the top of the iceberg of problems you bought yourself with that crazy program structure.

    Is there a way to get uVision to trace into the implementation file?

    Just don't (mis)treat them as headers.

Children
More questions in this forum