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

Debugger unable to show C source statement

Hi,
while simulating a XC164, I can run and step through the disassembly window, but the debugger is unable to show me the correct line within the correct file. Instead it shows me another line in another file, which does not allow stepping correctly!
Can this come from a special architecture of the source files? I explain : I have retrieved public-domain mrforth source files. These files are not organised in an academic way. Indeed, there is only one main C file, and all other files (both .h and .c) are just included at the top of it.
Could this make Microvision get lost?
How could I do to properly debug the source?

Parents
  • No.

    Because the debug information assumes that file.c compiles to file.obj - so the line number information relates to just file.c

    If file.c includes otherfile.c, this messes things up!

    You might be able to get around this by just preprocessing file.c to (typically) file.i, and then compiling file.i to file.obj - so that the debug line number information will relate to file.i (not file.c).

    It is left as an exercise for the student to determine how to select "pre-process only" in the C166 compiler...

Reply
  • No.

    Because the debug information assumes that file.c compiles to file.obj - so the line number information relates to just file.c

    If file.c includes otherfile.c, this messes things up!

    You might be able to get around this by just preprocessing file.c to (typically) file.i, and then compiling file.i to file.obj - so that the debug line number information will relate to file.i (not file.c).

    It is left as an exercise for the student to determine how to select "pre-process only" in the C166 compiler...

Children
No data